adobe / react-spectrum-charts

Build compelling visualizations using declarative react components.
http://opensource.adobe.com/react-spectrum-charts/
Apache License 2.0
58 stars 9 forks source link

highlightBy on ChartPopover #374

Open marshallpete opened 1 month ago

marshallpete commented 1 month ago

Provide a general summary of the feature here

Be able to specify which data points get selected for chart popovers.

๐Ÿค” Expected Behavior?

Currently you can only select a single point.

It would be nice to be able to select points by the following:

๐Ÿ’ Possible Solution

Need to add select highlighting logic to support the different methods.

This needs to be done for each of the different chart types since most of them handle select highlighting on their own.

๐Ÿ”ฆ Context

There are requests to be able to select grouped bars by dimension.

๐Ÿ’ป Examples

No response

๐Ÿงข Your Company/Team

Adobe/AEP

marshallpete commented 2 weeks ago

Implementation

We already do this for hover interactions. The prop is called highlightBy and it is on the ChartTooltip component. This feature request is basically doing the same thing but for ChartPopover and the prop should still be called highlightBy.

It's best to go through the code for highlightBy on ChartTooltip and figure out what it is doing. Then most of this logic can be reused or copied and modified for ChartPopover.

It's also helpful to understand how signals work in vega. Before starting on this issue, I can meet with you to explain a lot of this and get you pointed in the right direction.