User:AKlapper (WMF)/Sandbox

{ "data": [ {     "name": "colours", "values": [ { "code": 0, "rgb": "#1f77b4", "offset": 0 }, { "code": 1, "rgb": "#ff7f0e", "offset": 0 }, { "code": 2, "rgb": "#2ca02c", "offset": 0 }, ]   },    {      "name": "table", "values": [ {"id": 0, "x": 1502, "y": 211}, {"id": 0, "x": 1503, "y": 221}, {"id": 0, "x": 1504, "y": 207}, {"id": 0, "x": 1505, "y": 214}, {"id": 0, "x": 1506, "y": 212}, {"id": 0, "x": 1507, "y": 197}, {"id": 1, "x": 1502, "y": 190}, {"id": 1, "x": 1503, "y": 185}, {"id": 1, "x": 1504, "y": 186}, {"id": 1, "x": 1505, "y": 183}, {"id": 1, "x": 1506, "y": 190}, {"id": 1, "x": 1507, "y": 194}, {"id": 2, "x": 1502, "y": 127}, {"id": 2, "x": 1503, "y": 122}, {"id": 2, "x": 1504, "y": 122}, {"id": 2, "x": 1505, "y": 125}, {"id": 2, "x": 1506, "y": 132}, {"id": 2, "x": 1507, "y": 132}, ],     "transform": [ {         "type": "zip", "with": "colours", "as": "merged", "key": "data.id", "withKey": "data.code", "default": "#555555" }     ]    }  ],  "scales": [ {     "name": "x", "type": "ordinal", "range": "width", "domain": { "data": "table", "field": "data.x" } },   {      "name": "y", "range": "height", "nice": true, "domain": { "data": "table", "field": "data.y" } } ],  "marks": [ {     "type": "group", "from": { "data": "table", "transform": [ { "type": "facet", "keys": [ "data.id" ] } ]     },      "scales": [ {         "name": "y", "type": "linear", "range": -300, "domain": { "field": "data.y" } }     ],      "axes": [ {"type": "x", "scale": "x"}, {"type": "y", "scale": "y"} ],     "marks": [ {         "type": "line", "properties": { "enter": { "strokeWidth": { "value": 2 } },           "update": { "stroke": { "field": "merged.data.rgb" }, "x": { "scale": "x", "field": "data.x" }, "y": { "scale": "y", "field": "data.y" } }         }        }      ]    }  ] }