Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

message schema

Abierto
#8 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Documentación
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
javascript, jupyter-notebook, python

Línea de trabajo

No se indican archivos, pruebas ni puntos de entrada. Empieza por localizar el manejo de mensajes de Python a JavaScript y de JavaScript a Python, y luego compara los payloads implementados con los esquemas enumerados aquí; el trabajo estará terminado cuando el esquema de mensajes esté documentado y alineado con el protocolo real.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

At the request of @rgbkrk

Messages sent from python to js

  • the data field in sent messages is either a string with format
    "data:image/png;base64,{0}" or a dictionary
  • if a string, the {0} entry is a base64 encoded string of the image data
    • maybe a full image or a diff.
    • image is png encoded
  • if a dictionary then it will follow the schema
  {'type': 'object',
   'properties': {
       'type': {'type': 'str'}
   }
  }

Depending on the value of 'type', the schema for the rest of the dict/object


{'cursor': {'properties': {'cursor': {'type': int}, 'type': {'type': str}},
  'type': 'object'},
 'draw': {'properties': {'type': {'type': str}}, 'type': 'object'},
 'figure_label': {'properties': {'label': {'type': str},
   'type': {'type': str}},
  'type': 'object'},
 'image_mode': {'properties': {'mode': {'type': str}, 'type': {'type': str}},
  'type': 'object'},
 'message': {'properties': {'message': {'type': str}, 'type': {'type': str}},
  'type': 'object'},
 'refresh': {'properties': {'type': {'type': str}}, 'type': 'object'},
 'resize': {'properties': {'size': {'type': list}, 'type': {'type': str}},
  'type': 'object'},
 'rubberband': {'properties': {'type': {'type': str},
   'x0': {'type': float},
   'x1': {'type': float},
   'y0': {'type': float},
   'y1': {'type': float}},
  'type': 'object'},
 'save': {'properties': {'type': {'type': str}}, 'type': 'object'}}

Messages received by python from js

All of the messages seem to have


  {('msg_id',
    'parent_header',
    'buffers',
    'header',
    'content',
    'msg_type',
    'metadata')}

everything but 'content' looks like it is comm-related overhead

In 'content' there is 'data' and 'comm_id' (which is clearly comm overhead)

Inside of 'data'

  {'type': 'object',
   'properties': {
       'data': {'type': 'object',
                'properties': {
                    'type': {'type': 'str'}
                }
               }
       'comm_id': {'type': 'str'}
   }
  }

Depending on the value of 'type' (the entry in the message) it will
conform to one of the following specs


  {'ack': {'properties': {'figure_id': {'type': str}, 'type': {'type': str}},
    'type': 'object'},
   'button_press': {'properties': {'button': {'type': int},
     'figure_id': {'type': str},
     'guiEvent': {'type': dict},
     'type': {'type': str},
     'x': {'type': float},
     'y': {'type': float}},
    'type': 'object'},
   'button_release': {'properties': {'button': {'type': int},
     'figure_id': {'type': str},
     'guiEvent': {'type': dict},
     'type': {'type': str},
     'x': {'type': float},
     'y': {'type': float}},
    'type': 'object'},
   'closing': {'properties': {'figure_id': {'type': str}, 'type': {'type': str}},
    'type': 'object'},
   'draw': {'properties': {'figure_id': {'type': str}, 'type': {'type': str}},
    'type': 'object'},
   'figure_enter': {'properties': {'button': {'type': int},
     'figure_id': {'type': str},
     'guiEvent': {'type': dict},
     'type': {'type': str},
     'x': {'type': float},
     'y': {'type': float}},
    'type': 'object'},
   'figure_leave': {'properties': {'button': {'type': int},
     'figure_id': {'type': str},
     'guiEvent': {'type': dict},
     'type': {'type': str},
     'x': {'type': float},
     'y': {'type': float}},
    'type': 'object'},
   'key_press': {'properties': {'figure_id': {'type': str},
     'guiEvent': {'type': dict},
     'key': {'type': str},
     'type': {'type': str}},
    'type': 'object'},
   'key_release': {'properties': {'figure_id': {'type': str},
     'guiEvent': {'type': dict},
     'key': {'type': str},
     'type': {'type': str}},
    'type': 'object'},
   'motion_notify': {'properties': {'button': {'type': int},
     'figure_id': {'type': str},
     'guiEvent': {'type': dict},
     'type': {'type': str},
     'x': {'type': float},
     'y': {'type': float}},
    'type': 'object'},
   'refresh': {'properties': {'figure_id': {'type': str}, 'type': {'type': str}},
    'type': 'object'},
   'scroll': {'properties': {'button': {'type': int},
     'figure_id': {'type': str},
     'guiEvent': {'type': dict},
     'step': {'type': int},
     'type': {'type': str},
     'x': {'type': float},
     'y': {'type': float}},
    'type': 'object'},
   'send_image_mode': {'properties': {'figure_id': {'type': str},
     'type': {'type': str}},
    'type': 'object'},
   'set_dpi_ratio': {'properties': {'dpi_ratio': {'type': float},
     'figure_id': {'type': str},
     'type': {'type': str}},
    'type': 'object'},
   'supports_binary': {'properties': {'figure_id': {'type': str},
     'type': {'type': str},
     'value': {'type': bool}},
    'type': 'object'},
   'toolbar_button': {'properties': {'figure_id': {'type': str},
     'name': {'type': str},
     'type': {'type': str}},
    'type': 'object'}}

Lenguaje dominante
Jupyter Notebook
Estrellas
1.7k
Forks
234
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de matplotlib/ipympl

Todos los issues de matplotlib/ipympl

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.