SpiderStrategies / kalpa-tree

A tree implementation backed by D3
http://spiderstrategies.github.io/kalpa-tree/
ISC License
4 stars 2 forks source link

Adds `expandedNodes` method to the tree. #449

Closed nathanbowser closed 5 years ago

nathanbowser commented 5 years ago

This returns all the nodes that are expanded.

Fixes #448

nathanbowser commented 5 years ago

@jerryorr This is part one of your request from our slack chat early. Do you want the ability to set some state on the incoming nodes so the tree is rendered correctly, or do you want to render and then expand each of these nodes you persisted?

mattsgarlata commented 5 years ago

@nathanbowser for a very large tree, I would think manually expanding the nodes would be really slow, wouldn't it?

nathanbowser commented 5 years ago

Yea good point. I'll add support for initial renders because we already performance tune the initial drawing.

nathanbowser commented 5 years ago

Updated.

@jerryorr You can set collapsed: false on any of the persisted nodes that should be expanded on initial render.

I am thinking collapsed: false might seem weird, but that follows the internal conventions used by the tree, so I stuck with it.

mattsgarlata commented 5 years ago

+1