shyft.dashboard.time_series.tools.table_tools

Classes

ExportTableDataButton([label, height, ...])

Tool to download all data shown in all figures where this tool is attached to!

TableTool([logger])

This object represents the base class of all figure tools

Exceptions

exception shyft.dashboard.time_series.tools.table_tools.TableToolError[source]

Bases: RuntimeError

class shyft.dashboard.time_series.tools.table_tools.TableTool(logger=None)[source]

Bases: BaseTool

This object represents the base class of all figure tools

Parameters:

logger – optional logger

__init__(logger=None)[source]
Parameters:

logger – optional logger

abstractmethod on_bind(*, parent)[source]

Abstract method which is call on bind to a parent

Parameters:

parent (Any)

class shyft.dashboard.time_series.tools.table_tools.ExportTableDataButton(label='Download Table Data', height=50, width=150, padding=None, sizing_mode=None, logger=None)[source]

Bases: TableTool, Widget

Tool to download all data shown in all figures where this tool is attached to!

Two obstacles: - each obj/renderer in a figure has its own data source with own amount of time, value tuples - js callbacks and python callbacks in bokeh are not sync

Therefore: - for each renderer one separate csv file is downloaded - we create a bokeh PreText obj in addition to the download button, to which we attach a js callback for the download after the download the callback is removed again

Parameters:
  • logger – optional logger

  • label (str)

  • height (int)

  • width (int)

  • padding (int | None)

  • sizing_mode (str | None)

__init__(label='Download Table Data', height=50, width=150, padding=None, sizing_mode=None, logger=None)[source]
Parameters:
  • logger – optional logger

  • label (str)

  • height (int)

  • width (int)

  • padding (int | None)

  • sizing_mode (str | None)

on_bind(*, parent)[source]

Abstract method which is call on bind to a parent

Parameters:

parent (Any)

Return type:

None

on_click()[source]
Return type:

None

static js_callback(*, sources, names, column_name_maps, map_of_name_map)[source]

Creates js to download all data from multiple data sources to multiple csv files

Parameters:
  • sources (List[ColumnDataSource])

  • names (List[str])

  • column_name_maps (List[Dict[str, str]])

  • map_of_name_map (List[Dict[str, str]])

Return type:

str

property layout_components: Dict[str, List[Any]]

Property to return all layout.dom components of an visualisation app such that they can be arranged by the parent layout obj as desired.

Returns:

layout_components as

Return type:

{‘widgets’: [], ‘figures’: []}

property layout: LayoutDOM