Visualization
Public imports from paretorium.visualization. Install with
python -m pip install "paretorium[visualization]". Start with
Create your first tradespace, or see
How visualization is organized to choose a view.
Model wiring
Added in Paretorium 0.2.0. See Inspect the model DAG.
paretorium.visualization.model_dag(study: Study, *, concept: Concept | None = None, theme: Theme = DEFAULT_THEME) -> alt.LayerChart
Draw data dependencies from declared parameters through models to metrics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
study
|
Study
|
Study definition. The view uses the runner's validation and wiring without drawing samples or calling model functions. |
required |
concept
|
Concept | None
|
Complete concept to show. Required if any model has a conditional selector; only models active for this concept are drawn. Without selectors or a supplied concept, the first compatible concept is used to validate the common wiring. |
None
|
theme
|
Theme
|
Category colors, edge styling, and label color. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
LayerChart
|
A native Altair chart. Arrows point from producer to consumer. |
LayerChart
|
Parameter, model, output-port, and metric nodes have separate roles; |
LayerChart
|
hover on nodes for IDs, units, and declared details. Scenario overrides |
LayerChart
|
change input values, not wiring, and are not shown here. |
Raises:
| Type | Description |
|---|---|
ValueError
|
No compatible concept or declared nodes exist, a concept is required or invalid, or the selected model wiring is invalid. |
Summary comparisons
Use ConceptSummary records from summarize(). Choose a scenario and
two objective metrics per panel. An atlas returns a report section.
paretorium.visualization.tradespace(summaries: Iterable[ConceptSummary], *, scenario: str, x: Metric, y: Metric, x_domain: Domain | None = None, y_domain: Domain | None = None, statistic: Statistic = 'p50', min_feasibility: float = 1.0, intervals: bool = False, limit_metrics: Iterable[Metric] = (), decision_color: DecisionColor | None = None, color: Metric | None = None, size: Metric | None = None, label_designs: Sequence[str] = (), overlays: TradespaceOverlays = _DEFAULT_OVERLAYS, theme: Theme = DEFAULT_THEME) -> alt.LayerChart
Compose concept dots, optional p05–p95 bars, and a two-metric front.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
summaries
|
Iterable[ConceptSummary]
|
Concept summaries, as returned by |
required |
scenario
|
str
|
Scenario ID to plot. Results from other scenarios are ignored. |
required |
x
|
Metric
|
Quantity on the horizontal axis, declared as an objective. |
required |
y
|
Metric
|
Distinct quantity on the vertical axis, declared as an objective. |
required |
x_domain
|
Domain | None
|
Optional exact horizontal bounds in metric units, as an increasing (lower, upper) pair. Does not filter Pareto candidates. |
None
|
y_domain
|
Domain | None
|
Optional exact vertical bounds, with the same semantics. |
None
|
statistic
|
Statistic
|
Point and frontier statistic. Interval endpoints are still p05 and p95, regardless of this choice. |
'p50'
|
min_feasibility
|
float
|
Minimum sampled feasibility for Pareto membership. Concepts below the threshold remain visible. |
1.0
|
intervals
|
bool
|
Show horizontal and vertical marginal p05–p95 bars. Hidden by default. These are neither confidence intervals nor joint regions. |
False
|
limit_metrics
|
Iterable[Metric]
|
Metric definitions for labeling failed limits, including metrics not plotted. Without a definition, show the metric ID. The plotted metrics already supply their definitions. |
()
|
decision_color
|
DecisionColor | None
|
Optional decision grouping, browser picker, and subset highlight. Omit to color by comparison status or a metric. |
None
|
color
|
Metric | None
|
Metric to encode as a continuous color, using the selected
statistic. Shapes then show comparison status. Mutually
exclusive with |
None
|
size
|
Metric | None
|
Metric to encode as point area, using the selected statistic. Color and size do not enter the Pareto calculation. |
None
|
label_designs
|
Sequence[str]
|
Short design IDs or canonical concept keys to annotate with their short IDs. Empty by default. Designs outside fixed axis bounds are not labeled. |
()
|
overlays
|
TradespaceOverlays
|
Controls displayed-axis limits, benchmarks, and the utopia star. By default, only the utopia star is shown. |
_DEFAULT_OVERLAYS
|
theme
|
Theme
|
Appearance of the dots, comparison colors, Pareto front, and optional interval bars. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
LayerChart
|
A native Altair chart with a frontier computed on the displayed axes. |
paretorium.visualization.tradespace_table(summaries: Iterable[ConceptSummary], *, scenario: str, x: Metric, y: Metric, statistic: Statistic = 'p50', min_feasibility: float = 1.0, limit_metrics: Iterable[Metric] = ()) -> Table
Tabulate the same concept comparison as tradespace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
summaries
|
Iterable[ConceptSummary]
|
Concept summaries, as returned by |
required |
scenario
|
str
|
Scenario ID to tabulate. |
required |
x
|
Metric
|
Objective metric used on the horizontal axis of the chart. |
required |
y
|
Metric
|
Distinct objective metric used on the vertical axis of the chart. |
required |
statistic
|
Statistic
|
Statistic used for displayed points and Pareto membership. |
'p50'
|
min_feasibility
|
float
|
Minimum sampled feasibility for Pareto membership. |
1.0
|
limit_metrics
|
Iterable[Metric]
|
Definitions used to label limits whose failures are
shown in the table, as for |
()
|
Returns:
| Type | Description |
|---|---|
Table
|
A table with exact numeric values and separate display formatting. |
paretorium.visualization.comparison_grid(summaries: Iterable[ConceptSummary], *, scenario: str, pairs: Sequence[tuple[Metric, Metric]], columns: int = 2, statistic: Statistic = 'p50', min_feasibility: float = 1.0, intervals: bool = False, color: Metric | None = None, size: Metric | None = None, label_designs: Sequence[str] = (), domains: Mapping[str, Domain] | None = None, limit_metrics: Iterable[Metric] = (), show_limits: bool = False, show_ideal: bool = True, theme: Theme = DEFAULT_THEME) -> alt.ConcatChart
Compare an ordered set of metric pairs in a native Altair grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
summaries
|
Iterable[ConceptSummary]
|
Concept summaries, as returned by |
required |
scenario
|
str
|
Scenario ID shared by all panels. |
required |
pairs
|
Sequence[tuple[Metric, Metric]]
|
One or more ordered (horizontal, vertical) pairs of distinct objective metrics. Each panel uses only its own pair for Pareto ranking. Reuse the same definition wherever a metric appears. |
required |
columns
|
int
|
Positive number of columns before wrapping to the next row. |
2
|
statistic
|
Statistic
|
Point statistic used for position, color, area, and ranking. |
'p50'
|
min_feasibility
|
float
|
Minimum joint feasibility for Pareto eligibility. |
1.0
|
intervals
|
bool
|
Show p05–p95 marginal outcomes on the position axes. |
False
|
color
|
Metric | None
|
Optional numeric metric for continuous color on a common scale. Shapes then distinguish comparison status within each panel. |
None
|
size
|
Metric | None
|
Optional numeric metric for point area on a common scale. |
None
|
label_designs
|
Sequence[str]
|
Selected short design IDs or canonical concept keys. Annotate them with their short IDs in every panel where visible. |
()
|
domains
|
Mapping[str, Domain] | None
|
Optional exact axis bounds by metric ID. Otherwise ranges include the selected summaries, enabled intervals, and shown limits. A metric keeps its range even when it changes axes. |
None
|
limit_metrics
|
Iterable[Metric]
|
Metric definitions for reporting limit failures in tooltips, including metrics not plotted. |
()
|
show_limits
|
bool
|
Draw hard bounds and shade no-go regions on each pair. |
False
|
show_ideal
|
bool
|
Mark the preferred corner in each panel by default. |
True
|
theme
|
Theme
|
Shared styling for all panels, not the choice of encodings. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
ConcatChart
|
A chart ready to export or include as a |
paretorium.visualization.decision_atlas(summaries: Iterable[ConceptSummary], *, scenario: str, x: Metric, y: Metric, x_domain: Domain | None = None, y_domain: Domain | None = None, pairs: bool = False, statistic: Statistic = 'p50', min_feasibility: float = 1.0, limit_metrics: Iterable[Metric] = (), overlays: TradespaceOverlays = _DEFAULT_OVERLAYS, theme: Theme = DEFAULT_THEME) -> Section
Generate a section of tradespaces colored by individual decisions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
summaries
|
Iterable[ConceptSummary]
|
Results to compare, as returned by summarize. |
required |
scenario
|
str
|
Scenario ID to plot throughout the section. |
required |
x
|
Metric
|
Horizontal objective metric. |
required |
y
|
Metric
|
Vertical objective metric. |
required |
x_domain
|
Domain | None
|
Optional exact horizontal bounds for all figures. |
None
|
y_domain
|
Domain | None
|
Optional exact vertical bounds for all figures. |
None
|
pairs
|
bool
|
Include an additional chart for every pair of decisions. |
False
|
statistic
|
Statistic
|
Point and frontier statistic. |
'p50'
|
min_feasibility
|
float
|
Minimum joint feasibility for Pareto eligibility. |
1.0
|
limit_metrics
|
Iterable[Metric]
|
Metric definitions for reporting violations. |
()
|
overlays
|
TradespaceOverlays
|
Shared displayed-axis limits, benchmarks, and utopia star settings. |
_DEFAULT_OVERLAYS
|
theme
|
Theme
|
Shared mark styling. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
Section
|
Figures in decision ID order followed by any pair figures. |
Sample-level outcome views
Use individual EvaluationResult records, not summaries. The
coordinates of each scatter point come from the same evaluation.
paretorium.visualization.outcome_tradespace(evaluations: Iterable[EvaluationResult], *, scenario: str, x: Metric, y: Metric, concepts: Sequence[str], x_domain: Domain | None = None, y_domain: Domain | None = None, show_limits: bool = False, show_ideal: bool = True, theme: Theme = DEFAULT_THEME) -> alt.ConcatChart
Compare concept-wise sample clouds with aligned marginal box plots.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
evaluations
|
Iterable[EvaluationResult]
|
Individual evaluations, not concept summaries. |
required |
scenario
|
str
|
Scenario whose evaluations should be drawn. |
required |
x
|
Metric
|
Horizontal metric; need not be an objective. |
required |
y
|
Metric
|
Distinct vertical metric; need not be an objective. |
required |
concepts
|
Sequence[str]
|
Compatible design IDs or canonical concept keys in legend order. Provide at least one, without duplicates. |
required |
x_domain
|
Domain | None
|
Optional exact horizontal bounds in metric units, as an increasing (lower, upper) pair. Crops the view, not the samples used by the box plots. |
None
|
y_domain
|
Domain | None
|
Optional exact vertical bounds, with the same semantics. |
None
|
show_limits
|
bool
|
Show no-go regions for limits on the displayed axes. |
False
|
show_ideal
|
bool
|
Mark the preferred corner when both axes have an objective direction. Shown by default. |
True
|
theme
|
Theme
|
Shared mark styling. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
ConcatChart
|
A sample scatterplot with one box per concept on each margin. |
paretorium.visualization.joint_outcomes(evaluations: Iterable[EvaluationResult], *, scenario: str, concept: str, x: Metric, y: Metric, x_domain: Domain | None = None, y_domain: Domain | None = None, bins: int = 16, probability_levels: Sequence[float] = (0.5, 0.75, 0.9), show_limits: bool = False, show_ideal: bool = True, theme: Theme = DEFAULT_THEME) -> alt.ConcatChart
Show the paired outcomes of one concept, with marginal distributions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
evaluations
|
Iterable[EvaluationResult]
|
Individual evaluations, not concept summaries. |
required |
scenario
|
str
|
Scenario to show. |
required |
concept
|
str
|
Compatible design ID or canonical concept key to show. |
required |
x
|
Metric
|
Horizontal metric. |
required |
y
|
Metric
|
Distinct vertical metric. |
required |
x_domain
|
Domain | None
|
Optional exact horizontal bounds in metric units, as an increasing (lower, upper) pair. Crops the view without refitting density curves or renormalizing histograms to visible samples. |
None
|
y_domain
|
Domain | None
|
Optional exact vertical bounds, with the same semantics. |
None
|
bins
|
int
|
Positive number of equal-width bins in each marginal histogram. |
16
|
probability_levels
|
Sequence[float]
|
Approximate enclosed probability masses for Gaussian KDE contours. Pass an empty sequence to omit contours. Sparse, constant, or collinear data do not get joint contours. |
(0.5, 0.75, 0.9)
|
show_limits
|
bool
|
Show no-go regions for limits on the displayed axes. |
False
|
show_ideal
|
bool
|
Mark the preferred corner when both axes have an objective direction. Shown by default. |
True
|
theme
|
Theme
|
Shared mark styling. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
ConcatChart
|
A paired cloud with marginal density histograms, smoothed marginal |
ConcatChart
|
curves when supported, and optional joint outcome contours. Contours |
ConcatChart
|
are estimates of outcome concentration, not confidence intervals. |
paretorium.visualization.joint_outcome_atlas(evaluations: Iterable[EvaluationResult], *, panels: Sequence[tuple[str, str]], x: Metric, y: Metric, x_domain: Domain | None = None, y_domain: Domain | None = None, bins: int = 16, probability_levels: Sequence[float] = (0.5, 0.75, 0.9), show_limits: bool = False, show_ideal: bool = True, theme: Theme = DEFAULT_THEME) -> Section
Build a report section of joint outcome figures on common scales.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
evaluations
|
Iterable[EvaluationResult]
|
Individual evaluations, read once. |
required |
panels
|
Sequence[tuple[str, str]]
|
One or more (scenario ID, design ID or canonical concept key) pairs, in figure order. Each pair must select evaluations. |
required |
x
|
Metric
|
Horizontal metric. |
required |
y
|
Metric
|
Distinct vertical metric. |
required |
x_domain
|
Domain | None
|
Optional exact horizontal bounds in metric units, as an increasing (lower, upper) pair. When omitted, includes all selected samples, contour grid extents, and any enabled limits. |
None
|
y_domain
|
Domain | None
|
Optional exact vertical bounds, with the same semantics. |
None
|
bins
|
int
|
Positive number of equal-width histogram bins per margin. Bin edges and density scales are shared between figures. |
16
|
probability_levels
|
Sequence[float]
|
Joint KDE contour levels, as in |
(0.5, 0.75, 0.9)
|
show_limits
|
bool
|
Show no-go regions for limits on the displayed axes. |
False
|
show_ideal
|
bool
|
Mark the preferred corner when both axes have objectives. |
True
|
theme
|
Theme
|
Shared mark styling. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
Section
|
A section with one figure per pair. Each panel uses its own full |
Section
|
sample set to fit densities and normalize histograms. |
Assumptions, utility, and importance
Parameter views read declared assumptions. Utility curves read a metric's utility callable. The importance section formats a precomputed analysis.
paretorium.visualization.parameter_distribution(parameter: Parameter, *, scenarios: Iterable[Scenario] = (), theme: Theme = DEFAULT_THEME) -> Figure
Show a parameter's base assumption, option cases, and scenario overrides.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameter
|
Parameter
|
Declared numeric input. Supports fixed values, Uniform, Triangular, Beta, Lognormal, and Discrete distributions. |
required |
scenarios
|
Iterable[Scenario]
|
Scenarios whose explicit overrides should be shown. A scenario that inherits the default is not duplicated. |
()
|
theme
|
Theme
|
Palette and mark styling for the assumption panels. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
Figure
|
A figure with separate panels for density, probability mass, and |
Figure
|
fixed values when these coexist. The value scale is shared. |
Raises:
| Type | Description |
|---|---|
ValueError
|
An assumption uses an unsupported distribution type. |
paretorium.visualization.parameter_atlas(study: Study, *, title: str = 'Parameter atlas', theme: Theme = DEFAULT_THEME) -> Section
Generate a section containing one assumption figure per parameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
study
|
Study
|
Study supplying parameter declarations and scenario overrides. The atlas does not evaluate concepts or call a sampler. |
required |
title
|
str
|
Heading for the generated section. |
'Parameter atlas'
|
theme
|
Theme
|
Mark styling shared by all figures in the atlas. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
Section
|
Figures in study parameter order. |
paretorium.visualization.utility_curve(metric: Metric, *, domain: tuple[float, float] | None = None, show_limits: bool = False, theme: Theme = DEFAULT_THEME) -> alt.Chart | alt.LayerChart
Plot a metric's single-attribute utility function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metric
|
Metric
|
Metric with a utility callable. It is evaluated at chart coordinates, not at study outcomes. |
required |
domain
|
tuple[float, float] | None
|
Increasing finite bounds in metric units. Defaults to the anchor span for built-in curves, expanded to show enabled limits. Required for other callables, which are plotted using 101 evenly spaced values. |
None
|
show_limits
|
bool
|
Draw dashed rules at visible metric bounds and shade out-of-limit input values. Does not change the utility scores. |
False
|
theme
|
Theme
|
Line, boundary, and shading styles. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
Chart | LayerChart
|
A native Altair chart on a fixed [0, 1] utility scale. Built-in |
Chart | LayerChart
|
piecewise curves retain every anchor inside the domain. Cubic |
Chart | LayerChart
|
curves are sampled between visible anchors and mark only the anchors. |
paretorium.visualization.architectural_importance_section(result: ArchitecturalImportance) -> Section
Build first-order, per-option, and decision-pair tables for one analysis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
ArchitecturalImportance
|
One scenario/metric result from |
required |
Returns:
| Type | Description |
|---|---|
Section
|
A section reusable in an interactive HTML or static PDF report. |
Chart options and styling
Choose grouping, overlays, and encodings explicitly. A theme styles those choices without changing the analysis.
paretorium.visualization.DecisionColor
dataclass
Color concept points by a decision or by a pair of decisions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
by
|
str | tuple[str, str]
|
Decision ID, or two decision IDs to color by their option pairs. |
required |
interactive
|
bool
|
With a single decision, add a browser dropdown to switch
among decisions. Static output uses |
False
|
highlight
|
Mapping[str, str]
|
Optional decision-to-option selector. Every entry must match. Other concepts remain visible but dimmed. The view also shows the Pareto front within the matching subset. |
dict()
|
paretorium.visualization.TradespaceOverlays
dataclass
Optional contextual marks, independent of the Pareto calculation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
show_limits
|
bool
|
Shade values outside the displayed metrics' limits. |
False
|
references
|
tuple[ReferenceDesign, ...]
|
External benchmark points in the displayed units. |
()
|
show_ideal
|
bool
|
Show the utopia star in the preferred corner by default. It indicates objective directions, not a design or an estimate of the ideal objective vector. |
True
|
paretorium.visualization.ReferenceDesign
dataclass
An external benchmark at explicit coordinates, not a Pareto candidate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
Name drawn next to the reference marker. |
required |
x
|
float
|
Horizontal coordinate in the chart metric's units. |
required |
y
|
float
|
Vertical coordinate in the chart metric's units. |
required |
paretorium.visualization.Theme
dataclass
Translate visual roles into mark styling without changing chart data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point_color
|
str
|
Default point color, also used for eligible concepts. |
'#0369a1'
|
pareto_color
|
str
|
Color for a Pareto front and its member points. |
'#92400e'
|
ineligible_color
|
str
|
Color for concepts below a feasibility threshold. |
'#64748b'
|
interval_color
|
str
|
Color for uncertainty bars and their caps. |
'#1e293b'
|
palette
|
tuple[str, ...]
|
Ordered colors for categorical series. The chart, not the theme, chooses the field that defines those series. |
('#4c78a8', '#f58518', '#e45756', '#72b7b2', '#54a24b', '#eeca3b', '#b279a2', '#ff9da6', '#9d755d', '#bab0ac')
|
stroke_width_scale
|
float
|
Positive multiplier for line widths and tick thicknesses, including uncertainty bars. |
1.0
|
point_size_scale
|
float
|
Positive multiplier for symbol areas. |
1.0
|
interval_style
|
Literal['plain', 'capped']
|
Plain lines or lines with a cap at each endpoint (the default). Does not decide whether the chart shows intervals. |
'capped'
|
interval_opacity
|
float
|
Opacity of interval marks, between zero and one. |
0.7
|
interval_cap_size
|
float
|
Length of an interval cap in chart pixels, when caps are enabled. Thickness uses the stroke width multiplier. |
6.0
|
limit_color
|
str
|
Color of metric boundaries and no-go regions. |
'#b91c1c'
|
limit_opacity
|
float
|
Fill opacity for no-go regions, between zero and one. |
0.1
|
reference_color
|
str
|
Color of reference markers and labels. |
'#6d28d9'
|
ideal_color
|
str
|
Color of the ideal-direction marker. |
'#a16207'
|
highlight_color
|
str
|
Accent color for highlighted subset fronts and DAG connections. |
'#0f766e'
|
sample_opacity
|
float
|
Opacity of individual sample points, between zero and one. |
0.48
|
metric_color_scheme
|
str
|
Named Vega color scheme for quantitative color. |
'viridis'
|
design_label_color
|
str
|
Text color for visible design IDs. |
'#1e293b'
|
interval_stroke_width
|
float
|
Base width in pixels of interval lines and
thickness of caps, before applying |
1.0
|
paretorium.visualization.DEFAULT_THEME = Theme()
module-attribute
The default mark styling used by built-in layers and views.
Report objects and publishers
Wrap Altair charts as figures, combine them with tables in sections, and
publish a report. export_chart() instead exports a standalone chart.
paretorium.visualization.Figure
dataclass
A native Vega-Lite chart and its surrounding text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart
|
TopLevelMixin
|
Complete Altair chart, possibly with layers or panels. |
required |
caption
|
str
|
Optional plain-text explanation, shown below the chart. |
''
|
paretorium.visualization.Column
dataclass
A field to display as a table column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
str
|
Key in the input rows. |
required |
label
|
str
|
Heading to display. |
required |
units
|
str
|
Optional unit to display with the heading. |
''
|
format_spec
|
str
|
Optional Python format specifier (e.g. |
''
|
paretorium.visualization.Table
dataclass
Ordered columns and rows, ready for a publisher to lay out.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
columns
|
tuple[Column, ...]
|
Nonempty sequence of columns in display order. |
required |
rows
|
tuple[Mapping[str, Cell], ...]
|
Ordered records, each containing every column field. Use
|
required |
caption
|
str
|
Optional text identifying the table or its context. |
''
|
paretorium.visualization.Section
dataclass
paretorium.visualization.Report
dataclass
A document that can be published through multiple media.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Document title. |
required |
sections
|
tuple[Section, ...]
|
Sections in reading order. |
required |
introduction
|
str
|
Optional plain text shown before the first section. |
''
|
paretorium.visualization.export_chart(chart: alt.TopLevelMixin, directory: Path, *, name: str) -> tuple[Path, Path]
Save SVG and interactive HTML from the same Vega-Lite spec.
The HTML bundles the chart runtime. Supply inline data for an offline chart; external data and artwork references are not bundled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart
|
TopLevelMixin
|
Complete Altair chart, optionally with a top-level theme. |
required |
directory
|
Path
|
Destination directory, created if needed. |
required |
name
|
str
|
Plain file stem, without a path. |
required |
Returns:
| Type | Description |
|---|---|
tuple[Path, Path]
|
SVG and HTML paths, in that order. |
paretorium.visualization.export_html(report: Report, path: Path) -> Path
Render HTML with interactive Vega-Lite charts and sortable, searchable tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report
|
Report
|
Sections containing charts and tables. Chart tooltips and other Vega-Lite interactions remain available. |
required |
path
|
Path
|
Output HTML filename. Parent directories are created. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
The output path. The runtime is bundled once; use inline chart data |
Path
|
for an offline report. |
paretorium.visualization.export_pdf(report: Report, path: Path) -> Path
Render a paginated A4 report with vector charts and repeated table headers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report
|
Report
|
Sections containing charts and tables. Chart interactions are not available in PDF. |
required |
path
|
Path
|
Output PDF filename. Parent directories are created. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
The output path. |
Interactive notebook display
For local Jupyter, install with python -m pip install "paretorium[notebook]".
In Colab, install only paretorium[visualization] to keep the
runtime's built-in IPython. The same function works in IPython notebook
frontends that allow scripted HTML.
paretorium.visualization.display_notebook(content: alt.TopLevelMixin | Figure | Table | Section | Report, *, height: int = 520) -> None
Display an interactive chart, table, section, or report in a notebook.
Charts keep their Vega-Lite interactions, and tables keep their sort and filter controls. Each call emits one isolated frame with a bundled runtime; inline-data visualizations do not need a CDN or output files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
TopLevelMixin | Figure | Table | Section | Report
|
Renderable Altair chart (including a composed layer or multi-panel chart), figure, table, section, or report. Display only charts and external data sources you trust. |
required |
height
|
int
|
Positive frame height in pixels. Taller content, such as an atlas or a full report, can scroll inside the frame. |
520
|
Raises:
| Type | Description |
|---|---|
ImportError
|
IPython is not installed. Install |
TypeError
|
The content is not a supported visualization object. |
ValueError
|
The height is not a positive integer. |
Composable chart layers
Use these native Altair layers when you want to supply your own data and encodings or combine built-in marks with custom charts.
paretorium.visualization.plot_dots(data: LayerData, *, x: alt.X, y: alt.Y, tooltip: Sequence[alt.Tooltip] = (), color: str | alt.Color | None = None, size: alt.Size | None = None, shape: alt.Shape | None = None, clip: bool = False, theme: Theme = DEFAULT_THEME) -> alt.Chart
Draw one dot per row on caller-supplied axes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
LayerData
|
Chart-ready rows. |
required |
x
|
X
|
Horizontal encoding. |
required |
y
|
Y
|
Vertical encoding. |
required |
tooltip
|
Sequence[Tooltip]
|
Optional tooltip fields, in display order. |
()
|
color
|
str | Color | None
|
Optional categorical field name styled with the theme's palette, or an explicit Altair color encoding. Omit to use the theme's default point color. |
None
|
size
|
Size | None
|
Optional explicit size encoding. |
None
|
shape
|
Shape | None
|
Optional explicit shape encoding. The default is a circle. |
None
|
clip
|
bool
|
Clip dots at the plot boundary. |
False
|
theme
|
Theme
|
Mark styling; does not choose the color field. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
Chart
|
An unconfigured Altair layer that can be combined with other layers. |
paretorium.visualization.interval_bars(data: LayerData, *, x: alt.X, y: alt.Y, end: str, along: Literal['x', 'y'] = 'y', description: str = 'Interval', clip: bool = False, theme: Theme = DEFAULT_THEME) -> alt.Chart
Draw precomputed intervals on one axis without recomputing bounds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
LayerData
|
Rows containing the endpoints and an orthogonal coordinate. |
required |
x
|
X
|
Horizontal encoding. Supply the lower endpoint if along x. |
required |
y
|
Y
|
Vertical encoding. Supply the lower endpoint if along y. |
required |
end
|
str
|
Field name of the upper endpoint on the interval axis. |
required |
along
|
Literal['x', 'y']
|
Axis along which the interval extends. |
'y'
|
description
|
str
|
Meaning of the interval, for example p05–p95 or a confidence interval. The caller supplies the correct endpoints. |
'Interval'
|
clip
|
bool
|
Clip intervals and their end caps at the plot boundary. |
False
|
theme
|
Theme
|
Color, opacity, stroke width, and end-cap style. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
Chart
|
A plain rule or a capped interval layer, using the supplied bounds. |
paretorium.visualization.pareto_front_layer(data: LayerData, *, x: alt.X, y: alt.Y, connect: bool = True, subset: bool = False, clip: bool = False, theme: Theme = DEFAULT_THEME) -> alt.Chart
Draw preselected Pareto concepts; does not calculate dominance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
LayerData
|
Rows of already-selected Pareto concepts. |
required |
x
|
X
|
Horizontal quantitative encoding. |
required |
y
|
Y
|
Vertical quantitative encoding. |
required |
connect
|
bool
|
Connect points by x for a true two-metric front. Use
|
True
|
subset
|
bool
|
Use accent styling to distinguish a selected subset's front. |
False
|
clip
|
bool
|
Clip front points and lines at the plot boundary. |
False
|
theme
|
Theme
|
Color, stroke width, and symbol size for the frontier. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
Chart
|
A line-and-point front or a point-only overlay. |
paretorium.visualization.metric_limit_layer(x: Metric, y: Metric, *, x_domain: Domain, y_domain: Domain, x_title: str | None = None, y_title: str | None = None, theme: Theme = DEFAULT_THEME) -> alt.LayerChart
Draw dashed boundaries and nonoverlapping no-go shading.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Metric
|
Metric with the horizontal axis's inclusive limits. |
required |
y
|
Metric
|
Metric with the vertical axis's inclusive limits. |
required |
x_domain
|
Domain
|
Visible horizontal range, also used by the main chart. |
required |
y_domain
|
Domain
|
Visible vertical range, also used by the main chart. |
required |
x_title
|
str | None
|
Horizontal axis title, if overriding the metric label. |
None
|
y_title
|
str | None
|
Vertical axis title, if overriding the metric label. |
None
|
theme
|
Theme
|
Boundary and region styling. |
DEFAULT_THEME
|
Returns:
| Type | Description |
|---|---|
LayerChart
|
Layers that mark out-of-limit coordinates on the displayed axes. |
LayerChart
|
Each rule spans only the portion allowed by the other axis's limits. |
LayerChart
|
These marks do not represent joint feasibility over samples. |
paretorium.visualization.reference_design_layer(references: Iterable[ReferenceDesign], *, x: alt.X, y: alt.Y, clip: bool = False, theme: Theme = DEFAULT_THEME) -> alt.LayerChart
Label benchmark points without adding them to the candidate set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
references
|
Iterable[ReferenceDesign]
|
Benchmarks in the same units as the chart. |
required |
x
|
X
|
Horizontal encoding for the field |
required |
y
|
Y
|
Vertical encoding for the field |
required |
clip
|
bool
|
Clip markers and labels at the plot boundary. |
False
|
theme
|
Theme
|
Reference point and label styling. |
DEFAULT_THEME
|
paretorium.visualization.ideal_direction_layer(*, x: Literal['min', 'max'], y: Literal['min', 'max'], theme: Theme = DEFAULT_THEME) -> alt.Chart
Mark the preferred corner of the axes, independently of their domain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Literal['min', 'max']
|
Whether less or more of the horizontal metric is preferred. |
required |
y
|
Literal['min', 'max']
|
Whether less or more of the vertical metric is preferred. |
required |
theme
|
Theme
|
Marker color and size. |
DEFAULT_THEME
|