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).Assembly definitions may be specified using Javascript and attached to a jp_doodle canvas. The assemblies describe how to draw composite objects which are manipulated as primative units in the jp_doodle drawing system.
This demonstration attaches a "teddy bear" assembly definition and then creates some teddy bear assemblies and other standard assemblies on the canvas.
You may move the assemblies by mousing down on the object and dragging it to a new location and then mousing up.
As mention in the code comments, assembly definitions are tightly integrated into the redraw logic and cannot be defined using callbacks to Jupyter Python kernels (they must be defined in the browser Javascript context).
Assembly definitions which use other assembly definitions
must refer to the other assembly indirectly
using assembler.assembly
, for example
assembler.assembly({
assembly: "arrow",
x1: 0, y1:0, x2:100, y2:0, ...
});
See the draw_double_arrow
definition in the
source code for an example.
The arrow, double arrow, star, and circle arrow assemblies are automatically built in for all dual canvases.