scivianna.plotter_1d package

Scivianna 1D Plotter Module

The plotter_1d module provides plotting backends for rendering one-dimensional data such as line charts, time series, and XY plots in Scivianna.

Files

File

Description

__init__.py

Package initialization file

generic_plotter.py

Base class Plotter1D defining the 1D plotting API

bokeh_1d_plotter.py

Bokeh-based implementation BokehPlotter1D for interactive 1D plots

Plotter1D (Base Class)

Defines the interface for all 1D plotters in generic_plotter.py:

Key Methods

Method

Purpose

make_panel()

Create and return the Panel display object

plot(name, serie)

Add a new plot with given name and pandas Series data

update_plot(name, serie)

Update existing plot or create if not exists

set_visible(names)

Set which plots are visible (list of names)

set_x_scale(scale)

Set X axis scale to “log” or “lin”

set_y_scale(scale)

Set Y axis scale to “log” or “lin”

BokehPlotter1D

Implementation using Bokeh for interactive 1D visualization in bokeh_1d_plotter.py:

Features

  • Interactive hover tools

  • Multiple line overlays

  • Zoom and pan controls

  • Legend management

  • Responsive sizing

  • Color palette based on plot visibility order

Supported Plot Types

  • Line charts (single or multi-line)

  • Time series with time navigation

  • Variable comparisons

Customization

Bokeh plot properties can be customized via the underlying Bokeh figure:

  • Line colors and styles (automatically set based on visibility order)

  • Axis ranges

  • Grid visibility

  • Toolbar configuration

Additional Methods

Method

Purpose

get_x_bounds()

Returns (min, max) of displayed data on X axis

get_y_bounds()

Returns (min, max) of displayed data on Y axis

_disable_interactions(val)

Enable/disable plot interactions

Submodules

scivianna.plotter_1d.bokeh_1d_plotter module

class scivianna.plotter_1d.bokeh_1d_plotter.BokehPlotter1D

Bases: Plotter1D

Unfinished 1D plotter to get the coupling working

fig_pane

panel Bokeh pane

get_x_bounds() Tuple[float, float]

Returns the bounds of the displayed data along the X axis

Returns:

Displayed data X bounds

Return type:

Tuple[float, float]

get_y_bounds() Tuple[float, float]

Returns the bounds of the displayed data along the Y axis

Returns:

Displayed data Y bounds

Return type:

Tuple[float, float]

hover

Tool defining the hovered label

line_dict: Dict[str, GlyphRenderer]

Dictionnary of plot GlyphRenderers

make_panel() Viewable

Returns the panel to display in the layout

Returns:

Panel to display

Return type:

pn.viewable.Viewable

plot(name: str, serie: Series)

Adds a new plot to the figure from a set of polygons

Parameters:
  • name (str) – Plot name

  • serie (pd.Series) – Sata to plot

set_visible(names: List[str])

Updates the visible plots in the figure

Parameters:

names (List[str]) – List of displayed plots

set_x_scale(scale: str)

Sets the X axis scale to either log or lin

Parameters:

scale (str) – Scale to set

set_y_scale(scale: str)

Sets the Y axis scale to either log or lin

Parameters:

scale (str) – Scale to set

source_data_dict: Dict[str, ColumnDataSource]

Dictionnary of x, y ColumnDataSource containing the data to plot

update_plot(name: str, serie: Series)

Updates plot to the figure

Parameters:
  • name (str) – Plot name

  • serie (pd.Series) – Sata to plot

visible: List[str]

List of visible plots

scivianna.plotter_1d.generic_plotter module

class scivianna.plotter_1d.generic_plotter.Plotter1D

Bases: object

Unfinished 1D plotter to get the coupling working

make_panel()
plot(name: str, serie: Series)

Adds a new plot to the figure from a set of polygons

Parameters:
  • name (str) – Plot name

  • serie (pd.Series) – Sata to plot

set_visible(names: List[str])

Updates the visible plots in the figure

Parameters:

names (List[str]) – List of displayed plots

set_x_scale(scale: str)

Sets the X axis scale to either log or lin

Parameters:

scale (str) – Scale to set

set_y_scale(scale: str)

Sets the Y axis scale to either log or lin

Parameters:

scale (str) – Scale to set

update_plot(name: str, serie: Series)

Updates plot to the figure

Parameters:
  • name (str) – Plot name

  • serie (pd.Series) – Sata to plot

Module contents