-
Notifications
You must be signed in to change notification settings - Fork 277
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
Setting initial collapsed state of nodes #402
Comments
If anyone knows of any workarounds to this, e.g. via an imperative API call, please do let me know. 💜 |
Copying across the example I posted of what I am trying to achieve; I would like to load the tree with a specific path expanded (everything else collapsed). For example, given the following tree;
I would like to be able to set the path of
|
hey, @sockthedev. Is there any chance that you resolved the issue? I'd highly appreciate if you reply. Ciao |
Hey @hikmert, in the end I rendered the entire tree, but then updated the style for the active path so that it was "brighter" than the rest of the nodes. I would have preferred the above, but for now this is working. I'll see how the solution scales though. |
Hey, @sockthedev. Were you able to resolve the issue? |
Something like this patch can work: |
@danielbeeke What exactly does this enable us to do? I'm trying to control the collapsed state of individual nodes as well. |
Exactly that, |
I guess my question is, how do I use it? I just see a patch to the source code of the library, but how do i use it from my application? |
This might help: https://www.npmjs.com/package/patch-package |
that does help with patching the library. But how do i control these states in my app? Thanks |
Figured out more or less how i can control the collapsed state from my app, using the patch from @danielbeeke I will post my solution here eventually (after my vacation) |
I think there must be fix , so that is would be possible to predefine "collapsed" value on time of providing Tree data, like it was in previous version. If it is not predefined. it should take default value. |
There's a PR out for this, hoping it gets approved soon! #514 |
Are you reporting a bug, or opening a feature request?
Question or Feature Request
What is the behavior/output you expect?
How do you set the initial collapsed/expanded state of any particular set of nodes in the Tree data?
In v1, we were able to do this via the
_collapsed
attribute - but setting the__rd3t.collapsed
attribute does not have the same effect.What version of react-d3-tree are you using?
3.3
The text was updated successfully, but these errors were encountered: