Comments (6)
Working on this
from declarativewidgets.
As a first step, I'm working on a basic examples notebook, with an example analogous to this ipywidgets example
Bokeh contains a push_notebook()
function that allows a plot's data to be updated from code run in the notebook. The function sends a display_data
message that causes the update to happen.
The function is running successfully with urth-core-function
and sending the message, but it's not updating the plot. Currently investigating why the update works for ipywidgets interact
, but not urth-core-function
from declarativewidgets.
The cause is that there is no iopub.output
callback associated with the comm_msg
s that our widgets send. Usually (e.g. with ipywidgets, or normal code execution), the iopub.output
callback will inject the display_data
message contents into a code cell.
Bokeh's push_notebook()
works by sending javascript in the display_data
message that updates the plot. Since our widgets don't inject display_data
message contents due to lack of the iopub.output
callback, the javascript isn't running.
Ipywidgets adds this callback through their View
system. Each widget is associated with a client-side View
, which has a handle to a cell through view.options.cell
. The widget manager then constructs an iopub.output
callback associated with that cell (see WidgetManager.prototype.callbacks
).
However, our widgets don't use View
s. As a potential workaround, we can construct the iopub.output
callback using the currently selected code cell. In the case of Bokeh, it doesn't matter which output cell the display_data
contents is injected to since it's just javascript that needs a place to execute. In other cases (although we haven't run into these yet), display_data
contents will be injected to the currently selected cell.
tl;dr: our widgets don't have a certain callback since we don't use View
s, but looks like there may be a workaround
from declarativewidgets.
I was able to get the plot contents to display and update using urth-core-function
. I put together a notebook with two simple examples showing how Bokeh and declarative widgets can be integrated. Next, I want to put together a more complex example; the first step will be choosing the theme / data to work with.
from declarativewidgets.
It turns out there is an issue with the plot updating when more than one urth widget is declared in a single cell, so I'm looking into that now.
from declarativewidgets.
The issue was a race condition that occurred when setting the code cell.
We can use the parent header of the execute_input
to determine which cell is currently executing, and associate that cell with all of the created widgets, until a new execute_input
arrives. I added a new behavior to listen for execute_input
, and the current solution is to use a global lastExecutionId
to track the currently executing cell. See this branch for the implementation
So far, this successfully supports multiple widgets and Run All
from declarativewidgets.
Related Issues (20)
- declarativewidgets not working HOT 5
- Documentation not found HOT 1
- Need to modify scala build to install toree from apache's dist server and not pypi HOT 3
- R declarative widgets donβt actually depend on SparkR HOT 4
- Move to https://github.com/jupyter-widgets? HOT 7
- Error enabling on OSX with matplotlib 2.0 installed
- Associated repo website is 404 HOT 2
- Changing DataFrame Limit HOT 3
- widgets failing to load after notebook closed and reopened HOT 1
- dom-bind-behavior bug against Polymer 1.9
- urth-import fails with POLYMER package ECONFLICT
- urth-viz-table, selectionIndex property doesn't work
- Install declarativewidgets without "pip install"
- Link to latest docs is broken HOT 2
- Edit license and rename file to LICENSE
- Date Picker
- Broken links
- Is declarative widgets maintained? HOT 13
- Some extension like Explorer visualization HOT 1
- Why was it retired? Are there any follow-up projects like this? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from declarativewidgets.