Reference 〉 Function

BaseVisualization.event( int t, str color,  **kwargs )

Called when an event is triggered, in order to be reflected in the visualization. For example, a line is drawn in TimeSeries, and the background flashes in Charts. Any kwargs passed to model.addEvent() are passed to this function, allowing subclasses to receive custom arguments (for example, linestyle in TimeSeries.event()). This method is mandatory for subclasses to implement.

This function is called automatically when an event is triggered and should not be called by user code.

WARNING: This is an internal function. Its use in user code is not recommended or supported, and its signature can change in future updates without warning. Use one of the suggested functions above instead, if applicable.

Parameters

  • t int, required

    The model time at which the event occurred. Not necessarily the current time, as the event may not align with the refresh rate.

  • color str, required

    A color to be associated with the event. Subclasses can choose how they display the event.

  • **kwargs optional

    Any optional kwargs passed to model.addEvent() are passed to this function. Subclasses can choose to make some of these mandatory in the function signature, but should always accept **kwargs for compatibility purposes.

    Default value: {}

Notes and Examples

  1. Contribute a Note

    Your email address will not be published. Required fields are marked *

    You may use limited HTML for formatting. Please embed blocks of code in <pre><code> </code></pre> tags.