Skip to content

Interface: AttrBuilders ​

Experimental

The builders of the schema DSL (attr), one per attribute type and container.

Properties ​

PropertyModifierTypeDescription
anglereadonly<O>(opts?) => Attr<NumArrayOk<number, O> | Extras<O>, O>Experimental An angle in degrees, normalized to [-180, 180).
anyreadonly<O>(opts?) => AttrSpec<unknown, unknown>Experimental Any value; only undefined/null mean unset.
booleanreadonly<O>(opts?) => Attr<ArrayOk<boolean, O>, O>Experimental A boolean. Only true and false are accepted.
colorreadonly<O>(opts?) => Attr<ArrayOk<string, O>, O>Experimental Any CSS color. Stored in the full output as canonical rgb()/rgba().
colorlistreadonly<O>(opts?) => AttrSpec<readonly string[], Full<string[], O>>Experimental A list of CSS colors (e.g. colorway).
colorscalereadonly<O>(opts?) => Attr<ColorScale, O>Experimental A named colorscale or a list of [position, color] stops.
dataArrayreadonly<O>(opts?) => AttrSpec<DataArray, DataArray | undefined>Experimental A column of data (plain or typed array). Kept by reference, never copied.
enumeratedreadonly<O>(opts) => Attr<ArrayOk<EnumValue<O>, O>, O>Experimental One of a fixed set of values.
flaglistreadonly<O>(opts) => Attr<ArrayOk<FlagValue<O> | Extras<O>, O>, O>Experimental A +-joined combination of flags ('lines+markers'), or one of extras alone.
fnreadonly<O>(opts?) => AttrSpec<AnyFunction, AnyFunction | undefined>Experimental A function (style accessor, callback). Dropped from plot-schema.json values.
infoArrayreadonly<O>(opts) => AttrSpec<InfoItems<O>, Full<InfoItemsFull<O>, O>>Experimental A fixed-shape array such as an axis range ([min, max]).
integerreadonly<O>(opts?) => Attr<NumArrayOk<number, O> | Extras<O>, O>Experimental An integer. Non-integral numbers are rejected.
itemsreadonly<C>(children, opts) => ItemsNode<C & TemplatedItemChildren>Experimental An array of objects (annotations, shapes, …). Every item automatically gets name and templateitemname so it can be defined in, or linked to, a template (plan E1.5).
numberreadonly<O>(opts?) => Attr<NumArrayOk<number, O> | Extras<O>, O>Experimental A floating-point number. Numeric strings are coerced to numbers. Out-of-range values fall back to dflt (or are clamped with clamp: true).
objectreadonly<C>(children, meta?) => ObjectNode<C>Experimental A nested container.
stringreadonly<O>(opts?) => Attr<ArrayOk<string, O>, O>Experimental A string. Numbers are stringified unless strict: true.
subplotIdreadonly<O>(opts) => Attr<SubplotValue<O> | Extras<O>, O>Experimental A subplot reference such as 'x', 'x2', 'scene3'. 'x1' is normalized to 'x'.
subplotObjectreadonly<C>(subplot, children, meta?) => ObjectNode<C>Experimental A subplot container family: xaxis also matches xaxis2, xaxis3, … (plan E1.4). subplot is the base subplot id of the family ('x' for xaxis).

Released under the MIT License.