some visuals for โ€˜mainโ€™ model

Some visuals

Keyboard target
mutable frame_val = Mutable {}
frame_val = 0
OJS Runtime Error

Scrubber is not defined

Code
import {Scrubber} from "@mbostock/scrubber"

keys_stream_in = [{ key: "ArrowRight", frame: 20 },
  { key: "ArrowUp", frame: 30 },
  { key: "ArrowLeft", frame: 45 },{ key: "ArrowLeft", frame: 48 },
  { key: "ArrowUp", frame: 60 },
  { key: "ArrowUp", frame: 64 },
  { key: "ArrowUp", frame: 100 },
  { key: "ArrowUp", frame: 200 },
  { key: "ArrowUp", frame: 300 },
  { key: "ArrowUp", frame: 301 },
  { key: "ArrowUp", frame: 304 }]

mutable key_stream_in2 = [{ key: "ArrowRight", frame: 20 }]

import {viewof keys as keys2} from 'd/867e1424e1d093ab'

keys2
keys_stream_in = Array(11) [Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object]
mutable key_stream_in2 = Mutable {}
key_stream_in2 = Array(1) [Object]
OJS Runtime Error (line 70, column 1)

keys2 is not defined

gameplay (for fixed key stream) (workings are below)

Code
viewof frame_in = Scrubber(_.range(0,900), {delay: 100, autoplay:false})

viewof keys
OJS Runtime Error (line 86, column 19)

Scrubber is not defined

OJS Runtime Error (line 86, column 19)

Scrubber is not defined

HTMLDivElement {value: Array(0)}
viz_spec = Object {data: Object, datasets: Object, mark: Object, encoding: Object, height: 150, width: 200}
mutable state = Mutable {}
state = Object {player_x: 10, player_vx: 1, key_left: 0, key_right: 0}
Object {player_x: 10, player_vx: 1, key_left: 0, key_right: 0}
undefined
undefined
viz_data = Array(1) [Object]
Code
viewof viz = embed(viz_spec)

/*{
  //console.log(Object.entries(main.player_x$m.cache).length)
  frame_in; keys_stream_in; g_in; s_in; jump_limit_in;
  viz.data("data", [state]).resize().run();
}*/

//mutable viz_data0 = [] // includes data in spec for when I Open in Vega Editor

//htl.html`<button onclick=${() => (mutable viz_data0 = viz_data)}>insert data -> vega editor (dev)</button>`

import { fps, color } from "@ondras/fps"

div = {
  let node = html`<div>fps: ${Math.floor(fps)}</div>`;
  node.style.fontSize = "1em";
  node.style.color = color;
  node.style.textShadow = "0 0 0.08em #000";
  return node;
}
OJS Runtime Error (line 177, column 22)

color is not defined

Appendix

entrypoint = "./models/vek-reducer.cul.js"
entrypoint_no_cul_js = "./models/vek-reducer"
|