Repository navigation
Add scale tickformat as default formatter for timescales in axes - #438
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Date-valued band scales can be misclassified as time scales and crash because they lack tickFormat, and the new behavior lacks coverage.
Review effort: Balanced
Findings: 8
Open (9)
Date-valued band scales throw without an explicit formatter · New Date-valued band scales throw without an explicit formatter · New Date-valued band scales throw without an explicit formatter · New Date-valued band scales throw without an explicit formatter · New Date-valued band scales throw without an explicit formatter · New Date-valued band scales throw without an explicit formatter · New Date-valued band scales throw without an explicit formatter · New Date-valued band scales throw without an explicit formatter · New Add coverage for default time-scale formatting and tick-count forwarding · New
What changed in this PR
Adds automatic D3 tick formatting for time scales across Cartesian axis components.
Changes:
- Uses each time scale’s
tickFormatwhen no formatter is provided. - Updates SVG and HTML axis variants.
- Refreshes generated property-table snapshots.
| File | Description |
|---|---|
src/_components/AxisX.svelte |
Adds default time formatting. |
src/_components/AxisXTop.svelte |
Adds default time formatting. |
src/_components/AxisY.svelte |
Adds default time formatting. |
src/_components/AxisYRight.svelte |
Adds default time formatting. |
src/_components/AxisX.percent-range.html.svelte |
Updates HTML bottom axis. |
src/_components/AxisXTop.percent-range.html.svelte |
Updates HTML top axis. |
src/_components/AxisY.percent-range.html.svelte |
Updates HTML left axis. |
src/_components/AxisYRight.percent-range.html.svelte |
Updates HTML right axis. |
test/e2e/component-properties-table.spec.js-snapshots/Property-table-content-for-components-AxisX-svelte-1.aria.yml |
Updates AxisX documentation snapshot. |
test/e2e/component-properties-table.spec.js-snapshots/Property-table-content-for-components-AxisXTop-svelte-1.aria.yml |
Updates AxisXTop documentation snapshot. |
test/e2e/component-properties-table.spec.js-snapshots/Property-table-content-for-components-AxisY-svelte-1.aria.yml |
Updates AxisY documentation snapshot. |
test/e2e/component-properties-table.spec.js-snapshots/Property-table-content-for-components-AxisYRight-svelte-1.aria.yml |
Updates AxisYRight documentation snapshot. |
test/e2e/component-properties-table.spec.js-snapshots/Property-table-content-for-components-AxisX-percent-range-html-svelte-1.aria.yml |
Updates HTML AxisX snapshot. |
test/e2e/component-properties-table.spec.js-snapshots/Property-table-content-for-components-AxisXTop-percent-range-html-svelte-1.aria.yml |
Updates HTML AxisXTop snapshot. |
test/e2e/component-properties-table.spec.js-snapshots/Property-table-content-for-components-AxisY-percent-range-html-svelte-1.aria.yml |
Updates HTML AxisY snapshot. |
test/e2e/component-properties-table.spec.js-snapshots/Property-table-content-for-components-AxisYRight-percent-range-html-svelte-1.aria.yml |
Updates HTML AxisYRight snapshot. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation consistently applies the intended fallback and safely excludes Date-valued categorical scales without formatter support.
Review effort: Balanced
Findings: None
Resolved since last review (9)
Date-valued band scales throw without an explicit formatter Date-valued band scales throw without an explicit formatter Date-valued band scales throw without an explicit formatter Date-valued band scales throw without an explicit formatter Date-valued band scales throw without an explicit formatter Date-valued band scales throw without an explicit formatter Date-valued band scales throw without an explicit formatter Date-valued band scales throw without an explicit formatter Add coverage for default time-scale formatting and tick-count forwarding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds a new check in the axis components to use the default
k.{dim}Scale.tickFormatif values are dates.