-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
✅ Deploy Preview for svelteplot ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-78
# or install the specific version
npm install svelteplot@0.2.8-pr-78.0 |
There was a problem hiding this 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
andtickSpacing
props (exclusive) toAxisX
andAxisY
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 totrue
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>
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-78
# or install the specific version
npm install svelteplot@0.2.8-pr-78.1 |
This partially addresses the issue raised in #73 by adding the
tickCount
andtickSpacing
options to the AxisX and AxisY marks.Also adds unit tests and some more examples for axis options.