Reference 〉 Function

ChartPlot.update(datadict{str:num}, tint)

Receives current model data and stores it for future scrubbing.

Note that this function is called when the visualizer receives new data from the model. Because ChartPlot.draw() is called both after ChartPlot.update() and when the time bar is scrubbed, drawing code should be put in ChartPlot.draw() and not here, unless there is code to be run only in the event of new data that should not be run when scrubbing (e.g. calculating new plot bounds).

If the visualizer needs model properties besides the current data, the model object can be accessed with self.viz.model.

This function should not typically be called from user code, though it can be for out-of-sync plot updates when interacting with a plot. See the agentClick hook for an example.

Parameters

  • data dict{str:num}, required

    The current model data.

  • t int, required

    The current model time.

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.