Powered by AppSignal & Oban Pro

Dicect Notebook

notebooks/dicect.livemd

Dicect Notebook

Mix.install(
  [
    {:dicect, path: Path.join(__DIR__, ".."), env: :dev}
  ],
  config_path: :dicect,
  lockfile: :dicect
)

Load

alias Dicect.Lab.Ironsworn
alias Dicect.Lab.Fate
alias Dicect.Lab.BitD

alias VegaLite, as: Vl
alias Kino.VegaLite, as: KV

Ironsworn

%{data: data, diagrams: diagrams, title: title} = Ironsworn.run()

chart =
  Vl.new(width: 700, height: 400, title: title)
  |> Vl.layers(diagrams)
  |> KV.render()

KV.push_many(chart, data)

FATE

%{data: data, diagrams: diagrams, title: title} = Fate.run()

chart =
  Vl.new(width: 700, height: 400, title: title)
  |> Vl.layers(diagrams)
  |> KV.render()

KV.push_many(chart, data)

BitD

%{data: data, diagrams: diagrams, title: title} = BitD.run()

chart =
  Vl.new(width: 700, height: 400, title: title)
  |> Vl.layers(diagrams)
  |> KV.render()

KV.push_many(chart, data)