Skip to content
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

treeFilter option #1611

Merged
merged 1 commit into from
May 22, 2023
Merged

treeFilter option #1611

merged 1 commit into from
May 22, 2023

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented May 22, 2023

@mbostock mbostock requested a review from Fil May 22, 2023 16:29
)
)
]
? treeLayout === Tree || treeLayout === Cluster
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just hard-coded this to apply only to the “tidy” tree and cluster layouts (and thereby avoiding it for the indent layout), but we could make this a separate option and use this heuristic as the default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably nicer (for dev exploration at least) to give function implementations of layouts the same "powers" that named layout have. An alternative if we don't want this to be a user-facing option, is to read a special property (.balancedLabels?) on the layout function. (The two layouts from D3 would be tested like you do here.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m in favor of an option if you want to make it configurable (and not some alternative mechanism). Perhaps a textBalanced boolean option? Or you could even override the textAnchor option to be mirrored maybe, but perhaps that’s fancier than it needs to be.

@Fil Fil merged commit 0b2e741 into fil/balanced-tree May 22, 2023
@Fil Fil deleted the mbostock/tree-filter branch May 22, 2023 16:44
@Fil Fil mentioned this pull request May 22, 2023
3 tasks
mbostock added a commit that referenced this pull request Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants