-
It would be really useful to have an example (or some quick advice) on how to reset one of the Clauses in a cross-filter selection associated with a specific Chart. In the API it is mentioned that a Selection can be reset this way: This API sounds exactly right - except that I cannot seem to find in the documentation anywhere where to actually extract the source variable from a vgplot that I create that use this particular selection filter? Maybe I am somehow missing something really rudimental/simple here? Some generic and possibly common use cases related to this question:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Adding some notes here for future references to others who are looking to do the same thing. This is likely not the best-practice approach to achieve this, but it works. In order to match the plot to remove the selection from programmatically, I was able to set a unique ID in the attributes setting, that I could match knowing this unique ID in a wrapper component (or some other type of stateful object which is used to generate the vgplot. I would match the unique ID with any source objects that match this ID in the Selection object's source arrays, [object]._value.active as well as all the index references [object]._value[x] (if any). For discussion - the name() attribute is not listed in the attributes array in internal data structures (for example when reading out a Selection object through [object]._value[x].mark.plot.attributes.name), so using vg.name("my_unique_plot_id") can not be used in the approach above to identify the source associated with the plot to be cleared from a prior selection. Also, feel free to share the recommended best-practice approach for above, if any. |
Beta Was this translation helpful? Give feedback.
Adding some notes here for future references to others who are looking to do the same thing. This is likely not the best-practice approach to achieve this, but it works.
In order to match the plot to remove the selection from programmatically, I was able to set a unique ID in the attributes setting, that I could match knowing this unique ID in a wrapper component (or some other type of stateful object which is used to generate the vgplot. I would match the unique ID with any source objects that match this ID in the Selection object's source arrays, [object]._value.active as well as all the index references [object]._value[x] (if any).
For discussion - the name() attribute is not listed in…