-
Notifications
You must be signed in to change notification settings - Fork 18
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
Vega spec. converted from vega-lite spec which includes selection_point with selection_interval not working on VegaFusionWidget #495
Comments
Hi @cosmicfarmers, thanks for opening an issue and apologies for the delay in getting back to you (I was on holiday and at a conference the past couple of weeks). I can reproduce what you're seeing, and will try to dig in soon. I had been planning to deprecate |
Hi Jon, Thanks for getting back to me! What I love about VegaFusion is that even though it doesn’t support all data transformations (like contour and kde2d), I can still use server-side support for a lot of transformations. This is super helpful when my pipeline includes both supported and unsupported operations. I’m working on creating contoured shot frequency maps by pitch location from football games, which involves handling really large datasets. The process works smoothly because I first aggregate by location coordinates and then apply unsupported Vega transformations like kde2d and contour (which will work in web browsers if I understood correctly.). Real-time transformations are key since I offer a bunch of interactive options for viewing the contours. Given all this, supporting Vega specs is essential for my work, even though you’re planning to deprecate VegaFusionWidget, which I currently rely on. Employing JupyterChart will help users feel more accessible, but I really support this project supporting Vega specs as well. After all, the project name is not Vega-liteFusion. :) By the way, currently, I am not combining selection_point and selection_interval as a workaround. This is an awesome project, and I've been using VegaFusion for almost all of my work recently. Thanks so much! P.S. one quick question: sometimes all of data transformations are sent to my browser. I haven't investigated deeply because now it works like separating heavy parts work in server-side fortunately. Is there a way that I can check what part will work in server-side and which part will work in client-side before rendering it? |
Thanks for the kind words, it's great to hear that VegaFusion has been helpful for you!
We'll make sure that there continues to be a widget solution for Vega specs. At this point I'm picturing a small rewrite of VegaFusionWidget that uses AnyWidget (so it's much easier to maintain), and removes support for Vega-Lite and Vega-Altair charts. (All of the dedicated Altair support in VegaFusion has been upstreamed to Altair itself, and Vega-Lite to Vega conversions are easy with vl-convert, so I'd like to remove the Vega-Lite and Altair dependencies from VegaFusion). We could also make it possible to access and set signals and datasets from Python.
We'd like to support more Vega transforms over time (like contour and kde2d), but since this will take a while VegaFusion is designed to avoid extracting unsupported transforms (and all of their dependencies) to the server.
The best way right now is to look at the Does that help? |
New into VegaFusion. Does this thread say that taking the JSON example from https://vega.github.io/editor/#/gist/9f120931575dd754c80f251cb51316af/spec.json and trying to use it along with VegaFusionWidget won't work ? |
Hi @NikosAlexandris, VegaFusionWidget can accept a Vega specification directly. It will extract the transforms that is supports and pre-evaluate them in the Python kernel. But from looking at this example, it's not obvious to me that this will be beneficial. What are you hoping to improve by using VegaFusion? |
Apologies for sort of cross-posting (see also : #433 (comment)). I guess I need to do some homework and better understand the Vega / Altair universe. I want to use Python and do some nice stuff, eventually with massive data, and embed them in technical documentation (thinking of a Material for MkDocs instance) either via some plugin that can run Python inside some Markdown page or maybe (easier?) as a Jupyter Notebook. |
I tried to use the "timeline" vega specification (JSON) import vegafusion as vf
import altair as alt and vega_specification = r """
<source JSON from https://vega.github.io/editor/#/gist/9f120931575dd754c80f251cb51316af/spec.json>
""" and finally vf.jupyter.VegaFusionWidget(vega_specification) yet I get this error [Open Browser Console for more detailed log - Double click to close this message]
Failed to create view for 'VegaFusionView' from module 'vegafusion-jupyter' with model 'VegaFusionModel' from module 'vegafusion-jupyter'
@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/efe94fb19af9c243d85a.module.wasm:wasm-function[3871]:0x5b1b2d
@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/efe94fb19af9c243d85a.module.wasm:wasm-function[5402]:0x630c15
@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/efe94fb19af9c243d85a.module.wasm:wasm-function[4566]:0x6197aa
@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/efe94fb19af9c243d85a.module.wasm:wasm-function[4379]:0x612275
$@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/42.7f340c1b888746330122.js?v=7f340c1b888746330122:1:6634
h@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/439.66cc935afb7e9bf3bdb9.js?v=66cc935afb7e9bf3bdb9:1:613
value_changed@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/480.1bbfa387a4decef0a812.js?v=1bbfa387a4decef0a812:1:2733
render@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/480.1bbfa387a4decef0a812.js?v=1bbfa387a4decef0a812:1:1575 and then more from the Console panicked at vegafusion-wasm/src/lib.rs:396:58:
called `Result::unwrap()` on an `Err` value: Error("missing field `fields`", line: 824, column: 8)
Stack:
wn@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/42.7f340c1b888746330122.js?v=7f340c1b888746330122:1:12017
__wbg_new_abda76e883ba8a5f@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/remoteEntry.309c24c3ed6d290e29ab.js:1:13199
@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/efe94fb19af9c243d85a.module.wasm:wasm-function[6925]:0x64b19f
@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/efe94fb19af9c243d85a.module.wasm:wasm-function[3871]:0x5b1b07
@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/efe94fb19af9c243d85a.module.wasm:wasm-function[5402]:0x630c15
@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/efe94fb19af9c243d85a.module.wasm:wasm-function[4566]:0x6197aa
@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/efe94fb19af9c243d85a.module.wasm:wasm-function[4379]:0x612275
$@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/42.7f340c1b888746330122.js?v=7f340c1b888746330122:1:6634
h@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/439.66cc935afb7e9bf3bdb9.js?v=66cc935afb7e9bf3bdb9:1:613
value_changed@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/480.1bbfa387a4decef0a812.js?v=1bbfa387a4decef0a812:1:2733
render@http://localhost:8888/lab/extensions/vegafusion-jupyter/static/480.1bbfa387a4decef0a812.js?v=1bbfa387a4decef0a812:1:1575
42.7f340c1b888746330122.js:1:12183 |
Hello,
I can't use combination of selection_point and selection_interval on VegaFusionWidget ONLY WHEN I convert vega-lite spec. to vega spec and input the vega spec to VegaFusionWidget.
Please refer to the below. (jupyter notebook cells converted to markdown. ipynb file is not uploadable.)
Working: Altair (vega-lite)
Working: Altair on VegaFusionWidget
Not Working: Vega Spec. on VegaFusionWidget
Only selection_interval is working; selection_point is not clickable.
# I also tested vega spec converted from https://vega.github.io/editor/ on VegaFusionWidget, which is not working.
The text was updated successfully, but these errors were encountered: