-
Notifications
You must be signed in to change notification settings - Fork 8
Improvement/charts restructuration #945
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
base: development/1.0
Are you sure you want to change the base?
Improvement/charts restructuration #945
Conversation
Remove Vega Update core-ui (remove vega deps)
Hello jeanmarcmilletscality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
- Introduced `normalizeChartDataWithUnits` for consistent data normalization across Barchart and LineTimeSerieChart. - Updated `formatDate` to `formatXAxisDate` for clarified usage - Added `getTooltipDateFormat` for tooltip date formatting. - Cleaned up imports and removed unused functions in Barchart utilities. - Enhanced type definitions and documentation for better clarity. - Updated tests to cover new functionalities and ensure accuracy.
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
Return undefined for label if no unitRange
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.
Pull Request Overview
This PR restructures the chart components by consolidating them into a unified charts folder, removing the deprecated Vega library, and sharing common logic between chart implementations.
Key Changes:
- Removed Vega dependencies (vega, vega-embed, vega-lite, vega-tooltip) and all Vega-based chart implementations
- Consolidated all chart components into
src/lib/components/charts/with shared utilities - Created
chartUtils.tsto share logic between Barchart and LineTimeSerieChart (unit normalization, tick generation, date formatting)
Reviewed Changes
Copilot reviewed 48 out of 54 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Removed Vega library dependencies |
| src/lib/next.ts | Updated exports to use consolidated charts folder |
| src/lib/index.ts | Commented out deprecated chart exports |
| src/lib/components/charts/ | New consolidated charts structure with shared utilities |
| src/lib/components/charts/common/chartUtils.ts | Shared utility functions for unit conversion, tick generation, and date formatting |
| stories/ | Updated imports and removed deprecated story files |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| export const maxWidthTooltip = { maxWidth: '20rem' }; | ||
|
|
||
| /* -------------------------------------------------------------------------- */ | ||
| /* utils functions */ |
Copilot
AI
Oct 17, 2025
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.
Corrected spelling of 'utils functions' to 'utility functions'.
| /* utils functions */ | |
| /* utility functions */ |
| * For 'date' format, return YYYY-MM-DD format if time range is greater than 1 year, otherwise return MM-DD format | ||
| * Formats timestamp for X-axis labels based on duration | ||
| * | ||
| * |
Copilot
AI
Oct 17, 2025
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.
[nitpick] Extra blank line in JSDoc comment. Remove one of the consecutive blank lines for consistency.
| * |
| const numberOfTicks = | ||
| possibleTickNumbers.find((number) => topValue % (number - 1) === 0) || 2; // Default to 2 ticks if no match |
Copilot
AI
Oct 17, 2025
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.
[nitpick] The fallback value of 2 ticks seems arbitrary. Consider documenting why 2 is chosen as the default, or verify this produces reasonable tick spacing for edge cases where no modulo match is found.
| const numberOfTicks = | |
| possibleTickNumbers.find((number) => topValue % (number - 1) === 0) || 2; // Default to 2 ticks if no match | |
| // If no modulo match is found, default to 4 ticks for better chart readability. | |
| // This ensures at least start, end, and two intermediate ticks are present. | |
| const numberOfTicks = | |
| possibleTickNumbers.find((number) => topValue % (number - 1) === 0) || 4; |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Restructure charts components
Edit utils fn to share logic between charts when possible
Remove Vega