observablehq / plot

A concise API for exploratory data visualization implementing a layered grammar of graphics
https://observablehq.com/plot/
ISC License
4.4k stars 176 forks source link

Allow hierarchical data for the tree (and related) marks? #1712

Open mbostock opened 1 year ago

mbostock commented 1 year ago

We currently require you to provide tidy data to the tree mark, typically with a path column that provides a slash-delimited string representing the location of each row in the tree. It’d be nice if we also allowed D3’s nested {children} object representation, as is used by many D3 examples.

mbostock commented 1 year ago

Ideally the tree transform can do this — to turn a hierarchical object into an array of descendants without having to go through stratify and without computing paths.