Closed dcavanagh closed 7 years ago
As your question is more of a "how to" question, please post it on StackOverflow. Also, because I think it might be of broader interest, when answered there. You can ping me there or drop me a link to your SO question in this thread for reference.
Nevertheless, I am closing this issue, as this repo is not active for issues, but I am more than willing to respond as proposed above. Thx, for understanding, T.
Thanks - sorry about that. Here is a link to the SO question http://stackoverflow.com/questions/43696302/how-to-use-simulationlinkdatum-and-simulationnodedatum-in-d3
Thanks for opening the SO question. I just posted a suggested answer.
I'm having a problem using the SimulationLinkDatum Type. I made two classes Node and Link that implement SimulationNodeDatum and SimulationLinkDatum. When I go to try and use SimulationLinkDatum typescript says that d.source.x, d.targe.x, etc typescript says that "Property 'x' does not exist on type 'string | number | Node'."
I understand that the SimulationLinkDatum accepts
number | string | <T>
for the source and target node properties and that if you use number or string that it will be mutated into a SimulationNodeDatum. Is this just something that we have to live with or is there a better way of using these interfaces?Thanks