feat: add Delaunay/Voronoi marks and Hull mark#541
Merged
Conversation
Add DelaunayLink, DelaunayMesh, Voronoi, VoronoiMesh, and Hull marks with documentation page. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for svelteplot ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
4 tasks
Use SvelteSet/SvelteMap instead of built-in Set/Map per
svelte/prefer-svelte-reactivity rule. Add keys to {#each} blocks
per svelte/require-each-key rule.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove 'z' from channels arrays (not a ScaledChannelName) - Use ScaledDataRecord without Datum generic to match Mark's children type - Add PlotDefaults entries for all new marks - Import new mark components in plot.ts - Use resolveProp for z-channel grouping in Hull (follows Line convention) - Cast strokeOpacity/strokeWidth in mesh marks - Move strokeWidth default out of Mark defaults prop in Hull Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
gka
approved these changes
Apr 7, 2026
gka
left a comment
Contributor
There was a problem hiding this comment.
can you remove the hexbin docs that snuck into the delaunay docs?
aside from this, this feature still lacks a few things, but we can take care of them in separate PRs before releasing the next version.
- unit tests
- example plots
- canvas rendering
…in docs Add comprehensive unit tests for all 5 Delaunay/Voronoi marks: - Voronoi (16 tests): rendering, styling, channel mapping, events, edge cases - VoronoiMesh (11 tests): single-path rendering, attributes, edge cases - DelaunayMesh (10 tests): triangulation path, attributes, edge cases - DelaunayLink (12 tests): per-edge paths, styling, events, deduplication - Hull (14 tests): grouping by z/fill/stroke, styling, edge cases Fix Hull grouping bug where NaN coordinates during initial reactive render caused duplicate keyed-each keys crash: - Guard against NaN with Number.isFinite() instead of typeof === 'number' - Use index-based each key instead of path string to prevent duplicate keys Remove hexbin docs (Hexgrid + Hexbin transform sections) that were incorrectly included in the Delaunay docs page — these belong in the hexbin PR (svelteplot#542). ## New mark checklist (remaining items for this feature) - [x] Component source (`src/lib/marks/`) - [x] Type definitions (`src/lib/types/mark.ts`) - [x] Exports (`src/lib/marks/index.ts`) - [x] Sidebar config (`config/sidebar.ts`) - [x] Docs page (`src/routes/marks/delaunay/+page.md`) - [x] Unit tests (`src/tests/`) - [ ] Examples gallery (`src/routes/examples/delaunay/`) - [ ] Visual regression snapshots (`src/snapshots/delaunay/`) - [ ] Canvas rendering variants Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
DelaunayLink,DelaunayMesh,Hull,Voronoi,VoronoiMeshz,fill,stroke, and facet (fx/fy) channels viagroupFacetsAndZsrc/routes/examples/delaunay/PathGroup(for mesh/hull-style marks) andPathItems(for per-datum interactive marks), plusGeoPathGroup/GeoPathCanvasfor Contour and DensityDelaunayLink,DelaunayMesh,Hull,Voronoi,VoronoiMesh,Contour,Density) expose acanvasprop for canvas-accelerated renderingCloses #84
Split from #531 per reviewer request — hexbin mark and transform moved to a separate PR.
Test plan
pnpm testpasses (829 tests)pnpm buildsucceedspnpm lintpasses/marks/delaunay🤖 Generated with Claude Code