trw.reporting.reporting_bokeh_graph

Module Contents

Classes

PanelDataGraph

Helper class to compose Bokeh UI elements into complex classes.

Functions

process_data_graph(options, name, role, data, types, type_categories)

prepare_new_figure(options, data, data_types, xaxis_name, yaxis_name)

hash_data_attributes(data, keys)

Create a hashing on the keys variables. Each hash uniquely identify a key value combination

factorize_names(list_of_list_of_names)

Factorize the list of list of names so that we can extract

trw.reporting.reporting_bokeh_graph.process_data_graph(options, name, role, data, types, type_categories)
trw.reporting.reporting_bokeh_graph.prepare_new_figure(options, data, data_types, xaxis_name, yaxis_name)
trw.reporting.reporting_bokeh_graph.hash_data_attributes(data, keys)

Create a hashing on the keys variables. Each hash uniquely identify a key value combination

Parameters
  • data – the data

  • keys – the keys of the data to be considered unique

Returns

list of group ids

trw.reporting.reporting_bokeh_graph.factorize_names(list_of_list_of_names)

Factorize the list of list of names so that we can extract the common parts and return the variable parts of the name

Parameters

list_of_list_of_names – a list of [name1, name2, …, nameN]

Returns:

class trw.reporting.reporting_bokeh_graph.PanelDataGraph(options, name, data, data_types, type_categories)

Bases: trw.reporting.bokeh_ui.BokehUi

Helper class to compose Bokeh UI elements into complex classes.

Currently it is NOT possible to compose widgets (e.g., via sub-classing). Instead, use regular python with a single method get_ui that returns the Bokeh element to y_axis of the complex widget.

clear_graphs(self)
render_data(self, options, data, data_types, type_categories, layout)
static update_figure_data(fig, data, color, group_index, line_options)

Purpose here is to directly refresh the figure as much as possible instead of creating new ones. Unfortunately, fig.renderers.clear() does not work in bokeh 2.0

Instead, find the corresponding renderers and update its internal data.

static create_graph(fig, options, data, group_by, axis_x, axis_y, discard_group_by)
_update(self)
_update_and_clear_plots(self)

If we have large changes (e.g., new groups), clear all previous figures

update_controls(self, options, name, data, data_types, type_categories)
update_data(self, options, name, data, data_types, type_categories)