react-d3-tree icon indicating copy to clipboard operation
react-d3-tree copied to clipboard

How to replace ID

Open Nilanth opened this issue 5 years ago • 2 comments

Thank you for taking the time to report an issue with react-d3-tree!

Feel free to delete any questions that do not apply.

Are you reporting a bug, or opening a feature request?

opening a feature request

What is the actual behavior/output?

ID is autogenerated

What is the behavior/output you expect?

Need replace the ID manually

What version of react-d3-tree are you using?

1.14.2

Nilanth avatar Aug 28 '19 13:08 Nilanth

You can set the ID value you need to another key, for example iterate over all nodes and set

node.deviceId = yourID

The field id is obviously needed by the module itself for the correct displaying of every node

TomlDev avatar Aug 30 '19 10:08 TomlDev

You can set the ID value you need to another key, for example iterate over all nodes and set

node.deviceId = yourID

The field id is obviously needed by the module itself for the correct displaying of every node

So if you have an id on your data, it will get replaced by the component id. Why not use something like _id? It's quite intrusive.

Foxhoundn avatar Aug 26 '20 13:08 Foxhoundn