@toclocoinc/lattice-grid 1.23.0 → 1.24.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 +1 -1
- package/docs/API.html +173 -4
- package/docs/api-detail.html +54 -1
- package/lattice-grid.d.ts +300 -7
- package/lattice-grid.esm.min.js +1599 -312
- package/lattice-grid.min.cjs +1590 -312
- package/lattice-grid.min.js +1590 -312
- package/modules/charts.esm.min.js +600 -245
- package/modules/devtools.esm.min.js +2 -2
- package/modules/dhtmlx-compat.esm.min.js +4 -4
- package/modules/htmx.esm.min.js +1581 -312
- package/modules/htmx.min.cjs +1581 -312
- package/modules/htmx.min.js +1581 -312
- package/modules/react.esm.min.js +3 -3
- package/modules/svelte.esm.min.js +3 -3
- package/modules/vue.esm.min.js +3 -3
- package/modules/webcomponent.esm.min.js +1590 -312
- package/package.json +1 -1
package/lattice-grid.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
2
|
+
* Lattice Grid 1.24.0, type declarations
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
@@ -48,6 +48,9 @@ export type TypeName =
|
|
|
48
48
|
| 'viscosity' | 'kinematicViscosity' | 'thermalConductivity' | 'specificHeat'
|
|
49
49
|
// Temperature, which is affine rather than multiplicative
|
|
50
50
|
| 'celsius' | 'fahrenheit' | 'kelvin'
|
|
51
|
+
// Currency, whose "factor" is a moving exchange rate, so it carries an amount
|
|
52
|
+
// and a code rather than joining the fixed-factor unit factory.
|
|
53
|
+
| 'currency' | 'usd' | 'eur' | 'gbp' | 'jpy'
|
|
51
54
|
| (string & {});
|
|
52
55
|
|
|
53
56
|
/**
|
|
@@ -430,10 +433,10 @@ export type RendererName =
|
|
|
430
433
|
| 'winloss' | (string & {});
|
|
431
434
|
|
|
432
435
|
export type EditorName =
|
|
433
|
-
| 'checkbox' | 'code' | 'colour' | '
|
|
434
|
-
| 'ipaddress' | 'multiSelect' | 'number' | 'objectPicker' | 'password'
|
|
435
|
-
| 'rating' | 'segmented' | 'select' | 'slider' | 'temperature' | 'text'
|
|
436
|
-
| 'time' | 'treeSelect' | 'unit' | (string & {});
|
|
436
|
+
| 'checkbox' | 'code' | 'colour' | 'currency' | 'date' | 'datetime' | 'duration'
|
|
437
|
+
| 'iconPicker' | 'ipaddress' | 'multiSelect' | 'number' | 'objectPicker' | 'password'
|
|
438
|
+
| 'radix' | 'rating' | 'segmented' | 'select' | 'slider' | 'temperature' | 'text'
|
|
439
|
+
| 'textarea' | 'time' | 'treeSelect' | 'unit' | (string & {});
|
|
437
440
|
|
|
438
441
|
export interface EditorParams extends CellParams {
|
|
439
442
|
stop(cancel?: boolean): void;
|
|
@@ -1462,6 +1465,46 @@ export interface GridConfig {
|
|
|
1462
1465
|
itemRole?: string;
|
|
1463
1466
|
};
|
|
1464
1467
|
|
|
1468
|
+
/**
|
|
1469
|
+
* Present the grid as a pivot — a cross-tab drawn as a matrix (§10,
|
|
1470
|
+
* BACKLOG-0000738).
|
|
1471
|
+
*
|
|
1472
|
+
* The row dimensions (the grid's `group`) go down the left gutter, the column
|
|
1473
|
+
* dimensions (the grid's `pivot`) go across the top, and each totalled column
|
|
1474
|
+
* fills a cell with its reduction. `true` draws the matrix with the default
|
|
1475
|
+
* geometry; an object sizes the cells and gutter or names the breakpoint below
|
|
1476
|
+
* which it degrades to cards.
|
|
1477
|
+
*
|
|
1478
|
+
* **The numbers are the grid's own.** Every cell — body, subtotal, grand total
|
|
1479
|
+
* — is the same aggregate kernel the totals row uses, run over the rows that
|
|
1480
|
+
* feed the cell, so a pivot subtotal equals the grid's group total for that
|
|
1481
|
+
* set by construction rather than being re-derived. Both axes expand and
|
|
1482
|
+
* collapse, both are virtualised, and a cell click emits `pivot:drill` with the
|
|
1483
|
+
* keys of the contributing rows.
|
|
1484
|
+
*
|
|
1485
|
+
* **Narrow-screen fallback.** A matrix cannot be read on a phone, so at or
|
|
1486
|
+
* below `maxWidth` (the container width, not the viewport) the pivot degrades
|
|
1487
|
+
* to a card list — the record card by default — exactly as the table does under
|
|
1488
|
+
* `responsive`. Presentation only: sort, filter, group, pivot and the data
|
|
1489
|
+
* pipeline are unchanged.
|
|
1490
|
+
*/
|
|
1491
|
+
pivotView?: boolean | {
|
|
1492
|
+
/** How wide one value column is, in pixels. 120 by default. */
|
|
1493
|
+
cellWidth?: number;
|
|
1494
|
+
/** How tall one body row is, in pixels. 32 by default. */
|
|
1495
|
+
cellHeight?: number;
|
|
1496
|
+
/** How wide the row-label gutter is, in pixels. 200 by default. */
|
|
1497
|
+
headerWidth?: number;
|
|
1498
|
+
/** Degrade to cards at or below this container width. 640 by default. */
|
|
1499
|
+
maxWidth?: number;
|
|
1500
|
+
/** The card layout the narrow fallback uses. The record card when omitted. */
|
|
1501
|
+
fallbackTemplate?: string | object;
|
|
1502
|
+
/** A class of your own on the pivot root, alongside the grid's. */
|
|
1503
|
+
className?: string;
|
|
1504
|
+
/** The pivot's role. `grid` by default — a pivot is a grid of cells. */
|
|
1505
|
+
role?: string;
|
|
1506
|
+
};
|
|
1507
|
+
|
|
1465
1508
|
/**
|
|
1466
1509
|
* Present rows as cards when the grid's container is too narrow to be a
|
|
1467
1510
|
* table honestly, a phone, or a narrow panel on a wide screen.
|
|
@@ -2018,6 +2061,12 @@ export interface GridState {
|
|
|
2018
2061
|
sort?: SortEntry[];
|
|
2019
2062
|
group?: string[];
|
|
2020
2063
|
pivot?: { enabled: boolean; columns: string[] };
|
|
2064
|
+
/**
|
|
2065
|
+
* The pivot presentation's collapse state (§10, BACKLOG-0000738): which
|
|
2066
|
+
* row-axis and column-axis nodes are collapsed. Absent when the matrix is
|
|
2067
|
+
* fully expanded, and tolerated as "expand all" when applied.
|
|
2068
|
+
*/
|
|
2069
|
+
pivotView?: { rowsCollapsed: string[]; columnsCollapsed: string[] };
|
|
2021
2070
|
formatting?: Record<string, FormattingRule[]>;
|
|
2022
2071
|
expanded?: string[];
|
|
2023
2072
|
selection?: string[];
|
|
@@ -2392,6 +2441,38 @@ export interface StatisticsApi {
|
|
|
2392
2441
|
* its exact tier and, when one exists, the approximate alternative and bound.
|
|
2393
2442
|
*/
|
|
2394
2443
|
maintenanceTier(fn: string): MaintenanceTier;
|
|
2444
|
+
/**
|
|
2445
|
+
* A windowed aggregate — "the average lately" (BACKLOG-0000654) — over one
|
|
2446
|
+
* column, stamped with the window it covers (`over`), so a windowed figure is
|
|
2447
|
+
* never read without its window. Exact over the values inside the window.
|
|
2448
|
+
*
|
|
2449
|
+
* `kind: 'count'` takes the last `span` values in arrival order. `kind:
|
|
2450
|
+
* 'time'` takes the values within the last `span` ms (or `minutes`) and `kind:
|
|
2451
|
+
* 'session'` takes every value; both need a timestamp column, so `by` is
|
|
2452
|
+
* required for them and never guessed. Returns null when the column, or the
|
|
2453
|
+
* `by` column, is unknown.
|
|
2454
|
+
*/
|
|
2455
|
+
windowed(colId: string, fn: WindowedFn, opts: {
|
|
2456
|
+
kind: 'count' | 'time' | 'session';
|
|
2457
|
+
/** N ticks for a count window, or N ms for a time window. */
|
|
2458
|
+
span?: number;
|
|
2459
|
+
/** N minutes for a time window, converted to ms. */
|
|
2460
|
+
minutes?: number;
|
|
2461
|
+
/** A timestamp column; required for a time or session window. */
|
|
2462
|
+
by?: string;
|
|
2463
|
+
}): WindowedResult | null;
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
/** A named aggregate a windowed reduction can return. */
|
|
2467
|
+
export type WindowedFn =
|
|
2468
|
+
| 'sum' | 'avg' | 'mean' | 'min' | 'max' | 'count' | 'variance' | 'stddev';
|
|
2469
|
+
|
|
2470
|
+
/** One windowed figure and the window it covers. */
|
|
2471
|
+
export interface WindowedResult {
|
|
2472
|
+
/** The reduction, or null when the window held no usable values. */
|
|
2473
|
+
value: number | null;
|
|
2474
|
+
/** The window the figure was computed over — always stated. */
|
|
2475
|
+
over: WindowSpec;
|
|
2395
2476
|
}
|
|
2396
2477
|
|
|
2397
2478
|
/** How an approximate reduction's error bound holds, and what it measures. */
|
|
@@ -2434,6 +2515,40 @@ export interface WindowSpec {
|
|
|
2434
2515
|
size: number;
|
|
2435
2516
|
}
|
|
2436
2517
|
|
|
2518
|
+
/** The three window kinds a caller may ask for. */
|
|
2519
|
+
export const WINDOW_KINDS: readonly ('count' | 'time' | 'session')[];
|
|
2520
|
+
|
|
2521
|
+
/**
|
|
2522
|
+
* A sliding window over a stream of timestamped values (BACKLOG-0000654). Holds
|
|
2523
|
+
* the values currently in the window and re-reduces them on demand; the reduction
|
|
2524
|
+
* is exact over the values in the window. `grid.statistics.windowed(...)` drives
|
|
2525
|
+
* one of these over a column; a host can also drive one live, tick by tick.
|
|
2526
|
+
*/
|
|
2527
|
+
export class Window {
|
|
2528
|
+
constructor(kind: 'count' | 'time' | 'session', span?: number, now?: () => number);
|
|
2529
|
+
/** How many values are in the window right now. */
|
|
2530
|
+
readonly size: number;
|
|
2531
|
+
/** Add one value at an explicit or current timestamp. */
|
|
2532
|
+
push(v: number, t?: number): void;
|
|
2533
|
+
/** The window descriptor as it stands now. */
|
|
2534
|
+
spec(): WindowSpec;
|
|
2535
|
+
/** The values currently in the window, oldest first. */
|
|
2536
|
+
values(): number[];
|
|
2537
|
+
/** Every windowed aggregate at once, each stamped with the window. */
|
|
2538
|
+
aggregate(): {
|
|
2539
|
+
over: WindowSpec; count: number; sum: number | null; mean: number | null;
|
|
2540
|
+
min: number | null; max: number | null; variance: number | null; stddev: number | null;
|
|
2541
|
+
};
|
|
2542
|
+
/** One named aggregate over the window, stamped with the window it covers. */
|
|
2543
|
+
reduce(fn: WindowedFn): WindowedResult;
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
/** Build a window from a caller's spec: last N ticks, last N minutes/ms, or the session. */
|
|
2547
|
+
export function openWindow(
|
|
2548
|
+
opts: { kind: 'count' | 'time' | 'session'; span?: number; minutes?: number },
|
|
2549
|
+
now?: () => number,
|
|
2550
|
+
): Window;
|
|
2551
|
+
|
|
2437
2552
|
export type ShadowKind =
|
|
2438
2553
|
| 'updates' | 'updatedAt' | 'sinceUpdate' | 'delta' | 'deltaPercent'
|
|
2439
2554
|
| 'rate' | 'history' | 'firstValue' | 'streak'
|
|
@@ -2701,6 +2816,7 @@ export type EventName =
|
|
|
2701
2816
|
/* Columns */
|
|
2702
2817
|
| 'column:moved' | 'column:resized' | 'column:visible' | 'column:pinned'
|
|
2703
2818
|
| 'column:grouped' | 'column:pivoted' | 'column:filter:open' | 'column:menu:open'
|
|
2819
|
+
| 'pivot:drill'
|
|
2704
2820
|
| 'columns:changed' | 'columns:tagged' | 'header:contextmenu'
|
|
2705
2821
|
/* Selection and view */
|
|
2706
2822
|
| 'selection:changed' | 'range:changed' | 'clipboard:copy'
|
|
@@ -3532,6 +3648,22 @@ export interface PresentationApi {
|
|
|
3532
3648
|
setSpotlight(target?: { keys?: string[]; colIds?: string[] } | null): boolean;
|
|
3533
3649
|
}
|
|
3534
3650
|
|
|
3651
|
+
/**
|
|
3652
|
+
* Controls for the pivot presentation (§10, BACKLOG-0000738): expand or collapse
|
|
3653
|
+
* an axis node, and read the collapse state a saved view carries. Every method
|
|
3654
|
+
* is a no-op on a headless grid, which has no matrix to collapse.
|
|
3655
|
+
*/
|
|
3656
|
+
export interface PivotViewApi {
|
|
3657
|
+
/** Expand a collapsed node on the row or column axis. */
|
|
3658
|
+
expand(axis: 'row' | 'column', path: string): void;
|
|
3659
|
+
/** Collapse a node on the row or column axis, hiding its descendants. */
|
|
3660
|
+
collapse(axis: 'row' | 'column', path: string): void;
|
|
3661
|
+
/** Toggle a node's collapse on the row or column axis. */
|
|
3662
|
+
toggle(axis: 'row' | 'column', path: string): void;
|
|
3663
|
+
/** The collapsed row-axis and column-axis paths, as a saved view carries them. */
|
|
3664
|
+
state(): { rowsCollapsed: string[]; columnsCollapsed: string[] };
|
|
3665
|
+
}
|
|
3666
|
+
|
|
3535
3667
|
/**
|
|
3536
3668
|
* Redaction obscures a column's values on screen. It is presentational: the
|
|
3537
3669
|
* values stay in the model, the DOM, the clipboard and every export. Use
|
|
@@ -3838,6 +3970,8 @@ export interface Grid {
|
|
|
3838
3970
|
annotate?: AnnotationApi;
|
|
3839
3971
|
/** Full screen, scaling and chrome suppression. */
|
|
3840
3972
|
readonly presentation: PresentationApi;
|
|
3973
|
+
/** Expand and collapse the pivot presentation's axes; the state a view carries. */
|
|
3974
|
+
readonly pivotView: PivotViewApi;
|
|
3841
3975
|
/** The live feed: pausing it, flushing it, and what it has done. */
|
|
3842
3976
|
readonly updates: UpdatesApi;
|
|
3843
3977
|
/** Replaying the changes the grid has seen. */
|
|
@@ -3960,6 +4094,66 @@ export function parseUnit(text: string | number, opts?: UnitConfig): number | nu
|
|
|
3960
4094
|
export function formatUnit(value: number | null | undefined, opts?: UnitConfig): string;
|
|
3961
4095
|
export const UNIT_SYSTEMS: Record<string, readonly UnitDescriptor[]>;
|
|
3962
4096
|
|
|
4097
|
+
/**
|
|
4098
|
+
* A stored currency value: an amount in a named currency. `{amount:10,code:'USD'}`
|
|
4099
|
+
* is a different value from `{amount:10,code:'EUR'}` — currency is a real type,
|
|
4100
|
+
* not a display format, so the code rides on every cell.
|
|
4101
|
+
*/
|
|
4102
|
+
export interface Money {
|
|
4103
|
+
amount: number;
|
|
4104
|
+
code: string;
|
|
4105
|
+
}
|
|
4106
|
+
|
|
4107
|
+
/**
|
|
4108
|
+
* A caller-supplied exchange-rate source. The grid ships and fetches no rates.
|
|
4109
|
+
* Either a function `(from, to) => rate|null`, or a table of rates per unit of a
|
|
4110
|
+
* common base (the base being whichever code maps to 1, or `rateBase`). A source
|
|
4111
|
+
* that cannot answer returns `null`, which is surfaced loudly, never as zero.
|
|
4112
|
+
*/
|
|
4113
|
+
export type RateSource =
|
|
4114
|
+
| ((from: string, to: string) => number | null)
|
|
4115
|
+
| Record<string, number>;
|
|
4116
|
+
|
|
4117
|
+
export interface CurrencyConfig {
|
|
4118
|
+
/** The default currency code for bare numeric input, e.g. `'USD'`. */
|
|
4119
|
+
code?: string;
|
|
4120
|
+
/** The currency to render and aggregate in. Omit to keep each cell's own. */
|
|
4121
|
+
display?: string;
|
|
4122
|
+
/** The caller's rate source: a `(from,to)=>rate|null` fn or a rate table. */
|
|
4123
|
+
rates?: RateSource;
|
|
4124
|
+
/** The code a rate *table* is denominated in, when not the one mapping to 1. */
|
|
4125
|
+
rateBase?: string;
|
|
4126
|
+
/** Fixed fraction digits; omit for the code's own convention. */
|
|
4127
|
+
decimals?: number;
|
|
4128
|
+
/** The locale for number formatting. */
|
|
4129
|
+
locale?: string;
|
|
4130
|
+
/** Text for a null cell. */
|
|
4131
|
+
nullDisplay?: string;
|
|
4132
|
+
/** The loud marker rendered when a needed rate is missing. */
|
|
4133
|
+
missingRate?: string;
|
|
4134
|
+
/** An Excel number-format override. */
|
|
4135
|
+
excel?: string;
|
|
4136
|
+
/** The code list a currency editor's picker offers. */
|
|
4137
|
+
codes?: string[];
|
|
4138
|
+
}
|
|
4139
|
+
|
|
4140
|
+
/** Build a currency `DataType` (amount + code), aggregate-safe across currencies. */
|
|
4141
|
+
export function createCurrencyType(config?: CurrencyConfig): DataType;
|
|
4142
|
+
/** Parse edited/pasted text into a `Money`, taking the config's `code` for bare numbers. */
|
|
4143
|
+
export function parseMoney(text: string | number, cfg?: CurrencyConfig): Money | null;
|
|
4144
|
+
/** Render a `Money`, in the display currency when set; loud marker when a rate is missing. */
|
|
4145
|
+
export function formatMoney(value: unknown, cfg?: CurrencyConfig): string;
|
|
4146
|
+
/** Convert a `Money` into a target code via the resolved rate fn; `null` when no rate. */
|
|
4147
|
+
export function convertMoney(
|
|
4148
|
+
money: Money,
|
|
4149
|
+
to: string,
|
|
4150
|
+
rate: (from: string, to: string) => number | null,
|
|
4151
|
+
): number | null;
|
|
4152
|
+
/** Resolve a caller's rate source into a `(from,to)=>rate|null` function. */
|
|
4153
|
+
export function rateFunction(rates?: RateSource, base?: string): (from: string, to: string) => number | null;
|
|
4154
|
+
/** The loud marker text a missing rate renders as. */
|
|
4155
|
+
export const MISSING_RATE: string;
|
|
4156
|
+
|
|
3963
4157
|
/** How a statistic block finds the number it reports. */
|
|
3964
4158
|
export interface StatValueSpec {
|
|
3965
4159
|
/** The column to reduce, as a field name or a dotted path. Omit for `count`. */
|
|
@@ -4331,6 +4525,12 @@ export const LatticeGrid: {
|
|
|
4331
4525
|
parseUnit: typeof parseUnit;
|
|
4332
4526
|
formatUnit: typeof formatUnit;
|
|
4333
4527
|
UNIT_SYSTEMS: typeof UNIT_SYSTEMS;
|
|
4528
|
+
createCurrencyType: typeof createCurrencyType;
|
|
4529
|
+
parseMoney: typeof parseMoney;
|
|
4530
|
+
formatMoney: typeof formatMoney;
|
|
4531
|
+
convertMoney: typeof convertMoney;
|
|
4532
|
+
rateFunction: typeof rateFunction;
|
|
4533
|
+
MISSING_RATE: typeof MISSING_RATE;
|
|
4334
4534
|
};
|
|
4335
4535
|
|
|
4336
4536
|
export default LatticeGrid;
|
|
@@ -4433,6 +4633,65 @@ export interface ChartMeasure {
|
|
|
4433
4633
|
title?: string;
|
|
4434
4634
|
}
|
|
4435
4635
|
|
|
4636
|
+
/** One axis's configuration. A bare string is the title. */
|
|
4637
|
+
export interface ChartAxis {
|
|
4638
|
+
title?: string;
|
|
4639
|
+
/** Fix the axis rather than taking its extent from the data. */
|
|
4640
|
+
min?: number;
|
|
4641
|
+
max?: number;
|
|
4642
|
+
/** A tick count, or the exact values to tick. */
|
|
4643
|
+
ticks?: number | unknown[];
|
|
4644
|
+
/** A format mask, or a function of the value. */
|
|
4645
|
+
format?: string | ((value: unknown) => string);
|
|
4646
|
+
/** Draw the gridlines this axis owns. Default true for the measure axis. */
|
|
4647
|
+
grid?: boolean;
|
|
4648
|
+
/** Draw the tick labels. */
|
|
4649
|
+
labels?: boolean;
|
|
4650
|
+
/** Show every nth category label, on a crowded category axis. */
|
|
4651
|
+
every?: number;
|
|
4652
|
+
/** Force the category labels' rotation rather than deciding it. */
|
|
4653
|
+
rotate?: boolean | 'auto';
|
|
4654
|
+
}
|
|
4655
|
+
|
|
4656
|
+
/**
|
|
4657
|
+
* One declarative annotation (BACKLOG-0000744).
|
|
4658
|
+
*
|
|
4659
|
+
* A reference or target line, a shaded band, or a callout. Its value is a
|
|
4660
|
+
* constant `value` (or `from`/`to` for a band), or a `compute` reduction of the
|
|
4661
|
+
* data it annotates — `mean`, `median`, `min`, `max`, or `p95` for a
|
|
4662
|
+
* percentile — so it follows the data as the grid is filtered. Every annotation
|
|
4663
|
+
* names the axis it reads, which on a dual-axis chart is what stops it being
|
|
4664
|
+
* placed against the wrong scale, and is written into the accessible table as a
|
|
4665
|
+
* sentence.
|
|
4666
|
+
*/
|
|
4667
|
+
export interface ChartAnnotation {
|
|
4668
|
+
/** The default is a reference line. */
|
|
4669
|
+
kind?: 'line' | 'target' | 'band' | 'callout';
|
|
4670
|
+
/** A constant value, for a line, target or callout's measure position. */
|
|
4671
|
+
value?: number;
|
|
4672
|
+
/** A reduction of the annotated data instead of a constant. */
|
|
4673
|
+
compute?: 'mean' | 'avg' | 'median' | 'min' | 'max' | string;
|
|
4674
|
+
/** A band's two edges, each a constant or (with `fromCompute`/`toCompute`) computed. */
|
|
4675
|
+
from?: number;
|
|
4676
|
+
to?: number;
|
|
4677
|
+
fromCompute?: string;
|
|
4678
|
+
toCompute?: string;
|
|
4679
|
+
/** A vertical line's or callout's x position: a category or a number. */
|
|
4680
|
+
x?: unknown;
|
|
4681
|
+
at?: unknown;
|
|
4682
|
+
/** Force a line vertical rather than horizontal. */
|
|
4683
|
+
orient?: 'horizontal' | 'vertical';
|
|
4684
|
+
/** Which measure axis the annotation reads. */
|
|
4685
|
+
axis?: 'left' | 'right' | 'y2';
|
|
4686
|
+
/** Restrict a `compute` to one series, by its key. */
|
|
4687
|
+
series?: string;
|
|
4688
|
+
label?: string;
|
|
4689
|
+
colour?: string;
|
|
4690
|
+
/** A band's fill opacity; the default is 0.12. */
|
|
4691
|
+
opacity?: number;
|
|
4692
|
+
className?: string;
|
|
4693
|
+
}
|
|
4694
|
+
|
|
4436
4695
|
/** Data labels beside each mark. */
|
|
4437
4696
|
export interface ChartLabels {
|
|
4438
4697
|
position?: 'outside' | 'inside' | 'auto';
|
|
@@ -4479,7 +4738,28 @@ export interface ChartSpec {
|
|
|
4479
4738
|
scheme?: string | string[];
|
|
4480
4739
|
legend?: boolean | { position?: 'top' | 'bottom' | 'left' | 'right'; isolate?: boolean };
|
|
4481
4740
|
labels?: boolean | ChartLabels;
|
|
4482
|
-
|
|
4741
|
+
/**
|
|
4742
|
+
* Per-axis configuration. Each side is a title string or an object of
|
|
4743
|
+
* `{ title, min, max, ticks, format, grid, labels }`. `y2` (or `right`)
|
|
4744
|
+
* configures the second measure axis of a dual-axis or combo chart
|
|
4745
|
+
* (BACKLOG-0000743); a dual-axis chart labels both axes by default so it
|
|
4746
|
+
* cannot silently mislead.
|
|
4747
|
+
*/
|
|
4748
|
+
axis?: {
|
|
4749
|
+
x?: string | ChartAxis;
|
|
4750
|
+
y?: string | ChartAxis;
|
|
4751
|
+
y2?: string | ChartAxis;
|
|
4752
|
+
right?: string | ChartAxis;
|
|
4753
|
+
};
|
|
4754
|
+
/**
|
|
4755
|
+
* Dragging across the plot. `true` or `'filter'` writes a range condition into
|
|
4756
|
+
* the grid; `'zoom'` changes only this chart's own domain; `'select'` selects
|
|
4757
|
+
* the rows under the drag. The object form names which axis the drag acts on —
|
|
4758
|
+
* `axis: 'y'` or `'y2'` brushes a value axis, which on a dual-axis chart must
|
|
4759
|
+
* say which one it means (BACKLOG-0000743).
|
|
4760
|
+
*/
|
|
4761
|
+
brush?: boolean | 'filter' | 'zoom' | 'select'
|
|
4762
|
+
| { mode: 'filter' | 'zoom' | 'select'; axis?: 'x' | 'y' | 'y2' };
|
|
4483
4763
|
font?: object;
|
|
4484
4764
|
margin?: number | { top?: number; right?: number; bottom?: number; left?: number };
|
|
4485
4765
|
/** Horizontal reference lines. */
|
|
@@ -4498,7 +4778,20 @@ export interface ChartSpec {
|
|
|
4498
4778
|
* from another column instead.
|
|
4499
4779
|
*/
|
|
4500
4780
|
error?: boolean | { of?: string; confidence?: number };
|
|
4501
|
-
|
|
4781
|
+
/**
|
|
4782
|
+
* Horizontal reference lines. On a dual-axis bar or line chart (see
|
|
4783
|
+
* {@link ChartMeasure.axis}) a line naming `axis: 'right'` is placed on the
|
|
4784
|
+
* right-hand scale, so it means what the right axis says rather than landing
|
|
4785
|
+
* at the same number on the scale it does not belong to.
|
|
4786
|
+
*/
|
|
4787
|
+
reference?: { value: number; label?: string; axis?: 'left' | 'right' }[];
|
|
4788
|
+
/**
|
|
4789
|
+
* The declarative annotation layer: reference and target lines, shaded bands
|
|
4790
|
+
* and callouts, each naming the axis it reads and each described into the
|
|
4791
|
+
* accessible table as a sentence. A value may be a constant or `compute`d from
|
|
4792
|
+
* the data it annotates, so it follows the chart as the grid is filtered.
|
|
4793
|
+
*/
|
|
4794
|
+
annotations?: ChartAnnotation[];
|
|
4502
4795
|
/** Bins for a histogram; the default is twelve. */
|
|
4503
4796
|
buckets?: number;
|
|
4504
4797
|
/** A diverging colour ramp, for heatmap and geomap. */
|