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

react-charting: Add controlled selection to Legends component #32908

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

insaneinside
Copy link

@insaneinside insaneinside commented Sep 24, 2024

This PR adds controlled selection to the Legends component in @fluentui/react-charting.

With controlled selection, we allow the parent component to add additional integrations that interact with the selection state (for example, a button that selects all items, or a separate control that allows selecting grouped subsets of items).

Previous Behavior

Legends component allows setting initial selection via props, but does not allow fully-controlled selection behavior.

New Behavior

Legends component now supports fully-controlled selection behavior.

Related Issue(s)

None.

@insaneinside insaneinside requested a review from a team as a code owner September 24, 2024 21:29
@insaneinside
Copy link
Author

Team, thank you for your review! Please let me know if there are any additional changes that need to happen. Do I need to update any documentation, for example to add an example of a controlled legend selection to the React Charting demo site?

@AtishayMsft
Copy link
Contributor

@insaneinside Could you add the scenario where this behavior is required in the PR description. We have a legends onChange handler callback when a legend value changes.

It would be great if you could add an example as well. You can add the example under react-examples/src/react-charting/Legends

@AtishayMsft
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@fabricteam
Copy link
Collaborator

📊 Bundle size report

✅ No changes found

@@ -0,0 +1,7 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

🕵🏾‍♀️ visual regressions to review in the fluentuiv8 Visual Regression Report

react-charting-AreaChart 1 screenshots
Image Name Diff(in Pixels) Image Type
react-charting-AreaChart.Custom Accessibility.chromium.png 11 Changed
react-charting-LineChart 1 screenshots
Image Name Diff(in Pixels) Image Type
react-charting-LineChart.Gaps.chromium.png 1 Changed

@AtishayMsft
Copy link
Contributor

@AtishayMsft
Copy link
Contributor

Could you add some margin between the example button and legend control in the example that you have added.
It is looking misaligned currently.

image

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

Successfully merging this pull request may close these issues.

3 participants