Karana.KUtils.DataPlotter
=========================

.. py:module:: Karana.KUtils.DataPlotter

.. autoapi-nested-parse::

   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
-------

.. autoapisummary::

   Karana.KUtils.DataPlotter.DashAppStatic
   Karana.KUtils.DataPlotter.DashApp


Module Contents
---------------

.. py:class:: DashAppStatic(figs: list[plotly.graph_objects.Figure], title: str = 'DataPlotter', host: str = '0.0.0.0', port: int = 8050)

   Bases: :py:obj:`_DashAppBase`


   Use 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.


   .. py:property:: figs
      :type: list[plotly.graph_objects.Figure]


      Figures shown by the DashApp.


.. py:class:: DashApp(data: list[Karana.KUtils.SinglePlotData], title: str = 'DataPlotter', host: str = '0.0.0.0', port: int = 8050)

   Bases: :py:obj:`Karana.KUtils.PlotData`


   Use 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.


   .. py:attribute:: p


   .. py:attribute:: url
      :type:  str


   .. py:method:: removePlot(title: str, /)
                  removePlot(index: int, /)

      Remove the plot based on the value of arg.

      See overloads for more details.



   .. py:method:: addPlot(plot_data: Karana.KUtils.SinglePlotData)

      Add a plot.

      :param plot_fns: The plotting functions associated with the new plot.
      :type plot_fns: SinglePlotData



   .. py:property:: figs
      :type: list[plotly.graph_objects.Figure]


      Get the figures associated with this DashApp.


   .. py:method:: __del__()

      Shut everything down.



