StatsLibX logoStatsLibX

ViewX

v0.4.0

Optional visualization module. StatsLibX performs all analysis; ViewX exports results to HTML dashboards, PDF reports, or Presentation slide decks. Core statslibx works without viewx installed.

Overview

Install ViewX only when you need to export results: pip install statslibx[viewx]. Analysis classes work without ViewX. Export methods (.to_html(), .to_presentation(), .to_report()) raise ImportError with install instructions if ViewX is missing.

Canonical flow — analyze then visualize

DescriptiveSummary.to_html()
from statslibx import DescriptiveStats, load_iris

df = load_iris()
summary = DescriptiveStats(df).summary()   # works without viewx

summary.to_html(
    "iris_descriptive.html",
    theme="dark_enterprise",
    include_figures=True,
    data=df,
)

Result export methods

to_report_data
to_report_data(result, include_figures: bool = False, data: pd.DataFrame | None = None) -> dict
DescriptiveSummary.to_html
to_html(filename: str = 'report.html', theme: Literal['corporate_blue','dark_enterprise','modern_green','void_indigo','glass_ocean','cyberpunk_neon'] = 'dark_enterprise', include_figures: bool = True, data: pd.DataFrame | None = None, show: bool = False) -> str
TestResult.to_presentation
to_presentation(filename: str = 'presentation.html', theme: Literal['dark','light','neon','ocean','sunset','corporate'] = 'dark', include_figures: bool = True, open_browser: bool = False) -> str
render_html
render_html(result, filename: str = 'report.html', theme: HTMLTheme = 'dark_enterprise', ...) -> str

ViewX components (re-exported when installed)

HTML
HTML(title: str = 'ViewX Dashboard', theme: ThemeName = 'corporate_blue', cols: int = 12, rows: int = 12) -> HTML
Presentation
Presentation(title: str = 'Presentación', theme: Literal['dark','light','neon','ocean','sunset','corporate'] = 'dark') -> Presentation
Slide
Slide(title: str = '', notes: str = '') -> Slide
from_report_payload
from_report_payload(payload: dict, target: Literal['html','report','presentation'] = 'html', ...) -> str

Installation

Base install
pip install statslibx
# core analysis only
With ViewX export
pip install statslibx[viewx]

Import paths

from statslibx import to_report_data, Presentation, Slide, HTML

from statslibx.viewx.adapters import to_report_data

ViewX in the browser playground

The online playground runs the real statslibx in your browser via Pyodide. What works and what does not:

CapabilityIn the playgroundNotes
All analysis (descriptive, inferential, computational, timeseries, distribution, imputation, EDA)Worksnumpy, pandas, scipy, sympy and matplotlib are loaded.
Bundled datasets (iris, penguins, titanic)WorksLarge datasets are not bundled in the browser.
matplotlib plotsWorksFigures render inline in the output panel.
plotly / seabornInstallablePure-Python packages — install them from the Packages panel (micropip).
polars backendUnavailableCompiled packages cannot run in the browser; use the pandas backend.
ViewX export (.to_html() / .to_presentation())Requires pipInstall statslibx[viewx] locally; to_report_data() payloads work everywhere.