Worked Examples
Understand uncertainty displays — Visualization & Graphing
Understand uncertainty displays — Visualization & Graphing Cross-application area: Visualization & Graphing Status: Initial scientific graphics guidance; platform-specific features not verified. Why this visualization matters Show
Product: Sustainable Catalyst Research Lab
Component: Scientific Visualization & Graphing
Knowledge Base Category: Developer Guides
Cross-Application Area: Visualization & Graphing
Audience: Software engineers, scientific developers,
QA engineers, and accessibility reviewers
Supported Product Version: Pending release identification
Last Verified Version: Not yet verified
Technical Review: Pending
Documentation Status: Developer reference guidance
1. Engineering Objective
Develop, integrate, and test scientific visualizations that preserve
numerical accuracy, support accessible interpretation, and maintain
reproducibility across research workflows.
The visualization system must distinguish authoritative scientific
data from visual presentation instructions. A renderer must not
silently modify source measurements, introduce undocumented
transformations, or assign unsupported uncertainty semantics.
Required engineering properties:
- Scientific fidelity between source data and rendered values.
- Accessible visual encoding that does not depend exclusively on color.
- Meaningful titles, labels, captions, and alternative descriptions.
- Equivalent numerical information where required for interpretation.
- Versioned datasets and reproducible rendering specifications.
- Explicit treatment of units, uncertainty, missing values, and transformations.
- Secure processing of external data and graphical content.
- Consistent scientific meaning across interactive and static exports.
2. Component Scope and Integration
This guide concerns the proposed Scientific Visualization &
Graphing component associated with Sustainable Catalyst Research Lab.
The component should expose a consistent rendering contract
that can be adopted by analytical applications without duplicating
scientific validation logic.
| Application | Responsibility |
|---|---|
| Research Lab | Scientific figure exploration, interactive inspection, and visual analysis. |
| Workbench | Reproducible computation, validated figure specifications, and notebook outputs. |
| Library | Source datasets, provenance, licensing, and scientific references. |
| Site Intelligence | Spatial datasets, coordinate systems, and geographic visualization. |
| Decision Studio | Model scenarios, comparative analysis, and uncertainty representation. |
| Workspace | Project association, ownership, figure review, and approval records. |
| Research | Publication relationships and supporting scientific evidence. |
| Reporting & Publication Studio | Accessible figure assembly, version management, and publication exports. |
These relationships represent intended integration boundaries.
Actual implementation must be confirmed using source code,
API contracts, and deployment evidence.
3. Scientific Rendering Contract
Every scientific figure should be generated from validated
source data and a versioned specification.
The rendering contract should identify:
- Source dataset identifier and immutable version.
- Source provenance and applicable permissions.
- Variable names, types, units, and dimensionality.
- Coordinate reference system or temporal reference, where applicable.
- Missing-data handling and quality flags.
- Applied transformations and statistical operations.
- Uncertainty definitions and numerical bounds.
- Axis scales, limits, visual encodings, and legend mappings.
- Accessibility descriptions and numerical alternatives.
- Renderer identifier, dependency version, and export format.
3.1 Example Figure Specification
The following JSON demonstrates a proposed renderer-independent
contract. This is illustrative rather than an existing verified API.
{
"schema_version": "1.0.0",
"figure_id": "synthetic-figure-001",
"source": {
"artifact_id": "synthetic-dataset-001",
"version": "1"
},
"type": "line",
"title": "Experimental Response Over Time",
"axes": {
"x": {
"label": "Observation time",
"unit": "days",
"scale": "linear"
},
"y": {
"label": "Measured response",
"unit": "a.u.",
"scale": "linear"
}
},
"series": [
{
"id": "control",
"label": "Control",
"x": [0, 7, 14, 21],
"y": [10.0, 10.5, 10.8, 11.0],
"marker": "circle",
"line_style": "solid"
},
{
"id": "treatment",
"label": "Treatment",
"x": [0, 7, 14, 21],
"y": [10.0, 12.0, 14.5, 16.0],
"marker": "diamond",
"line_style": "dash"
}
],
"accessibility": {
"color_independent_encoding": true,
"table_required": true,
"description_required": true
}
}
Data classification: Synthetic demonstration
values. These observations do not represent actual research findings.
4. Backend Data Validation
Validate the scientific input before passing it to
a graphics renderer.
Reject or explicitly handle:
- Unsupported schema versions.
- Mismatched coordinate and value array lengths.
- Invalid numeric data types.
- NaN and infinity values not covered by an explicit policy.
- Incompatible measurement units.
- Incorrectly ordered uncertainty bounds.
- Missing or invalid spatial reference information.
- Undocumented transformations or interpolations.
- Unauthorized or inaccessible source artifacts.
4.1 Python Validation Example
import math
def validate_series(x, y):
if len(x) != len(y):
raise ValueError(
"Coordinate and value lengths differ"
)
if len(x) == 0:
raise ValueError(
"Series contains no observations"
)
for value in y:
if isinstance(value, bool):
raise ValueError(
"Boolean values are not measurements"
)
if not isinstance(value, (int, float)):
raise ValueError(
"Non-numeric observation"
)
if not math.isfinite(value):
raise ValueError(
"Non-finite observation"
)
return True
This example validates basic numerical structure.
Production implementations additionally require
formal schema validation, source authorization,
unit compatibility, uncertainty semantics,
and scientifically appropriate missing-data policies.
5. Accessible Rendering Requirements
Scientific figures should provide meaningful visual
encoding together with accessible alternatives.
5.1 Visual Encoding
- Use distinguishable line patterns or marker shapes.
- Label scientific variables and measurement units.
- Provide meaningful legends and direct annotations where useful.
- Use appropriate text and graphical contrast.
- Preserve readable labels when figures are resized.
- Avoid misleading axis scaling or undocumented clipping.
- Distinguish measured observations from modeled estimates.
5.2 Accessible Alternatives
Where applicable, provide:
- Concise alternative text.
- Scientific captions explaining the figure’s purpose and limitations.
- Structured tables containing essential numerical values.
- Longer descriptions for complex graphical relationships.
- Keyboard-accessible interactions or equivalent alternatives.
- Accessible representations of uncertainty and model assumptions.
Accessibility must be evaluated at the level of
the completed figure and its publication context.
Providing alternative text alone does not establish
WCAG conformance.
6. Renderer Integration
Candidate rendering technologies include Plotly,
Vega-Lite, Matplotlib, MapLibre, CesiumJS, and PyVista.
Their suitability depends on visualization type,
accessibility requirements, rendering environment,
and supported output formats.
| Renderer | Typical Use | Key Testing Concern |
|---|---|---|
| Plotly | Interactive scientific charts | Data fidelity, interaction, export consistency |
| Vega-Lite | Declarative statistical visualization | Transformation and specification semantics |
| Matplotlib | Static publication figures | Numerical correctness and accessible supporting content |
| MapLibre | Geospatial maps | Spatial fidelity and keyboard-accessible alternatives |
| CesiumJS | Three-dimensional geospatial graphics | Spatial semantics and alternative representations |
| PyVista | Scientific meshes and simulations | Mesh integrity, scalar mappings, static alternatives |
A framework’s inclusion in this table does not
establish that its adapter is operational in
the deployed Research Lab.
7. Automated Testing Requirements
Implement automated checks for scientific correctness
and rendering behavior.
7.1 Numerical Tests
- Compare plotted data with authoritative source values.
- Validate dimensional and unit consistency.
- Test missing observations and non-finite values.
- Verify transformations against known results.
- Validate uncertainty bounds and interval definitions.
- Test extreme magnitudes and scale limits.
- Confirm rendering does not mutate source inputs.
7.2 Golden Fixture Tests
Use small synthetic datasets with predetermined
expected numerical outputs.
def test_valid_series():
assert validate_series(
[0, 1, 2],
[10.0, 11.0, 12.0]
)
def test_reject_non_finite():
import pytest
with pytest.raises(ValueError):
validate_series(
[0, 1],
[10.0, float("nan")]
)
def test_reject_mismatched_lengths():
import pytest
with pytest.raises(ValueError):
validate_series(
[0, 1, 2],
[10.0, 11.0]
)
7.3 Accessibility Tests
Combine automated accessibility checks with
manual browser and assistive-technology testing.
- Verify accessible names and descriptions.
- Test keyboard navigation and visible focus.
- Check text and non-text contrast.
- Review color-independent data distinctions.
- Validate accessible data-table relationships.
- Test resizing and magnification.
- Inspect essential hover and interaction alternatives.
7.4 Export and Regression Tests
Test applicable HTML, SVG, PNG, and PDF outputs.
Confirm that exports preserve numerical values,
units, captions, legends, uncertainty semantics,
and accessible supporting information.
Visual regression tests should detect missing
labels, clipped content, or renderer changes.
Numerical tests must remain independent of
screenshot comparisons.
8. Security Requirements
Treat imported datasets, text annotations,
labels, SVG content, and rendering parameters
as potentially untrusted inputs.
- Validate incoming data against approved schemas.
- Escape or sanitize untrusted output appropriately.
- Prevent unsafe script execution in HTML and SVG.
- Restrict external asset loading and arbitrary network access.
- Enforce authorization before retrieving source datasets.
- Validate export permissions independently of frontend controls.
- Apply rendering resource limits and execution timeouts.
- Record and review dependency vulnerabilities.
A visualization must not provide an unauthorized
route to private datasets or protected research artifacts.
9. Reproducibility and Provenance
Every publication-grade figure should retain
enough information to reproduce its numerical
results and inspect its scientific assumptions.
Recommended provenance fields:
- Dataset artifact ID and version.
- Source content checksum.
- Computation or notebook identifier.
- Code revision or commit SHA.
- Figure specification version.
- Renderer and dependency versions.
- Transformation parameters.
- Export artifact identifiers and checksums.
- Validation and review results.
Reproducibility requires more than producing
a similar-looking chart. The documented pipeline
should preserve the same scientific quantities
and relevant analytical relationships.
10. Quality Assurance and Acceptance
The figure implementation should pass the
following acceptance criteria before being
classified as verified.
- The figure schema is valid and versioned.
- The source dataset is identifiable and authorized.
- Numerical calculations match expected results.
- Units and uncertainty semantics remain correct.
- Essential comparisons do not depend on color alone.
- Accessible descriptions and numerical alternatives are available.
- Essential interactive controls are keyboard accessible.
- Export formats preserve scientific meaning.
- Security checks pass.
- Tests and environment information are recorded.
- Required scientific and technical reviews are completed.
Acceptance principle:
Successful rendering alone does not establish
scientific correctness, accessibility, or
production readiness.
11. Product Version and Verification Record
This section documents the evidence required
to associate this article with a verified
Sustainable Catalyst release.
| Field | Current Value |
|---|---|
| Product | Sustainable Catalyst Research Lab |
| Component | Scientific Visualization & Graphing — proposed classification |
| Supported version | Not yet established |
| Last verified version | Not yet verified |
| Source repository and commit | Pending source audit |
| Deployment environment | Pending runtime verification |
| Automated test evidence | Pending |
| Accessibility review | Pending |
Before assigning a last verified version,
inspect the installed component, identify
its release, and execute the applicable
numerical, accessibility, and export tests.
12. Related Releases, Issues, and Engineering Work
This article should be associated with
reviewed engineering records documenting
scientific visualization functionality.
Relevant records may include renderer
integration issues, scientific validation
defects, accessibility improvements,
and publication export changes.
Related engineering initiative:
SC-FIG-01 — Shared Scientific Figure Contract
(proposed initiative; not a verified release).
Related implementation area:
Workbench scientific visualization and
renderer-adapter development.
A specific release, known issue, or reviewed
suggestion should be linked only after its
identity and relevance are confirmed.
13. Developer Definition of Done
A scientific rendering implementation
is ready for technical acceptance when:
- Its schema and interface are documented.
- Numerical invariants are tested.
- Accessible visual encoding is implemented.
- Alternative descriptions and data representations are available.
- Export behavior is verified.
- Provenance and version information are preserved.
- Security and authorization checks pass.
- Test evidence is retained.
- Actual product and component versions are identified.
- Release and review requirements are satisfied.
14. References and Technical Documentation
-
W3C.
Web Content Accessibility Guidelines (WCAG) 2.2.
WCAG 2.2
-
W3C Web Accessibility Initiative.
Images Tutorial.
Accessible Images Guidance
-
W3C.
Understanding Use of Color.
WCAG Use of Color
-
W3C.
Understanding Non-text Contrast.
WCAG Non-text Contrast
-
Plotly.
Python Graphing Library.
Plotly Documentation
-
Vega-Lite.
Declarative Visualization Documentation.
Vega-Lite Documentation
-
MapLibre.
MapLibre GL JS Documentation.
MapLibre Documentation
-
Cesium.
CesiumJS Documentation.
CesiumJS Documentation
-
PyVista.
Scientific Visualization Documentation.
PyVista Documentation
-
JSON Schema.
Specification.
JSON Schema
