-
Notifications
You must be signed in to change notification settings - Fork 197
tree #841
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
tree #841
Conversation
|
Okay, I figured out how to get faceting and imputed nodes to work: now the tree transforms generate one element per node or per link, respectively, and for imputed nodes the associated data is null (but you can still access node-related metadata using a node accessor). Here’s a little example of the flare dataset with small nodes (<5000 bytes) on the left and large nodes (≥5000 bytes) on the right. Fun! |
Fil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! I've added a few suggestions (which can all be addressed later) in #843.

Introduces two new options transforms: Plot.treeNode, for laying out tree nodes, and Plot.treeLink, for laying out tree links. The new convenience mark Plot.tree combines a link, dot, and text with these options transforms to generate a tree diagram.
The Plot.treeNode options transform supports special evaluators for tree nodes. If a channel is defined as a string starting with “node:” then it is interpreted as one of the built-in node evaluators:
Alternatively you can specify a channel as an {node} object where node is a function. This function is then passed the d3-hierarchy node instance.
The Plot.treeLink options transform similarly supports special evaluators for tree links. If the “node:” prefix or {node} syntax is used, it refers to child node of the link; if the “parent:” prefix syntax is used, it refers to the parent node of the link. If the {link} syntax is used, the function is passed two arguments (child, parent) and can compute the desired corresponding value.
TODO
Use root.count or root.sum and expose a node:value somehow?Not now.Related #136.