Welcome to ssv’s documentation!

Contents:

class ssv.ssv.SSV

Class factory for Vis.

static create_vis(*args, **kwargs)

method to create new Vis Class.

Parameters:
  • *args – Variable length argument list.
  • **kwargs – Arbitrary keyword arguments.
Returns:

New instance of Vis

class ssv.ssv.Vis(x_series, x_series_unit, svg_filepath_or_tree, title='My Simulation', font_size=12)

Class representing SSV visualization.

This class represents all parts required to generate an SSV visualization (Vis) object, including
  • Visualization Element Mapping
  • Visualization Rendering
Parameters:
  • x_series (int, float) – X-series data for simulation (e.g., time series). Must be castable as a numeric array by numpy.
  • x_series_unit (string) – X-series data unit (e.g., ‘hours’)
  • svg_file_path (str) – File path of svg outline used to support visualization layout.
  • title (Optional[str]) – Title of visualization.
  • font_size (Optional[int,float]) – Font size to be used post-render (relative to Web Browser)
add_element(element_type, element_ids, element_description='', **kwargs)

Method to add visualization element to internal class property.

Parameters:
  • element_type (str) – String representation of visualization element type (see Element Module for valid types).
  • element_ids (list[str], str) – String id(s) representing the id(s) of the corresponding svg element in the svg layout provided by the Vis class.
  • element_description (Optional[str]) – Description of the visualization element intended representation (e.g., physical objects like ‘Reactor Vessel’ and ‘Steam Pipe’).
  • **kwargs – Arbitrary keyword arguments dependant on element_type.
Returns:

New visualization element of element_type.

del_element(element_id)

Method to delete visualization element id from internal class property.

Parameters:element_ids (str) – String id representing the id of the corresponding svg element in the svg layout provided by the Vis class.
render_model(mode='full', height=400)

Method to render visualization.

Parameters:
  • mode (str) – Rendering mode
  • rendering creates full visualization that can be saved directly as an html file (*'full') –
  • rendering creates a subset of the visualization that requires external dependencies (*'partial') – (i.e., javascript libraries) to be provided separately. Use this option to support a dashboard layout.
  • height (float, int) – Base pixel height for visualization div.
save_visualization(file_path, **kwargs)

Method to save rendered visualization as html file.

Parameters:file_path (str) – Intended file path for saving rendered visualization as single encompassing html file.

Indices and tables