This is the base class of all side effects. It contains all common methods like setting configuration, disabling,
enabling side effect, etc. Every new side effect has to inherit this class or SpawnableSideEffect or
SurrogateSideEffect class. All side effects are initialized by firebolt. The instance of firebolt is
passed on initialization. The firebolt instance contains ```context``` which is the instance of visual unit with
which the firebolt is attached.
Methods
(static) defaultConfig() → {Object}
Returns the default configuration of the side effect.
Returns:
Default configuration of side effect.
- Type
- Object
(static) formalName() → {string}
Returns the formal name of a side effect. This method must be implemented by all side effects which changes
or adds any element in the visualization.
Returns:
Formal name of side effect.
- Type
- string
(static) mutates() → {boolean}
Returns true if the side effects mutates the data of chart.
Returns:
If the side effect mutates the data of chart.
- Type
- boolean
addStrategy(name, fn) → {GenericSideEffect}
Adds a new strategy method for this side effect. The strategy method is implemented by side effect class.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of the strategy. |
fn |
function | Strategy method. |
Returns:
Instance of side effect.
- Type
- GenericSideEffect
apply(selectionSet, payload, options)
Applies the interaction effect on the chart. This is where the implemntation of the side effect is defined.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
selectionSet |
Object | Contains the entry and exit set of data which got affected during interaction.
Properties
|
||||||||||||||||||||||||||||||||||||||||||
payload |
Object | Payload information of the behavioural action on trigger of which this side effect is applied. | ||||||||||||||||||||||||||||||||||||||||||
options |
Object | Optional information for side effect like strategy, etc. |
config(config) → {GenericSideEffect|Object}
Sets or gets the configuration of side effect.
When setter,
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | Configuration of side effect. |
Returns:
-
Side effect instance. When getter,
- Type
- GenericSideEffect
-
Side effect configuration.
- Type
- Object