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

(feat)Line: add support for hiding line charts by default #2540

Merged
merged 7 commits into from
Jul 23, 2024

Conversation

clcatalan
Copy link
Contributor

@clcatalan clcatalan commented Mar 13, 2024

Solves issue for: #2481

Solution is for user to simply pass an array of keys in the initialHiddenIds props for the Line Chart. This toggles the legend to "off" by default. The app consuming nivo should do the computation to determine if a key should be hidden or not.

*this is what it looks like on load, the cognac line is hidden by default
Screenshot 2024-03-13 at 11 38 01 PM

Copy link

vercel bot commented Mar 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nivo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2024 1:31am

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b9ae884:

Sandbox Source
nivo Configuration

@jerichocalibuso
Copy link

Wow galing

@plouc
Copy link
Owner

plouc commented May 12, 2024

Thank you for this @clcatalan! Could you please add tests for this new feature?

@plouc plouc added the 📈 line @nivo/line package label May 12, 2024
@clcatalan
Copy link
Contributor Author

hi @plouc added unit tests, all Line unit tests still pass as expected
Screenshot 2024-06-17 at 1 28 14 PM

Screenshot 2024-06-17 at 1 28 40 PM

website/src/data/components/line/props.ts Outdated Show resolved Hide resolved
website/src/data/components/line/props.ts Outdated Show resolved Hide resolved
@plouc plouc merged commit 0f5ac2f into plouc:master Jul 23, 2024
4 of 5 checks passed
Copy link
Owner

@plouc plouc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📈 line @nivo/line package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants