You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any sample to show how to use the data attribute as function ?
Are we expected to use instance of the Vega View in this particular function in order to make some "insert" or "remove" ? If yes, we can unfortunately not access the Vega main instance to use the advanced "Changeset" features (in order to modify one datum for example).
varbarData={table: function(dataset){vegaView.remove('table',dataset)// remove allvegaView.insert('table',otherDataset)// set a new dataset// no modify function on vegaView... no access to Vega main instance// no need to return anythingvegaView.run()}};
Thank you very much
The text was updated successfully, but these errors were encountered:
In fact, I found the way to access Vega. Vega is in fact not an instance and I can simply import it at the top of the script, and use the "changeset" features.
But I am still curious about a sample of function for data attribute.
Thanks
kristw
changed the title
data Attribute as a function
Is there any sample to show how to use the data attribute as function ?
Jul 20, 2020
I think I have a working example of this. I am passing in the spec via a prop (established in state), calling some function (in this case, an async fetch), and then merging the response into spec, which effectively uses it as inline data. The Vega component is smart enough to re-render when it sees a spec change, so I think this method may be somewhat extensible.
Is there any sample to show how to use the data attribute as function ?
Are we expected to use instance of the Vega View in this particular function in order to make some "insert" or "remove" ? If yes, we can unfortunately not access the Vega main instance to use the advanced "Changeset" features (in order to modify one datum for example).
Thank you very much
The text was updated successfully, but these errors were encountered: