Open cosmicfarmers opened 3 months ago
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 VegaFusionWidget
and direct folks to use Altair's JupyterChart with the "vegafusion"
data transformer. This has the same performance characteristics as VegaFusionWidget
and supports accessing selections and params from Python. But the JupyterChart
approach only works on Altair charts, not on Vega specs. So this issue is a good reminder of that use case. I might rework VegaFusionWidget
to work like JupyterChart
, but focus exclusively on Vega specs.
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
VegaFusionWidget
and direct folks to use Altair's JupyterChart with the"vegafusion"
data transformer. This has the same performance characteristics asVegaFusionWidget
and supports accessing selections and params from Python. But theJupyterChart
approach only works on Altair charts, not on Vega specs. So this issue is a good reminder of that use case. I might reworkVegaFusionWidget
to work likeJupyterChart
, but focus exclusively on Vega specs.
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!
Given all this, supporting Vega specs is essential for my work, even though you’re planning to deprecate VegaFusionWidget, which I currently rely on.
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.
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.
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.
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?
The best way right now is to look at the server_vega_spec
property of the VegaFusionWidget
instance. This will contain a Vega spec that includes the data specifications that were eligible for evaluation on the server. client_vega_spec
contains the Vega spec that is actually rendered on the client (with the extracted data transforms removed), and comm_plan
contains the specification of which datasets will be transferred between the client and server to maintain interactivity. This is described in https://vegafusion.io/planner_results.html. We need to add a compatibility table to the docs, but you can look at https://github.com/vega/vegafusion/tree/main/vegafusion-runtime/src/transform to see the collection of transforms that are currently (at least partially) implemented.
Does that help?
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.