Constructor
new PlotlyNotificationRedirection(callback, durationDict)
Set up an observer that handles the plotly notifications.
Parameters:
Name | Type | Description |
---|---|---|
callback |
messageCallback | The callback that is called within an observer that listens to the output of the notifier element in the DOM and redirects it. |
durationDict |
Object | Configuration dictionary to specify how long the messages should be displayed via the callback function, with keys as messages and values as duration. |
Methods
_getDuration(message) → {Number}
Version 5.24 of plotly has two notifier lengths: 'long' = 3000 and 'default' = 1000.
Based on the notifier message, the duration can be configured here.
Only for messages displayed via the callback function.
Parameters:
Name | Type | Description |
---|---|---|
message |
String | Message text. |
Returns:
Duration of text message.
- Type
- Number
_observePlotlyNotifier(callback)
Instead of showing the messages in the default plotly notifier, it is hidden and the messages are redirected to a callback function.
The callback function is responsible to handle the message, i.e., showing it in the DOM. Arguments for the callback: message text and duration.
Parameters:
Name | Type | Description |
---|---|---|
callback |
messageCallback | A callback to show the message. |