This is an example page for the
jp_doodle
package.
jp_doodle
makes implementing special purpose interactive visualizations easy.
Quick references: Javascript API; Python API.
Miscellaneous Demos: Image detail viewer..
These example pages use stand alone Javascript, but the code used to implement them can be transliterated to Python and implemented using Jupyter widgets (modulo some subtleties).Canvases can respond to mouse events. The mouse events can be associated to the whole canvas or to named elements in the canvas.
In this illustration a different click event handler attaches to each text area to change the text areas in different ways for 5 seconds.
Event handlers may be attached globally to the whole canvas or locally to an object. The example above associates a local event handler to a named object for a given event type using
element.on_canvas_event(event_type, handler_function, object_name);
The name for a named object occurring under an event
is bound to the event as event.canvas_name
and
the properties of the object are bound to the event as event.object_info
even if the event is handled by a global event handler. Only the top object
under an event is bound to the event -- obscured objects below do not respond
to the event.
Objects with no assigned unique name cannot bind events individually and the object information for unnamed artifacts under an event are not bound to the event.