Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/facett

facett-plotters/.nornir/assets/chart-flow.svg

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 820 360" font-family="sans-serif" font-size="13">
  <rect width="820" height="360" fill="#0f1720"/>
  <text x="20" y="30" fill="#e6edf3" font-size="16" font-weight="bold">facett-plotters · ChartView — series in, one kind out, everything else derived</text>

  <!-- data in -->
  <rect x="20" y="60" width="220" height="104" rx="8" fill="#15202b" stroke="#2d3f50"/>
  <text x="34" y="84" fill="#f0c674" font-weight="bold">Vec&lt;Series&gt;  (data)</text>
  <text x="34" y="106" fill="#c6d3df" font-size="11">Series { label, points: Vec&lt;(x,y)&gt; }</text>
  <text x="34" y="126" fill="#9aa7b3" font-size="11">the whole input model —</text>
  <text x="34" y="144" fill="#9aa7b3" font-size="11">no axes/legend/colours given</text>

  <!-- ChartView Elm box -->
  <rect x="300" y="52" width="300" height="256" rx="8" fill="#15202b" stroke="#2d3f50"/>
  <text x="316" y="76" fill="#9fd3f5" font-weight="bold">ChartView (facett Elm → Facet)</text>
  <rect x="316" y="90" width="268" height="26" rx="4" fill="#1b2b3a" stroke="#33506b"/>
  <text x="326" y="107" fill="#c6d3df" font-size="11">ChartState: kind · hover(series,point)</text>
  <rect x="316" y="124" width="268" height="24" rx="4" fill="#1b2b3a" stroke="#33506b"/>
  <text x="326" y="140" fill="#c6d3df" font-size="11">update_json(Msg) · state_json() → bounds</text>

  <text x="316" y="172" fill="#7fd08c" font-size="12" font-weight="bold">▶ view (pure) — one mark, derived chrome:</text>
  <text x="330" y="192" fill="#c6d3df" font-size="11">• kind = Line — 2px polyline / series</text>
  <text x="330" y="210" fill="#c6d3df" font-size="11">• kind = Bar — grouped bars, 0 baseline</text>
  <text x="330" y="228" fill="#c6d3df" font-size="11">• kind = Scatter — markers, no join</text>
  <text x="316" y="252" fill="#9aa7b3" font-size="11">derived: x/y bounds · gridlines · legend</text>
  <text x="316" y="270" fill="#9aa7b3" font-size="11">Msg: SetKind(kind) · Hover(Option)</text>
  <text x="316" y="290" fill="#9aa7b3" font-size="11">colour: palette::series_color(theme, i)</text>

  <!-- input arrow -->
  <line x1="240" y1="112" x2="300" y2="112" stroke="#6fd3f5" stroke-width="2" marker-end="url(#a)"/>

  <!-- palette out -->
  <rect x="640" y="60" width="160" height="104" rx="8" fill="#15202b" stroke="#2d3f50"/>
  <text x="654" y="84" fill="#7fd08c" font-weight="bold">categorical palette</text>
  <text x="654" y="104" fill="#c6d3df" font-size="11">8 validated hues, fixed</text>
  <text x="654" y="122" fill="#c6d3df" font-size="11">order; light/dark steps</text>
  <text x="654" y="140" fill="#9aa7b3" font-size="11">picked by theme surface —</text>
  <text x="654" y="158" fill="#9aa7b3" font-size="11">identity, never a hash</text>
  <line x1="600" y1="120" x2="640" y2="120" stroke="#7fd08c" stroke-width="2" marker-end="url(#a)"/>

  <!-- robot seam -->
  <rect x="640" y="208" width="160" height="100" rx="8" fill="#15202b" stroke="#2d3f50"/>
  <text x="654" y="232" fill="#f0c674" font-weight="bold">robot (in code)</text>
  <text x="654" y="252" fill="#c6d3df" font-size="11">feed series → state_json</text>
  <text x="654" y="270" fill="#c6d3df" font-size="11">assert count + bounds</text>
  <text x="654" y="288" fill="#c6d3df" font-size="11">set_kind → kind reflects</text>
  <line x1="600" y1="256" x2="640" y2="256" stroke="#6fd3f5" stroke-width="2" marker-end="url(#a)"/>

  <text x="20" y="342" fill="#586570" font-size="11">Everything but the numbers is derived: axis bounds, gridlines, legend, tooltip, and series colour all fall out of the data + the active theme.</text>
  <defs><marker id="a" markerWidth="9" markerHeight="9" refX="7" refY="4" orient="auto"><path d="M0,0 L8,4 L0,8 Z" fill="#8fb0c8"/></marker></defs>
</svg>