fragile.dataviz.stream_plots#

Module Contents#

Classes#

StreamingPlot

Represents a holoviews plot updated with streamed data.

Div

Represents a holoviews plot updated with streamed data.

Table

holoviews.Table with data streaming capabilities.

RGB

holoviews.RGB with data streaming capabilities.

Image

holoviews.Image with data streaming capabilities.

Curve

Create a holoviews.Curve plot that plots steaming data.

Histogram

Create a holoviews.Histogram plot that plots steaming data.

Bivariate

Create a holoviews.Bivariate plot that plots steaming data.

QuadMesh

Create a holoviews.Histogram plot that plots steaming data.

QuadMeshContours

Create a holoviews.Histogram plot that plots steaming data.

Scatter

Represents a holoviews plot updated with streamed data.

Landscape2D

Plots the interpolated landscaped of values of a set of points.

PlotCallback

The Walkers is a data structure that takes care of all the data involved in making a Swarm evolve.

class fragile.dataviz.stream_plots.StreamingPlot(plot, stream=None, data=None, bokeh_opts=None, mpl_opts=None, **kwargs)#

Represents a holoviews plot updated with streamed data.

Parameters
  • plot (Callable) –

  • bokeh_opts (dict) –

  • mpl_opts (dict) –

name =#
default_opts#
stream_class#
default_bokeh_opts#
default_mpl_opts#
property opts_kwargs#
abstract get_default_data()#
get_default_stream(data)#
preprocess_data(data)#

Perform the necessary data wrangling for plotting the data.

send(data)#

Stream data to the plot and keep track of how many times the data has been streamed.

Return type

None

init_plot(plot)#

Initialize the holoviews plot to accept streaming data.

Parameters

plot (Callable) – Callable that returns a holoviews plot.

Return type

None

init_stream(stream=None, data=None)#

Initialize the data stream that will be used to stream data to the plot.

update_kwargs(**kwargs)#

Update the supplied options kwargs with backend specific parameters.

opts(plot=None, **kwargs)#

Update the plot parameters. Same as holoviews opts.

class fragile.dataviz.stream_plots.Div(data=None, plot=holoviews.Div, **kwargs)#

Bases: StreamingPlot

Represents a holoviews plot updated with streamed data.

default_opts#
name = Div#
default_bokeh_opts#
get_default_data()#
opts(plot=None, **kwargs)#

Update the plot parameters. Same as holoviews opts.

class fragile.dataviz.stream_plots.Table(data=None, plot=holoviews.Table, **kwargs)#

Bases: StreamingPlot

holoviews.Table with data streaming capabilities.

default_opts#
name = table#
default_bokeh_opts#
get_default_data()#
opts(plot=None, **kwargs)#

Update the plot parameters. Same as holoviews opts.

class fragile.dataviz.stream_plots.RGB(data=None, plot=holoviews.RGB, **kwargs)#

Bases: StreamingPlot

holoviews.RGB with data streaming capabilities.

name = rgb#
default_bokeh_opts#
get_default_data()#
opts(plot=None, **kwargs)#

Update the plot parameters. Same as holoviews opts.

class fragile.dataviz.stream_plots.Image(data=None, plot=holoviews.Image, **kwargs)#

Bases: StreamingPlot

holoviews.Image with data streaming capabilities.

name = image#
default_bokeh_opts#
get_default_data()#
opts(plot=None, **kwargs)#

Update the plot parameters. Same as holoviews opts.

class fragile.dataviz.stream_plots.Curve(data=None, plot=holoviews.Curve, buffer_length=10000, index=False, data_names=('x', 'y'), **kwargs)#

Bases: StreamingPlot

Create a holoviews.Curve plot that plots steaming data.

The streaming process is handled using a Buffer.

Parameters
  • buffer_length (int) –

  • index (bool) –

name = curve#
default_bokeh_opts#
stream_class#
get_default_stream(data)#
get_default_data()#
opts(plot=None, **kwargs)#

Update the plot parameters. Same as holoviews opts.

class fragile.dataviz.stream_plots.Histogram(data=None, plot=None, n_bins=20, **kwargs)#

Bases: StreamingPlot

Create a holoviews.Histogram plot that plots steaming data.

The streaming process is handled using a Pipe.

Parameters

n_bins (int) –

name = histogram#
default_opts#
default_bokeh_opts#
static plot_histogram(data)#

Plot the histogram.

Parameters

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.

opts(plot=None, **kwargs)#

Update the plot parameters. Same as holoviews opts.

preprocess_data(data)#

Perform the necessary data wrangling for plotting the data.

get_default_data()#
class fragile.dataviz.stream_plots.Bivariate(data=None, plot=holoviews.Bivariate, **kwargs)#

Bases: StreamingPlot

Create a holoviews.Bivariate plot that plots steaming data.

The streaming process is handled using a Pipe.

name = bivariate#
default_bokeh_opts#
opts(plot=None, **kwargs)#

Update the plot parameters. Same as holoviews opts.

__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 Holomap.

Parameters
  • xlabel (str) –

  • ylabel (str) –

  • framewise (bool) –

  • axiswise (bool) –

  • normalize (bool) –

get_default_data()#
class fragile.dataviz.stream_plots.QuadMesh(data=None, plot=None, n_points=20, **kwargs)#

Bases: StreamingPlot

Create a holoviews.Histogram plot that plots steaming data.

The streaming process is handled using a Pipe.

Parameters

n_points (int) –

name = quadmesh#
default_bokeh_opts#
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.

Return type

None

plot_quadmesh(data)#

Plot the data as an energy landscape.

Parameters

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.

preprocess_data(data, xx=None, yy=None, zz=None)#

Create the meshgrid needed to interpolate the target data points.

Parameters

data (Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]) –

get_default_data()#
opts(plot=None, **kwargs)#

Update the plot parameters. Same as holoviews opts.

class fragile.dataviz.stream_plots.QuadMeshContours(data=None, levels=16, **kwargs)#

Bases: QuadMesh

Create a holoviews.Histogram plot that plots steaming data.

The streaming process is handled using a Pipe.

Parameters

levels (int) –

default_opts#
default_bokeh_opts#
plot_quadmesh(data)#

Plot the data as an energy landscape.

Parameters

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.

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.

Return type

None

opts(plot=None, **kwargs)#

Update the plot parameters. Same as holoviews opts.

class fragile.dataviz.stream_plots.Scatter(data=None, plot=holoviews.Scatter, n_points=20, **kwargs)#

Bases: StreamingPlot

Represents a holoviews plot updated with streamed data.

Parameters

n_points (int) –

default_bokeh_opts#
default_mpl_opts#
get_default_data()#
opts(plot=None, **kwargs)#

Update the plot parameters. Same as holoviews opts.

class fragile.dataviz.stream_plots.Landscape2D(data=None, contours=True, **kwargs)#

Bases: StreamingPlot

Plots the interpolated landscaped of values of a set of points.

The data is visualized creating a holoviews.QuadMesh with a holoviews.Contours plot with the original data points displayed as a holoviews.Scatter.

Parameters

contours (bool) –

name = landscape#
default_bokeh_opts#
init_plot(plot)#

Initialize the holoviews plot to accept streaming data.

Parameters

plot (Callable) – Callable that returns a holoviews plot.

Return type

None

plot_landscape(data)#

Plot the data as an energy landscape.

Parameters

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.

preprocess_data(data)#

Perform the necessary data wrangling for plotting the data.

send(data)#

Stream data to the plot and keep track of how many times the data has been streamed.

Return type

None

get_default_data()#
opts(**kwargs)#

Update the plot parameters. Same as holoviews opts.

__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 Holomap.

Parameters
  • xlabel (str) –

  • ylabel (str) –

  • framewise (bool) –

  • axiswise (bool) –

  • normalize (bool) –

  • cmap (str) –

class fragile.dataviz.stream_plots.PlotCallback(report_interval=1, **kwargs)#

Bases: fragile.core.api_classes.Callback

The Walkers is a data structure that takes care of all the data involved in making a Swarm evolve.

Parameters

report_interval (int) –

property report_interval#
after_evolve()#
abstract send()#
abstract panel()#
run_end()#