Skip to content

Enhancements/address GitHub issues#140

Merged
hunterg325 merged 9 commits into
mainfrom
enhancements/address-github-issues
Feb 25, 2026
Merged

Enhancements/address GitHub issues#140
hunterg325 merged 9 commits into
mainfrom
enhancements/address-github-issues

Conversation

@hunterg325
Copy link
Copy Markdown
Member

@hunterg325 hunterg325 commented Feb 25, 2026

Description

This PR adds a new tickFormatter option to AxisConfig for fully customizable axis tick label formatting and wires it through the render pipeline, including adaptive time-axis tick computation and label rendering.[page:1] It also introduces a comprehensive tick-formatter example page demonstrating percentage, duration, custom time, and integer-only axis labels with null-based label suppression, and adds targeted tests to validate formatter behavior on both value and time axes.[page:1] Additionally, it cleans up local design docs from version control by ignoring docs/plans/ and removing previously tracked plan files.[page:1]

Type of Change

  • New feature (non-breaking change which adds functionality)[page:1]
  • Documentation update[page:1]
  • Code refactoring / test coverage improvements[page:1]

Related Issues

  • Implements custom axis tick label formatter design and plan for AxisConfig.tickFormatter.[page:1]
  • Addresses GitHub issue for custom axis tick label formatting (tickFormatter) — closes [Feature]: Custom axis tick label formatter #138.[page:1]

Highlights

  • Added AxisConfig.tickFormatter?: (value: number) => string | null with support for both value and time axes, including null-based label suppression.[page:1]
  • Integrated tickFormatter into renderAxisLabels for x and y axes and into computeAdaptiveTimeXAxisTicks so adaptive tick count uses the formatted label widths.[page:1]
  • Added tick-formatter example (HTML + TS) showcasing:
    • Percentage y-axis labels (0–1 → 0%–100%).[page:1]
    • Duration y-axis labels (seconds → d/h/m).[page:1]
    • Custom time x-axis labels using locale date formatting.[page:1]
    • Integer-only x-axis labels using null to hide fractional ticks.[page:1]
  • Extended docs (docs/api/options.md) with detailed description and examples for tickFormatter.[page:1]
  • Added tests for renderAxisLabels and computeAdaptiveTimeXAxisTicks to ensure custom formatters and suppression behavior work correctly for value and time axes.[page:1]
  • Updated .gitignore to exclude docs/plans/ and removed tracked plan files from the repo.[page:1]

Testing

  • Unit tests for axis label rendering and adaptive time-axis ticks updated/added and passing.[page:1]
  • Tested in Chrome/Edge 113+
  • Tested in Safari 18+
  • Verified WebGPU validation is clean (no console warnings)

Design for GitHub issue #114: pinch-to-zoom, single-finger pan,
and zoom reset button for touch devices when inside zoom is enabled.
6-task TDD plan covering pointer tracking, single-finger pan,
pinch-to-zoom, zoom reset button, coordinator wiring, and manual testing.
#138)

Add optional tickFormatter callback to AxisConfig that replaces built-in
tick label formatting. Supports value and time axes, with null return to
suppress individual labels.

- Wire tickFormatter into x-axis and y-axis rendering in renderAxisLabels
- Wire into adaptive time x-axis tick computation for correct overlap measurement
- Add 7 unit tests covering formatter usage and null suppression
- Update docs/api/options.md with API docs and usage examples
- Add tick-formatter example page with 4 demo charts
- Add example to examples index
Replace generic 0-100 y-axis with temperature data (°C formatter) so
y-axis title is visible and labels are compact.
Plans are local design docs and should not be shipped; docs/plans/ is already gitignored.

Made-with: Cursor
@hunterg325 hunterg325 merged commit d88adb8 into main Feb 25, 2026
2 checks passed
@hunterg325 hunterg325 deleted the enhancements/address-github-issues branch February 25, 2026 21:39
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.

[Feature]: Custom axis tick label formatter

1 participant