-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not working with VegaFusionWidget: Error: [object ArrayBuffer] is not serializable #46
Comments
This may be the same issue as #42 since VegaFusion also uses binary messages |
Bokeh 3.0 will have much better support for binary messages so we may just get this for free. |
@mattpap What do you think? Will your new serialization work allow serializing an ArrayBuffer embedded in some JSON object? |
It does have bidirectional support for |
I just stumbled on this repo today, because I was working on a reboot of flask_ipywidgets and was curious how you people were doing some similar work (the code looks very similar 👀 ). My guess is that https://github.com/bokeh/ipywidgets_bokeh/blob/main/ipywidgets_bokeh/kernel.py#L71 has an issue when there is a memoryview object with a non-byte format. A |
the offset should be in bytes, not elements. See also bokeh/ipywidgets_bokeh#46 (comment)
Thanks @maartenbreddels . I dont know the details by @philippjfr has said the next version of Bokeh will solve this issue. |
the offset should be in bytes, not elements. See also bokeh/ipywidgets_bokeh#46 (comment)
the offset should be in bytes, not elements. See also bokeh/ipywidgets_bokeh#46 (comment)
* Fix jinja2 imports (#3258) * fix: wrong offset when memoryview format is non-byte (#3206) the offset should be in bytes, not elements. See also bokeh/ipywidgets_bokeh#46 (comment) * Support jupyter server root_dir with lab extension (#3172) Jupyter sends path relative to the root_dir which can be different from the cwd. This commit fixes the lab extension for panel preview to account for root_dir. Reference: #3170 * DOC: add note on enabling panel widget on Jupyter Lab (#3029) * Remove redundant and confusing JupyterLab install instructions (#3037) * Remove reference to Python 2 and link to Travis * Remove redondant install instructions to work with Jupyter * Update CHANGELOG * Add setuptools to build requirements * use https instead of the git:// protocol in GHA (#3092) * Try to switch to setuptools (#3138) * Try to switch to setuptools * Continue on error * CI: fix Macos tests workflow (#3160) * attempt to fix CI on macos * forgot bokeh channel * remove strict setting * reset strict and add pyctdev channel * remove continue_on_error and test py310 * clean up test workflow * add comment about PYCTDEV_SELF_CHANNEL * remove py310 * Revert change to build backend * Update setuptools pin * Pin setuptools * Further pin updates * Pin setuptools (#3265) * Fix image_url test * Pin pyvista * Bump panel.js version * Fix GH workflows * Bump panel.js version Co-authored-by: Maarten Breddels <[email protected]> Co-authored-by: Govinda Totla <[email protected]> Co-authored-by: Ray Bell <[email protected]> Co-authored-by: Maxime Liquet <[email protected]>
Wanted to update this issue with the current behavior using the latest versions of the various libraries: Versions:
Example app: import panel as pn
import ipywidgets as ipw
pn.extension('ipywidgets')
from vega_datasets import data
import altair as alt
import vegafusion as vf
source = alt.UrlData(
data.flights_2k.url,
format={'parse': {'date': 'date'}}
)
brush = alt.selection_interval(encodings=['x'])
# Define the base chart, with the common parts of the
# background and highlights
base = alt.Chart(width=160, height=130).mark_bar().encode(
x=alt.X(alt.repeat('column')).bin(maxbins=20),
y='count()'
)
# gray background with selection
background = base.encode(
color=alt.value('#ddd')
).add_params(brush)
# blue highlights on the transformed data
highlight = base.transform_filter(brush)
# layer the two charts & repeat
chart = alt.layer(
background,
highlight,
data=source
).transform_calculate(
"time",
"hours(datum.date)"
).repeat(column=["distance", "delay", "time"])
chart_widget = vf.jupyter.VegaFusionWidget(chart)
pn.panel(chart_widget).servable() Run app:
The window opens and the widgets loads successfully (as indicated by the VegaFusion logo being displayed). But an error occurs immediately after: Browser trace:
Python trace
It looks like the issue is related to the Here's the definitions of this prop on the Python side of the widget (See https://github.com/hex-inc/vegafusion/blob/main/python/vegafusion-jupyter/vegafusion_jupyter/widget.py#L31-L32)
My guess is that the |
Thanks for the update @jonmmease! I'd love to support VegaFusion properly and we'll probably do two things to make that happen:
I'll reach out when we're ready to start on that. |
Just wanted to pass along an update. I've reworked the VegaFusion architecture a bit to make it possible to integrate VegaFusion into Altair's regular JupyterChart. See vega/altair#3281. This doesn't require binary serialization and already works well with Panel. I'm going to deprecate |
Panel: 0.12.6 vegafusion-jupyter: 0.0.2 vega-datasets 0.9.0 ipywidgets-bokeh 1.2.1
I'm trying to use the VegaFusionWidget ipywidget with Panel. See vega/vegafusion#62. But its raising the error below.
The text was updated successfully, but these errors were encountered: