One cell of a live board, as a process (spec/15 §8.3, D-146).
A cell process applies, compiles and draws its component, and sends what it shows — a
Visualize.Board.View — straight to the board's subscribers, so no frame crosses the
board's mailbox. The board (Visualize.Board.Server) starts one per cell, :temporary
under a supervisor of its own, monitors it and restarts it with a backoff: a cell that
dies is shown crashed and started again, alone.
- The heap limit. The cell's first act is
Process.flag(:max_heap_size, …)withkill: true, so a design that grows its heap without bound — a 10,000-tick axis, an unbounded layout, a slot fed millions of rows — is killed in its own process. - Coalescing. A data message taken from the mailbox first takes every later one behind it and keeps the newest, so a cell that falls behind skips to the present and a slow cell drops only its own frames.
- Drawing. With every slot holding a delivery, the rows are placed by their
timestamp with a break in every gap (
Visualize.Board.Rows), the component is applied at the cell's box and compiled, one compiled chart per frame, and every data change is aVisualize.Chart.Compiled.step/3per frame inside one accessible root. A delivery naming another schema version (Compiled.stale?/2), a new size and a new chart or variables compile again,carry/2'd from the compiled chart before.
The board's messages are plain sends, never calls, so a slow cell never holds the board:
{:data, slots, now}, {:now, now}, {:size, size}, {:component, chart, vars},
{:selection, selection} and {:subscribers, pids, newcomer}.
- The selection (spec/15 §13.2, D-151, D-171). A cell whose rows hold the board's
selection draws its data in the palette's view states: its rows gain a
:"$vis_state"column,:selectedwhere the selection is and:mutedelsewhere, and each mark withdatalays{:field, :"$vis_state"}in its style stack, the style the column names (#644), before a trailing local edit (spec/14 §3.7). A cell that does not hold it draws as before. - A pick,
{:pick, from, ref, series, index}, is answered tofromas{ref, reply}: the row behind that keyboard point, its identity, item and frame, or:error. - A click,
{:event, from, ref, click}, is answered the same way (spec/15 §9.2, D-170): theVisualize.Eventof a click on the drawing the cell holds, its row read from the rows each mark drew at the last frame, or:error. Each frame drawn has a token of its own, the view'sdrawn, and a click carrying another is dropped.
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.