:py:mod:`fragile.dataviz.stream_plots` ====================================== .. py:module:: fragile.dataviz.stream_plots Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: fragile.dataviz.stream_plots.StreamingPlot fragile.dataviz.stream_plots.Div fragile.dataviz.stream_plots.Table fragile.dataviz.stream_plots.RGB fragile.dataviz.stream_plots.Image fragile.dataviz.stream_plots.Curve fragile.dataviz.stream_plots.Histogram fragile.dataviz.stream_plots.Bivariate fragile.dataviz.stream_plots.QuadMesh fragile.dataviz.stream_plots.QuadMeshContours fragile.dataviz.stream_plots.Scatter fragile.dataviz.stream_plots.Landscape2D fragile.dataviz.stream_plots.PlotCallback .. py:class:: StreamingPlot(plot, stream=None, data=None, bokeh_opts = None, mpl_opts = None, **kwargs) Represents a holoviews plot updated with streamed data. .. py:attribute:: name :annotation: = .. py:attribute:: default_opts .. py:attribute:: stream_class .. py:attribute:: default_bokeh_opts .. py:attribute:: default_mpl_opts .. py:method:: opts_kwargs() :property: .. py:method:: get_default_data() :abstractmethod: .. py:method:: get_default_stream(data) .. py:method:: preprocess_data(data) Perform the necessary data wrangling for plotting the data. .. py:method:: send(data) Stream data to the plot and keep track of how many times the data has been streamed. .. py:method:: init_plot(plot) Initialize the holoviews plot to accept streaming data. :param plot: Callable that returns a holoviews plot. .. py:method:: init_stream(stream=None, data=None) Initialize the data stream that will be used to stream data to the plot. .. py:method:: update_kwargs(**kwargs) Update the supplied options kwargs with backend specific parameters. .. py:method:: opts(plot=None, **kwargs) Update the plot parameters. Same as `holoviews` `opts`. .. py:class:: Div(data=None, plot=holoviews.Div, **kwargs) Bases: :py:obj:`StreamingPlot` Represents a holoviews plot updated with streamed data. .. py:attribute:: default_opts .. py:attribute:: name :annotation: = Div .. py:attribute:: default_bokeh_opts .. py:method:: get_default_data() .. py:method:: opts(plot=None, **kwargs) Update the plot parameters. Same as `holoviews` `opts`. .. py:class:: Table(data=None, plot=holoviews.Table, **kwargs) Bases: :py:obj:`StreamingPlot` ``holoviews.Table`` with data streaming capabilities. .. py:attribute:: default_opts .. py:attribute:: name :annotation: = table .. py:attribute:: default_bokeh_opts .. py:method:: get_default_data() .. py:method:: opts(plot=None, **kwargs) Update the plot parameters. Same as `holoviews` `opts`. .. py:class:: RGB(data=None, plot=holoviews.RGB, **kwargs) Bases: :py:obj:`StreamingPlot` ``holoviews.RGB`` with data streaming capabilities. .. py:attribute:: name :annotation: = rgb .. py:attribute:: default_bokeh_opts .. py:method:: get_default_data() .. py:method:: opts(plot=None, **kwargs) Update the plot parameters. Same as `holoviews` `opts`. .. py:class:: Image(data=None, plot=holoviews.Image, **kwargs) Bases: :py:obj:`StreamingPlot` ``holoviews.Image`` with data streaming capabilities. .. py:attribute:: name :annotation: = image .. py:attribute:: default_bokeh_opts .. py:method:: get_default_data() .. py:method:: opts(plot=None, **kwargs) Update the plot parameters. Same as `holoviews` `opts`. .. py:class:: Curve(data=None, plot=holoviews.Curve, buffer_length = 10000, index = False, data_names=('x', 'y'), **kwargs) Bases: :py:obj:`StreamingPlot` Create a ``holoviews.Curve`` plot that plots steaming data. The streaming process is handled using a :class:`Buffer`. .. py:attribute:: name :annotation: = curve .. py:attribute:: default_bokeh_opts .. py:attribute:: stream_class .. py:method:: get_default_stream(data) .. py:method:: get_default_data() .. py:method:: opts(plot=None, **kwargs) Update the plot parameters. Same as `holoviews` `opts`. .. py:class:: Histogram(data=None, plot=None, n_bins = 20, **kwargs) Bases: :py:obj:`StreamingPlot` Create a ``holoviews.Histogram`` plot that plots steaming data. The streaming process is handled using a :class:`Pipe`. .. py:attribute:: name :annotation: = histogram .. py:attribute:: default_opts .. py:attribute:: default_bokeh_opts .. py:method:: plot_histogram(data) :staticmethod: Plot the histogram. :param data: Tuple containing (values, bins), xlim. xlim is a tuple containing two typing_.Scalars that represent the limits of the x axis of the histogram. :returns: Histogram plot. .. py:method:: opts(plot=None, **kwargs) Update the plot parameters. Same as `holoviews` `opts`. .. py:method:: preprocess_data(data) Perform the necessary data wrangling for plotting the data. .. py:method:: get_default_data() .. py:class:: Bivariate(data=None, plot=holoviews.Bivariate, **kwargs) Bases: :py:obj:`StreamingPlot` Create a ``holoviews.Bivariate`` plot that plots steaming data. The streaming process is handled using a :class:`Pipe`. .. py:attribute:: name :annotation: = bivariate .. py:attribute:: default_bokeh_opts .. py:method:: opts(plot=None, **kwargs) Update the plot parameters. Same as `holoviews` `opts`. .. py:method:: __opts(title='', xlabel = 'x', ylabel = 'y', framewise = True, axiswise = True, normalize = True, *args, **kwargs) Update the plot parameters. Same as ``holoviews`` ``opts``. The default values updates the plot axes independently when being displayed in a :class:`Holomap`. .. py:method:: get_default_data() .. py:class:: QuadMesh(data=None, plot=None, n_points = 20, **kwargs) Bases: :py:obj:`StreamingPlot` Create a ``holoviews.Histogram`` plot that plots steaming data. The streaming process is handled using a :class:`Pipe`. .. py:attribute:: name :annotation: = quadmesh .. py:attribute:: default_bokeh_opts .. py:method:: send(data, xx=None, yy=None, zz=None) Stream data to the plot and keep track of how many times the data has been streamed. .. py:method:: plot_quadmesh(data) Plot the data as an energy landscape. :param data: (x, y, xx, yy, z, xlim, ylim). x, y, z represent the coordinates of the points that will be interpolated. xx, yy represent the meshgrid used to interpolate the points. xlim, ylim are tuples containing the limits of the x and y axes. :returns: Plot representing the interpolated energy landscape of the target points. .. py:method:: preprocess_data(data, xx=None, yy=None, zz=None) Create the meshgrid needed to interpolate the target data points. .. py:method:: get_default_data() .. py:method:: opts(plot=None, **kwargs) Update the plot parameters. Same as `holoviews` `opts`. .. py:class:: QuadMeshContours(data=None, levels = 16, **kwargs) Bases: :py:obj:`QuadMesh` Create a ``holoviews.Histogram`` plot that plots steaming data. The streaming process is handled using a :class:`Pipe`. .. py:attribute:: default_opts .. py:attribute:: default_bokeh_opts .. py:method:: plot_quadmesh(data) Plot the data as an energy landscape. :param data: (x, y, xx, yy, z, xlim, ylim). x, y, z represent the coordinates of the points that will be interpolated. xx, yy represent the meshgrid used to interpolate the points. xlim, ylim are tuples containing the limits of the x and y axes. :returns: Plot representing the interpolated energy landscape of the target points. .. py:method:: send(data, xx=None, yy=None, zz=None) Stream data to the plot and keep track of how many times the data has been streamed. .. py:method:: opts(plot=None, **kwargs) Update the plot parameters. Same as `holoviews` `opts`. .. py:class:: Scatter(data=None, plot=holoviews.Scatter, n_points = 20, **kwargs) Bases: :py:obj:`StreamingPlot` Represents a holoviews plot updated with streamed data. .. py:attribute:: default_bokeh_opts .. py:attribute:: default_mpl_opts .. py:method:: get_default_data() .. py:method:: opts(plot=None, **kwargs) Update the plot parameters. Same as `holoviews` `opts`. .. py:class:: Landscape2D(data=None, contours = True, **kwargs) Bases: :py:obj:`StreamingPlot` Plots the interpolated landscaped of values of a set of points. The data is visualized creating a :class:`holoviews.QuadMesh` with a :class:`holoviews.Contours` plot with the original data points displayed as a :class:`holoviews.Scatter`. .. py:attribute:: name :annotation: = landscape .. py:attribute:: default_bokeh_opts .. py:method:: init_plot(plot) Initialize the holoviews plot to accept streaming data. :param plot: Callable that returns a holoviews plot. .. py:method:: plot_landscape(data) Plot the data as an energy landscape. :param data: (x, y, xx, yy, z, xlim, ylim). x, y, z represent the coordinates of the points that will be interpolated. xx, yy represent the meshgrid used to interpolate the points. xlim, ylim are tuples containing the limits of the x and y axes. :returns: Plot representing the interpolated energy landscape of the target points. .. py:method:: preprocess_data(data) Perform the necessary data wrangling for plotting the data. .. py:method:: send(data) Stream data to the plot and keep track of how many times the data has been streamed. .. py:method:: get_default_data() .. py:method:: opts(**kwargs) Update the plot parameters. Same as `holoviews` `opts`. .. py:method:: __opts(title='Distribution landscape', xlabel = 'x', ylabel = 'y', framewise = True, axiswise = True, normalize = True, cmap = 'default', **kwargs) Update the plot parameters. Same as ``holoviews`` ``opts``. The default values updates the plot axes independently when being displayed in a :class:`Holomap`. .. py:class:: PlotCallback(report_interval = 1, **kwargs) Bases: :py:obj:`fragile.core.api_classes.Callback` The :class:`Walkers` is a data structure that takes care of all the data involved in making a Swarm evolve. .. py:method:: report_interval() :property: .. py:method:: after_evolve() .. py:method:: send() :abstractmethod: .. py:method:: panel() :abstractmethod: .. py:method:: run_end()