Skip to main content
100%

Bounded Force Layout - Columns by Depth

✓ Published0🌍 Public
MMNoichl
Last edited Dec 21, 2017
Created on Dec 21, 2017

This example visualizes energy flows between sources and uses as a bounded force-directed layout, with nodes arranged in vertical columns based on a cluster depth value. The graph shows citation relationships among publications on race and IQ, using circle nodes and connecting lines rendered in SVG. Built with D3 v3 and Vue, the code uses `d3.layout.force` with a custom tick function that constrains node positions within the SVG bounds and adjusts vertical placement by cluster. A simple D3 tooltip appears on mouseover, and the data comes from a local `graph.json` file.

AI-generated description

This example takes <a href='http://bl.ocks.org/bjtucker/'>bjtucker</a>'s block: <a href='http://bl.ocks.org/bjtucker/151f6344ffd02105a67a'>Bounded Force Layout - force rank by group</a> and swaps out the dataset, showing energy flows from source to use.

This example also adds a Simple D3 tooltip. Hat tip to biovisualize for that bl.ock.

See another view of this energy flow data at the bl.ock Sankey Particles - Transparent Links


README.md from the original bl.ock


This D3 example shows how to constrain the position of nodes within the rectangular bounds of the containing SVG element. As a side-effect of updating the node's cx and cy attributes, we update the node positions to be within the range [radius, width - radius] for x, [radius, height - radius] for y. If you prefer, you could use the each operator to do this as a separate step, rather than as a side-effect of setting attributes.

Wrote the each operator step described above, but used tick to settle groups into separate ranks. -bjtucker

forked from <a href='http://bl.ocks.org/micahstubbs/'>micahstubbs</a>'s block: <a href='http://bl.ocks.org/micahstubbs/5e07b8b42f4fb826a7145e800dc23ec2'>Bounded Force Layout - Columns by Depth</a>

gpl-3.0 Licensed

Similar vizzes