Code Insights: Refactor line chart series toggling logic
Created by: vovakulikov
Based on https://github.com/sourcegraph/sourcegraph/pull/37224 Closes https://github.com/sourcegraph/sourcegraph/issues/36462 Closes https://github.com/sourcegraph/sourcegraph/issues/36325
Test plan
- Open storybook
- Go to Smart View Grid
- Find any chart with multiple series
- Hover over legend item should dim all but that legend item
- Hover over series should dim all other series
More cases from @unclejustin
Given three series A, B & C.
Scenario 1: No series selected, no series hovered
A, B & C: Rendered full color.
Scenario 2: No series selected, series A hovered
A: Rendered full color. B & C: Rendered dimmed.
Scenario 3: Series A selected, no series hovered
A: Rendered full color. B & C: Hidden.
Scenario 4: Series A selected, Series A hovered
A: Rendered full color. B & C: Hidden.
Scenario 5: Series A selected, Series B hovered
A: Rendered full color. B: Rendered dimmed. C: Hidden.
App preview:
Check out the client app preview documentation to learn more.