documentation for the tree mark and the treeLink, treeNode transforms#1351
Conversation
| } | ||
|
|
||
| /** | ||
| * Transforms a tabular dataset into a hierarchy according to the given **path** input channel, which is typically a slash-separated string; then executes a tree layout algorithm to compute **x** and **y** output channels; these channels can then be fed to other marks to construct a node-link diagram. |
| } | ||
|
|
||
| /** | ||
| * Based on the **tree** options (**path**, **delimiter**, **treeAnchor**, |
There was a problem hiding this comment.
Indentation should have one space, not two. (I will fix.)
There was a problem hiding this comment.
Also, I don’t think we need to repeat the tree options here. They should be clear from autocomplete (or jumping to the TreeTransformOptions interface).
| // TODO tree channels, e.g., "node:name" | "node:path" | "node:internal"? | ||
| export interface TreeOptions extends DotOptions, LinkOptions, TextOptions, TreeTransformOptions { | ||
| /** | ||
| * Should the node be represented by a dot. Defaults to true unless a **marker** is specified. |
There was a problem hiding this comment.
I can’t really explain why, but I think grammatically this should read as “whether to represent the node with a dot” instead of “should the node be represented by a dot”. “Should” can imply correctness or appropriateness, but we’re not really making a judgment about what is correct or appropriate here, just honoring the user’s intention. (I will fix.)
| */ | ||
| export function tree(data?: Data, options?: TreeOptions): CompoundMark; | ||
|
|
||
| export function cluster(data?: Data, options?: TreeOptions): CompoundMark; |
There was a problem hiding this comment.
Missing documentation. (I have fixed.)
| */ | ||
| delimiter?: string; | ||
| /** | ||
| * If the **treeAnchor** is *left*, the root of the tree will be aligned with |
There was a problem hiding this comment.
These options could use a summary sentence prior to diving into the possible ways in which the options could be specified. For example:
- treeAnchor - how to orient the tree
- treeLayout - how to position nodes in the tree
- treeSeparation - how much space to reserve between adjacent nodes
- treeSort - how to order nodes prior to computing the layout
etc.
…observablehq#1351) * documentation for the tree mark and the treeLink, treeNode transforms * tweaks * tweaks --------- Co-authored-by: Mike Bostock <mbostock@gmail.com>
For #1343
We could possibly add more information, like how dx defaults to +6 if the anchor is left, etc.