import { c as ChartAssemblyInput, I as InstantiateContext, h as ChartWarning, g as ChartTemplateDef } from '../types-DHaPWLqG.cjs'; import { a as PivotSurface, c as TransformSurface } from '../pivot-CwI9D70d.cjs'; /** * Plotly chart assembly — Two-Stage Pipeline Coordinator. * * Reuses the **same core analysis pipeline** as the other backends: * Phase 0: resolveChannelSemantics → ChannelSemantics * Step 0a: declareLayoutMode → LayoutDeclaration * Step 0b: convertTemporalData → converted data * Step 0c: filterOverflow → filtered data, nominalCounts * Phase 1: computeLayout → LayoutResult * * Then diverges for Phase 2 (Plotly-specific): * template.instantiate → builds the Plotly figure structure * plApplyLayoutToSpec → applies layout decisions to the figure * * Key structural difference from the other backends' output: * PL: { data: [{ type, x, y, … }], layout: { xaxis, yaxis, … } } * Figures are pure JSON — no callback functions anywhere — so compiled * specs survive serialization across process boundaries. * * column/row facets render as a subplot grid (see facet.ts), mirroring the * Chart.js backend's facet decisions (shared nice y-domain, leftmost-only * y labels, column wrapping). * * This module has NO React, Redux, or UI framework dependencies. */ /** * Assemble a Plotly figure object (`{ data, layout }`). * * ```ts * const figure = assemblePlotly({ * data: { values: myRows }, * semantic_types: { weight: 'Quantity' }, * chart_spec: { chartType: 'Bar Chart', encodings: { x: { field: 'category' }, y: { field: 'value' } } }, * }); * ``` * * @returns A Plotly figure with optional `_warnings` and `_width`/`_height` hints */ declare function assemblePlotly(input: ChartAssemblyInput): any; /** Inspect the Plotly legacy (composed) view transformation surface for an input. */ declare function getPlotlyPivot(input: ChartAssemblyInput): PivotSurface | undefined; /** Inspect the Plotly two-control transform surface for an input. */ declare function getPlotlyTransform(input: ChartAssemblyInput): TransformSurface | undefined; /** * ============================================================================= * PHASE 2: INSTANTIATE SPEC — Plotly backend * ============================================================================= * * Translates semantic decisions (Phase 0) and layout dimensions (Phase 1) * into Plotly-specific figure properties. * * Key differences from the other backends: * - PL figures are `{ data: traces[], layout }` and stay pure JSON — axis * tick formatting uses declarative `tickformat`/axis types, never * callback functions * - PL sizing via `layout.width` / `layout.height` * - PL label rotation via `layout.xaxis.tickangle` * * PL dependency: **Yes — this is where Plotly-specific syntax lives** * ============================================================================= */ /** * Phase 2: Apply layout and semantic decisions to the Plotly figure. * * Handles common Plotly plumbing across all templates: * - Figure sizing (_width, _height + layout.width/height) * - Axis label rotation and font sizing * - Overflow truncation warnings */ declare function plApplyLayoutToSpec(figure: any, context: InstantiateContext, warnings: ChartWarning[]): void; /** * Apply tooltips to a Plotly figure. Plotly hover is on by default; this * pins an explicit unified hover mode so tooltips read across series. */ declare function plApplyTooltips(figure: any): void; /** * Plotly template registry. * * Mirrors the structure of chartjs/templates/index.ts, echarts/templates/index.ts * and vegalite/templates/index.ts but with Plotly template definitions. * * Coverage: the four original acceptance templates (Bar, Line, Area, Scatter) * plus an expressive tranche mirroring most of the Vega-Lite catalog (grouped/ * stacked bar, distributions, circular charts, specialized native-trace charts), * two Plotly opportunity charts (Funnel, Gauge) that showcase native * `indicator`/`funnel` traces ECharts otherwise hand-builds, native geo charts * (Map, Choropleth — Plotly's own `scattergeo`/`choropleth` built-in atlas, no * TopoJSON fetch/join needed), and two composite table/strip layouts * (Sparkline, Bar Table) built as self-contained Plotly figures (own axis * grid + paper-anchored annotations) rather than forced through the generic * cartesian column/row facet combiner (`facet.ts`), which only supports one * axis pair per panel. See `sparkline.ts` / `bar-table.ts` for the composite * layout technique and `selfManagesFacets` in `../assemble.ts`. */ /** * Plotly chart template definitions, grouped by category. */ declare const plTemplateDefs: { [key: string]: ChartTemplateDef[]; }; /** * Flat list of all Plotly chart template definitions. */ declare const plAllTemplateDefs: ChartTemplateDef[]; /** * Look up a Plotly chart template definition by chart type name. */ declare function plGetTemplateDef(chartType: string): ChartTemplateDef | undefined; /** * Get the available channels for a Plotly chart type. */ declare function plGetTemplateChannels(chartType: string): string[]; export { assemblePlotly, getPlotlyPivot, getPlotlyTransform, plAllTemplateDefs, plApplyLayoutToSpec, plApplyTooltips, plGetTemplateChannels, plGetTemplateDef, plTemplateDefs };