-
Notifications
You must be signed in to change notification settings - Fork 185
documentation for the tree mark and the treeLink, treeNode transforms #1351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,47 @@ import type {TextOptions} from "./text.js"; | |
|
||
// TODO tree channels, e.g., "node:name" | "node:path" | "node:internal"? | ||
export interface TreeOptions extends DotOptions, LinkOptions, TextOptions, TreeTransformOptions { | ||
/** | ||
* Whether to represent the node with a dot; defaults to true unless a | ||
* **marker** is specified. | ||
*/ | ||
dot?: boolean; | ||
/** | ||
* The **stroke** color for the text mark to improve the legibility of labels | ||
* atop other marks by creating a halo effect; defaults to *white*. | ||
*/ | ||
textStroke?: MarkOptions["stroke"]; | ||
} | ||
|
||
/** | ||
* Transforms a tabular dataset into a hierarchy according to the given **path** | ||
* input channel, which typically contains slash-separated strings; then | ||
* executes a tree layout algorithm, by default Reingold–Tilford’s “tidy” | ||
* algorithm, to compute *x* and *y* output channels; these channels can then be | ||
* fed to other marks to construct a node-link diagram. | ||
* | ||
* These options control how the tabular data is organized into a hierarchy: | ||
* | ||
* * **path** - a channel specifying each node’s hierarchy location; defaults to identity | ||
* * **delimiter** - the path separator; defaults to forward slash (/) | ||
* | ||
* These options control how the node-link diagram is laid out: | ||
* | ||
* * **treeLayout** - a tree layout algorithm; defaults to [d3.tree](https://github.com/d3/d3-hierarchy/blob/main/README.md#tree) | ||
* * **treeAnchor** - a tree layout orientation, either *left* or *right*; defaults to *left* | ||
* * **treeSort** - a node comparator, or null to preserve input order | ||
* * **treeSeparation** - a node separation function, or null for uniform separation | ||
*/ | ||
export function tree(data?: Data, options?: TreeOptions): CompoundMark; | ||
|
||
/** | ||
* Shorthand for Plot.tree using | ||
* [d3.cluster](https://github.com/d3/d3-hierarchy/blob/main/README.md#cluster) | ||
* as the **treeLayout** option, placing leaf nodes of the tree at the same | ||
* depth. Equivalent to: | ||
* | ||
* ```js | ||
* Plot.tree(data, {...options, treeLayout: d3.cluster}) | ||
* ``` | ||
*/ | ||
export function cluster(data?: Data, options?: TreeOptions): CompoundMark; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing documentation. (I have fixed.) |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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.
Uh oh!
There was an error while loading. Please reload this page.