Skip to content

Conversation

@JeanMarcMilletScality
Copy link
Contributor

@JeanMarcMilletScality JeanMarcMilletScality commented Oct 15, 2025

Restructure charts components
Edit utils fn to share logic between charts when possible

Remove Vega

⚠️ This PR remove Vega file and move a lot of files and could break imports

@bert-e
Copy link
Contributor

bert-e commented Oct 15, 2025

Hello jeanmarcmilletscality,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Oct 15, 2025

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

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.
@bert-e
Copy link
Contributor

bert-e commented Oct 17, 2025

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

Return undefined for label if no unitRange
@JeanMarcMilletScality JeanMarcMilletScality marked this pull request as ready for review October 17, 2025 14:19
Copy link

Copilot AI left a 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.ts to 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 */
Copy link

Copilot AI Oct 17, 2025

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'.

Suggested change
/* utils functions */
/* utility functions */

Copilot uses AI. Check for mistakes.
* 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
*
*
Copy link

Copilot AI Oct 17, 2025

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.

Suggested change
*

Copilot uses AI. Check for mistakes.
Comment on lines +58 to +59
const numberOfTicks =
possibleTickNumbers.find((number) => topValue % (number - 1) === 0) || 2; // Default to 2 ticks if no match
Copy link

Copilot AI Oct 17, 2025

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.

Suggested change
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;

Copilot uses AI. Check for mistakes.
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