Open cosmicfarmers opened 1 month ago
Thanks for the report and repro! Looks like something might be going wrong in our dependency analysis. Could you take a look at the server_vega_spec
, client_vega_spec
, and comm_plan
properties and see if anything stands out between the broken case and the workaround case? See https://vegafusion.io/planner_results.html.
I am looking into the VegaFusionWidget
instances of the cases I mentioned above. It can takes some more time on my side since I have some of my works deadline come. (but I fortunately found some workarounds.)
By the way, I found another workaround, which MIGHT be related to the quick question in this thread: https://github.com/vega/vegafusion/issues/495#issuecomment-2226884040
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?
This is the new workaround.
I just convert the vega-lite json from altair instance (which was the input of the broken vf) into vega spec. using vl_converter
, and I input the vega spec. to the VegaFusionWidget
. It shows tooltips without adding a random param, although it is not utilizing server-side computation at all.
This is the code.
final_ap_vega_spec = vlc.vegalite_to_vega(final_ap.to_json())
workaround2_vf = vf.jupyter.VegaFusionWidget(final_ap_vega_spec)
workaround2_vf
comm_plan
of Workaround 2 (Tooltip: Yes, Server-side Computation: No){
"server_to_client": [],
"client_to_server": []
}
comm_plan
of the Workaround 1 (Tooltip: Yes, Server-side Computation: Yes)( which I added a param like .add_params(alt.selection_point(fields=['DUMMY']))
)
{
"server_to_client": [
{
"namespace": "data",
"name": "source_0",
"scope": []
},
{
"namespace": "data",
"name": "source_0_view_4_y_domain_greeting",
"scope": []
}
],
"client_to_server": []
}
comm_plan
of the Broken (Tooltip: No, Server-side Computation: Yes){
"server_to_client": [
{
"namespace": "data",
"name": "source_0",
"scope": []
},
{
"namespace": "data",
"name": "source_0_view_1_y_domain_greeting",
"scope": []
}
],
"client_to_server": []
}
Getting back to the "quick question", I think I had a trouble with sending all data to my web browser but I guess it was fixed because I fixed the tooltip by using .add_params(alt.selection_point(fields=['DUMMY']))
, which seems to be the only way for now to have benefits of both server-side computation and tooltip showing, although I am not 100% sure.
This is what I guessed what happened to me.
.add_params(alt.selection_point(fields=['DUMMY']))
because I know it; sometimes I don't check if the tooltip is working or not. Just add.
Hi Jon,
Thanks for your project always!
I am posting a reproducible notebook about another possible bug. I must add like
.add_params(alt.selection_point(fields=['DUMMY']))
to maketooltip=True
work.Altair: Tooltip WORKING
VegaFusionWidget: Tooltip NOT WORKING
VegaFusionWidget: Tooltip WORKING only when I add some params.
I need a workaround
.add_params(alt.selection_point(fields=['DUMMY']))
.