Module: lib/elementModel

Classes

ElementModelValidationError

Methods

(static) renderElements(parent, elementsopt, nullable, clearopt)

Render an element model

Parameters:
Name Type Attributes Default Description
parent Element

The parent element to render within

elements Object | Array <optional>
<nullable>
null

The element model. An element model is either null, an element object, or an array of any of these.

clear boolean <optional>
true

If true, empty parent before rendering

Source:
Throws:

Validation error string

Type
ElementModelValidationError

(static) renderElementsToString(elementsopt, nullable, indentopt, nullable) → {string}

Render an element model to an HTML or SVG string. Note that 'callback' members are ignored.

Parameters:
Name Type Attributes Default Description
elements Object | Array <optional>
<nullable>
null

The element model. An element model is either null, an element object, or an array of any of these.

indent number | string <optional>
<nullable>
null

Indentation string or number of spaces (like JSON.stringify)

Source:
Throws:

Validation error string

Type
ElementModelValidationError
Returns:

The HTML or SVG string

Type
string

(static) validateElements(elementsnullable) → (nullable) {Object|Array}

Validate an element model

Parameters:
Name Type Attributes Description
elements Object | Array <nullable>

The element model. An element model is either null, an element object, or an array of any of these.

Source:
Throws:

Validation error string

Type
ElementModelValidationError
Returns:

The element model (unchanged)

Type
Object | Array