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

[WIP] make nodes collapsable #6

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

m0veax
Copy link
Contributor

@m0veax m0veax commented Jan 25, 2024

Idea:

A node has a link or button to hide child nodes. The button changes from "[-]" to "[+]" to inform the user

@m0veax
Copy link
Contributor Author

m0veax commented Jan 25, 2024

Using this Feature

https://reactflow.dev/examples/nodes/hidden

Copy link
Member

@orangecms orangecms left a comment

Choose a reason for hiding this comment

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

Suggestion:

We have the tree in the state and derive the layout from it.
When collapsing a node, it would be nice to redistribute the nodes accordingly.
So let's hoist the collapsed state from being local here to bring global, and treat a collapsed node just like a leaf. The current transform helpers may need some splitting in order to accomodatr for that. WDYT?

@m0veax
Copy link
Contributor Author

m0veax commented Jan 29, 2024

So, I thought about the whole case and my next steps would be:

  • Add redux
  • move the tree into the state management
  • make collapse / decollapse state events
  • rerender the tree if changes occur

What do you think about hiding the nodes starting on the 3rd level by default?

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.

2 participants