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 fault the frame raises rather than reports — a value a scale cannot take, 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.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.