Cant pass extra data in nodes in simulation.nodes function
elVengador opened this issue · 1 comments
elVengador commented
I want to pass extra data like nodeId to use later
For example find a node under mouse cursor, then get nodeId and make some operations
Im building nodes inthis way:
const nodes: (SimulationNodeDatum)[] = notes.map(c => Object.create(c))
all extra data from notes
is removed
if I force like this:
const nodes: (SimulationNodeDatum)[] = notes.map(c => Object.create({ ...c, tmp: true }))
Fil commented
It seems to be working here https://observablehq.com/@recifs/simulation-nodes-with-added-data--support