Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatically set the active datapoint on a LineChart and BarChart #2488

Open
dorwin-patreon opened this issue Dec 8, 2023 · 1 comment
Labels

Comments

@dorwin-patreon
Copy link

Problem

Our organization uses nivo Line and Bar (ResponsiveLine, ResponsiveBar) components to generate user dashboards. When a user hovers over or clicks on a specific datapoint, a custom tooltip is shown. We currently show these tooltips by attaching event handlers to the onMouseXyz graph events.

Missing feature: we'd like to set up screenshot testing for these graphs by loading it with fake user data and "programmatically selecting" a datapoint on the graph. E.g. On a dashboard that displays the daily number of messages received over the last 30 days, we'd like to set up a test that shows the tooltip is generated when the user hovers over the T-15 datapoint.

Ideal Solution

The easiest solution I can think off is introducing 2 new, optional component properties named activeDatapoint, onActiveDatapoint that can be set by the client. When activeDatapoint is set by the client and available in the graph's dataset, onActiveDatapoint is triggered with a similar payload as the onMouseXyz event handlers.

Thanks again for building this fantastic library.

Copy link

stale bot commented Mar 13, 2024

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the stale label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant