bkrem / react-d3-tree

:deciduous_tree: React component to create interactive D3 tree graphs
https://bkrem.github.io/react-d3-tree
MIT License
1.08k stars 270 forks source link

How to replace ID #232

Open Nilanth opened 5 years ago

Nilanth commented 5 years ago

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

TomlDev commented 5 years ago

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

Foxhoundn commented 4 years ago

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.