Visualize.Chart.Builder.Params (Visualize v0.2.25)

Copy Markdown View Source

The builder's parameters form: Visualize.Chart.free_vars/1 rendered (spec/14 §18.11).

One control per variable the stack still demands, ordered by name, with its default, whether it is required, and the paths it stands at. It is the second inspector — Visualize.Chart.explain/1 says where a value came from and Visualize.Chart.free_vars/1 says what is still open — and, like the first, it is a view of one function, so what it offers and what Visualize.Chart.apply/2 will demand are the same set by construction.

The control is Visualize.Chart.Builder.Editor.widget/1 of the first use's expects, the schema's type at the path the variable stands at, so the parameters form and the fragment editor choose from one table and a schema addition reaches both (D-86, D-88).

This module compiles only when Phoenix.Component is loaded (spec/10 §1.1, D-45, D-85).

Summary

Functions

Renders the parameters form (spec/10 §15.3), and the per-site rows (spec/14 §19.10).

Functions

panel(assigns)

Renders the parameters form (spec/10 §15.3), and the per-site rows (spec/14 §19.10).

A <form class="vis-builder-params"> with one <label class="vis-builder-param"> per free variable, each carrying the control its first use's type asks for; then one <form class="vis-builder-site"> per site that carries variables, with a row per variable reading as one of three states — flows up, = literal, = var(:name).

Attributes

  • layers (:list) (required) - the layers, as Visualize.Chart.stack/1 takes them.
  • vars (:map) - the values now bound. Defaults to %{}.
  • id (:string) - the parameters form's id, and the stem of its site forms' and datalist's. Defaults to "vis-builder-params".
  • sites (:list) - each site's own free variables and what it binds them to (spec/14 §19.10). Defaults to [].
  • names (:list) - the variable names a site may bind to. Defaults to [].
  • target (:any) - the phx-target of the form's events. Defaults to nil.
  • class (:string) - appended to the form's class. Defaults to nil.