User:TreeOfKnowledge/sandbox/Template:Graph:Moseley's law

{ "_comment": "http://vega.github.io/vega-editor/?mode=vega&renderer=svg", "width": 400, "height": 200, "padding": {"top": 10, "left": 30, "bottom": 55, "right": 10}, "data": [ {"name": "table", "values": [848.61, 1040.98, 1253.688, 1486.708, 1739.985, 2013.68, 2307.885, 2622.44, 2957.682, 3313.9476, 3691.719, 4090.735, 4510.8991, 4952.216, 5414.8045, 5898.801, 6404.0062, 6930.378, 7478.2521, 8047.8227, 8638.906, 9251.674, 9886.52, 10543.2674, 11222.52, 11924.36, 12648.002, 13395.49, 14165.2, 14958.54, 15774.914, 16615.16, 17479.372, 18367.2, 19279.16, 20216.12, 21177.08, 22162.917, 23173.98, 24209.75, 25271.36, 26358.86, 27472.57, 28612.32, 29778.78, 30973.13, 32193.262, 33442.12, 34720, 36026.71, 37360.739, 38725.11, 40118.481, 41542.63, 42996.72, 44482.75, 45998.94, 47547.1, 49127.24, 50741.475, 52389.48, 54070.39, 55790.8, 57533.2, 59318.847, 61141, 63001.07, 64896.2, 66832.9, 68804.5, 70819.5, 72872.5, 74970.11], "transform": [ {"type": "formula", "field": "sqrt", "expr": "sqrt(datum.data)"}, {"type": "rank"}, {"type": "formula", "field": "number", "expr": "datum.rank + 9"}, {"type": "formula", "field": "moseleysqrt", "expr": "sqrt(10.2042698422455 * pow(datum.number - 1, 2))"}]} ], "scales": [ {"name": "x", "type": "linear", "range": "width", "zero": false, "domain": [0, 85]}, {"name": "y", "type": "linear", "range": "height", "domain": [0, 300]} ], "axes": [ {"type": "x", "scale": "x", "values": [10, 20, 30, 40, 50, 60, 70, 80], "nice": true, "title": "Atomic Number", "properties": {"labels": {"fontSize": {"value": 16}}, "title": {"fontSize": {"value": 16}}}}, {"type": "y", "scale": "y", "values": [0], "titleOffset": 15, "title": "√ν", "properties": {"labels": {"fontSize": {"value": 16}}, "title": {"fontSize": {"value": 16}}}} ], "marks": [ {     "type": "line", "from": {"data": "table"}, "properties": { "enter": { "interpolate": {"value": "monotone"}, "x": {"scale": "x", "field": "number"}, "y": {"scale": "y", "field": "moseleysqrt"}, "stroke": {"value": "#14f"}, "strokeOpacity": {"value": 0.4}, "strokeWidth": {"value": 3} }     }    },    {      "type": "symbol", "from": {"data": "table"}, "properties": { "enter": { "interpolate": {"value": "monotone"}, "x": {"scale": "x", "field": "number"}, "y": {"scale": "y", "field": "sqrt"}, "fill": {"value": "black"}, "size": {"value": 3} }     }    }  ] }