FormidableLabs / FormidableLabs/victory

VictoryVoronoiContainer should allow default active points

Open
#1,187 4 comments 3 reactions 0 assignees View on GitHub
Issue: Accepted Type: Enhancement :pencil2:
Dominant language
TypeScript
Stars
11.2k
Forks
536
PR merge metrics
No merged PRs in 30d

Description

This would allow users to show a chart with a point / tooltip auto-selected. The chart would still be interactive as usual while the user was hovering over it, but would have a default value otherwise.
This is currently possible in Victory with `externalEventMutations`, but it's complicated and fiddly.

Proposed API change:

A new prop called `defaultVoronoiValue` will be added. This prop should be given relative to data space (not svg coordinate space). The point(s) nearest to `defaultVoronoiValue` will be set `active` when the chart renders and `onMouseLeave`

```
defaultVoronoiValue: PropTypes.oneOfType([
PropTypes.number,
PropTypes.shape({
x: PropTypes.number,
y: PropTypes.number
})
])
```

Contributor guide

Open the contributing guide

Research direction

Start with VictoryVoronoiContainer and inspect how externalEventMutations currently sets active points and how the container handles rendering and onMouseLeave. Trace the existing prop definitions and related interaction behavior before deciding where the new data-space value belongs. Done means defaultVoronoiValue selects the nearest point or points initially and after onMouseLeave while normal hover interaction remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.