import type { ThemeMode } from "./types"; /** * Categorical palette — scienceplots' standard seven-colour "science" cycle. * Re-exported for API compatibility with the former plotly build; the * authoritative copy now lives in `presets/molplot.json` and flows through * {@link getPreset}. */ export declare const CHART_PALETTE: readonly string[]; export declare const CHART_DEFAULT_COLOR: string; /** CSS values read from the host page so docs type/color match the article. */ export interface HostStyle { /** Computed body font-size in px (e.g. `.md-typeset` ≈ 12.8). */ fontSizePx: number; fontFamily: string | null; color: string | null; } export interface ChartTheme { background: "transparent"; font: { size: number; color: string; family: string; }; axis: { gridColor: string; tickColor: string; }; palette: readonly string[]; /** Colour scheme names shared with matplotlib. */ scheme: { sequential: string; diverging: string; }; /** Ring colour used to highlight a selected point. */ highlightRing: string; /** Line stroke width / marker size from the preset geometry. */ geometry: { lineWidth: number; markerSize: number; barGap: number; }; /** Type scale from the preset. */ fontSize: { base: number; title: number; label: number; tick: number; legend: number; }; /** The preset name this theme was resolved from. */ presetName: string; mode: "light" | "dark"; /** Host body size used for {@link fontScaleForHost}. */ hostFontPx: number; } /** * Read type / ink from the surrounding page so docs charts match body copy * instead of a frozen paper × 3× scale. * * Prefer `.md-typeset` (Material / Zensical article) when present. */ export declare function readHostStyle(el: HTMLElement | null | undefined): HostStyle; /** * Axis / label type stack: Times New Roman + math fonts (STIX / Latin Modern) * so τ, Ų, subscripts match paper figures. Body prose may stay Inter; chart * labels stay scientific serif. */ export declare const CHART_SERIF_STACK: string; /** * Resolve a theme mode (and optional named preset) to a concrete ChartTheme. * `auto` observes `` once at call time — for live tracking, * the chart classes set up a MutationObserver and call this on change. * * Host supplies **ink colour** and **body size** (for fontScale). Chart type * family stays Times + math fonts — not the page sans — so axis titles read * like paper figures next to Inter body copy. */ export declare function resolveTheme(mode: ThemeMode, presetName?: string, host?: HTMLElement | null): ChartTheme; /** * Paper design width (matches `view.continuousWidth`). At this width the * preset type scale (≈9–12 px) is correct for a 3.5″ figure. */ export declare const MOLPLOT_DESIGN_WIDTH = 320; /** * Scale factor so chart type matches the **host page body**, not a paper * billboard. * * Paper tick is ≈9 px. Docs body (`.md-typeset`) is typically 0.8rem ≈ 12–13 px. * We target tick ≈ 0.95 × body, title ≈ 1.05 × body — readable next to prose * without crushing legends or eating the plot. * * Width only nudges ±10% (narrow sidebars vs full column). */ export declare function fontScaleForHost(width: number, bodyPx?: number): number; /** * Width-only scale with a neutral body size. Prefer * {@link fontScaleForHost} when the host element is known. */ export declare function fontScaleForWidth(width: number): number; /** * Build the Vega-Lite `config` object for a theme. This is the *single* * place the unified preset is injected into a spec — the exact counterpart of * the matplotlib rcParams the Python package applies, so a spec rendered in * the browser and the same spec rendered by scienceplots share palette, type * scale, and grid styling. * * @param fontScale - multiplies every type size (1 = paper preset). Web * hosts should pass {@link fontScaleForHost} so labels track page body type. */ export declare function vegaConfig(theme: ChartTheme, fontScale?: number): Record;