vizabi / core

Data fetching and transformation module with API based on Grammar of Graphics
1 stars 1 forks source link

A convenient way to get array of markers of a marker that are selected/highlighted #22

Open angiehjort opened 4 years ago

angiehjort commented 4 years ago

Maybe there is one, i just don't know

so select/highlight encodings have a filter that filter can be set by .markers or by .dimensions, right? and if the filter is set by .dimensions then .markers is empty and i can't do [...markers]

so if i want to get an array of markers that are selected in a marker i would do something like

this.maker.dataArray.filter(d => this.marker.encoding.get("selected").has(d))

can there be an easier way? such as

this.marker.encoding.get("selected").dataArray

jheeffer commented 4 years ago

Good point. Could have a function with one argument being an array of markers which then gets filtered, with default of that array being the encoding's marker's data array.