Skip to content
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

Add {signal,data,event,resize} listener options reagent components #13

Open
metasoarous opened this issue Sep 18, 2018 · 1 comment
Open

Comments

@metasoarous
Copy link
Owner

metasoarous commented Sep 18, 2018

As in Similar to onSignalXXX hooks of react-vega. This means getting into some of vega's stateful bits, so may be a nice opportunity to look at dataflow in and out, and how to optimize against rerendering and vega compilation. Ideally, we'd have a really high level way of plugging into signals at different levels.

@metasoarous
Copy link
Owner Author

This issue sort of missed the mark; At the time, react-vega was using an awkward set of onSignalXXX handlers. They've since moved to more general signalListeners option which points to an object mapping of signal names to handler functions:

https://github.com/vega/react-vega/tree/master/packages/react-vega

I think this makes a lot more sense, and we could do something similar here (probably :signal-handlers, :data-handlers, :event-listeners and :resize-listeners in our case).

Now that we have #13 (access to the vega view object), it's possible to call .addSignalListener etc. on this object directly to get this functionality. So in a way this is somewhat low priority now.

Still, it would be nice to be able to avoid the additional level of callbacks and not have to mess with the view api for basic use cases such as this. There's also potentially some advantage in us explicitly managing the calls to the underlying vega view functions, so that multiple handlers aren't being attached when components update (I this this might only be an issue in certain cases, but will be important to scope out if we implement these conveniences).

@metasoarous metasoarous changed the title Add listener options for vega and vega-lite components Add {signal,data,event,resize} listener options reagent components Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant