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(xychart): add colorAccessor to LineSeries #1489

Merged
merged 2 commits into from
May 3, 2022

Conversation

Zenith00
Copy link
Contributor

@Zenith00 Zenith00 commented May 1, 2022

🚀 Enhancements

  • Add colorAccessor to XYChart LineSeries prop that accepts a function that takes the dataKey and returns a color, replacing the default theme color

resolves #1260

Based on #1005

@Zenith00 Zenith00 changed the title new(xychart): add colorAccessor to LineSeries feat(xychart): add colorAccessor to LineSeries May 1, 2022
Copy link
Collaborator

@williaster williaster left a comment

Choose a reason for hiding this comment

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

Thanks for the addition @Zenith00 ! 🙌

This lgtm, I just merged a react@18 PR and want to test it as an alpha version. So once that's out we can publish this (should be later today if all goes well).

<DataContext.Provider value={getDataContext(series)}>
<svg>
<LineSeries
dataKey={series.key}
Copy link
Collaborator

@williaster williaster May 2, 2022

Choose a reason for hiding this comment

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

looks like linting is complaining that this isn't a single line

<LineSeries dataKey={series.key} {...series} colorAccessor={(_) => 'banana'} />

You could also run yarn format in the monorepo root, but sometimes that will update other files unintentionally (you can skip commit-ing them)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yarn format run. Looks like it picked up a ,->; in BaseLineSeries as well

@williaster
Copy link
Collaborator

Awesome, thanks for the fix and again for the contributions! Should be released shortly 🎉

@williaster williaster merged commit 4d86f4f into airbnb:master May 3, 2022
@github-actions
Copy link

github-actions bot commented May 3, 2022

🎉 This PR is included in version v2.10.0 of the packages modified 🎉

@Zenith00 Zenith00 deleted the i-1260 branch May 3, 2022 01:09
@alexandreabeh
Copy link

Excited to see this update - thank you @Zenith00 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add colorAccessor prop to XYChart LineSeries
3 participants