StatusImage(templateStr, eventList) → {StatusImage}

creates an SVG image showing the point-in-time state of the system

new StatusImage(templateStr, eventList) → {StatusImage}

constructor for creating a new status image

Parameters:
Name Type Description
templateStr string

The string or path to a Handlebars template to be used for the SVG image

eventList Array.<string>

An array of strings of event names to listen for as part of the status update. They will e passed to the Handlebars tempalte as data.

Returns:
StatusImage -

The newly created StatusImage object

Methods

_eventCb(e)

Called when an event is detected to aggregate status events. Mostly for internal use.

Parameters:
Name Type Description
e EventBase

An event that inherits from EventBase

render() → {string}

Renders the SVG from the template and the event data

Returns:
string -

A string representing the SVG image of the current status