path-tree icon indicating copy to clipboard operation
path-tree copied to clipboard

Remove element from tree, by id

Open jeromegn opened this issue 3 years ago • 1 comments
trafficstars

Would it be possible to remove a path from the tree, by id?

Looking through the code, it looks like it might be possible, but I'm not exactly sure how I'd do it.

jeromegn avatar Oct 13 '22 14:10 jeromegn

Yes, you can delete nodes and data by id.

See https://github.com/viz-rs/path-tree/blob/main/src/node.rs#L19, the node stores the id, so we can look it up recursively.

PR welcome. :)

fundon avatar Oct 14 '22 09:10 fundon