Graphs

This example shows different types of graphs (and layouts) that you can visualize using Rerun.

Rerun ships with an integrated engine to produce force-based layouts to visualize graphs. Force-directed layout approaches have to advantage that they are flexible and can therefore be used to create different kinds of visualizations. This example shows different types of layouts:

  • Regular force-directed layouts of node-link diagrams
  • Bubble charts, which are based on packing circles

Used Rerun types used-rerun-types

GraphNodes, GraphEdges

Force-based layouts forcebased-layouts

To compute the graph layouts, Rerun implements a physics simulation that is very similar to d3-force. In particular, we implement the following forces:

  • Centering force, which shifts the center of mass of the entire graph.
  • Collision radius force, which resolves collisions between nodes in the graph, taking their radius into account.
  • Many-Body force, which can be used to create attraction or repulsion between nodes.
  • Link force, which acts like a spring between two connected nodes.
  • Position force, which pull all nodes towards a given position, similar to gravity.

If you want to learn more about these forces, we recommend looking at the D3 documentation as well.

Our implementation of the physics simulation is called Fjädra. You can find it on GitHub and on crates.io.

Run the code run-the-code

pip install -e examples/python/graphs
python -m graphs