Difference between revisions of "Guild:Good Eats"
From A Wiki in the Desert
(Created page with "Welcome to Good Eats! Located just north of Bernike CS @ 2948, -913.") |
|||
Line 1: | Line 1: | ||
Welcome to Good Eats! Located just north of Bernike CS @ 2948, -913. | Welcome to Good Eats! Located just north of Bernike CS @ 2948, -913. | ||
+ | |||
+ | == Food Grid == | ||
+ | <graph> | ||
+ | { | ||
+ | "width": 800, | ||
+ | "height": 500, | ||
+ | "padding": 50, | ||
+ | "data": [ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ], | ||
+ | "signals": [ | ||
+ | { | ||
+ | "name": "point", | ||
+ | "init": 0, | ||
+ | "streams": [ | ||
+ | { | ||
+ | "type": "mousedown", | ||
+ | "expr": "{x: eventX(), y: eventY()}" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "name": "delta", | ||
+ | "init": 0, | ||
+ | "streams": [ | ||
+ | { | ||
+ | "type": "[mousedown, window:mouseup] > window:mousemove", | ||
+ | "expr": "{x: point.x - eventX(), y: eventY() - point.y}" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "name": "xAnchor", | ||
+ | "init": 0, | ||
+ | "streams": [ | ||
+ | { | ||
+ | "type": "mousemove", | ||
+ | "expr": "eventX()", | ||
+ | "scale": {"name": "x","invert": true} | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "name": "yAnchor", | ||
+ | "init": 0, | ||
+ | "streams": [ | ||
+ | { | ||
+ | "type": "mousemove", | ||
+ | "expr": "eventY()", | ||
+ | "scale": {"name": "y","invert": true} | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "name": "zoom", | ||
+ | "init": 1, | ||
+ | "verbose": true, | ||
+ | "streams": [ | ||
+ | { | ||
+ | "type": "wheel", | ||
+ | "expr": "pow(1.001, event.deltaY*pow(16, event.deltaMode))" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "name": "xs", | ||
+ | "streams": [ | ||
+ | { | ||
+ | "type": "mousedown, mouseup, wheel", | ||
+ | "expr": "{min: xMin, max: xMax}" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "name": "ys", | ||
+ | "streams": [ | ||
+ | { | ||
+ | "type": "mousedown, mouseup, wheel", | ||
+ | "expr": "{min: yMin, max: yMax}" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "name": "xMin", | ||
+ | "init": -1.6, | ||
+ | "streams": [ | ||
+ | { | ||
+ | "type": "delta", | ||
+ | "expr": "xs.min + (xs.max-xs.min)*delta.x/width" | ||
+ | }, | ||
+ | { | ||
+ | "type": "zoom", | ||
+ | "expr": "(xs.min-xAnchor)*zoom + xAnchor" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "name": "xMax", | ||
+ | "init": 1.6, | ||
+ | "streams": [ | ||
+ | { | ||
+ | "type": "delta", | ||
+ | "expr": "xs.max + (xs.max-xs.min)*delta.x/width" | ||
+ | }, | ||
+ | { | ||
+ | "type": "zoom", | ||
+ | "expr": "(xs.max-xAnchor)*zoom + xAnchor" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "name": "yMin", | ||
+ | "init": -1, | ||
+ | "streams": [ | ||
+ | { | ||
+ | "type": "delta", | ||
+ | "expr": "ys.min + (ys.max-ys.min)*delta.y/height" | ||
+ | }, | ||
+ | { | ||
+ | "type": "zoom", | ||
+ | "expr": "(ys.min-yAnchor)*zoom + yAnchor" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "name": "yMax", | ||
+ | "init": 1, | ||
+ | "streams": [ | ||
+ | { | ||
+ | "type": "delta", | ||
+ | "expr": "ys.max + (ys.max-ys.min)*delta.y/height" | ||
+ | }, | ||
+ | { | ||
+ | "type": "zoom", | ||
+ | "expr": "(ys.max-yAnchor)*zoom + yAnchor" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "name": "pointSize", | ||
+ | "init": 20, | ||
+ | "streams": [ | ||
+ | { | ||
+ | "type": "xMin", | ||
+ | "expr": "clamp(60/(xMax-xMin), 1, 100)" | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | ], | ||
+ | "scales": [ | ||
+ | { | ||
+ | "name": "x", | ||
+ | "type": "linear", | ||
+ | "range": "width", | ||
+ | "zero": false, | ||
+ | "domainMin": {"signal": "xMin"}, | ||
+ | "domainMax": {"signal": "xMax"} | ||
+ | }, | ||
+ | { | ||
+ | "name": "y", | ||
+ | "type": "linear", | ||
+ | "range": "height", | ||
+ | "zero": false, | ||
+ | "domainMin": {"signal": "yMin"}, | ||
+ | "domainMax": {"signal": "yMax"} | ||
+ | } | ||
+ | ], | ||
+ | "axes": [ | ||
+ | { | ||
+ | "type": "x", | ||
+ | "scale": "x", | ||
+ | "grid": true, | ||
+ | "layer": "back", | ||
+ | "properties": {"labels": {"fontSize": {"value": 14}}} | ||
+ | }, | ||
+ | { | ||
+ | "type": "y", | ||
+ | "scale": "y", | ||
+ | "grid": true, | ||
+ | "layer": "back", | ||
+ | "properties": {"labels": {"fontSize": {"value": 14}}} | ||
+ | } | ||
+ | ], | ||
+ | "marks": [ | ||
+ | { | ||
+ | "type": "group", | ||
+ | "properties": { | ||
+ | "enter": { | ||
+ | "x": {"value": 0}, | ||
+ | "width": {"field": {"group": "width"}}, | ||
+ | "y": {"value": 0}, | ||
+ | "height": {"field": {"group": "height"}}, | ||
+ | "clip": {"value": true} | ||
+ | } | ||
+ | }, | ||
+ | "marks": [ | ||
+ | { | ||
+ | "type": "symbol", | ||
+ | "from": {"data": "points"}, | ||
+ | "properties": { | ||
+ | "update": { | ||
+ | "x": {"scale": "x","field": "x"}, | ||
+ | "y": {"scale": "y","field": "y"}, | ||
+ | "fill": {"value": "steelblue"}, | ||
+ | "size": {"signal": "pointSize"} | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </graph> |
Revision as of 17:22, 10 June 2021
Welcome to Good Eats! Located just north of Bernike CS @ 2948, -913.