Firebolt
Firebolt is responsible for dispatching behavioural actions when physical actions trigger like mouseclick, mouseover, etc. It also stores the entry and exit set of every behavioural action.
dispatchBehaviour
Syntax: dispatchBehaviour(behaviour, payload)
Dispatches a behavioural action with a payload. It takes the name of the behavioural action and a payload object which contains the criteria and an optional array of side effects which determines what side effects are going to be shown in the canvas. Dispatching a behavioural action also triggers propagation in the DataModel graph.
Parameters:
Property | Type | Required | Default | Description |
---|---|---|---|---|
behaviour | string | true | - | Name of the behavioural action |
payload | object | true | - | Contains information about the identifiers which will be be propagated and what side effects will be shown in canvas. |
payload.criteria | object | Array | true | - | Contains the values of dimensions and range of measures. |
payload.sideEffects | Array | false | - | Side effects that will be shown in canvas. |
Usage
// Get the firebolt instance of the canvas
const firebolt = canvas.firebolt();
// Dispatch a select behaviour
firebolt.dispatchBehaviour('brush', {
// Selects all the rows with Acceleration having range between 12 and 14.
criteria: {
range: {
Acceleration: [12, 14]
}
}
});
Additionally, it can also be passed an array of side effects in the payload.
Usage
// Dispatch a select behaviour with only tooltip as side effect.
firebolt.dispatchBehaviour('select', {
criteria: {
dimensions: {
Cylinders: ['5']
}
},
sideEffects: ['tooltip']
});
Returns
Instance of Firebolt.