User:Yurik/CenterMap

{ "version": 2, "width": 800, "height": 600, "padding": 12, "background": "#edf1f7", "signals": [ {     "name": "rotate", "init": 0 },   {      "name": "down", "init": {}, "streams": [{ "type": "mousedown", "expr": "{angle: rotate, x: eventX}" }]   },    {      "name": "rotate", "init": 0, "streams": [{ "type": "[mousedown, window:mouseup] > window:mousemove", "expr": "(down.angle + (eventX - down.x)) % 360" }]   },    {      "name": "isDragging", "init": false, "streams": [ {"type": "@handle:mousedown","expr": "true"}, {"type": "mouseup","expr": "false"} ]   },    {      "name": "handlePosition", "streams": [{"type": "mousemove[isDragging]","expr": "eventX"}] },   {      "name": "scaledHandlePosition", "expr": "handlePosition", "scale": {"name": "yearsScale","invert": true} },   {      "name": "currentYear", "init": 15000, "expr": "clamp(parseInt(scaledHandlePosition),80,30000)" } ],  "data": [ {     "name": "world", "url": "wikiraw:///User:Ad_Huikeshoven/gemeenten/topojson", "format": {"type": "topojson","feature": "gemeenten"}, "transform": [{ "type": "geopath", "projection": "mercator", "rotate": {"signal": "rotate"}, "scale": {"signal":"currentYear"}, "center": [5,53], }]   }  ],  "scales": [ {     "name": "yearsScale", "type": "linear", "zero": false, "domain": [80, 30000], "range": "width" } ],  "marks": [ {     "type": "path", "from": {"data": "world"}, "properties": { "enter": { "stroke": {"value": "#fff"} },       "update": { "path": {"field": "layout_path"}, "fill": {"value": "#ccc"} },       "hover": { "fill": {"value": "pink"} }     }    },    {      "name": "yearLabel", "type": "text", "properties": { "enter": { "x": {"value": 0}, "y": {"value": 25}, "fontSize": {"value": 32}, "fontWeight": {"value": "bold"}, "fill": {"value": "steelblue"} },       "update": {"text": {"signal": "currentYear"}} }   },    {      "name": "scrollLine", "type": "rule", "properties": { "enter": { "x": {"value": 0}, "y": {"value": 40}, "x2": {"value": 300}, "stroke": {"value": "#000"}, "strokeWidth": {"value": 2} }     }    },    {      "name": "handle", "type": "path", "properties": { "enter": { "y": {"value": 40}, "path": {"value": "m-5.5,-10l0,20l11.5,-10l-11.5,-10z"}, "stroke": {"value": "#880"}, "strokeWidth": {"value": 2.5} },       "update": { "x": {"scale": "yearsScale","signal": "currentYear"}, "fill": {"value": "#fff"} },       "hover": {"fill": {"value": "#f00"}} }   },    {      "name": "debugRotate", "type": "text", "properties": { "enter": { "x": {"value": 250}, "y": {"value": 0}, "fill": {"value": "black"} },       "update": {"text": {"signal": "rotate"}} }   },    {      "name": "debugHandlePosition", "type": "text", "properties": { "enter": { "x": {"value": 250}, "y": {"value": 14}, "fill": {"value": "black"} },       "update": {"text": {"signal": "handlePosition"}} }   },    {      "name": "debugScaledHandlePosition", "type": "text", "properties": { "enter": { "x": {"value": 250}, "y": {"value": 28}, "fill": {"value": "black"} },       "update": {"text": {"signal": "scaledHandlePosition"}} }   }  ] }