-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: all line series with same labels should have same color in a da… #4478
Conversation
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
WalkthroughThe updates focus on enhancing the color management for charts by introducing a dynamic color generation method. This approach utilizes labels to determine colors, streamlining the process and improving the visual consistency across charts. The modifications span across the chart data retrieval and tooltip enhancements, including the integration of a new utility for color generation based on specific keys and a predefined color map. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 3
Configuration used: CodeRabbit UI
Files selected for processing (4)
- frontend/src/lib/getChartData.ts (1 hunks)
- frontend/src/lib/uPlotLib/plugins/tooltipPlugin.ts (2 hunks)
- frontend/src/lib/uPlotLib/utils/generateColor.ts (1 hunks)
- frontend/src/lib/uPlotLib/utils/getSeriesData.ts (3 hunks)
Additional comments: 4
frontend/src/lib/uPlotLib/utils/getSeriesData.ts (2)
- 1-6: The import of
themeColors
andgenerateColor
is correctly implemented, aligning with the PR objectives to dynamically generate colors based on series labels. Ensure thatthemeColors.chartcolors
is correctly defined and contains a valid color mapping.- 48-48: Using
generateColor
to dynamically assign colors based on the label is a significant improvement for consistency across dashboards. Ensure thatthemeColors.chartcolors
is adequately populated and that the color generation logic ingenerateColor.ts
is robust to handle all expected labels.frontend/src/lib/uPlotLib/plugins/tooltipPlugin.ts (2)
- 9-9: The addition of the
generateColor
function from../utils/generateColor
is correctly implemented, aligning with the PR's goal to ensure color consistency across tooltips. This change effectively replaces the static color array with a dynamic approach.- 58-59: Correctly replacing the static
colors
array with dynamically generated colors based on labels significantly enhances the consistency and user experience of the dashboard. Ensure thatthemeColors.chartcolors
provides a comprehensive color palette to cover all potential labels.
…shboard
Summary by CodeRabbit
New Features
Refactor