ViewX
v0.4.0Optional 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()
python
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
dict — title, sections, tables, valueboxes?, figures?, metadata?
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
str — path to generated HTML
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
str — path to generated presentation
render_html
render_html(result, filename: str = 'report.html', theme: HTMLTheme = 'dark_enterprise', ...) -> str
str
ViewX components (re-exported when installed)
HTML
HTML(title: str = 'ViewX Dashboard', theme: ThemeName = 'corporate_blue', cols: int = 12, rows: int = 12) -> HTML
HTML
Presentation
Presentation(title: str = 'Presentación', theme: Literal['dark','light','neon','ocean','sunset','corporate'] = 'dark') -> Presentation
Presentation
Slide
Slide(title: str = '', notes: str = '') -> Slide
Slide
from_report_payload
from_report_payload(payload: dict, target: Literal['html','report','presentation'] = 'html', ...) -> str
str — generated file path
Installation
Base install
python
pip install statslibx
# core analysis onlyWith ViewX export
python
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:
| Capability | In the playground | Notes |
|---|---|---|
| All analysis (descriptive, inferential, computational, timeseries, distribution, imputation, EDA) | Works | numpy, pandas, scipy, sympy and matplotlib are loaded. |
| Bundled datasets (iris, penguins, titanic) | Works | Large datasets are not bundled in the browser. |
| matplotlib plots | Works | Figures render inline in the output panel. |
| plotly / seaborn | Installable | Pure-Python packages — install them from the Packages panel (micropip). |
| polars backend | Unavailable | Compiled packages cannot run in the browser; use the pandas backend. |
| ViewX export (.to_html() / .to_presentation()) | Requires pip | Install statslibx[viewx] locally; to_report_data() payloads work everywhere. |