The builder's preview pane: the stacked design drawn, or its faults (spec/14 §18.4).
The pane draws through the ordinary path — Visualize.Chart.apply/2 over the pool of
sample sources and the variables, then Visualize.Chart.render/2 — so what a person
sees while editing and what the host is handed on save cannot differ. Where application
reports faults the pane lists them instead, one line per error as
Visualize.Chart.Validator.format/1 renders it and in the validator's order: an
incomplete design is the normal state of one being built, so the error list is a panel
of the tool and not an error page.
A binding of the wrong type is checked before anything is applied (spec/14 §18.4,
D-153): Visualize.Chart.check_types/2 over each slot's types — what its rows show and,
for a catalog feed, its schema — and a mismatch is drawn as a fault panel in the board
runtime's cell-state style, Visualize.Board.State.render/3 of {:invalid, errors},
with every fault listed beneath it. Any other fault the frame raises rather than
reports — a theme name nothing resolves — raises here as it does anywhere else (spec/14
§7.3): those are faults of the host's data, and catching them would hide a bug in the
host.
This module compiles only when Phoenix.Component is loaded (spec/10 §1.1, D-45, D-85).
Summary
Functions
Renders the preview pane (spec/10 §15.3).
Functions
Renders the preview pane (spec/10 §15.3).
<div class="vis-builder-preview"> holding either the chart's markup or
<ul class="vis-builder-errors"> with one <li class="vis-builder-error"> per fault.
Exactly one of the two is present; beneath either, the steps the chart still has to take
as <ol class="vis-builder-steps">, each a button (spec/14 §18.4, #374). The chart is drawn with paths: true, so every
node it draws carries data-node, and the <svg> carries data-builder-selected
with the open node's label (spec/14 §18.4, §18.16).
Attributes
design(:map) (required) - the stacked design to draw.sources(:map) - the pool the design's slots bind to. Defaults to%{}.vars(:map) - the values the design's variables take. Defaults to%{}.theme(:any) - aVisualize.Theme,nilfor the design's own. Defaults tonil.generators(:list) - host generator modules the design may call (spec/14 §3.13, §18.2). Defaults to[].catalog(:map) - the connector catalog: a slot bound to one of its feeds is typed by its schema. Defaults tonil.class(:string) - appended to the pane's class. Defaults tonil.selected(:string) - the open node's label, carried on the<svg>for the graph's hook (spec/14 §18.4). Defaults tonil.steps(:list) - what the chart still needs, asVisualize.Chart.Builder.Steps.steps/1gives it (#374). Defaults to[].target(:any) - thephx-targetof a step's button. Defaults tonil.size(:any) - the{width, height}the design is drawn at — the graph's measured box — ornilfor the render's default (spec/14 §18.4). Defaults tonil.box(:string) - the id of the box the chart sits in, which hostsResizeHookand reportsgraph_sizetotarget;nildraws the chart bare (spec/14 §18.4). Defaults tonil.