deathbeds / jyve

Jupyer Kernels, right inside JupyterLab
https://deathbeds.github.io/jyve/lab/
BSD 3-Clause "New" or "Revised" License
60 stars 14 forks source link

Support Jupyter Widgets #43

Open bollwyvl opened 5 years ago

bollwyvl commented 5 years ago

Get the JS kernel to support the Jupyter Widget message spec. Unfortunately, the most professionally-maintained JS kernel does't have a story yet so we'll be inventing new stuff.

desired API

How should widgets be available?

let x = widgets.FloatSlider({description: 'x'});
display.display(x);
// a widget appears in the output area
x.value = 1.0
// item moves along axis
x.jsobserve('value', (change) => { document.write(change.new) })
// page streams changed values
widgets.jsdlink([x, 'value'], [x, 'description'], (value) => { `${value} %` }
// some weird labelling stuff happens

approaches

down the road