Skip to content

@sqlrooms/mosaic / parseSpec

Function: parseSpec()

parseSpec(spec, options?): SpecNode

Parse a Mosaic specification to an AST (abstract syntax tree).

Parameters

ParameterTypeDescription
specSpecThe input specification.
options?{ components?: Map<string, Function>; transforms?: Set<string>; inputs?: Set<string>; plot?: PlotNames; params?: any[]; datasets?: any[]; }Optional parse options object.
options.components?Map<string, Function>Map of component names to parse functions.
options.transforms?Set<string>The names of allowed transform functions.
options.inputs?Set<string>The names of supported input widgets.
options.plot?PlotNamesThe names of supported plot elements.
options.params?any[]An array of [name, node] pairs of pre-parsed Param or Selection AST nodes.
options.datasets?any[]An array of [name, node] pairs of pre-parsed dataset definition AST nodes.

Returns

SpecNode

The top-level AST spec node.