Skip to content

feature: axis tick count #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 29, 2025
Merged

feature: axis tick count #78

merged 4 commits into from
May 29, 2025

Conversation

gka
Copy link
Contributor

@gka gka commented May 29, 2025

This partially addresses the issue raised in #73 by adding the tickCount and tickSpacing options to the AxisX and AxisY marks.

Also adds unit tests and some more examples for axis options.

@gka gka requested a review from Copilot May 29, 2025 10:42
Copy link

netlify bot commented May 29, 2025

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit 4c804d5
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/68383b1f302ebc000895f5cd
😎 Deploy Preview https://deploy-preview-78--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

📦 Preview package for this PR is published!

Version: 0.2.8-pr-78.0

Install it with:

npm install svelteplot@pr-78
# or install the specific version
npm install svelteplot@0.2.8-pr-78.0

Copy link
Contributor

@Copilot 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 introduces user-configurable tick spacing and count for both X and Y axes, along with documentation, examples, and tests.

  • Adds tickCount and tickSpacing props (exclusive) to AxisX and AxisY marks, and wire up overrides in rendering logic
  • Augments unit tests for axis marks covering default ticks, custom values, count, spacing, and interval scenarios
  • Updates documentation and example pages to surface the new options; adds ts-essentials dependency for the XOR type

Reviewed Changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/lib/marks/AxisY.svelte Added tickCount/tickSpacing props, interval override, updated autoTickCount logic
src/lib/marks/AxisX.svelte Added tickCount/tickSpacing props and autoTickCount logic (missing interval support)
src/tests/axisY.test.ts New tests for tickCount, tickSpacing, interval on Y axis
src/tests/axisX.test.ts New tests for tickCount, tickSpacing, interval on X axis
src/tests/axisY.test.svelte Svelte test wrapper for Y axis
src/tests/axisX.test.svelte Svelte test wrapper for X axis
src/routes/marks/axis/+page.md Documented new tickSpacing and tickCount options
src/routes/examples/axis/*.svelte Added tick-spacing, tick-count, and tick-interval examples
package.json Added ts-essentials dependency for XOR type
.vscode/settings.json Adjusted ESLint fix-on-save configuration
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)

src/tests/axisY.test.ts:74

  • [nitpick] Duplicate test description 'tickSpacing'. Rename this second test to distinguish it (e.g., 'tickSpacing via scale options').
it('tickSpacing', () => {

.vscode/settings.json:5

  • [nitpick] The source.fixAll.eslint setting should typically be a boolean or an explicit object configuration rather than the string "explicit"; consider reverting to true or a valid ESLint config object to ensure fixes run on save.
"source.fixAll.eslint": "explicit"

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

📦 Preview package for this PR is published!

Version: 0.2.8-pr-78.1

Install it with:

npm install svelteplot@pr-78
# or install the specific version
npm install svelteplot@0.2.8-pr-78.1

@gka gka merged commit 096c43b into main May 29, 2025
8 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.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy