graphein 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/index.d.ts +880 -110
- package/dist/index.js +7914 -1574
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
package/dist/index.d.ts
CHANGED
|
@@ -176,6 +176,11 @@ declare function interpolateOklab(a: RGBA, b: RGBA): Interpolator;
|
|
|
176
176
|
/** Get a categorical palette by name (defaults to the 'graphein' palette). */
|
|
177
177
|
declare function categorical(name?: string): string[];
|
|
178
178
|
declare const categoricalSchemes: string[];
|
|
179
|
+
/**
|
|
180
|
+
* Derive a categorical palette for dark surfaces while preserving each swatch's
|
|
181
|
+
* OKLCH hue identity. Invalid colors are passed through unchanged.
|
|
182
|
+
*/
|
|
183
|
+
declare function adaptPaletteForDarkBackground(palette: readonly string[], background?: string, minContrast?: number): string[];
|
|
179
184
|
/**
|
|
180
185
|
* Build a continuous ramp from ordered color stops, interpolating each segment
|
|
181
186
|
* in OKLab. Endpoints (t=0,1) return the first/last stop exactly.
|
|
@@ -604,48 +609,71 @@ interface ThemeColors {
|
|
|
604
609
|
/** Negative / down semantics. */
|
|
605
610
|
negative: string;
|
|
606
611
|
}
|
|
612
|
+
interface ThemeFontSizes {
|
|
613
|
+
tiny: number;
|
|
614
|
+
small: number;
|
|
615
|
+
base: number;
|
|
616
|
+
large: number;
|
|
617
|
+
title: number;
|
|
618
|
+
}
|
|
619
|
+
interface ThemeFontWeights {
|
|
620
|
+
normal: number;
|
|
621
|
+
medium: number;
|
|
622
|
+
bold: number;
|
|
623
|
+
}
|
|
607
624
|
interface ThemeFont {
|
|
608
625
|
family: string;
|
|
609
|
-
size:
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
626
|
+
size: ThemeFontSizes;
|
|
627
|
+
weight: ThemeFontWeights;
|
|
628
|
+
}
|
|
629
|
+
interface ThemeSpacing {
|
|
630
|
+
xs: number;
|
|
631
|
+
sm: number;
|
|
632
|
+
md: number;
|
|
633
|
+
lg: number;
|
|
634
|
+
xl: number;
|
|
635
|
+
}
|
|
636
|
+
interface ThemeRadii {
|
|
637
|
+
sm: number;
|
|
638
|
+
md: number;
|
|
639
|
+
lg: number;
|
|
640
|
+
}
|
|
641
|
+
interface ThemeStrokes {
|
|
642
|
+
thin: number;
|
|
643
|
+
base: number;
|
|
644
|
+
thick: number;
|
|
621
645
|
}
|
|
622
646
|
interface ThemeTokens {
|
|
623
647
|
name: string;
|
|
624
648
|
dark: boolean;
|
|
625
649
|
color: ThemeColors;
|
|
626
650
|
font: ThemeFont;
|
|
627
|
-
spacing:
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
651
|
+
spacing: ThemeSpacing;
|
|
652
|
+
radius: ThemeRadii;
|
|
653
|
+
stroke: ThemeStrokes;
|
|
654
|
+
}
|
|
655
|
+
/** Non-fatal theme resolution warning. */
|
|
656
|
+
interface ThemeWarning {
|
|
657
|
+
/** Dot path to the invalid override token. */
|
|
658
|
+
path: string;
|
|
659
|
+
/** Human-readable warning. */
|
|
660
|
+
message: string;
|
|
661
|
+
}
|
|
662
|
+
/** Theme resolution result with non-fatal warnings. */
|
|
663
|
+
interface ResolvedTheme {
|
|
664
|
+
/** Concrete theme tokens after applying valid overrides. */
|
|
665
|
+
tokens: ThemeTokens;
|
|
666
|
+
/** Non-fatal warnings for ignored invalid overrides. */
|
|
667
|
+
warnings: ThemeWarning[];
|
|
644
668
|
}
|
|
645
669
|
declare const lightTheme: ThemeTokens;
|
|
646
670
|
declare const darkTheme: ThemeTokens;
|
|
647
671
|
declare const themes: Record<string, ThemeTokens>;
|
|
648
|
-
type
|
|
672
|
+
type TokenOverrides<T> = {
|
|
673
|
+
[K in keyof T]?: T[K] extends readonly unknown[] ? T[K] : T[K] extends object ? TokenOverrides<T[K]> : T[K];
|
|
674
|
+
};
|
|
675
|
+
/** Named theme or nested token overrides; unspecified tokens retain their base values. */
|
|
676
|
+
type ThemeInput = string | (TokenOverrides<ThemeTokens> & {
|
|
649
677
|
base?: string;
|
|
650
678
|
});
|
|
651
679
|
/**
|
|
@@ -654,6 +682,11 @@ type ThemeInput = string | (Partial<ThemeTokens> & {
|
|
|
654
682
|
* - an object deep-merges onto a base theme (override.base or override.dark picks it)
|
|
655
683
|
*/
|
|
656
684
|
declare function resolveTheme(theme?: ThemeInput): ThemeTokens;
|
|
685
|
+
/**
|
|
686
|
+
* Resolve a theme reference into concrete tokens plus non-fatal warnings for
|
|
687
|
+
* invalid color overrides that fell back to the selected base theme.
|
|
688
|
+
*/
|
|
689
|
+
declare function resolveThemeChecked(theme?: ThemeInput): ResolvedTheme;
|
|
657
690
|
|
|
658
691
|
/**
|
|
659
692
|
* Theme-side support for the hand-drawn ("sketch") style.
|
|
@@ -2235,6 +2268,292 @@ declare class CanvasLayer {
|
|
|
2235
2268
|
clear(): void;
|
|
2236
2269
|
}
|
|
2237
2270
|
|
|
2271
|
+
/**
|
|
2272
|
+
* Canvas painting for chart "overlay" text (axis labels, titles, legends,
|
|
2273
|
+
* annotation labels). In the browser this text lives in a crisp, selectable
|
|
2274
|
+
* HTML overlay; headless (no DOM) there is no overlay, so the very same text is
|
|
2275
|
+
* painted onto the marks canvas with these helpers.
|
|
2276
|
+
*
|
|
2277
|
+
* The geometry is shared: call sites compute one set of positions and either
|
|
2278
|
+
* realise them as absolutely-positioned DOM nodes (browser) or feed them here
|
|
2279
|
+
* (headless). The transform/width vocabulary the DOM path uses
|
|
2280
|
+
* (`translateX(-50%)`, `translateY(-50%)`, `translate(-50%,-50%) rotate(±90deg)`,
|
|
2281
|
+
* box `width` + `align`) maps deterministically onto canvas
|
|
2282
|
+
* `textAlign`/`textBaseline`/rotation, so both paths land the same pixels.
|
|
2283
|
+
*/
|
|
2284
|
+
interface CanvasPillStyle {
|
|
2285
|
+
background: string;
|
|
2286
|
+
border?: string;
|
|
2287
|
+
radius?: number;
|
|
2288
|
+
padX?: number;
|
|
2289
|
+
padY?: number;
|
|
2290
|
+
}
|
|
2291
|
+
interface CanvasTextCmd {
|
|
2292
|
+
/** Anchor x (interpreted per `align`). */
|
|
2293
|
+
x: number;
|
|
2294
|
+
/** Anchor y (interpreted per `baseline`). */
|
|
2295
|
+
y: number;
|
|
2296
|
+
text: string;
|
|
2297
|
+
/** CSS font shorthand (authoritative — already encodes size + weight). */
|
|
2298
|
+
font: string;
|
|
2299
|
+
color: string;
|
|
2300
|
+
/** Font pixel size, used to size the optional pill. */
|
|
2301
|
+
size: number;
|
|
2302
|
+
align?: CanvasTextAlign;
|
|
2303
|
+
baseline?: CanvasTextBaseline;
|
|
2304
|
+
/** Rotation about (x, y), in radians. */
|
|
2305
|
+
rotate?: number;
|
|
2306
|
+
opacity?: number;
|
|
2307
|
+
/** Draw a rounded "pill"/badge behind the text (solid fill + hairline border). */
|
|
2308
|
+
pill?: CanvasPillStyle;
|
|
2309
|
+
}
|
|
2310
|
+
/** Paint a single text command onto a 2D context. Self-contained (save/restore). */
|
|
2311
|
+
declare function paintCanvasText(ctx: CanvasRenderingContext2D, c: CanvasTextCmd): void;
|
|
2312
|
+
/** Option shape shared by the DOM text helpers (axes + chrome). */
|
|
2313
|
+
interface OverlayTextOpts {
|
|
2314
|
+
left: number;
|
|
2315
|
+
top: number;
|
|
2316
|
+
width?: number;
|
|
2317
|
+
text: string;
|
|
2318
|
+
color: string;
|
|
2319
|
+
size: number;
|
|
2320
|
+
align?: 'left' | 'center' | 'right';
|
|
2321
|
+
transform?: string;
|
|
2322
|
+
opacity?: number;
|
|
2323
|
+
pill?: CanvasPillStyle;
|
|
2324
|
+
}
|
|
2325
|
+
/**
|
|
2326
|
+
* Translate an absolutely-positioned overlay text node (left/top/width/align +
|
|
2327
|
+
* a CSS `transform` from the known vocabulary) into the equivalent canvas
|
|
2328
|
+
* command. Keeps the headless output pixel-aligned with the browser overlay.
|
|
2329
|
+
*/
|
|
2330
|
+
declare function overlayTextToCanvasCmd(o: OverlayTextOpts, font: string): CanvasTextCmd;
|
|
2331
|
+
type LegendSymbol = 'square' | 'circle' | 'line';
|
|
2332
|
+
/** Total horizontal footprint of a legend swatch (square/circle = 11, line = 14). */
|
|
2333
|
+
declare function legendSwatchWidth(symbol: LegendSymbol | undefined, swatch?: number): number;
|
|
2334
|
+
/**
|
|
2335
|
+
* Paint a legend swatch onto canvas, vertically centered on `midY`. Mirrors the
|
|
2336
|
+
* DOM swatch (square/circle 11px, line 14×3px).
|
|
2337
|
+
*/
|
|
2338
|
+
declare function paintLegendSwatch(ctx: CanvasRenderingContext2D, x: number, midY: number, symbol: LegendSymbol | undefined, color: string, swatch?: number): void;
|
|
2339
|
+
|
|
2340
|
+
/**
|
|
2341
|
+
* Label ledger — a record of every text label a chart actually drew.
|
|
2342
|
+
*
|
|
2343
|
+
* Both text chokepoints push here as they render: `axes/draw.ts` for cartesian
|
|
2344
|
+
* charts and `charts/chrome.ts` for every other visual. That gives the render
|
|
2345
|
+
* report one chart-type-agnostic source of truth for text diagnostics — a pie's
|
|
2346
|
+
* callouts, a sankey's node names and a bar chart's tick labels all land in the
|
|
2347
|
+
* same ledger — so clipping and collision checks work everywhere instead of only
|
|
2348
|
+
* where a `CartesianModel` happens to exist.
|
|
2349
|
+
*/
|
|
2350
|
+
|
|
2351
|
+
/** What a recorded label is for, so diagnostics can name it meaningfully. */
|
|
2352
|
+
type LabelRole = 'axis-label' | 'axis-title' | 'title' | 'subtitle' | 'legend' | 'data-label' | 'annotation' | 'other';
|
|
2353
|
+
/** One label as drawn, with the box it occupies and the budget it was given. */
|
|
2354
|
+
interface LabelRecord {
|
|
2355
|
+
role: LabelRole;
|
|
2356
|
+
/** The string actually painted (already shortened when it did not fit). */
|
|
2357
|
+
text: string;
|
|
2358
|
+
/** The full string before any truncation. */
|
|
2359
|
+
fullText: string;
|
|
2360
|
+
/** True when `text` had to be shortened to fit `budget`. */
|
|
2361
|
+
truncated: boolean;
|
|
2362
|
+
/** Axis-aligned bounding box in CSS pixels, relative to the surface. */
|
|
2363
|
+
box: Rect;
|
|
2364
|
+
/** Rotation in degrees; 0 for upright text. */
|
|
2365
|
+
angle: number;
|
|
2366
|
+
/** Font pixel size — the box includes line-box leading, this is the ink height. */
|
|
2367
|
+
size: number;
|
|
2368
|
+
/** The width the caller allowed, when it declared one. */
|
|
2369
|
+
budget?: number;
|
|
2370
|
+
/** The axis a tick label belongs to. */
|
|
2371
|
+
axis?: 'x' | 'y';
|
|
2372
|
+
color?: string;
|
|
2373
|
+
opacity?: number;
|
|
2374
|
+
/** Known background behind this label, not a guessed universal theme token. */
|
|
2375
|
+
background?: string;
|
|
2376
|
+
/** JSON Pointer into the effective spec, when the label has a config origin. */
|
|
2377
|
+
path?: string;
|
|
2378
|
+
clip?: Rect;
|
|
2379
|
+
}
|
|
2380
|
+
interface SuppressedLabel {
|
|
2381
|
+
role: LabelRole;
|
|
2382
|
+
reason: 'space' | 'collision' | 'unreadable' | 'static-viewport' | 'frame';
|
|
2383
|
+
/** Identifying text (axes, category names, titles) versus optional value labels. */
|
|
2384
|
+
required: boolean;
|
|
2385
|
+
count: number;
|
|
2386
|
+
example?: string;
|
|
2387
|
+
axis?: 'x' | 'y';
|
|
2388
|
+
path?: string;
|
|
2389
|
+
}
|
|
2390
|
+
/** Collects label records for a single render pass. */
|
|
2391
|
+
declare class LabelLedger {
|
|
2392
|
+
readonly records: LabelRecord[];
|
|
2393
|
+
readonly suppressed: SuppressedLabel[];
|
|
2394
|
+
add(record: LabelRecord): void;
|
|
2395
|
+
/** One aggregate per reason/role/path, never an allocation for every omitted tick. */
|
|
2396
|
+
omit(record: Omit<SuppressedLabel, 'count'> & {
|
|
2397
|
+
count?: number;
|
|
2398
|
+
}): void;
|
|
2399
|
+
clear(): void;
|
|
2400
|
+
/** Records matching any of `roles`. */
|
|
2401
|
+
byRole(...roles: LabelRole[]): LabelRecord[];
|
|
2402
|
+
}
|
|
2403
|
+
/**
|
|
2404
|
+
* Record a label when a ledger is present.
|
|
2405
|
+
*
|
|
2406
|
+
* Renderers reach the ledger through a `Surface`, and some callers (headless
|
|
2407
|
+
* targets, unit-test doubles) hand-roll a partial surface object, so the ledger
|
|
2408
|
+
* is treated as best-effort: diagnostics degrade rather than the render failing.
|
|
2409
|
+
*/
|
|
2410
|
+
declare function recordLabel(ledger: LabelLedger | undefined, record: LabelRecord): void;
|
|
2411
|
+
/** Record text painted by a native canvas helper that does not use overlay chrome. */
|
|
2412
|
+
declare function recordCanvasLabel(ledger: LabelLedger | undefined, command: CanvasTextCmd, options?: {
|
|
2413
|
+
role?: LabelRole;
|
|
2414
|
+
background?: string;
|
|
2415
|
+
fullText?: string;
|
|
2416
|
+
budget?: number;
|
|
2417
|
+
path?: string;
|
|
2418
|
+
clip?: Rect;
|
|
2419
|
+
}): void;
|
|
2420
|
+
/**
|
|
2421
|
+
* Snapshot already-mounted DOM text; no retained nodes. Missing DOM layout
|
|
2422
|
+
* (e.g. jsdom) returns false rather than inventing measured text geometry.
|
|
2423
|
+
*/
|
|
2424
|
+
declare function recordDomLabels(ledger: LabelLedger | undefined, host: HTMLElement, origin: {
|
|
2425
|
+
x: number;
|
|
2426
|
+
y: number;
|
|
2427
|
+
}, background?: string, role?: LabelRole, path?: string, scrollViewport?: Rect): boolean;
|
|
2428
|
+
/**
|
|
2429
|
+
* Shorten `text` so it fits `budget` pixels, reporting whether it had to be cut.
|
|
2430
|
+
* A missing or non-positive budget means "unconstrained" — the caller had no
|
|
2431
|
+
* room to declare, so the text is left intact rather than blanked.
|
|
2432
|
+
*/
|
|
2433
|
+
declare function fitLabel(text: string, budget: number | undefined, font: string): {
|
|
2434
|
+
text: string;
|
|
2435
|
+
truncated: boolean;
|
|
2436
|
+
};
|
|
2437
|
+
/**
|
|
2438
|
+
* Resolve an overlay text node's layout into an axis-aligned bounding box.
|
|
2439
|
+
*
|
|
2440
|
+
* Reuses {@link overlayTextToCanvasCmd} so the box lands exactly where the glyphs
|
|
2441
|
+
* do, including the `translateX(-50%)` / `translateY(-50%)` / `rotate(-45deg)`
|
|
2442
|
+
* transform vocabulary the DOM path uses.
|
|
2443
|
+
*/
|
|
2444
|
+
declare function labelBox(o: OverlayTextOpts, font: string): {
|
|
2445
|
+
box: Rect;
|
|
2446
|
+
angle: number;
|
|
2447
|
+
};
|
|
2448
|
+
/** True when two boxes overlap by more than `tolerance` pixels on both axes. */
|
|
2449
|
+
declare function boxesOverlap(a: Rect, b: Rect, tolerance?: number): boolean;
|
|
2450
|
+
/** Test the text rectangles, not just the overlapping envelopes of rotated labels. */
|
|
2451
|
+
declare function labelsOverlap(a: LabelRecord, b: LabelRecord, tolerance?: number): boolean;
|
|
2452
|
+
|
|
2453
|
+
type EvidenceCoverage = 'complete' | 'partial' | 'none';
|
|
2454
|
+
type MarkKind = 'point' | 'line-run' | 'area-region' | 'bar' | 'box' | 'slice' | 'cell' | 'region' | 'node' | 'link' | 'stage' | 'tile' | 'comparison' | 'value' | 'control';
|
|
2455
|
+
type DataRepresentation = 'rows' | 'aggregate' | 'derived' | 'literal' | 'control' | 'unknown';
|
|
2456
|
+
interface LogicalMarkCount {
|
|
2457
|
+
drawn: number;
|
|
2458
|
+
visible: number;
|
|
2459
|
+
}
|
|
2460
|
+
/** An actually painted perimeter that keeps a pale filled mark identifiable. */
|
|
2461
|
+
interface MarkBoundary {
|
|
2462
|
+
color: string;
|
|
2463
|
+
opacity: number;
|
|
2464
|
+
width: number;
|
|
2465
|
+
}
|
|
2466
|
+
/** A bounded sample of actual primary mark paints, not theme palette guesses. */
|
|
2467
|
+
interface PaintEvidence {
|
|
2468
|
+
color: string;
|
|
2469
|
+
opacity: number;
|
|
2470
|
+
/** Supplied nominal backdrop; not a pixel-level analysis of overlapping marks. */
|
|
2471
|
+
background?: string;
|
|
2472
|
+
count: number;
|
|
2473
|
+
/** Intentional cross-highlight dimming is recorded, but not a contrast defect. */
|
|
2474
|
+
intentionalDim?: boolean;
|
|
2475
|
+
boundary?: MarkBoundary;
|
|
2476
|
+
}
|
|
2477
|
+
/**
|
|
2478
|
+
* Lightweight facts from a draw pass. Logical marks are not canvas paint calls:
|
|
2479
|
+
* a box/whisker is one box, a pie category one slice, and a line one finite run.
|
|
2480
|
+
* Points additionally painted on a line count separately; `segments` counts its
|
|
2481
|
+
* adjacent finite observations, not curve tessellation. An area band includes its
|
|
2482
|
+
* boundary stroke; a line's optional fill is decoration, not an extra mark.
|
|
2483
|
+
* A table counts mounted/painted body cells, not rows; a matrix counts resolved
|
|
2484
|
+
* aggregate measure cells (not row headers or missing-value placeholders). Value cards count
|
|
2485
|
+
* one resolved primary value (including a zero readout); dropdown/search/range
|
|
2486
|
+
* count one composite control and lists count their mounted/painted options.
|
|
2487
|
+
* Axes, legends, annotations and trendline decorations are not data marks.
|
|
2488
|
+
*
|
|
2489
|
+
* `visible` means finite positive primitive bounds intersect the renderer's clip
|
|
2490
|
+
* at nonzero opacity. It does not promise unoccluded pixels or distinguishability.
|
|
2491
|
+
* Counts describe the final static pass, not intermediate animation frames.
|
|
2492
|
+
*/
|
|
2493
|
+
interface RenderEvidence {
|
|
2494
|
+
marks: LogicalMarkCount & {
|
|
2495
|
+
byKind: Partial<Record<MarkKind, LogicalMarkCount>>;
|
|
2496
|
+
segments: number;
|
|
2497
|
+
};
|
|
2498
|
+
data: {
|
|
2499
|
+
inputRows: number;
|
|
2500
|
+
representation: DataRepresentation;
|
|
2501
|
+
/** Source rows accounted for, including aggregation; absent if not established. */
|
|
2502
|
+
representedRows?: number;
|
|
2503
|
+
omittedRows?: number;
|
|
2504
|
+
/** Valid observations not individually drawn after draw-side reduction; zero is explicit when established. */
|
|
2505
|
+
reducedRows?: number;
|
|
2506
|
+
/** Rows retained behind an intentional interactive scroll/window, not discarded; zero is explicit when established. */
|
|
2507
|
+
deferredRows?: number;
|
|
2508
|
+
};
|
|
2509
|
+
geometry: {
|
|
2510
|
+
method: 'primitive-bounds';
|
|
2511
|
+
bounds?: Rect;
|
|
2512
|
+
nonFinite: number;
|
|
2513
|
+
clipped: number;
|
|
2514
|
+
};
|
|
2515
|
+
colors: {
|
|
2516
|
+
samples: PaintEvidence[];
|
|
2517
|
+
truncated: boolean;
|
|
2518
|
+
};
|
|
2519
|
+
coverage: {
|
|
2520
|
+
marks: EvidenceCoverage;
|
|
2521
|
+
data: EvidenceCoverage;
|
|
2522
|
+
geometry: EvidenceCoverage;
|
|
2523
|
+
colors: EvidenceCoverage;
|
|
2524
|
+
text: EvidenceCoverage;
|
|
2525
|
+
textContrast: EvidenceCoverage;
|
|
2526
|
+
};
|
|
2527
|
+
labels?: {
|
|
2528
|
+
drawn: number;
|
|
2529
|
+
suppressed: number;
|
|
2530
|
+
requiredSuppressed: number;
|
|
2531
|
+
contrastChecked: number;
|
|
2532
|
+
};
|
|
2533
|
+
}
|
|
2534
|
+
/** Counters and bounded paint styles only: no retained point/shape scene graph. */
|
|
2535
|
+
declare class EvidenceLedger {
|
|
2536
|
+
private value;
|
|
2537
|
+
private paints;
|
|
2538
|
+
private alphas;
|
|
2539
|
+
private boundsOverflow;
|
|
2540
|
+
private viewport;
|
|
2541
|
+
background?: string;
|
|
2542
|
+
reset(size: Size, inputRows?: number, background?: string, clip?: Rect): void;
|
|
2543
|
+
visibleViewport(): Rect;
|
|
2544
|
+
/** Call even on an early empty return, so zero marks is observed, not guessed. */
|
|
2545
|
+
begin(representation?: DataRepresentation): void;
|
|
2546
|
+
/** Only supply source-row accounting when the renderer can establish it. */
|
|
2547
|
+
data(representedRows: number, representation?: DataRepresentation, reducedRows?: number, deferredRows?: number): void;
|
|
2548
|
+
unknownData(representation: DataRepresentation): void;
|
|
2549
|
+
partial(...areas: Array<keyof RenderEvidence['coverage']>): void;
|
|
2550
|
+
/** Record a logical mark at its paint site; positional args avoid per-point objects. */
|
|
2551
|
+
mark(kind: MarkKind, x: number, y: number, width: number, height: number, color?: string, opacity?: number, clip?: Rect, count?: number, background?: string | undefined, intentionalDim?: boolean, boundary?: MarkBoundary): void;
|
|
2552
|
+
segments(count: number): void;
|
|
2553
|
+
private paint;
|
|
2554
|
+
snapshot(): RenderEvidence;
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2238
2557
|
/**
|
|
2239
2558
|
* A rendering Surface mounted inside a user-provided container. It owns a stack
|
|
2240
2559
|
* of layers:
|
|
@@ -2263,9 +2582,19 @@ declare class Surface {
|
|
|
2263
2582
|
* Defaults to false (browser).
|
|
2264
2583
|
*/
|
|
2265
2584
|
headless: boolean;
|
|
2585
|
+
/**
|
|
2586
|
+
* Every overlay label drawn during the current pass, recorded by the text
|
|
2587
|
+
* helpers in `axes/draw.ts` and `charts/chrome.ts`. The render report reads it
|
|
2588
|
+
* to detect clipped and colliding text for any chart type, cartesian or not.
|
|
2589
|
+
*/
|
|
2590
|
+
readonly labels: LabelLedger;
|
|
2591
|
+
/** Logical marks and bounded geometry/paint counters for the current pass. */
|
|
2592
|
+
readonly evidence: EvidenceLedger;
|
|
2593
|
+
/** DOM visuals may refresh measurements after scrolling or an in-place control change. */
|
|
2594
|
+
collectEvidence?: () => void;
|
|
2266
2595
|
constructor(container: HTMLElement);
|
|
2267
2596
|
resize(width: number, height: number, dpr?: number): void;
|
|
2268
|
-
/** Clear both canvas layers
|
|
2597
|
+
/** Clear both canvas layers, empty the HTML overlay, and reset the ledger. */
|
|
2269
2598
|
clear(): void;
|
|
2270
2599
|
/** Remove all DOM created by this Surface. */
|
|
2271
2600
|
destroy(): void;
|
|
@@ -2485,22 +2814,167 @@ interface RegressionFit {
|
|
|
2485
2814
|
*/
|
|
2486
2815
|
declare function linearRegression(xs: readonly number[], ys: readonly number[]): RegressionFit | null;
|
|
2487
2816
|
|
|
2817
|
+
/** The original, compact column profile contract. */
|
|
2488
2818
|
interface ColumnProfile {
|
|
2489
2819
|
field: string;
|
|
2490
|
-
type:
|
|
2820
|
+
type: FieldType;
|
|
2821
|
+
/** Distinct existing grouping keys, including the shared null/undefined/"" key. */
|
|
2491
2822
|
cardinality: number;
|
|
2492
2823
|
}
|
|
2824
|
+
interface NumericEvidence {
|
|
2825
|
+
/** Non-missing values accepted by the existing numeric coercion. */
|
|
2826
|
+
valid: number;
|
|
2827
|
+
/** Non-missing values not accepted by numeric coercion. */
|
|
2828
|
+
invalid: number;
|
|
2829
|
+
numbers: number;
|
|
2830
|
+
numericStrings: number;
|
|
2831
|
+
booleans: number;
|
|
2832
|
+
dates: number;
|
|
2833
|
+
nonFinite: number;
|
|
2834
|
+
negative: number;
|
|
2835
|
+
zero: number;
|
|
2836
|
+
positive: number;
|
|
2837
|
+
range: [number, number] | null;
|
|
2838
|
+
}
|
|
2839
|
+
interface TemporalEvidence {
|
|
2840
|
+
/** Includes numeric epochs and supported date strings, not just inferred dates. */
|
|
2841
|
+
valid: number;
|
|
2842
|
+
invalid: number;
|
|
2843
|
+
dateObjects: number;
|
|
2844
|
+
strings: number;
|
|
2845
|
+
numericEpochs: number;
|
|
2846
|
+
/** Epoch milliseconds; uses the same local-date parsing as rendering. */
|
|
2847
|
+
range: [number, number] | null;
|
|
2848
|
+
}
|
|
2849
|
+
type TypeAmbiguity = 'mixed-types' | 'numeric-identifier' | 'numeric-date' | 'date-order' | 'invalid-temporal';
|
|
2850
|
+
interface DetailedColumnProfile extends ColumnProfile {
|
|
2851
|
+
/** All counts describe inspected rows, not estimates of uninspected rows. */
|
|
2852
|
+
inspectedRows: number;
|
|
2853
|
+
/** Presence counts keys even when their value is null or undefined. */
|
|
2854
|
+
present: number;
|
|
2855
|
+
absent: number;
|
|
2856
|
+
/** Absent, null, undefined, and blank strings (never numeric zero). */
|
|
2857
|
+
missing: number;
|
|
2858
|
+
/** Non-missing values usable under `type`, or the explicitly requested type. */
|
|
2859
|
+
valid: number;
|
|
2860
|
+
invalid: number;
|
|
2861
|
+
/** Objects/arrays are structural containers, not scalar chart values. */
|
|
2862
|
+
structured: number;
|
|
2863
|
+
expectedType?: FieldType;
|
|
2864
|
+
nonMissingCardinality: number;
|
|
2865
|
+
quantitative: NumericEvidence;
|
|
2866
|
+
temporal: TemporalEvidence;
|
|
2867
|
+
/** Counts are exact, but legacy type inference inspects at most 200 values. */
|
|
2868
|
+
inference: {
|
|
2869
|
+
inspectedValues: number;
|
|
2870
|
+
exact: boolean;
|
|
2871
|
+
};
|
|
2872
|
+
ambiguity: TypeAmbiguity[];
|
|
2873
|
+
}
|
|
2874
|
+
interface ProfileField {
|
|
2875
|
+
field: string;
|
|
2876
|
+
/** An explicit encoding type affects validity evidence, never inferred `type`. */
|
|
2877
|
+
type?: FieldType;
|
|
2878
|
+
}
|
|
2879
|
+
interface ProfileEncoding {
|
|
2880
|
+
/** Fields that jointly identify an encoded position, cell, or comparison pair. */
|
|
2881
|
+
keys: readonly (string | ProfileField)[];
|
|
2882
|
+
/** Required values at that position; omitted types use the inferred type. */
|
|
2883
|
+
values?: readonly (string | ProfileField)[];
|
|
2884
|
+
/** Ask about missing combinations of observed keys; never infers a time cadence. */
|
|
2885
|
+
complete?: boolean;
|
|
2886
|
+
}
|
|
2887
|
+
interface ProfileOptions {
|
|
2888
|
+
/** Defaults to all discovered fields, including nested/dotted paths. */
|
|
2889
|
+
fields?: readonly (string | ProfileField)[];
|
|
2890
|
+
/** Optional deterministic, evenly spaced row sample. Default: inspect all rows. */
|
|
2891
|
+
sampleSize?: number;
|
|
2892
|
+
encoding?: ProfileEncoding;
|
|
2893
|
+
}
|
|
2894
|
+
interface DataFinding {
|
|
2895
|
+
code: string;
|
|
2896
|
+
severity: 'info' | 'warning';
|
|
2897
|
+
message: string;
|
|
2898
|
+
fields?: string[];
|
|
2899
|
+
count?: number;
|
|
2900
|
+
/** Meaning-affecting choices are disclosed, never applied by profiling. */
|
|
2901
|
+
requiresDecision: boolean;
|
|
2902
|
+
}
|
|
2903
|
+
interface EncodingProfile {
|
|
2904
|
+
keys: string[];
|
|
2905
|
+
/** Rows with usable key fields, independent of their measure validity. */
|
|
2906
|
+
keyRows: number;
|
|
2907
|
+
/** Distinct observed key combinations, including those with unusable measures. */
|
|
2908
|
+
observedKeys: number;
|
|
2909
|
+
usableRows: number;
|
|
2910
|
+
/** Missing takes precedence over invalid so these row counts are disjoint. */
|
|
2911
|
+
missingRows: number;
|
|
2912
|
+
invalidRows: number;
|
|
2913
|
+
/** Distinct keys with a complete, usable observation. */
|
|
2914
|
+
distinctKeys: number;
|
|
2915
|
+
/** Number of encoded key groups with more than one usable observation. */
|
|
2916
|
+
duplicateKeys: number;
|
|
2917
|
+
/** Additional usable observations beyond the first at each key. */
|
|
2918
|
+
duplicateRows: number;
|
|
2919
|
+
/** Only supplied for exact evidence and an explicit `complete` request. */
|
|
2920
|
+
possibleCombinations?: number;
|
|
2921
|
+
missingCombinations?: number;
|
|
2922
|
+
}
|
|
2923
|
+
interface DatasetProfile {
|
|
2924
|
+
rowCount: number;
|
|
2925
|
+
invalidRows: number;
|
|
2926
|
+
sampling: {
|
|
2927
|
+
mode: 'exact' | 'sampled';
|
|
2928
|
+
inspectedRows: number;
|
|
2929
|
+
totalRows: number;
|
|
2930
|
+
};
|
|
2931
|
+
columns: DetailedColumnProfile[];
|
|
2932
|
+
encoding?: EncodingProfile;
|
|
2933
|
+
findings: DataFinding[];
|
|
2934
|
+
}
|
|
2935
|
+
/**
|
|
2936
|
+
* Inspect data without cleaning, grouping, inferring units, or changing types.
|
|
2937
|
+
* Numeric/date evidence uses the same coercions as rendering. Explicit encoding
|
|
2938
|
+
* keys opt into duplicate/completeness evidence; no grid or cadence is invented.
|
|
2939
|
+
*/
|
|
2940
|
+
declare function profileData(data: readonly Datum[], options?: ProfileOptions): DatasetProfile;
|
|
2941
|
+
/** Backward-compatible column list with additive, detailed evidence. */
|
|
2942
|
+
declare function profileColumns(data: readonly Datum[], options?: ProfileOptions): DetailedColumnProfile[];
|
|
2943
|
+
|
|
2944
|
+
interface RecommendationEvidence {
|
|
2945
|
+
columns: DetailedColumnProfile[];
|
|
2946
|
+
sampling: DatasetProfile['sampling'];
|
|
2947
|
+
encoding?: EncodingProfile;
|
|
2948
|
+
intent?: RecommendOptions['intent'];
|
|
2949
|
+
targetSize?: Size;
|
|
2950
|
+
}
|
|
2493
2951
|
interface RecommendedChart {
|
|
2494
2952
|
spec: ChartSpec;
|
|
2495
2953
|
score: number;
|
|
2496
2954
|
rationale: string;
|
|
2955
|
+
/** A valid candidate can still need an explicit meaning/field decision. */
|
|
2956
|
+
status?: 'ready' | 'needs-decision';
|
|
2957
|
+
findings?: DataFinding[];
|
|
2958
|
+
evidence?: RecommendationEvidence;
|
|
2959
|
+
alternatives?: ChartType[];
|
|
2497
2960
|
}
|
|
2498
2961
|
interface RecommendOptions {
|
|
2499
2962
|
intent?: 'trend' | 'comparison' | 'distribution' | 'relationship' | 'composition';
|
|
2500
2963
|
maxResults?: number;
|
|
2964
|
+
/** Layout guidance only; no data is filtered or grouped to fit this size. */
|
|
2965
|
+
targetSize?: Size;
|
|
2501
2966
|
}
|
|
2502
|
-
|
|
2503
|
-
|
|
2967
|
+
interface RecommendationResult {
|
|
2968
|
+
recommendations: RecommendedChart[];
|
|
2969
|
+
profile: DatasetProfile;
|
|
2970
|
+
findings: DataFinding[];
|
|
2971
|
+
status: 'ready' | 'needs-decision' | 'no-candidate';
|
|
2972
|
+
}
|
|
2973
|
+
/** Return ranked valid candidates, without applying any proposed data decisions. */
|
|
2974
|
+
declare function recommendChart(data: readonly Datum[], opts: RecommendOptions & {
|
|
2975
|
+
detailed: true;
|
|
2976
|
+
}): RecommendationResult;
|
|
2977
|
+
declare function recommendChart(data: readonly Datum[], opts?: RecommendOptions): RecommendedChart[];
|
|
2504
2978
|
|
|
2505
2979
|
/** Environment helpers — safe in both browser and Node (SSR/test). */
|
|
2506
2980
|
declare const isBrowser: boolean;
|
|
@@ -2529,80 +3003,14 @@ interface BackingSize {
|
|
|
2529
3003
|
declare function computeBackingSize(width: number, height: number, dpr: number): BackingSize;
|
|
2530
3004
|
|
|
2531
3005
|
/** Tiny DOM helpers (browser-only). */
|
|
3006
|
+
|
|
3007
|
+
/** Space available to a child, excluding host padding (client dimensions already exclude borders). */
|
|
3008
|
+
declare function measureContentSize(el: HTMLElement): Size;
|
|
2532
3009
|
declare function setStyle(el: HTMLElement, style: Partial<CSSStyleDeclaration>): void;
|
|
2533
3010
|
declare function createDiv(className?: string, style?: Partial<CSSStyleDeclaration>): HTMLDivElement;
|
|
2534
3011
|
/** Absolute-position a layer to fill its positioned parent. */
|
|
2535
3012
|
declare const fillParentStyle: Partial<CSSStyleDeclaration>;
|
|
2536
3013
|
|
|
2537
|
-
/**
|
|
2538
|
-
* Canvas painting for chart "overlay" text (axis labels, titles, legends,
|
|
2539
|
-
* annotation labels). In the browser this text lives in a crisp, selectable
|
|
2540
|
-
* HTML overlay; headless (no DOM) there is no overlay, so the very same text is
|
|
2541
|
-
* painted onto the marks canvas with these helpers.
|
|
2542
|
-
*
|
|
2543
|
-
* The geometry is shared: call sites compute one set of positions and either
|
|
2544
|
-
* realise them as absolutely-positioned DOM nodes (browser) or feed them here
|
|
2545
|
-
* (headless). The transform/width vocabulary the DOM path uses
|
|
2546
|
-
* (`translateX(-50%)`, `translateY(-50%)`, `translate(-50%,-50%) rotate(±90deg)`,
|
|
2547
|
-
* box `width` + `align`) maps deterministically onto canvas
|
|
2548
|
-
* `textAlign`/`textBaseline`/rotation, so both paths land the same pixels.
|
|
2549
|
-
*/
|
|
2550
|
-
interface CanvasPillStyle {
|
|
2551
|
-
background: string;
|
|
2552
|
-
border?: string;
|
|
2553
|
-
radius?: number;
|
|
2554
|
-
padX?: number;
|
|
2555
|
-
padY?: number;
|
|
2556
|
-
}
|
|
2557
|
-
interface CanvasTextCmd {
|
|
2558
|
-
/** Anchor x (interpreted per `align`). */
|
|
2559
|
-
x: number;
|
|
2560
|
-
/** Anchor y (interpreted per `baseline`). */
|
|
2561
|
-
y: number;
|
|
2562
|
-
text: string;
|
|
2563
|
-
/** CSS font shorthand (authoritative — already encodes size + weight). */
|
|
2564
|
-
font: string;
|
|
2565
|
-
color: string;
|
|
2566
|
-
/** Font pixel size, used to size the optional pill. */
|
|
2567
|
-
size: number;
|
|
2568
|
-
align?: CanvasTextAlign;
|
|
2569
|
-
baseline?: CanvasTextBaseline;
|
|
2570
|
-
/** Rotation about (x, y), in radians. */
|
|
2571
|
-
rotate?: number;
|
|
2572
|
-
opacity?: number;
|
|
2573
|
-
/** Draw a rounded "pill"/badge behind the text (solid fill + hairline border). */
|
|
2574
|
-
pill?: CanvasPillStyle;
|
|
2575
|
-
}
|
|
2576
|
-
/** Paint a single text command onto a 2D context. Self-contained (save/restore). */
|
|
2577
|
-
declare function paintCanvasText(ctx: CanvasRenderingContext2D, c: CanvasTextCmd): void;
|
|
2578
|
-
/** Option shape shared by the DOM text helpers (axes + chrome). */
|
|
2579
|
-
interface OverlayTextOpts {
|
|
2580
|
-
left: number;
|
|
2581
|
-
top: number;
|
|
2582
|
-
width?: number;
|
|
2583
|
-
text: string;
|
|
2584
|
-
color: string;
|
|
2585
|
-
size: number;
|
|
2586
|
-
align?: 'left' | 'center' | 'right';
|
|
2587
|
-
transform?: string;
|
|
2588
|
-
opacity?: number;
|
|
2589
|
-
pill?: CanvasPillStyle;
|
|
2590
|
-
}
|
|
2591
|
-
/**
|
|
2592
|
-
* Translate an absolutely-positioned overlay text node (left/top/width/align +
|
|
2593
|
-
* a CSS `transform` from the known vocabulary) into the equivalent canvas
|
|
2594
|
-
* command. Keeps the headless output pixel-aligned with the browser overlay.
|
|
2595
|
-
*/
|
|
2596
|
-
declare function overlayTextToCanvasCmd(o: OverlayTextOpts, font: string): CanvasTextCmd;
|
|
2597
|
-
type LegendSymbol = 'square' | 'circle' | 'line';
|
|
2598
|
-
/** Total horizontal footprint of a legend swatch (square/circle = 11, line = 14). */
|
|
2599
|
-
declare function legendSwatchWidth(symbol: LegendSymbol | undefined, swatch?: number): number;
|
|
2600
|
-
/**
|
|
2601
|
-
* Paint a legend swatch onto canvas, vertically centered on `midY`. Mirrors the
|
|
2602
|
-
* DOM swatch (square/circle 11px, line 14×3px).
|
|
2603
|
-
*/
|
|
2604
|
-
declare function paintLegendSwatch(ctx: CanvasRenderingContext2D, x: number, midY: number, symbol: LegendSymbol | undefined, color: string, swatch?: number): void;
|
|
2605
|
-
|
|
2606
3014
|
/**
|
|
2607
3015
|
* Text measurement using a shared offscreen canvas context. Falls back to a
|
|
2608
3016
|
* rough heuristic when no canvas is available (SSR/test). In a non-DOM
|
|
@@ -2855,6 +3263,16 @@ interface ValidationError {
|
|
|
2855
3263
|
kind: 'chartType' | 'enum' | 'field' | 'channel';
|
|
2856
3264
|
candidates: string[];
|
|
2857
3265
|
};
|
|
3266
|
+
/** A data/meaning choice, rather than a safe automatic correction. */
|
|
3267
|
+
requiresDecision?: boolean;
|
|
3268
|
+
/** Exact, inspected field counts for data-quality findings. */
|
|
3269
|
+
evidence?: {
|
|
3270
|
+
inspectedRows: number;
|
|
3271
|
+
present: number;
|
|
3272
|
+
missing: number;
|
|
3273
|
+
valid: number;
|
|
3274
|
+
invalid: number;
|
|
3275
|
+
};
|
|
2858
3276
|
}
|
|
2859
3277
|
interface ValidationResult {
|
|
2860
3278
|
valid: boolean;
|
|
@@ -2907,11 +3325,30 @@ declare function lintSpec(spec: ChartSpec): LintFinding[];
|
|
|
2907
3325
|
* the right correction is unclear, the error is left for the agent to resolve.
|
|
2908
3326
|
*/
|
|
2909
3327
|
|
|
3328
|
+
/** How aggressively {@link repairSpec} may infer missing or misspelled parts. */
|
|
3329
|
+
interface RepairOptions {
|
|
3330
|
+
/**
|
|
3331
|
+
* Repair level. `'safe'` preserves the historical behavior and only applies
|
|
3332
|
+
* validator-provided fixes; `'data'` may additionally infer unambiguous fixes
|
|
3333
|
+
* from the spec's own data array.
|
|
3334
|
+
*/
|
|
3335
|
+
level?: 'safe' | 'data';
|
|
3336
|
+
}
|
|
3337
|
+
/** A patch operation plus the human-readable reason it was considered safe. */
|
|
3338
|
+
interface AppliedRepair {
|
|
3339
|
+
/** The JSON Patch operation that was applied. */
|
|
3340
|
+
op: JsonPatchOp;
|
|
3341
|
+
/** Short explanation of why this repair was applied. */
|
|
3342
|
+
rationale: string;
|
|
3343
|
+
}
|
|
3344
|
+
/** Result returned by {@link repairSpec}. */
|
|
2910
3345
|
interface RepairResult {
|
|
2911
3346
|
/** The (possibly) corrected spec — a new object; the input is never mutated. */
|
|
2912
3347
|
spec: unknown;
|
|
2913
3348
|
/** Patch operations that were applied, in order. Empty when nothing changed. */
|
|
2914
3349
|
applied: JsonPatchOp[];
|
|
3350
|
+
/** Applied patch operations paired with their repair rationales. */
|
|
3351
|
+
appliedDetails: AppliedRepair[];
|
|
2915
3352
|
/**
|
|
2916
3353
|
* Structural errors that remain after repair. `remaining.length === 0` means
|
|
2917
3354
|
* the repaired spec is valid. Advisory lint warnings are not counted here.
|
|
@@ -2924,7 +3361,7 @@ interface RepairResult {
|
|
|
2924
3361
|
* correcting the chart `type` changes which channels are required). Pure: the
|
|
2925
3362
|
* input spec is deep-cloned before any patch is applied.
|
|
2926
3363
|
*/
|
|
2927
|
-
declare function repairSpec(spec: unknown): RepairResult;
|
|
3364
|
+
declare function repairSpec(spec: unknown, options?: RepairOptions): RepairResult;
|
|
2928
3365
|
|
|
2929
3366
|
/**
|
|
2930
3367
|
* Resolve a spec's `sketch` option into concrete, fully-defaulted knobs for the
|
|
@@ -2947,6 +3384,67 @@ interface ResolvedSketch extends RoughStyle {
|
|
|
2947
3384
|
*/
|
|
2948
3385
|
declare function resolveSketch(spec: ChartSpec): ResolvedSketch | null;
|
|
2949
3386
|
|
|
3387
|
+
interface FieldRoleInfo {
|
|
3388
|
+
/** Spec path, including [] for repeated definitions. */
|
|
3389
|
+
path: string;
|
|
3390
|
+
role: 'position' | 'measure' | 'category' | 'series' | 'size' | 'time' | 'target' | 'geography' | 'filter' | 'text';
|
|
3391
|
+
types: FieldType[];
|
|
3392
|
+
required: boolean;
|
|
3393
|
+
}
|
|
3394
|
+
interface DataRequirement {
|
|
3395
|
+
code: string;
|
|
3396
|
+
fields: string[];
|
|
3397
|
+
description: string;
|
|
3398
|
+
}
|
|
3399
|
+
interface CardinalityGuidance {
|
|
3400
|
+
fields: string[];
|
|
3401
|
+
minimum?: number;
|
|
3402
|
+
maximum?: number;
|
|
3403
|
+
recommendedMaximum?: number;
|
|
3404
|
+
unique?: boolean;
|
|
3405
|
+
description: string;
|
|
3406
|
+
}
|
|
3407
|
+
interface AggregationCapability {
|
|
3408
|
+
mode: 'rows' | 'aggregate' | 'bin' | 'distribution' | 'value' | 'pivot' | 'lookup' | 'filter-domain' | 'running-total';
|
|
3409
|
+
by: string[];
|
|
3410
|
+
defaultOp?: string;
|
|
3411
|
+
/** Spec path controlling the operation, only when the renderer consumes it. */
|
|
3412
|
+
operationPath?: string;
|
|
3413
|
+
caveats: string[];
|
|
3414
|
+
}
|
|
3415
|
+
interface ChartCapabilities {
|
|
3416
|
+
fieldRoles: FieldRoleInfo[];
|
|
3417
|
+
requirements: DataRequirement[];
|
|
3418
|
+
cardinality: CardinalityGuidance[];
|
|
3419
|
+
aggregation: AggregationCapability;
|
|
3420
|
+
features: string[];
|
|
3421
|
+
}
|
|
3422
|
+
/** Agent-facing metadata for one chart family and its starter template. */
|
|
3423
|
+
interface ChartTypeInfo {
|
|
3424
|
+
/** The chart type string accepted by {@link starterSpec}. */
|
|
3425
|
+
type: ChartType;
|
|
3426
|
+
/** A one-line description of when to use this chart type. */
|
|
3427
|
+
purpose: string;
|
|
3428
|
+
/** Required channels, fields, or top-level properties needed for validity. */
|
|
3429
|
+
requiredChannels: string[];
|
|
3430
|
+
/** A minimal valid starter spec for this chart type. */
|
|
3431
|
+
example: ChartSpec;
|
|
3432
|
+
/** Additive machine-readable authoring guidance, populated by listChartTypes. */
|
|
3433
|
+
capabilities?: ChartCapabilities;
|
|
3434
|
+
}
|
|
3435
|
+
/**
|
|
3436
|
+
* Return a minimal valid starter spec for a chart type, including placeholder
|
|
3437
|
+
* inline data whose fields match the spec's encodings and field references.
|
|
3438
|
+
*/
|
|
3439
|
+
declare function starterSpec(type: ChartType): ChartSpec;
|
|
3440
|
+
/**
|
|
3441
|
+
* List every registered chart/slicer type, machine-readable data requirements
|
|
3442
|
+
* and capabilities, and a ready-to-render starter. Guidance never transforms data.
|
|
3443
|
+
*/
|
|
3444
|
+
declare function listChartTypes(): (ChartTypeInfo & {
|
|
3445
|
+
capabilities: ChartCapabilities;
|
|
3446
|
+
})[];
|
|
3447
|
+
|
|
2950
3448
|
/**
|
|
2951
3449
|
* Number formatting — a pragmatic subset of the d3-format mini-language, enough
|
|
2952
3450
|
* for agent-authored specs without a runtime dependency.
|
|
@@ -2970,6 +3468,8 @@ interface NumberFormatSpec {
|
|
|
2970
3468
|
precision?: number;
|
|
2971
3469
|
type?: 'f' | '%' | 's' | 'd' | 'e' | 'g' | '';
|
|
2972
3470
|
}
|
|
3471
|
+
/** Whether a hint uses the supported numeric mini-language rather than date tokens. */
|
|
3472
|
+
declare function isNumberFormat(spec: string): boolean;
|
|
2973
3473
|
declare function parseNumberFormat(spec: string): NumberFormatSpec;
|
|
2974
3474
|
/** Format a number according to a parsed or string spec. */
|
|
2975
3475
|
declare function formatNumber(value: number, spec?: string | NumberFormatSpec): string;
|
|
@@ -2999,6 +3499,8 @@ declare function prettyDate(value: Date | number): string;
|
|
|
2999
3499
|
* strings. When a `%` (date) hint is supplied for such a string we parse it and
|
|
3000
3500
|
* format as a date, so e.g. a table column `{ format: '%b %e, %Y' }` over
|
|
3001
3501
|
* `"2024-05-02"` renders `May 2, 2024` rather than the raw string.
|
|
3502
|
+
* An explicit numeric hint also formats numeric strings; without a hint strings
|
|
3503
|
+
* stay intact, including identifiers with leading zeros.
|
|
3002
3504
|
*/
|
|
3003
3505
|
declare function formatValue(value: unknown, hint?: string): string;
|
|
3004
3506
|
/**
|
|
@@ -3073,7 +3575,15 @@ interface FrameInput {
|
|
|
3073
3575
|
yAxis?: AxisInput;
|
|
3074
3576
|
/** Secondary (right) y-axis for dual-axis combo charts; reserves a right gutter. */
|
|
3075
3577
|
y2Axis?: AxisInput;
|
|
3076
|
-
|
|
3578
|
+
/** Internal caption spacing for small-multiple panels; normal charts use density defaults. */
|
|
3579
|
+
titleGap?: number;
|
|
3580
|
+
/** Minimum mark extent before dropping chrome; compact sparklines may use less than 24px. */
|
|
3581
|
+
minimumPlotSize?: number;
|
|
3582
|
+
}
|
|
3583
|
+
/** Resolved chrome density, derived only from the available layout size. */
|
|
3584
|
+
type FrameDensity = 'comfortable' | 'compact';
|
|
3585
|
+
/** Chrome rungs removed to keep a viable mark area in very small containers. */
|
|
3586
|
+
type DroppedChrome = 'subtitle' | 'axis-titles' | 'legend' | 'title';
|
|
3077
3587
|
interface Frame {
|
|
3078
3588
|
width: number;
|
|
3079
3589
|
height: number;
|
|
@@ -3088,6 +3598,36 @@ interface Frame {
|
|
|
3088
3598
|
legendPosition?: LegendPosition;
|
|
3089
3599
|
/** Resolved x tick-label rotation in degrees (0 = horizontal). */
|
|
3090
3600
|
xLabelAngle: number;
|
|
3601
|
+
/**
|
|
3602
|
+
* Pixel budget one x tick label may occupy along its own text direction.
|
|
3603
|
+
* Rotated labels are capped so long names can't swallow the plot; renderers
|
|
3604
|
+
* ellipsize to this rather than overflowing the reserved band.
|
|
3605
|
+
*/
|
|
3606
|
+
xLabelMaxWidth: number;
|
|
3607
|
+
/** Pixel budget for a left-gutter tick label, capped so one outlier value
|
|
3608
|
+
* can't consume the plot. Renderers ellipsize to it. */
|
|
3609
|
+
yLabelMaxWidth: number;
|
|
3610
|
+
/** Matching text budget for a secondary right-hand value axis. */
|
|
3611
|
+
y2LabelMaxWidth?: number;
|
|
3612
|
+
/** Legend items that did not fit and were dropped from {@link legendItems}. */
|
|
3613
|
+
legendOverflow: number;
|
|
3614
|
+
/** Where to draw the "+N more" chip, when {@link legendOverflow} is non-zero. */
|
|
3615
|
+
legendOverflowRect?: Rect;
|
|
3616
|
+
/** Pixel budget for a legend label, capped so long series names can't consume
|
|
3617
|
+
* the plot. Renderers ellipsize to it. */
|
|
3618
|
+
legendLabelMaxWidth: number;
|
|
3619
|
+
/**
|
|
3620
|
+
* Layout density derived from the available plot budget. `comfortable` is the
|
|
3621
|
+
* normal chrome used at dashboard/card sizes; `compact` marks small containers
|
|
3622
|
+
* so renderers can switch to their compact font/spacing ramp. It is never
|
|
3623
|
+
* spec-controlled.
|
|
3624
|
+
*/
|
|
3625
|
+
density: FrameDensity;
|
|
3626
|
+
/**
|
|
3627
|
+
* Chrome rungs omitted, in priority order, so the mark area remains viable.
|
|
3628
|
+
* Dropped regions are not reserved in the frame.
|
|
3629
|
+
*/
|
|
3630
|
+
dropped: DroppedChrome[];
|
|
3091
3631
|
}
|
|
3092
3632
|
declare const TICK_SIZE = 6;
|
|
3093
3633
|
/**
|
|
@@ -3098,6 +3638,8 @@ declare const TICK_SIZE = 6;
|
|
|
3098
3638
|
* `spec.padding` over it (`{ ...NO_PADDING, ...spec.padding }`) to allow overrides.
|
|
3099
3639
|
*/
|
|
3100
3640
|
declare const NO_PADDING: Insets;
|
|
3641
|
+
/** A plot must keep at least this many pixels on each side to render marks. */
|
|
3642
|
+
declare const MIN_VIABLE_PLOT_SIZE = 24;
|
|
3101
3643
|
/** Reserve space for every region and return the plot rect + positioned chrome. */
|
|
3102
3644
|
declare function computeFrame(input: FrameInput): Frame;
|
|
3103
3645
|
|
|
@@ -3262,6 +3804,8 @@ interface CartesianModel {
|
|
|
3262
3804
|
xTicks: Tick[];
|
|
3263
3805
|
yTicks: Tick[];
|
|
3264
3806
|
colorOf(key: string): string;
|
|
3807
|
+
/** Stable first-seen series keys used for palette assignment. */
|
|
3808
|
+
colorDomain?: string[];
|
|
3265
3809
|
/** Hand-drawn render settings, or null for the default clean rendering. */
|
|
3266
3810
|
sketch: ResolvedSketch | null;
|
|
3267
3811
|
/**
|
|
@@ -3285,6 +3829,8 @@ interface CartesianModel {
|
|
|
3285
3829
|
};
|
|
3286
3830
|
}
|
|
3287
3831
|
declare function resolveCurve(curve?: CurveType): Curve;
|
|
3832
|
+
/** Retain category color identity without retaining or changing source rows. */
|
|
3833
|
+
declare function seriesColorDomain(spec: CartesianChartSpec, previous?: readonly string[]): string[];
|
|
3288
3834
|
interface BuildOptions {
|
|
3289
3835
|
width: number;
|
|
3290
3836
|
height: number;
|
|
@@ -3293,6 +3839,11 @@ interface BuildOptions {
|
|
|
3293
3839
|
originY?: number;
|
|
3294
3840
|
/** Shared scale domains/colors, so faceted panels stay directly comparable. */
|
|
3295
3841
|
shared?: SharedScales;
|
|
3842
|
+
/** Previous/unfiltered series keys; explicit color-channel domains take priority. */
|
|
3843
|
+
colorDomain?: readonly string[];
|
|
3844
|
+
/** Caption/mark budgets for compact small-multiple panels. */
|
|
3845
|
+
titleGap?: number;
|
|
3846
|
+
minimumPlotSize?: number;
|
|
3296
3847
|
}
|
|
3297
3848
|
/** Scale state shared across a facet grid so every panel is comparable. */
|
|
3298
3849
|
interface SharedScales {
|
|
@@ -3664,6 +4215,8 @@ interface ComboModel {
|
|
|
3664
4215
|
plot: Rect;
|
|
3665
4216
|
x: XModel;
|
|
3666
4217
|
xTicks: Tick[];
|
|
4218
|
+
/** Full category names wrapped into bounded horizontal lines, parallel to xTicks. */
|
|
4219
|
+
wrappedXLabels?: string[][];
|
|
3667
4220
|
left: ComboAxisModel;
|
|
3668
4221
|
right?: ComboAxisModel;
|
|
3669
4222
|
layers: ComboLayerModel[];
|
|
@@ -3732,6 +4285,7 @@ declare function buildHistogramModel(spec: HistogramSpec, tokens: ThemeTokens, o
|
|
|
3732
4285
|
*/
|
|
3733
4286
|
|
|
3734
4287
|
type ReportSeverity = 'error' | 'warning' | 'info';
|
|
4288
|
+
|
|
3735
4289
|
/** One machine-readable finding about the rendered chart. */
|
|
3736
4290
|
interface RenderDiagnostic {
|
|
3737
4291
|
/** Stable identifier an agent can match/suppress on (e.g. `axis-label-overlap`). */
|
|
@@ -3747,6 +4301,15 @@ interface RenderDiagnostic {
|
|
|
3747
4301
|
fix?: JsonPatchOp[];
|
|
3748
4302
|
/** One-line advisory when there is no unambiguous safe patch. */
|
|
3749
4303
|
hint?: string;
|
|
4304
|
+
/** JSON Pointer into the effective spec (dashboard findings are view-scoped). */
|
|
4305
|
+
path?: string;
|
|
4306
|
+
viewId?: string;
|
|
4307
|
+
/** Eligibility guidance only; fixes are never automatically applied by reporting. */
|
|
4308
|
+
action?: {
|
|
4309
|
+
kind: 'presentation' | 'semantic';
|
|
4310
|
+
safety: 'default-only' | 'requires-review';
|
|
4311
|
+
paths: string[];
|
|
4312
|
+
};
|
|
3750
4313
|
}
|
|
3751
4314
|
/** A post-render, vision-free description of what was drawn. */
|
|
3752
4315
|
interface RenderReport {
|
|
@@ -3755,7 +4318,7 @@ interface RenderReport {
|
|
|
3755
4318
|
size: Size;
|
|
3756
4319
|
/** Plot rectangle (cartesian-derived reports only). */
|
|
3757
4320
|
plot?: Rect;
|
|
3758
|
-
/**
|
|
4321
|
+
/** Legacy bound-row count (or effective data.length); NOT evidence of drawing. */
|
|
3759
4322
|
markCount: number;
|
|
3760
4323
|
/** Number of distinct series. */
|
|
3761
4324
|
seriesCount: number;
|
|
@@ -3770,7 +4333,22 @@ interface RenderReport {
|
|
|
3770
4333
|
* an LLM). Absent for chart types that carry no summarizable trend.
|
|
3771
4334
|
*/
|
|
3772
4335
|
summary?: string;
|
|
4336
|
+
/** Observed logical marks and explicit diagnostic coverage, when available. */
|
|
4337
|
+
evidence?: RenderEvidence;
|
|
4338
|
+
/** Child reports retain their own sizes, evidence and local diagnostic paths. */
|
|
4339
|
+
views?: Array<{
|
|
4340
|
+
id: string;
|
|
4341
|
+
index: number;
|
|
4342
|
+
report: RenderReport;
|
|
4343
|
+
}>;
|
|
4344
|
+
}
|
|
4345
|
+
/** A dashboard has the same facts as a chart report, with its own discriminant. */
|
|
4346
|
+
interface DashboardRenderReport extends Omit<RenderReport, 'type' | 'views'> {
|
|
4347
|
+
type: 'dashboard';
|
|
4348
|
+
views: NonNullable<RenderReport['views']>;
|
|
3773
4349
|
}
|
|
4350
|
+
/** Common report type for APIs that accept either a chart or a dashboard. */
|
|
4351
|
+
type AnyRenderReport = RenderReport | DashboardRenderReport;
|
|
3774
4352
|
/** Inputs for {@link buildRenderReport}. */
|
|
3775
4353
|
interface ReportInput {
|
|
3776
4354
|
type: ChartType;
|
|
@@ -3781,12 +4359,34 @@ interface ReportInput {
|
|
|
3781
4359
|
size: Size;
|
|
3782
4360
|
/** The resolved cartesian model, when the chart type is cartesian. */
|
|
3783
4361
|
model?: CartesianModel;
|
|
4362
|
+
/**
|
|
4363
|
+
* Every label the chart drew, from the surface's label ledger. Supplying it
|
|
4364
|
+
* enables the text diagnostics (clipping, collision, occlusion) for *any*
|
|
4365
|
+
* chart type, including the non-cartesian ones that have no model.
|
|
4366
|
+
*/
|
|
4367
|
+
labels?: LabelRecord[];
|
|
4368
|
+
suppressedLabels?: SuppressedLabel[];
|
|
4369
|
+
evidence?: RenderEvidence;
|
|
3784
4370
|
}
|
|
3785
4371
|
/**
|
|
3786
4372
|
* Build the render report for a freshly-drawn chart. Pure: it reads the
|
|
3787
4373
|
* resolved model + theme, never the canvas bitmap.
|
|
3788
4374
|
*/
|
|
3789
4375
|
declare function buildRenderReport(input: ReportInput): RenderReport;
|
|
4376
|
+
/** Scope child pointers/patches to their original view index, never display order. */
|
|
4377
|
+
declare function scopeViewDiagnostic(diagnostic: RenderDiagnostic, id: string, index: number, type: string): RenderDiagnostic;
|
|
4378
|
+
/** Add counters, but do not conflate repeated row participation across views with unique source rows. */
|
|
4379
|
+
declare function mergeRenderEvidence(items: readonly RenderEvidence[], inputRows?: number): RenderEvidence;
|
|
4380
|
+
/** Browser and headless dashboard reports use identical aggregation and patch scoping. */
|
|
4381
|
+
declare function aggregateDashboardReports(input: {
|
|
4382
|
+
spec: DashboardSpec;
|
|
4383
|
+
size: Size;
|
|
4384
|
+
views: NonNullable<RenderReport['views']>;
|
|
4385
|
+
labels?: LabelRecord[];
|
|
4386
|
+
suppressedLabels?: SuppressedLabel[];
|
|
4387
|
+
chromeMeasured?: boolean;
|
|
4388
|
+
diagnostics?: RenderDiagnostic[];
|
|
4389
|
+
}): DashboardRenderReport;
|
|
3790
4390
|
/** Apply safe render-report JSON Patch fixes to a clone of the spec. Pure: no rendering. */
|
|
3791
4391
|
declare function repairReport(spec: ChartSpec, report: RenderReport): {
|
|
3792
4392
|
spec: ChartSpec;
|
|
@@ -3816,6 +4416,8 @@ declare const FACETABLE_TYPES: ReadonlySet<string>;
|
|
|
3816
4416
|
interface FacetPanel {
|
|
3817
4417
|
value: string;
|
|
3818
4418
|
model: CartesianModel;
|
|
4419
|
+
report?: RenderReport;
|
|
4420
|
+
compactAxes?: Array<'x' | 'y'>;
|
|
3819
4421
|
}
|
|
3820
4422
|
/** The resolved layout of a faceted chart — the header frame plus panel models. */
|
|
3821
4423
|
interface FacetLayout {
|
|
@@ -3827,8 +4429,12 @@ interface FacetLayout {
|
|
|
3827
4429
|
panels: FacetPanel[];
|
|
3828
4430
|
/** Positioned shared legend items (multi-series only). */
|
|
3829
4431
|
legendItems?: PositionedLegendItem[];
|
|
4432
|
+
legendCount?: number;
|
|
3830
4433
|
/** A representative panel model (panels[0]) for token/legend draw. */
|
|
3831
4434
|
repModel: CartesianModel;
|
|
4435
|
+
labels?: LabelRecord[];
|
|
4436
|
+
suppressedLabels?: SuppressedLabel[];
|
|
4437
|
+
evidence?: RenderEvidence;
|
|
3832
4438
|
}
|
|
3833
4439
|
/** True when `spec` declares a usable facet on a facet-eligible cartesian type. */
|
|
3834
4440
|
declare function isFaceted(spec: ChartSpec): boolean;
|
|
@@ -3836,8 +4442,9 @@ declare function isFaceted(spec: ChartSpec): boolean;
|
|
|
3836
4442
|
* Resolve a faceted spec into a grid of panel models sharing one set of scales.
|
|
3837
4443
|
* Returns `null` when there is nothing to facet (no rows / no distinct values),
|
|
3838
4444
|
* so the caller can fall back to the normal single-chart path.
|
|
4445
|
+
* Retained/unfiltered color keys seed the reference model's shared color map.
|
|
3839
4446
|
*/
|
|
3840
|
-
declare function buildFacetModels(spec: ChartSpec, tokens: ThemeTokens, size: Size): FacetLayout | null;
|
|
4447
|
+
declare function buildFacetModels(spec: ChartSpec, tokens: ThemeTokens, size: Size, colorDomain?: readonly string[]): FacetLayout | null;
|
|
3841
4448
|
/**
|
|
3842
4449
|
* Draw a faceted chart onto `surface`: the shared header (overall title + legend)
|
|
3843
4450
|
* then every panel through the full cartesian pipeline. Static — no interaction
|
|
@@ -3876,6 +4483,12 @@ interface HeadlessTarget {
|
|
|
3876
4483
|
width: number;
|
|
3877
4484
|
/** Logical (CSS-pixel) height to draw at. */
|
|
3878
4485
|
height: number;
|
|
4486
|
+
/** Visible clip already applied by a composing caller, in this target's coordinates. */
|
|
4487
|
+
clip?: Rect;
|
|
4488
|
+
/** Shared selection state for composed static views; absent means a private store. */
|
|
4489
|
+
store?: SelectionStore;
|
|
4490
|
+
/** The composing host already provides card chrome (same convention as render options). */
|
|
4491
|
+
frame?: boolean;
|
|
3879
4492
|
}
|
|
3880
4493
|
/**
|
|
3881
4494
|
* Paint `spec` onto `target.marks` (in CSS pixels — the caller sets up any
|
|
@@ -3887,7 +4500,9 @@ interface HeadlessTarget {
|
|
|
3887
4500
|
* DOM-only) kpi, table, matrix, slicers and dashboard, which now paint a static
|
|
3888
4501
|
* canvas snapshot so the whole catalog validates server-side.
|
|
3889
4502
|
*/
|
|
4503
|
+
declare function renderToContext(target: HeadlessTarget, spec: DashboardSpec): DashboardRenderReport;
|
|
3890
4504
|
declare function renderToContext(target: HeadlessTarget, spec: ChartSpec): RenderReport;
|
|
4505
|
+
declare function renderToContext(target: HeadlessTarget, spec: ChartSpec | DashboardSpec): AnyRenderReport;
|
|
3891
4506
|
|
|
3892
4507
|
/**
|
|
3893
4508
|
* Chart runtime: the public `render(container, spec)` entry point.
|
|
@@ -3901,6 +4516,11 @@ declare function renderToContext(target: HeadlessTarget, spec: ChartSpec): Rende
|
|
|
3901
4516
|
type SelectionChangeListener = (name: string, value: SelectionValue | null) => void;
|
|
3902
4517
|
/** Options for {@link render}. */
|
|
3903
4518
|
interface RenderOptions {
|
|
4519
|
+
/**
|
|
4520
|
+
* Paint final frames without entrance/update animation, preserving spec.animation.
|
|
4521
|
+
* Re-read on every draw so a scoped caller can restore this option after a pass.
|
|
4522
|
+
*/
|
|
4523
|
+
synchronous?: boolean;
|
|
3904
4524
|
/**
|
|
3905
4525
|
* A shared selection bus. Pass the same store to multiple `render()` calls to
|
|
3906
4526
|
* link them (cross-highlight / cross-filter). Omit to give the chart its own
|
|
@@ -4100,6 +4720,8 @@ declare function wireViews(views: DashboardView[], interactions: 'auto' | 'none'
|
|
|
4100
4720
|
*/
|
|
4101
4721
|
|
|
4102
4722
|
interface RenderDashboardOptions {
|
|
4723
|
+
/** Forward a dynamically scoped final-frame animation override to every child. */
|
|
4724
|
+
synchronous?: boolean;
|
|
4103
4725
|
/** Share a bus with charts/dashboards outside this one. */
|
|
4104
4726
|
store?: SelectionStore;
|
|
4105
4727
|
/**
|
|
@@ -4123,6 +4745,8 @@ interface DashboardInstance {
|
|
|
4123
4745
|
readonly store: SelectionStore;
|
|
4124
4746
|
/** The mounted chart instances, in view order. */
|
|
4125
4747
|
readonly views: ChartInstance[];
|
|
4748
|
+
/** Aggregate current child diagnostics/evidence, with original view IDs and scoped patches. */
|
|
4749
|
+
report(): DashboardRenderReport;
|
|
4126
4750
|
getSelection(name?: string): SelectionValue | null | Record<string, SelectionValue | null>;
|
|
4127
4751
|
setSelection(name: string, value: SelectionValue | null): void;
|
|
4128
4752
|
clearSelection(name?: string): void;
|
|
@@ -4141,6 +4765,8 @@ type DashboardCell = {
|
|
|
4141
4765
|
w: number;
|
|
4142
4766
|
h: number;
|
|
4143
4767
|
baseCols: number;
|
|
4768
|
+
/** Responsive hidden views do not reserve a grid footprint. */
|
|
4769
|
+
hidden?: boolean;
|
|
4144
4770
|
};
|
|
4145
4771
|
type Cell = DashboardCell;
|
|
4146
4772
|
|
|
@@ -4160,15 +4786,159 @@ declare function defaultSpan(spec: ChartSpec, cols: number): {
|
|
|
4160
4786
|
declare function resolveDashboardLayout(layout?: DashboardLayout): ResolvedLayout;
|
|
4161
4787
|
/** Inherit the dashboard's data/theme/background onto a (wired) view spec. */
|
|
4162
4788
|
declare function inheritInto(spec: ChartSpec, dash: DashboardSpec, tokens: ThemeTokens, suppressTitle?: boolean): ChartSpec;
|
|
4163
|
-
|
|
4789
|
+
interface DashboardPlacementOptions {
|
|
4790
|
+
/** Effective responsive columns; defaults to the full-width `cols`. */
|
|
4791
|
+
columns?: number;
|
|
4792
|
+
/** Grid width for per-view responsive rules. Omit to resolve base placement. */
|
|
4793
|
+
width?: number;
|
|
4794
|
+
}
|
|
4795
|
+
/** Resolve grid positions once for browser and headless, keeping spans distinct from coordinates. */
|
|
4796
|
+
declare function placeViews(views: readonly WiredView[], cols: number, preset: DashboardLayout['preset'], options?: DashboardPlacementOptions): Cell[];
|
|
4164
4797
|
declare function resolveDashboardSections(views: WiredView[], layout: Pick<ResolvedLayout, 'cols' | 'rowHeight' | 'sections'>): SectionPlan[];
|
|
4165
4798
|
declare function renderDashboard(target: HTMLElement | string, spec: DashboardSpec, options?: RenderDashboardOptions): DashboardInstance;
|
|
4166
4799
|
|
|
4800
|
+
/** Opt-in presentation improvement. The budget includes initial and rollback renders. */
|
|
4801
|
+
interface QualityOptions {
|
|
4802
|
+
/** Hard whole-visual render ceiling; default 3. Mutable targets reserve one rollback pass. */
|
|
4803
|
+
maxPasses?: 1 | 2 | 3;
|
|
4804
|
+
}
|
|
4805
|
+
type QualityStopReason = 'no-target' | 'invalid-spec' | 'satisfied' | 'no-actions' | 'blocked' | 'no-progress' | 'repeated-spec' | 'pass-limit' | 'candidate-invalid' | 'candidate-failed' | 'candidate-regressed' | 'render-failed' | 'restore-failed';
|
|
4806
|
+
/** A proposed presentation change and its disposition, never a data repair. */
|
|
4807
|
+
interface QualityAction {
|
|
4808
|
+
diagnostic: string;
|
|
4809
|
+
path?: string;
|
|
4810
|
+
viewId?: string;
|
|
4811
|
+
patches: JsonPatchOp[];
|
|
4812
|
+
reason: string;
|
|
4813
|
+
}
|
|
4814
|
+
interface QualityIteration {
|
|
4815
|
+
/** One-based actual render attempt, including failed and restoration attempts. */
|
|
4816
|
+
pass: number;
|
|
4817
|
+
phase: 'initial' | 'candidate' | 'restore';
|
|
4818
|
+
outcome: 'selected' | 'rejected' | 'failed';
|
|
4819
|
+
/** Changes attempted in this pass; restoration reapplies the selected spec instead. */
|
|
4820
|
+
patches: JsonPatchOp[];
|
|
4821
|
+
report?: AnyRenderReport;
|
|
4822
|
+
error?: string;
|
|
4823
|
+
}
|
|
4824
|
+
/** Evidence and decisions from a bounded loop; no claim of visual perfection. */
|
|
4825
|
+
interface QualityResult {
|
|
4826
|
+
enabled: true;
|
|
4827
|
+
/** False for invalid input, a missing target, or a failed initial render. */
|
|
4828
|
+
evaluated: boolean;
|
|
4829
|
+
maxPasses: 1 | 2 | 3;
|
|
4830
|
+
renderPasses: number;
|
|
4831
|
+
/** The pass that produced the returned frame/report, absent if rendering failed. */
|
|
4832
|
+
selectedPass?: number;
|
|
4833
|
+
stopReason: QualityStopReason;
|
|
4834
|
+
iterations: QualityIteration[];
|
|
4835
|
+
/** Only actions retained in the selected effective spec. */
|
|
4836
|
+
applied: QualityAction[];
|
|
4837
|
+
/** Blocked, ineffective, invalid, failed, or rolled-back actions, with reasons. */
|
|
4838
|
+
rejected: QualityAction[];
|
|
4839
|
+
}
|
|
4840
|
+
|
|
4841
|
+
/**
|
|
4842
|
+
* Headless dashboard composition — `renderDashboardToContext`.
|
|
4843
|
+
*
|
|
4844
|
+
* Lays a dashboard's views out on the same responsive grid as the browser
|
|
4845
|
+
* runtime, then paints each view onto one canvas via {@link renderToContext}
|
|
4846
|
+
* translated into its cell. No DOM: the whole page rasterizes to a single PNG
|
|
4847
|
+
* server-side, and the per-view reports fold into one aggregate {@link RenderReport}.
|
|
4848
|
+
*/
|
|
4849
|
+
|
|
4850
|
+
/** Compose a dashboard spec onto a single canvas context. */
|
|
4851
|
+
declare function renderDashboardToContext(target: HeadlessTarget, spec: DashboardSpec): DashboardRenderReport;
|
|
4852
|
+
|
|
4853
|
+
/**
|
|
4854
|
+
* One-call agent drafting loop: validate → repair → render/report → summarize.
|
|
4855
|
+
*
|
|
4856
|
+
* `draft()` is the dependency-free core version of the MCP render loop. It can
|
|
4857
|
+
* run without a DOM (validation/repair/summary only), paint into a caller-owned
|
|
4858
|
+
* headless canvas target, or mount into a browser container when one is supplied.
|
|
4859
|
+
*/
|
|
4860
|
+
|
|
4861
|
+
/** Options for {@link draft}. */
|
|
4862
|
+
interface DraftOptions {
|
|
4863
|
+
/**
|
|
4864
|
+
* Auto-apply safe JSON Patch repairs before returning. Defaults to true.
|
|
4865
|
+
* Disable when you need a read-only validation/lint pass over the original
|
|
4866
|
+
* input.
|
|
4867
|
+
*/
|
|
4868
|
+
repair?: boolean;
|
|
4869
|
+
/**
|
|
4870
|
+
* How hard repair may try. `'safe'` (the default) applies only the fixes
|
|
4871
|
+
* validation itself proposes; `'data'` additionally infers unambiguous
|
|
4872
|
+
* corrections from the spec's own `data` — a typo'd field name, a missing
|
|
4873
|
+
* `encoding`, a missing `type`. Every inferred change is reported in
|
|
4874
|
+
* {@link DraftResult.repairs} with its rationale, so nothing is silent.
|
|
4875
|
+
*/
|
|
4876
|
+
repairLevel?: 'safe' | 'data';
|
|
4877
|
+
/**
|
|
4878
|
+
* Opt in to presentation-default improvement, with at most three whole-visual
|
|
4879
|
+
* render passes including initial and rollback passes. Never changes data or
|
|
4880
|
+
* explicit settings. Omit (or false) to retain the single-render behavior.
|
|
4881
|
+
*/
|
|
4882
|
+
quality?: boolean | QualityOptions;
|
|
4883
|
+
/**
|
|
4884
|
+
* Optional headless 2D canvas target. When provided and the repaired spec is
|
|
4885
|
+
* valid, `draft()` paints the chart or dashboard and returns its corresponding
|
|
4886
|
+
* {@link AnyRenderReport}. This path needs no DOM.
|
|
4887
|
+
*/
|
|
4888
|
+
target?: HeadlessTarget;
|
|
4889
|
+
/**
|
|
4890
|
+
* Optional browser container or selector. When provided and `target` is
|
|
4891
|
+
* omitted, `draft()` mounts the chart or dashboard and returns its report and
|
|
4892
|
+
* the corresponding instance for lifecycle management.
|
|
4893
|
+
*/
|
|
4894
|
+
container?: HTMLElement | string;
|
|
4895
|
+
/** Browser render options forwarded when `container` is used. */
|
|
4896
|
+
renderOptions?: RenderOptions;
|
|
4897
|
+
}
|
|
4898
|
+
/** Result of a {@link draft} validation/repair/render pass. */
|
|
4899
|
+
interface DraftResult<R extends AnyRenderReport = AnyRenderReport> {
|
|
4900
|
+
/** Selected effective spec after optional authoring repairs and presentation defaults. */
|
|
4901
|
+
spec: unknown;
|
|
4902
|
+
/** True when structural validation passed after optional repair. */
|
|
4903
|
+
valid: boolean;
|
|
4904
|
+
/** True when a final rendered frame and matching report are available. */
|
|
4905
|
+
rendered: boolean;
|
|
4906
|
+
/** JSON Patch operations applied by repair, in order. */
|
|
4907
|
+
patches: JsonPatchOp[];
|
|
4908
|
+
/** The same operations paired with a human-readable rationale for each. */
|
|
4909
|
+
repairs: AppliedRepair[];
|
|
4910
|
+
/** Structural validation errors remaining after optional repair. */
|
|
4911
|
+
errors: ValidationError[];
|
|
4912
|
+
/** Advisory validation/lint findings for the returned spec. */
|
|
4913
|
+
warnings: ValidationError[];
|
|
4914
|
+
/** Vision-free render diagnostics, present only when rendering happened. */
|
|
4915
|
+
report?: R;
|
|
4916
|
+
/** Browser chart instance, present only when `container` rendering happened. */
|
|
4917
|
+
instance?: ChartInstance;
|
|
4918
|
+
/** Browser dashboard instance; separate from `instance` to retain its chart-specific type. */
|
|
4919
|
+
dashboardInstance?: DashboardInstance;
|
|
4920
|
+
/** Bounded presentation decisions and pass history; present only when opted in. */
|
|
4921
|
+
quality?: QualityResult;
|
|
4922
|
+
/** Opt-in rendering failure, when no matching final frame/report could be returned. */
|
|
4923
|
+
renderError?: string;
|
|
4924
|
+
/** Deterministic alt-text style summary, when the valid spec is summarizable. */
|
|
4925
|
+
summary?: string;
|
|
4926
|
+
}
|
|
4927
|
+
/**
|
|
4928
|
+
* Validate a chart spec, apply safe repairs, optionally render it, and return
|
|
4929
|
+
* everything an agent needs for the next iteration. Rendering is skipped when
|
|
4930
|
+
* validation still has errors after repair so invalid specs never reach the
|
|
4931
|
+
* renderer.
|
|
4932
|
+
*/
|
|
4933
|
+
declare function draft(spec: DashboardSpec, options?: DraftOptions): DraftResult<DashboardRenderReport>;
|
|
4934
|
+
declare function draft(spec: ChartSpec, options?: DraftOptions): DraftResult<RenderReport>;
|
|
4935
|
+
declare function draft(spec: unknown, options?: DraftOptions): DraftResult;
|
|
4936
|
+
|
|
4167
4937
|
/**
|
|
4168
4938
|
* graphein — public entry point.
|
|
4169
4939
|
*
|
|
4170
4940
|
* The barrel grows as modules land. Keep exports explicit and tree-shakeable.
|
|
4171
4941
|
*/
|
|
4172
|
-
declare const VERSION = "0.
|
|
4942
|
+
declare const VERSION = "0.19.0";
|
|
4173
4943
|
|
|
4174
|
-
export { type AggOp, type AggregateOp, type AggregateTransform, type AnimateOptions, type AnimationConfig, type AnimationHandle, type Annotation, type AnySpec, type ArcOptions, type AreaOptions, type AreaPoint, type AreaSpec, type AxesConfig, type AxisConfig, type AxisInput, type BackingSize, type BandScale, type BandScaleOptions, type BarSpec, type BaseSlicerSpec, type BaseSpec, type BinLayout, type BinTransform, type BoxSpec, type BuildOptions, type BulletSpec, CARTESIAN_TYPES, CHART_TYPES, type CalculateTransform, type CalendarHeatmapSpec, CanvasLayer, type CanvasPillStyle, type CanvasTextCmd, type CartesianChartSpec, type CartesianInteractionBuilder, type CartesianModel, type CartesianRenderer, type CategoryInsights, type ChartInsights, type ChartInstance, type ChartSpec, type ChartSummary, type ChartType, type ChoroplethSpec, type ColorScale, type ColumnProfile, type ComboAxisModel, type ComboLayer, type ComboLayerModel, type ComboMark, type ComboModel, type ComboSide, type ComboSpec, type Comparable, type ConditionalFormat, type ContinuousScale, type ControllerSelect, type Curve, type CurveType, type CustomRenderer, DEFAULT_ENTRANCE_DURATION, DEFAULT_ROUGH_STYLE, DEFAULT_UPDATE_DURATION, DIM_ALPHA, type DashboardCell, type DashboardInstance, type DashboardLayout, type DashboardResponsiveSpan, type DashboardSection, type DashboardSpec, type DashboardView, type DateRangeSlicerSpec, type Datum, type DebugConfig, type DebugSection, type DebugViewDeps, type DebugViewResult, type DecimateOptions, type Dimensions, type DropdownSlicerSpec, type DumbbellSpec, type EasingFunction, type Emphasis, type Encoding, type EntranceContext, ExpressionError, type Extent, FACETABLE_TYPES, FUNCTION_NAMES, type FacetConfig, type FacetLayout, type FacetPanel, type FieldDef, type FieldType, type FieldValue, type FillStyle, type FilterClause, type FilterPredicate, type FilterTransform, type FoldTransform, type Frame, type FrameInput, type FunnelSpec, type GaugeSpec, type GeoFeature, type GeoFeatureCollection, type GeoGeometry, type GeoMultiPolygon, type GeoPolygon, type GeoPosition, type GroupedMap, type HachureSegment, type HeadlessTarget, type HeatmapSpec, type HighlightConfig, type HistogramBin, type HistogramBinDatum, type HistogramModel, type HistogramSpec, type Hover, type IconRule, type Insets, type InsightFamily, type InsightOptions, type Inspector, type InspectorOptions, InteractionController, type InteractionLink, type InteractionModel, type Interpolator, type JsonPatchOp, type KpiComparison, type KpiSpec, type LegendConfig, type LegendHitRegion, type LegendItem, type LegendPosition, type LegendSymbol, type LineOptions, type LineSpec, type LinearScaleOptions, type LintFinding, type ListSlicerSpec, type LiteralPredicate, type LogScaleOptions, type MapProjection, type MarkOptions, type MatrixSpec, type MatrixValueDef, NO_PADDING, type NumberFormatSpec, type OKLCH, type OKLab, type OverlayTextOpts, type PathSink, type PieLabels, type PieSpec, type PivotCell, type PivotFlatRow, type PivotHeaderNode, type PivotOptions, type PivotResult, type PivotValueDef, type Point, type PointRef, type PointScale, type PointScaleOptions, type PointSelection, type PositionedLegendItem, type RGBA, type RangeSelection, type RangeSlicerSpec, type RecommendOptions, type RecommendedChart, type Rect, type RegressionFit, type RenderContext, type RenderDashboardOptions, type RenderDiagnostic, type RenderOptions, type RenderReport, type RepairResult, type ReportInput, type ReportSeverity, type ResolvedEntrance, type ResolvedSeries, type ResolvedSketch, type Rng, type RoughContext, RoughPen, type RoughStyle, SKETCH_FONT_FAMILY, SKETCH_FONT_NAME, SLICER_TYPES, SPEC_ATTR, SR_ONLY_STYLE, type SankeySpec, type ScaleConfig, type ScaleType, type ScatterInsights, type ScatterSpec, type SearchSlicerSpec, type SelectConfig, type SelectionChangeListener, type SelectionDef, type SelectionListener, type SelectionParam, type SelectionStore, type SelectionValue, type SeriesInsights, type SetSelection, type SharedScales, type Size, type SketchConfig, type SlicerSpec, type SlicerType, type SlopeSpec, Surface, TICK_SIZE, TIME_UNITS, TRANSFORM_KINDS, TYPE_ATTR, type TableColumn, type TableSpec, type TextMetricsLite, type TextSelection, type ThemeColors, type ThemeFont, type ThemeInput, type ThemeTokens, type Tick, type TimeScaleOptions, type TimeUnit, type TimeUnitTransform, type TitleConfig, type TitleInput, Tooltip, type TooltipConfig, type TooltipContent, type TooltipRow, type Transform, type TreemapSpec, type TrendlineConfig, type UpdateContext, VERSION, type ValidationError, type ValidationResult, type ValueInsights, type ValueRef, type ValueRule, type WaterfallSpec, type WiredView, type XKind, type XModel, type YModel, aggregateValues, analyzeChart, animate, applyA11y, applyAggregate, applyBin, applyCalculate, applyFilter, applyFold, applyPatch, applyPick, applyTimeUnit, applyTransform, applyTransforms, arc, area, assertValidSpec, autoInsightAnnotations, backOut, bandScale, bounceOut, buildCartesianInteraction, buildCartesianModel, buildComboModel, buildDataTableFallback, buildFacetModels, buildHistogramModel, buildRenderReport, cartesianInteractionBuilders, cartesianRenderers, categorical, categoricalSchemes, chartTitleText, chartTypeLabel, checkExpression, clamp01, clamp255, compileExpression, compilePredicate, computeBackingSize, computeBins, computeFrame, computeSeriesInsights, contrastRatio, createDiv, createInspector, createRoughPen, createSelectionStore, cubicIn, cubicInOut, cubicOut, curveCatmullRom, curveLinear, curveMonotoneX, curveStep, curveStepAfter, curveStepBefore, customRenderers, darkTheme, decimate, defaultSpan, dependentParams, diverging, divergingColorScale, divergingSchemes, drawAnnotationLabels, drawAnnotations, drawAxesUnderlay, drawDebugCanvas, drawFacet, drawLegend, drawOverlay, drawTitle, drawTrendlineLabels, drawTrendlines, easings, elasticOut, ellipsize, ensureSketchFont, expoInOut, expoOut, facetReport, fillParentStyle, filterRows, fontString, formatCountUp, formatDate, formatNumber, formatValue, getDevicePixelRatio, groupBy, hashString, inferFieldType, inferFieldTypes, inferValueType, inheritInto, interpolateArray, interpolateNumber, interpolateNumberArray, interpolateObject, interpolateOklab, interpolateRgb, isBrowser, isEmptyValue, isFaceted, isParamClause, isSlicerType, keyFields, legendSwatchWidth, lightTheme, line, linear, linearRegression, linearScale, linearToSrgb, lintSpec, literalToValue, logScale, lttbRun, makeMatcher, matchesValue, measureText, monotoneXTangents, mulberry32, niceDomain, oklabToOklch, oklabToRgb, oklchToOklab, ordinalColorScale, overlayTextToCanvasCmd, paintCanvasText, paintLegendSwatch, parseColor, parseNumberFormat, pivot, placeViews, pointScale, polygonHachureLines, prefersReducedMotion, prettyDate, profileColumns, quadIn, quadInOut, quadOut, rampFromStops, readableTextColor, recommendChart, relativeLuminance, render, renderDashboard, renderDebugView, renderToContext, repairReport, repairSpec, resolveCurve, resolveDashboardLayout, resolveDashboardSections, resolveEmphasis, resolveEntrance, resolveFilterValues, resolveInsightOptions, resolveSketch, resolveTheme, resolveUpdate, resolveValueRef, rgbToOklab, rgbaToCss, rotatePoint, roundedRect, sampleArc, sequential, sequentialColorScale, sequentialSchemes, serializeSpec, setMeasureContext, setStyle, sinInOut, slicerParamName, smartDate, specFields, srgbToLinear, stripData, summarize, summarizeChart, themes, tickIncrement, tickStep, ticks, timeScale, timeTickFormat, timeTicks, toHex, toPointer, tooltipEnabled, truncateTo, validateDashboard, validateSpec, wireViews, withAlpha, withSketchFont };
|
|
4944
|
+
export { type AggOp, type AggregateOp, type AggregateTransform, type AggregationCapability, type AnimateOptions, type AnimationConfig, type AnimationHandle, type Annotation, type AnyRenderReport, type AnySpec, type AppliedRepair, type ArcOptions, type AreaOptions, type AreaPoint, type AreaSpec, type AxesConfig, type AxisConfig, type AxisInput, type BackingSize, type BandScale, type BandScaleOptions, type BarSpec, type BaseSlicerSpec, type BaseSpec, type BinLayout, type BinTransform, type BoxSpec, type BuildOptions, type BulletSpec, CARTESIAN_TYPES, CHART_TYPES, type CalculateTransform, type CalendarHeatmapSpec, CanvasLayer, type CanvasPillStyle, type CanvasTextCmd, type CardinalityGuidance, type CartesianChartSpec, type CartesianInteractionBuilder, type CartesianModel, type CartesianRenderer, type CategoryInsights, type ChartCapabilities, type ChartInsights, type ChartInstance, type ChartSpec, type ChartSummary, type ChartType, type ChartTypeInfo, type ChoroplethSpec, type ColorScale, type ColumnProfile, type ComboAxisModel, type ComboLayer, type ComboLayerModel, type ComboMark, type ComboModel, type ComboSide, type ComboSpec, type Comparable, type ConditionalFormat, type ContinuousScale, type ControllerSelect, type Curve, type CurveType, type CustomRenderer, DEFAULT_ENTRANCE_DURATION, DEFAULT_ROUGH_STYLE, DEFAULT_UPDATE_DURATION, DIM_ALPHA, type DashboardCell, type DashboardInstance, type DashboardLayout, type DashboardPlacementOptions, type DashboardRenderReport, type DashboardResponsiveSpan, type DashboardSection, type DashboardSpec, type DashboardView, type DataFinding, type DataRepresentation, type DataRequirement, type DatasetProfile, type DateRangeSlicerSpec, type Datum, type DebugConfig, type DebugSection, type DebugViewDeps, type DebugViewResult, type DecimateOptions, type DetailedColumnProfile, type Dimensions, type DraftOptions, type DraftResult, type DropdownSlicerSpec, type DroppedChrome, type DumbbellSpec, type EasingFunction, type Emphasis, type Encoding, type EncodingProfile, type EntranceContext, type EvidenceCoverage, ExpressionError, type Extent, FACETABLE_TYPES, FUNCTION_NAMES, type FacetConfig, type FacetLayout, type FacetPanel, type FieldDef, type FieldRoleInfo, type FieldType, type FieldValue, type FillStyle, type FilterClause, type FilterPredicate, type FilterTransform, type FoldTransform, type Frame, type FrameDensity, type FrameInput, type FunnelSpec, type GaugeSpec, type GeoFeature, type GeoFeatureCollection, type GeoGeometry, type GeoMultiPolygon, type GeoPolygon, type GeoPosition, type GroupedMap, type HachureSegment, type HeadlessTarget, type HeatmapSpec, type HighlightConfig, type HistogramBin, type HistogramBinDatum, type HistogramModel, type HistogramSpec, type Hover, type IconRule, type Insets, type InsightFamily, type InsightOptions, type Inspector, type InspectorOptions, InteractionController, type InteractionLink, type InteractionModel, type Interpolator, type JsonPatchOp, type KpiComparison, type KpiSpec, LabelLedger, type LabelRecord, type LabelRole, type LegendConfig, type LegendHitRegion, type LegendItem, type LegendPosition, type LegendSymbol, type LineOptions, type LineSpec, type LinearScaleOptions, type LintFinding, type ListSlicerSpec, type LiteralPredicate, type LogScaleOptions, type LogicalMarkCount, MIN_VIABLE_PLOT_SIZE, type MapProjection, type MarkBoundary, type MarkKind, type MarkOptions, type MatrixSpec, type MatrixValueDef, NO_PADDING, type NumberFormatSpec, type NumericEvidence, type OKLCH, type OKLab, type OverlayTextOpts, type PaintEvidence, type PathSink, type PieLabels, type PieSpec, type PivotCell, type PivotFlatRow, type PivotHeaderNode, type PivotOptions, type PivotResult, type PivotValueDef, type Point, type PointRef, type PointScale, type PointScaleOptions, type PointSelection, type PositionedLegendItem, type ProfileEncoding, type ProfileField, type ProfileOptions, type QualityAction, type QualityIteration, type QualityOptions, type QualityResult, type QualityStopReason, type RGBA, type RangeSelection, type RangeSlicerSpec, type RecommendOptions, type RecommendationEvidence, type RecommendationResult, type RecommendedChart, type Rect, type RegressionFit, type RenderContext, type RenderDashboardOptions, type RenderDiagnostic, type RenderEvidence, type RenderOptions, type RenderReport, type RepairOptions, type RepairResult, type ReportInput, type ReportSeverity, type ResolvedEntrance, type ResolvedSeries, type ResolvedSketch, type ResolvedTheme, type Rng, type RoughContext, RoughPen, type RoughStyle, SKETCH_FONT_FAMILY, SKETCH_FONT_NAME, SLICER_TYPES, SPEC_ATTR, SR_ONLY_STYLE, type SankeySpec, type ScaleConfig, type ScaleType, type ScatterInsights, type ScatterSpec, type SearchSlicerSpec, type SelectConfig, type SelectionChangeListener, type SelectionDef, type SelectionListener, type SelectionParam, type SelectionStore, type SelectionValue, type SeriesInsights, type SetSelection, type SharedScales, type Size, type SketchConfig, type SlicerSpec, type SlicerType, type SlopeSpec, type SuppressedLabel, Surface, TICK_SIZE, TIME_UNITS, TRANSFORM_KINDS, TYPE_ATTR, type TableColumn, type TableSpec, type TemporalEvidence, type TextMetricsLite, type TextSelection, type ThemeColors, type ThemeFont, type ThemeFontSizes, type ThemeFontWeights, type ThemeInput, type ThemeRadii, type ThemeSpacing, type ThemeStrokes, type ThemeTokens, type ThemeWarning, type Tick, type TimeScaleOptions, type TimeUnit, type TimeUnitTransform, type TitleConfig, type TitleInput, Tooltip, type TooltipConfig, type TooltipContent, type TooltipRow, type Transform, type TreemapSpec, type TrendlineConfig, type TypeAmbiguity, type UpdateContext, VERSION, type ValidationError, type ValidationResult, type ValueInsights, type ValueRef, type ValueRule, type WaterfallSpec, type WiredView, type XKind, type XModel, type YModel, adaptPaletteForDarkBackground, aggregateDashboardReports, aggregateValues, analyzeChart, animate, applyA11y, applyAggregate, applyBin, applyCalculate, applyFilter, applyFold, applyPatch, applyPick, applyTimeUnit, applyTransform, applyTransforms, arc, area, assertValidSpec, autoInsightAnnotations, backOut, bandScale, bounceOut, boxesOverlap, buildCartesianInteraction, buildCartesianModel, buildComboModel, buildDataTableFallback, buildFacetModels, buildHistogramModel, buildRenderReport, cartesianInteractionBuilders, cartesianRenderers, categorical, categoricalSchemes, chartTitleText, chartTypeLabel, checkExpression, clamp01, clamp255, compileExpression, compilePredicate, computeBackingSize, computeBins, computeFrame, computeSeriesInsights, contrastRatio, createDiv, createInspector, createRoughPen, createSelectionStore, cubicIn, cubicInOut, cubicOut, curveCatmullRom, curveLinear, curveMonotoneX, curveStep, curveStepAfter, curveStepBefore, customRenderers, darkTheme, decimate, defaultSpan, dependentParams, diverging, divergingColorScale, divergingSchemes, draft, drawAnnotationLabels, drawAnnotations, drawAxesUnderlay, drawDebugCanvas, drawFacet, drawLegend, drawOverlay, drawTitle, drawTrendlineLabels, drawTrendlines, easings, elasticOut, ellipsize, ensureSketchFont, expoInOut, expoOut, facetReport, fillParentStyle, filterRows, fitLabel, fontString, formatCountUp, formatDate, formatNumber, formatValue, getDevicePixelRatio, groupBy, hashString, inferFieldType, inferFieldTypes, inferValueType, inheritInto, interpolateArray, interpolateNumber, interpolateNumberArray, interpolateObject, interpolateOklab, interpolateRgb, isBrowser, isEmptyValue, isFaceted, isNumberFormat, isParamClause, isSlicerType, keyFields, labelBox, labelsOverlap, legendSwatchWidth, lightTheme, line, linear, linearRegression, linearScale, linearToSrgb, lintSpec, listChartTypes, literalToValue, logScale, lttbRun, makeMatcher, matchesValue, measureContentSize, measureText, mergeRenderEvidence, monotoneXTangents, mulberry32, niceDomain, oklabToOklch, oklabToRgb, oklchToOklab, ordinalColorScale, overlayTextToCanvasCmd, paintCanvasText, paintLegendSwatch, parseColor, parseNumberFormat, pivot, placeViews, pointScale, polygonHachureLines, prefersReducedMotion, prettyDate, profileColumns, profileData, quadIn, quadInOut, quadOut, rampFromStops, readableTextColor, recommendChart, recordCanvasLabel, recordDomLabels, recordLabel, relativeLuminance, render, renderDashboard, renderDashboardToContext, renderDebugView, renderToContext, repairReport, repairSpec, resolveCurve, resolveDashboardLayout, resolveDashboardSections, resolveEmphasis, resolveEntrance, resolveFilterValues, resolveInsightOptions, resolveSketch, resolveTheme, resolveThemeChecked, resolveUpdate, resolveValueRef, rgbToOklab, rgbaToCss, rotatePoint, roundedRect, sampleArc, scopeViewDiagnostic, sequential, sequentialColorScale, sequentialSchemes, serializeSpec, seriesColorDomain, setMeasureContext, setStyle, sinInOut, slicerParamName, smartDate, specFields, srgbToLinear, starterSpec, stripData, summarize, summarizeChart, themes, tickIncrement, tickStep, ticks, timeScale, timeTickFormat, timeTicks, toHex, toPointer, tooltipEnabled, truncateTo, validateDashboard, validateSpec, wireViews, withAlpha, withSketchFont };
|