Publish and subscribe to signals - abudaan/vega-multi-view GitHub Wiki
This is the core functionality of vega-multi-view
that makes internal signals of views available for each other despite the fact that they all live in a separate HTML element. Both publish and subscribe can use aliases so as to avoid name clashes.
For instance if 2 specs both have a signal named hover
you can publish them with an alias to keep them apart, you could use the aliases hover_spec1
and hover_spec2
. Now other views can pick the signal they are interested in.
A common scenario is when a mouse over event in one view should trigger the hover of another view as well or when one spec sets a range in the data that is rendered by another spec.
Note that you define publish and subscribe aliases in the configuration of a view. This means that when the view is added to a page it might be possible that the configuration of another spec has already defined aliases with the same name. Therefor I recommend to prefix or suffix the names of your aliases with the filename or the name of the spec.