User:Yestarhumeler/Sandbox/Mod625

From Fallen London Wiki
Reward Distribution Graph

<graph> {

"version": 2,
"width": 400,
"height": 250,
"padding": "auto",
"axes": [
 { "type": "x", "scale": "xscale", "ticks": 26 },
 { "type": "y", "scale": "yscale", "values": [0, 1, 2, 3, 4, 5, 10, 15, 20] }
],
"scales": [
 {
  "name": "xscale",
  "type": "linear",
  "range": "width",
  "domain": { "data": "r3", "field": "x" }
 },
 {
  "name": "yscale",
  "type": "linear",
  "range": "height",
  "domain": { "data": "r3", "field": "y" }
 },
 {
  "name": "legend-colour",
  "type": "ordinal",
  "range": { "data": "rlegend", "field": "colour" },
  "domain": { "data": "rlegend", "field": "title" }
 },
 {
  "name": "legend-shape",
  "type": "ordinal",
  "range": { "data": "rlegend", "field": "shape" },
  "domain": { "data": "rlegend", "field": "title" }
 }
],
"data": [
 {
  "name": "xrange",
  "values": [
   {"x": 0}, {"x": 1}, {"x": 2}, {"x": 3},
   {"x": 4}, {"x": 5}, {"x": 6}, {"x": 7},
   {"x": 8}, {"x": 9}, {"x": 10}, {"x": 11},
   {"x": 12}, {"x": 13}, {"x": 14}, {"x": 15},
   {"x": 16}, {"x": 17}, {"x": 18}, {"x": 19},
   {"x": 20}, {"x": 21}, {"x": 22}, {"x": 23},
   {"x": 24}, {"x": 25}
  ]
 },
 {
  "name": "r1",
  "source": "xrange",
  "transform": [
   { "type": "formula", "field": "y", "expr": "floor(datum.x / 6.25)" }
  ]
 },
 {
  "name": "r2",
  "source": "xrange",
  "transform": [
   { "type": "formula", "field": "y", "expr": "floor((datum.x % 6.25) / 1.25)" }
  ]
 },
 {
  "name": "r3",
  "source": "xrange",
  "transform": [
   { "type": "formula", "field": "y", "expr": "floor((datum.x % 1.25) * 20)" }
  ]
 },
 {
  "name": "rlegend",
  "values": [
   { "colour": "#0000bb", "title": "Reward 1", "shape": "square" },
   { "colour": "#bb0000", "title": "Reward 2", "shape": "diamond" },
   { "colour": "#777700", "title": "Reward 3", "shape": "triangle-down" }
  ]
 }
],
"marks": [
 {
  "type": "line",
  "from": { "data": "r1" },
  "properties": {
   "enter": {
    "stroke": { "value": "#0000ff" },
    "strokeWidth": { "value": 3 }
   },
   "update": {
    "x": { "scale": "xscale", "field": "x" },
    "y": { "scale": "yscale", "field": "y" }
   }
  }
 },
 {
  "type": "line",
  "from": { "data": "r2" },
  "properties": {
   "enter": {
    "stroke": { "value": "#ff0000" },
    "strokeWidth": { "value": 3 }
   },
   "update": {
    "x": { "scale": "xscale", "field": "x" },
    "y": { "scale": "yscale", "field": "y" }
   }
  }
 },
 {
  "type": "line",
  "from": { "data": "r3" },
  "properties": {
   "enter": {
    "stroke": { "value": "#bbbb00" },
    "strokeWidth": { "value": 3 }
   },
   "update": {
    "x": { "scale": "xscale", "field": "x" },
    "y": { "scale": "yscale", "field": "y" }
   }
  }
 },
 {
  "type": "symbol",
  "from": { "data": "r1" },
  "properties": {
   "enter": {
    "fill": { "value": "#0000bb" },
    "shape": { "value": "square" },
    "size": { "value": 40 }
   },
   "update": {
    "x": { "scale": "xscale", "field": "x" },
    "y": { "scale": "yscale", "field": "y" }
   }
  }
 },
 {
  "type": "symbol",
  "from": { "data": "r2" },
  "properties": {
   "enter": {
    "fill": { "value": "#bb0000" },
    "shape": { "value": "diamond" },
    "size": { "value": 40 }
   },
   "update": {
    "x": { "scale": "xscale", "field": "x" },
    "y": { "scale": "yscale", "field": "y" }
   }
  }
 },
 {
  "type": "symbol",
  "from": { "data": "r3" },
  "properties": {
   "enter": {
    "fill": { "value": "#777700" },
    "shape": { "value": "triangle-down" },
    "size": { "value": 40 }
   },
   "update": {
    "x": { "scale": "xscale", "field": "x" },
    "y": { "scale": "yscale", "field": "y" }
   }
  }
 }
],
"legends": [
 {
  "fill": "legend-colour",
  "shape": "legend-shape",
  "properties": {
   "symbols": {
    "stroke": { "value": "transparent" }
   }
  }
 }
]

} </graph>