Skip to content

fix: add support for dx/dy transform to Grid marks#175

Merged
gka merged 2 commits intomainfrom
fix/grid-dx-dy
Sep 6, 2025
Merged

fix: add support for dx/dy transform to Grid marks#175
gka merged 2 commits intomainfrom
fix/grid-dx-dy

Conversation

@gka
Copy link
Copy Markdown
Contributor

@gka gka commented Sep 6, 2025

resolves #142

This pull request adds support for dx and dy offset properties to the GridX and GridY Svelte mark components, allowing for more flexible grid positioning. It also introduces new test suites for these components to verify correct handling of style and transform properties, and removes outdated test files.

Enhancements to Grid Marks:

  • Added support for dx and dy properties in both GridX and GridY components, enabling per-line translation offsets via the new resolveProp helper. These offsets are now applied in the SVG transform attribute for each grid line.

Testing improvements:

  • Added new test suites gridX.test.svelte.ts and gridY.test.svelte.ts to verify grid mark rendering, style application, and dynamic updates to dx and dy properties, including function-valued offsets.

@netlify
Copy link
Copy Markdown

netlify bot commented Sep 6, 2025

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit 28b6ab5
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/68bc23f7db72e90008f7c4de
😎 Deploy Preview https://deploy-preview-175--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.

@gka gka added this to the 1.0 milestone Sep 6, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 6, 2025

📦 Preview package for this PR is published!

Version: 0.3.11-pr-175.0

Install it with:

npm install svelteplot@pr-175
# or install the specific version
npm install svelteplot@0.3.11-pr-175.0

@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 6, 2025

📦 Preview package for this PR is published!

Version: 0.3.11-pr-175.1

Install it with:

npm install svelteplot@pr-175
# or install the specific version
npm install svelteplot@0.3.11-pr-175.1

@gka gka merged commit d1dd704 into main Sep 6, 2025
8 checks passed
@gka gka deleted the fix/grid-dx-dy branch September 6, 2025 12:10
gka added a commit that referenced this pull request Mar 9, 2026
…517)

## Summary

- Replace `axis-properties-fix.test.ts` (mock-only interface tests) with
real component-level tests in `axisY.test.ts`
- Add test for `AxisY` `fill` prop with constant value (`'red'`)
- Add test for `AxisY` `fill` prop with function accessor (`(d, i) =>
...`)

All 3 bugs from #142 are now accounted for:
1. **GridY.dx** — fixed in #175 (merged)
2. **AxisY.fill** — confirmed working via new component tests
3. **AxisY.class** — confirmed working (existing `axisY.test.ts` tests
verify class application)

Closes #142

## Test plan

- [x] `pnpm test -- src/tests/axisY.test.ts` — all 19 tests pass
- [x] Pre-commit hooks (prettier, oxlint) pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Gregor Aisch <gka@users.noreply.github.com>
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.

[BUG] Multiple Mark props issues

1 participant