Is there anyone, who tried to create a D3 Force Directed Graph with React Native? There are complications, since the Svg Elements are named differently in the react-native-svg Component. I changed parts of the canonical demo, but it still doesn’t seem to work.
No Svg Elements for Nodes / or Links (as shown in the code snippet) are added…
I guess, it has to do with the D3 Select function not working in React Native, obviously, since there is no DOM…
const link = svg
.data(updatedLinks)
.enter()
.append("Line")
.attr("stroke", config.linkStroke)
.attr("stroke-opacity", config.linkStrokeOpacity)
.attr("stroke-width", config.linkStrokeWidth)
.attr("marker-end", "url(#arrow)"); // Apply the 'arrow' marker to each link