Physics based model of physics

In this model basic mechanical quantities in physics are shown with their relations.

HTML

<!DOCTYPE html>
<html>
  <head>
    <title>Common mechanical quantities</title>
    <script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script>
    </head>
  <body>

  </body>

CSS

.link {
  stroke: #fcfcfc;
}

.node text {
  pointer-events: none;
  font: 12px Calibri, Arial;
}
path.link {
  fill: none;
  stroke: #666;
  stroke-width: 1.5px;
}

marker#licensing {
  fill: green;
}

path.link.licensing {
  stroke: green;
}

path.link.resolved {
  stroke-dasharray: 0,2 1;
}

circle {
  fill: #ccc;
  stroke: #333;
  stroke-width: 1.5px;
}

text {
  font: 10px sans-serif;
  pointer-events: none;
}

text.shadow {
  stroke: #fff;
  stroke-width: 3px;
  stroke-opacity: .8;
}

JavaScript

/* (c) Michiel van der Blonk
 * a model of basic phycics quantities
 * July 2012
 * some code adapted from http://bl.ocks.org/1153292
 */
var width = 960,
    height = 700,
    r = 12,
    gravity = 0.1,
    distance = 100,
    charge = -800,
    fill = d3.scale.category10(),

    // these are the quantities
    // the groups are
    // 1: essential axiomatic units m, l, t
    // 2: related to movement
    // 3: related to energy
    // 4: related to a single unit
    nodes=[
        {name:"Mass", symbol:"m", unit:"kg", group:1}, 
        {name:"Time", symbol:"t", unit:"s", group:1}, 
        {name:"Length", symbol:"d", unit:"m", group:1},
        {name:"Force", symbol:"F", unit:"N", group:3, formula:"F=m.a"}, 
        {name:"Velocity", symbol:"v", unit:"m/s", group:2, formula:"v=d/t"}, 
        {name:"Acceleration", symbol:"a", unit:"m/(s.s)", group:2, formula:"a=v/d"},
        {name:"Work", symbol:"W", unit:"J", group:3, formula:"W=F.d"}, 
        {name:"Momentum", symbol:"p", unit:"kg.m/s", group:2, formula:"p=m.v"}, 
        {name:"Impulse", symbol:"I", unit:"N.s", group:2, formula:"I=F.t"},
        {name:"Energy (k)", symbol:"E", unit:"J", group:3, formula:"Ek=0.5m.v.v"}, 
        {name:"Power", symbol:"P", unit:"W", group:3, formula:"P=W/t"}, 
        {name:"Pressure", symbol:"p", unit:"Pa", group:3, formula:"p=F/A"},
        {name:"Area", symbol:"A", unit:"m.m", group:4, formula:"A=d*d"}, 
        {name:"Volume", symbol:"V", unit:"m.m.m", group: "4", formula:"V=A*d"}, 
        {name:"Frequency", symbol:"f", unit:"Hz", group:4, formula:"f=1/t"}
        ],

    // the relations shown can be calculated using
    // formulas from either 1 or 2 other quantities
    links=[
        {"source":1,"target":4,"value":1}, {"source":2,"target":4,"value":1}, // velocity
        {"source":2,"target":5,"value":1}, {"source":4,"target":5,"value":1}, // acceleration
        {"source":0,"target":3,"value":1}, {"source":5,"target":3,"value":1}, // force
       ...