pdstools.utils.plot_utils

Plot utilities for pdstools visualizations.

Attributes

Functions

get_colorscale(→ Union[List[Tuple[float, str]], List[str]])

Get the colorscale for a metric.

Module Contents

COLORSCALES: Dict[str, Any]
get_colorscale(metric: str, default: str = 'other') List[Tuple[float, str]] | List[str]

Get the colorscale for a metric.

Parameters:
  • metric (str) – The metric name to look up (e.g., “Performance”, “SuccessRate”).

  • default (str, optional) – The default colorscale key to use if metric not found, by default “other”.

Returns:

A Plotly-compatible colorscale (list of (position, color) tuples or list of colors).

Return type:

Union[List[Tuple[float, str]], List[str]]

Examples

>>> get_colorscale("Performance")
[(0, '#d91c29'), (0.01, '#F76923'), (0.3, '#20aa50'), (0.8, '#20aa50'), (1, '#0000FF')]
>>> get_colorscale("UnknownMetric")
['#d91c29', '#F76923', '#20aa50']