Skip to content

fix(eclwatch): add a multi-scale 24-hour tick formatter#4482

Merged
GordonSmith merged 1 commit into
hpcc-systems:mainfrom
jeclrsg:fix-chart-timeline-formatting
Nov 20, 2025
Merged

fix(eclwatch): add a multi-scale 24-hour tick formatter#4482
GordonSmith merged 1 commit into
hpcc-systems:mainfrom
jeclrsg:fix-chart-timeline-formatting

Conversation

@jeclrsg

@jeclrsg jeclrsg commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

adds a 24h multiscale tick formatting function to chart/Axis, exposes a tickFormatFunc property in timeline/ReactTimelineSeries, and uses both in eclwatch/WUTimeline

Checklist:

  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit message includes a "fixes" reference if appropriate.
    • The commit is signed.
  • The change has been fully tested:
    • I have viewed all related gallery items
    • I have viewed all related dermatology items
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised new issues to address them separately

Testing:

@jeclrsg jeclrsg requested a review from Copilot October 28, 2025 16:23

Copilot AI left a comment

Copy link
Copy Markdown

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 adds support for a multi-scale 24-hour tick formatter to improve timeline visualization. The change introduces an adaptive tick formatting function that automatically selects appropriate time formats based on the granularity of the data (milliseconds → seconds → minutes → hours → days → months → years), and enables its use in the WUTimeline component.

Key changes:

  • Created a new multiScale24Hours() formatter with adaptive time formatting logic
  • Added tickFormatFunc() method to allow custom tick formatting functions in Axis and ReactTimelineSeries
  • Updated WUTimeline to use the new multi-scale formatter instead of a fixed "%H:%M" format

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/chart/src/timeFormats.ts New file containing the multiScale24Hours() adaptive formatter implementation
packages/chart/src/index.ts Exports the new timeFormats module
packages/chart/src/Axis.ts Adds tickFormatFunc() method to support custom tick formatting functions
packages/timeline/src/ReactTimelineSeries.ts Adds tickFormatFunc() method that delegates to underlying axis instances
packages/eclwatch/src/WUTimeline.ts Replaces static tickFormat() with tickFormatFunc(multiScale24Hours())

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/timeline/src/ReactTimelineSeries.ts Outdated
Comment thread packages/timeline/src/ReactTimelineSeries.ts Outdated
Comment thread packages/chart/src/Axis.ts Outdated
adds a 24h multiscale tick formatting function to chart/Axis, exposes a
tickFormatFunc property in timeline/ReactTimelineSeries, and uses both
in eclwatch/WUTimeline

Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com>
@jeclrsg jeclrsg force-pushed the fix-chart-timeline-formatting branch from fc17d83 to 77d640d Compare October 28, 2025 16:28
@GordonSmith GordonSmith force-pushed the main branch 3 times, most recently from ac285a3 to 136469b Compare October 29, 2025 15:37
@jeclrsg jeclrsg requested a review from GordonSmith November 14, 2025 15:19
@GordonSmith GordonSmith merged commit 24d965d into hpcc-systems:main Nov 20, 2025
2 of 4 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 20, 2025
GordonSmith pushed a commit that referenced this pull request Nov 20, 2025
adds a 24h multiscale tick formatting function to chart/Axis, exposes a
tickFormatFunc property in timeline/ReactTimelineSeries, and uses both
in eclwatch/WUTimeline

Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com>
@github-actions github-actions Bot mentioned this pull request Nov 20, 2025
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