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

Hide a node based on a condition #426

Open
ganeshpaharan opened this issue Aug 6, 2024 · 6 comments
Open

Hide a node based on a condition #426

ganeshpaharan opened this issue Aug 6, 2024 · 6 comments

Comments

@ganeshpaharan
Copy link

ganeshpaharan commented Aug 6, 2024

Hello Author,
Thanks you for your wonderful work & thanks very much for providing a solution for my previous request.

Is there a way to conditionally hide/show a node?
I'm working on a feature where expanding a particular node reveals multiple children with the same attributes. I'd like to show just one child node and display the number of similar nodes (essentially hiding the duplicates).
I also want this functionality to work when expanding all

Thanks in advance

@bumbeishvili
Copy link
Owner

Hi, why not precomputing that data before passing it to the org chart and then just showing up that number inside nodes?

I don't see why that logic has to be inside org chart

@ganeshpaharan
Copy link
Author

Yes, I did that. I removed duplicate nodes from data then rendered the chart, but it’s not possible to see all the children if I want to since I removed from data
Was just looking for any functionality in the chart itself 😊
I can keep original data and load the chart with modified data. And when I want to see all the children while expanding then I’ll have render chart with original data

@ganeshpaharan
Copy link
Author

I was wondering if there could be any easy way to implement this 😊

@bumbeishvili
Copy link
Owner

@ganeshpaharan can you add some kind of rough sketches of what you want, I might not be understanding it fully

@ganeshpaharan
Copy link
Author

Sure
Below is the example I’m trying to achieve
IMG_4973

@bumbeishvili
Copy link
Owner

@ganeshpaharan can you also link an online sample where you tried my suggestion and faced the problem which you mentioned?

You can extend this sample - https://stackblitz.com/edit/js-mfzkbs?file=index.html

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

No branches or pull requests

2 participants