Forum Discussion
D3JSVisual separation between nodes
- 2 months ago
Hello dbernal_007,
Yes, this is generally possible in D3.js.
To increase the distance between nodes, you'll need to adjust the parameters of your layout (for example, linkDistance in a force-directed graph or the node spacing settings in hierarchical/tree layouts). Increasing the spacing will make the connecting links/arrows longer.
Once you have sufficient space, you can place an icon on or near the link by:
- Adding an SVG element (image, circle, text, etc.) positioned at the midpoint of the link.
- Updating its position whenever the graph is rendered or refreshed.
- The exact implementation depends on which D3 layout you're using (force-directed, tree, sankey, network graph, etc.).
Could you share:
- The type of D3 visual you're using?
- A code snippet or screenshot of the current implementation?
That would help provide a more specific solution.
Best regards,
Omkar Shinde
Microsoft Fabric Enthusiast | Power BI Consultant
💡 If you found this response helpful, please consider giving it a Kudos.
✅ If this resolves your question, please mark it as the Accepted Solution to help others in the community.
Hello dbernal_007,
Yes, this is generally possible in D3.js.
To increase the distance between nodes, you'll need to adjust the parameters of your layout (for example, linkDistance in a force-directed graph or the node spacing settings in hierarchical/tree layouts). Increasing the spacing will make the connecting links/arrows longer.
Once you have sufficient space, you can place an icon on or near the link by:
- Adding an SVG element (image, circle, text, etc.) positioned at the midpoint of the link.
- Updating its position whenever the graph is rendered or refreshed.
- The exact implementation depends on which D3 layout you're using (force-directed, tree, sankey, network graph, etc.).
Could you share:
- The type of D3 visual you're using?
- A code snippet or screenshot of the current implementation?
That would help provide a more specific solution.
Best regards,
Omkar Shinde
Microsoft Fabric Enthusiast | Power BI Consultant
💡 If you found this response helpful, please consider giving it a Kudos.
✅ If this resolves your question, please mark it as the Accepted Solution to help others in the community.