Karana.KUtils.DataPlotter#
Classes and functions used to stream data to a DashApp.
This module contains classes and functions used to stream data to a DashApp. These are useful for plotting data while a simulation is running. The DashApp is a useful format, as it allows one to view the results from a web browser, and that browser does not have to be on the same machine as the machine generating the data. This is particularly useful when running a simulation on a remote machine without an X session.
Classes#
Use this class to create a DashApp servers up static figures. |
|
Use this class to create a DashApp that you can stream data to. |
Module Contents#
- class Karana.KUtils.DataPlotter.DashAppStatic(figs: list[plotly.graph_objects.Figure], title: str = 'DataPlotter', host: str = '0.0.0.0', port: int = 8050)[source]#
Bases:
_DashAppBaseUse this class to create a DashApp servers up static figures.
These figures can be changed manually using the figs property. However, they are not designed to be updated regularly. For that, please use the DashApp class.
- property figs: list[plotly.graph_objects.Figure]#
Figures shown by the DashApp.
- class Karana.KUtils.DataPlotter.DashApp(data: list[Karana.KUtils._KUtils_Py.SinglePlotData], title: str = 'DataPlotter', host: str = '0.0.0.0', port: int = 8050)[source]#
Bases:
Karana.KUtils._KUtils_Py.PlotDataUse this class to create a DashApp that you can stream data to.
This class will automatically create empty plots based on the SinglePlotData`s provided. In addition, it will start a websocket and http server for clients to connect to view the plots. Calling `update will update the data of the plots based on the data provided in the `SinglePlotData`s.
- p#
- url#
- removePlot(title: str, /)[source]#
- removePlot(index: int, /)
Remove the plot based on the value of arg.
See overloads for more details.
- addPlot(plot_data: Karana.KUtils._KUtils_Py.SinglePlotData)[source]#
Add a plot.
- Parameters:
plot_fns (SinglePlotData) – The plotting functions associated with the new plot.
- property figs: list[plotly.graph_objects.Figure]#
Get the figures associated with this DashApp.