yifanwu
yifanwu

Reputation: 1645

get vega/vega-lite spec after programmatic data updates via views

I made changes to a vega-lite chart via view.change (here), then I want to export the vega-spec. I checked how the buttons in vega-embed does it (code) but realized that it just references the original spec. I need the vega spec after. Any one has any ideas how? The view APIs don't see to give a, "get spec" functionality.

Thanks!

Upvotes: 1

Views: 257

Answers (1)

dominik
dominik

Reputation: 5935

View updates do not change the spec but only the state of the dataflow. Use view.getState to get the state. More at https://vega.github.io/vega/docs/api/view/#view_getState.

Upvotes: 1

Related Questions