Skip to content

Conversation

@gka
Copy link
Contributor

@gka gka commented Nov 4, 2025

This pull request passes the ticks array to the tickFormat function. This allows for more context-aware formatting, such as adding units only to the last tick. The changes are validated with new tests and demonstrated in an example.

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

📦 Preview package for this PR is published!

Version: 0.5.2-pr-252.0

Install it with:

npm install svelteplot@pr-252
# or install the specific version
npm install svelteplot@0.5.2-pr-252.0

@netlify
Copy link

netlify bot commented Nov 4, 2025

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit 0695d3e
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/690a05eb4df49b0008339397
😎 Deploy Preview https://deploy-preview-252--svelteplot.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

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 enhances the tickFormat function signature for axis components to accept a third parameter containing the complete array of tick values. This enables custom formatting logic that depends on the full set of ticks, such as adding a unit label only to the last tick.

Key Changes:

  • Updated tickFormat function signature to accept (d, i, ticks) instead of (d, i) for both X and Y axes
  • Added comprehensive test coverage for the new parameter
  • Created an example demonstrating unit label formatting on the last tick

Reviewed Changes

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

Show a summary per file
File Description
src/lib/marks/helpers/BaseAxisX.svelte Updated tickFormat signature and invocation to pass ticks array
src/lib/marks/helpers/BaseAxisY.svelte Updated tickFormat signature and invocation to pass ticks array
src/tests/axisX.test.ts Added test verifying ticks array is passed to tickFormat
src/tests/axisY.test.ts Added test verifying ticks array is passed to tickFormat
src/routes/examples/axis/unit-tick.svelte Added example demonstrating unit label on last tick
static/examples/axis/unit-tick.png Screenshot for light theme example
static/examples/axis/unit-tick.dark.png Screenshot for dark theme example

@gka gka merged commit 462b5f7 into main Nov 4, 2025
14 checks passed
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.

2 participants