| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Adds d3-hierarchy layout transforms following Observable Plot's *Node/*Link paired convention: - treeNode/treeLink: tree and cluster diagrams - treemapNode: space-filling rectangular treemaps - packNode: circle-packing layouts - partitionNode/partitionLink: icicle/sunburst partition layouts Shared infrastructure in hierarchy.ts provides stratification (flat data → hierarchy) and a WeakMap cache that deduplicates layout computation across paired transforms. Includes docs page, sidebar entries, 5 tree examples, flare.csv dataset, and 59 tests across 4 test files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix record interface types: [key: string]: unknown → any, add [key: symbol]: any for compatibility with Record<string|symbol, RawValue> - Move examples from examples/graph/ to per-transform directories (examples/tree/, treemap/, pack/, partition/) to fix prerender 404 caused by [group] route resolving graph → /marks/graph - Wrap computed values in $derived() for Svelte 5 reactivity correctness - Add `as [number, number]` tuple casts on size options - Apply Prettier formatting to all new files 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. |
Sorry, something went wrong.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Wire delimiter option through buildHierarchy() — d3's stratify().path() hardcodes '/' as separator, so custom delimiters (like '.') are now converted before passing to d3. This was the root cause of flat/broken hierarchy plots. - Fix Text marks rendering literal "null" — filter data to leaf nodes before passing to <Text> instead of returning null from the accessor (String(null) → "null" in Text.svelte). - Normalize padding as fraction of layout size in treemap/pack/partition — padding: 0.01 now means 1% regardless of layout size parameter. - Fix treemap/partition examples: padding was in absolute layout units, consuming entire space with size: [1,1]. Pack example: switched to normalized coordinates with derived pixelSize for r conversion. - Expose two-tier API: treeLayout, treemapLayout, packLayout, partitionLayout as public low-level functions returning raw d3 hierarchy roots. Matches the force transform's forceLayout / forceNode pattern. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Generate screenshot thumbnails for all hierarchy examples (tree, treemap, pack, partition) via screenshot-examples.js on OSC. - Add --no-sandbox and --disable-setuid-sandbox to Puppeteer launch options, required for headless Chrome on HPC compute nodes and CI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
I set this back to draft as it needs some more work. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Add hierarchy layout transforms wrapping d3-hierarchy: tree, treemap, pack, and partition.
layouts (Closes feature: add Tree transform #81, Closes feature: Add treeLink transform #358, Closes feature: Add treeNode transform #359)
rectangular partitions
All transforms use a curried factory pattern (treeNode(options)({ data })) that produces new record sets compatible with existing marks (Dot, Link, Rect, Text). Paired *Node/*Link transforms share a WeakMap-based cache so the layout computes only once per data array.
treeNode/treeLink follow the Observable Plot tree transform API. treemapNode, packNode, and partitionNode/partitionLink extend beyond Observable Plot's API, wrapping d3-hierarchy layouts directly.
Partially addresses #92 (Tree mark) and #75 (missing transform types) — the transforms are implemented but a dedicated <Tree> convenience mark is not included in this PR.
What's included
Design decisions
Test plan
🤖 Generated with Claude Code