@toclocoinc/lattice-grid 1.62.0 → 1.63.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 +23 -8
- package/docs/API.html +526 -16
- package/docs/CHART-CODES.md +141 -2
- package/docs/api-detail.html +194 -5
- package/lattice-grid.d.ts +235 -5
- package/lattice-grid.esm.min.js +856 -78
- package/lattice-grid.min.cjs +856 -78
- package/lattice-grid.min.js +856 -78
- package/modules/ai.d.ts +1 -1
- package/modules/ai.esm.min.js +13 -16
- package/modules/ai.min.cjs +13 -16
- package/modules/ai.min.js +13 -16
- package/modules/angular.d.ts +1 -1
- package/modules/angular.esm.min.js +2 -2
- package/modules/angular.min.cjs +2 -2
- package/modules/angular.min.js +2 -2
- package/modules/chart-alluvial.d.ts +1 -1
- package/modules/chart-alluvial.esm.min.js +1 -1
- package/modules/chart-alluvial.min.cjs +147 -0
- package/modules/chart-alluvial.min.js +147 -0
- package/modules/chart-arc.d.ts +1 -1
- package/modules/chart-arc.esm.min.js +1 -1
- package/modules/chart-arc.min.cjs +106 -0
- package/modules/chart-arc.min.js +106 -0
- package/modules/chart-bubblemap.d.ts +1 -1
- package/modules/chart-bubblemap.esm.min.js +42 -6
- package/modules/chart-bubblemap.min.cjs +126 -0
- package/modules/chart-bubblemap.min.js +126 -0
- package/modules/chart-bump.d.ts +1 -1
- package/modules/chart-bump.esm.min.js +1 -1
- package/modules/chart-bump.min.cjs +110 -0
- package/modules/chart-bump.min.js +110 -0
- package/modules/chart-calendar.d.ts +1 -1
- package/modules/chart-calendar.esm.min.js +1 -1
- package/modules/chart-calendar.min.cjs +129 -0
- package/modules/chart-calendar.min.js +129 -0
- package/modules/chart-decomposition.d.ts +1 -1
- package/modules/chart-decomposition.esm.min.js +1 -1
- package/modules/chart-decomposition.min.cjs +131 -0
- package/modules/chart-decomposition.min.js +131 -0
- package/modules/chart-diverging.d.ts +1 -1
- package/modules/chart-diverging.esm.min.js +1 -1
- package/modules/chart-diverging.min.cjs +104 -0
- package/modules/chart-diverging.min.js +104 -0
- package/modules/chart-dumbbell.d.ts +1 -1
- package/modules/chart-dumbbell.esm.min.js +1 -1
- package/modules/chart-dumbbell.min.cjs +114 -0
- package/modules/chart-dumbbell.min.js +114 -0
- package/modules/chart-fan.d.ts +1 -1
- package/modules/chart-fan.esm.min.js +1 -1
- package/modules/chart-fan.min.cjs +139 -0
- package/modules/chart-fan.min.js +139 -0
- package/modules/chart-hexbin.d.ts +1 -1
- package/modules/chart-hexbin.esm.min.js +1 -1
- package/modules/chart-hexbin.min.cjs +148 -0
- package/modules/chart-hexbin.min.js +148 -0
- package/modules/chart-hexmap.d.ts +1 -1
- package/modules/chart-hexmap.esm.min.js +46 -6
- package/modules/chart-hexmap.min.cjs +164 -0
- package/modules/chart-hexmap.min.js +164 -0
- package/modules/chart-icicle.d.ts +1 -1
- package/modules/chart-icicle.esm.min.js +1 -1
- package/modules/chart-icicle.min.cjs +97 -0
- package/modules/chart-icicle.min.js +97 -0
- package/modules/chart-parallel.d.ts +1 -1
- package/modules/chart-parallel.esm.min.js +1 -1
- package/modules/chart-parallel.min.cjs +123 -0
- package/modules/chart-parallel.min.js +123 -0
- package/modules/chart-ridgeline.d.ts +1 -1
- package/modules/chart-ridgeline.esm.min.js +1 -1
- package/modules/chart-ridgeline.min.cjs +119 -0
- package/modules/chart-ridgeline.min.js +119 -0
- package/modules/chart-roc.d.ts +1 -1
- package/modules/chart-roc.esm.min.js +1 -1
- package/modules/chart-roc.min.cjs +181 -0
- package/modules/chart-roc.min.js +181 -0
- package/modules/chart-slope.d.ts +1 -1
- package/modules/chart-slope.esm.min.js +1 -1
- package/modules/chart-slope.min.cjs +100 -0
- package/modules/chart-slope.min.js +100 -0
- package/modules/chart-splom.d.ts +1 -1
- package/modules/chart-splom.esm.min.js +1 -1
- package/modules/chart-splom.min.cjs +124 -0
- package/modules/chart-splom.min.js +124 -0
- package/modules/chart-waffle.d.ts +1 -1
- package/modules/chart-waffle.esm.min.js +1 -1
- package/modules/chart-waffle.min.cjs +97 -0
- package/modules/chart-waffle.min.js +97 -0
- package/modules/charts.d.ts +1 -1
- package/modules/charts.esm.min.js +1917 -662
- package/modules/charts.min.cjs +1917 -662
- package/modules/charts.min.js +1917 -662
- package/modules/data-router.d.ts +1 -1
- package/modules/data-router.esm.min.js +129 -20
- package/modules/data-router.min.cjs +129 -20
- package/modules/data-router.min.js +129 -20
- package/modules/devtools.d.ts +1 -1
- package/modules/devtools.esm.min.js +2 -2
- package/modules/devtools.min.cjs +2 -2
- package/modules/devtools.min.js +2 -2
- package/modules/dhtmlx-compat.d.ts +1 -1
- package/modules/dhtmlx-compat.esm.min.js +4 -16
- package/modules/dhtmlx-compat.min.cjs +4 -16
- package/modules/dhtmlx-compat.min.js +4 -16
- package/modules/gantt.d.ts +1 -1
- package/modules/gantt.esm.min.js +187 -82
- package/modules/gantt.min.cjs +187 -82
- package/modules/gantt.min.js +187 -82
- package/modules/geo-europe-nuts.d.ts +16 -0
- package/modules/geo-europe-nuts.esm.min.js +29 -0
- package/modules/geo-uk.d.ts +18 -0
- package/modules/geo-uk.esm.min.js +29 -0
- package/modules/geo-us-states.d.ts +16 -0
- package/modules/geo-us-states.esm.min.js +29 -0
- package/modules/geo-world-110m.d.ts +17 -0
- package/modules/geo-world-110m.esm.min.js +29 -0
- package/modules/geo-world-50m.d.ts +16 -0
- package/modules/geo-world-50m.esm.min.js +29 -0
- package/modules/htmx.d.ts +1 -1
- package/modules/htmx.esm.min.js +856 -78
- package/modules/htmx.min.cjs +856 -78
- package/modules/htmx.min.js +856 -78
- package/modules/kanban.d.ts +1 -1
- package/modules/kanban.esm.min.js +4 -16
- package/modules/kanban.min.cjs +4 -16
- package/modules/kanban.min.js +4 -16
- package/modules/kpi.d.ts +1 -1
- package/modules/kpi.esm.min.js +29 -24
- package/modules/kpi.min.cjs +29 -24
- package/modules/kpi.min.js +29 -24
- package/modules/layout.d.ts +1 -1
- package/modules/layout.esm.min.js +4 -16
- package/modules/layout.min.cjs +4 -16
- package/modules/layout.min.js +4 -16
- package/modules/mock-socket.d.ts +1 -1
- package/modules/mock-socket.esm.min.js +2 -2
- package/modules/mock-socket.min.cjs +2 -2
- package/modules/mock-socket.min.js +2 -2
- package/modules/react.d.ts +308 -3
- package/modules/react.esm.min.js +1072 -22
- package/modules/react.min.cjs +1056 -21
- package/modules/react.min.js +1056 -21
- package/modules/svelte.d.ts +1 -1
- package/modules/svelte.esm.min.js +2 -2
- package/modules/svelte.min.cjs +2 -2
- package/modules/svelte.min.js +2 -2
- package/modules/tabs.d.ts +1 -1
- package/modules/tabs.esm.min.js +4 -16
- package/modules/tabs.min.cjs +4 -16
- package/modules/tabs.min.js +4 -16
- package/modules/vue.d.ts +1 -1
- package/modules/vue.esm.min.js +2 -2
- package/modules/vue.min.cjs +2 -2
- package/modules/vue.min.js +2 -2
- package/modules/webcomponent.d.ts +1 -1
- package/modules/webcomponent.esm.min.js +856 -78
- package/modules/webcomponent.min.cjs +856 -78
- package/modules/webcomponent.min.js +856 -78
- 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.63.0, type declarations
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
@@ -238,6 +238,12 @@ export interface NumberFormat {
|
|
|
238
238
|
notation?: 'standard' | 'compact' | 'scientific';
|
|
239
239
|
negative?: 'minus' | 'parentheses' | 'suffix';
|
|
240
240
|
negativeClass?: string;
|
|
241
|
+
/**
|
|
242
|
+
* Show a leading `+` on a positive value (`+5`, `+£5.00`, `+12%`). A
|
|
243
|
+
* negative value keeps whatever `negative` says regardless of this flag,
|
|
244
|
+
* and zero shows no sign either way (BACKLOG-0001095). Off by default.
|
|
245
|
+
*/
|
|
246
|
+
signed?: boolean;
|
|
241
247
|
prefix?: string;
|
|
242
248
|
suffix?: string;
|
|
243
249
|
zeroDisplay?: string;
|
|
@@ -1225,7 +1231,12 @@ export interface Source {
|
|
|
1225
1231
|
destroy?(): void;
|
|
1226
1232
|
}
|
|
1227
1233
|
|
|
1228
|
-
export interface MemorySourceConfig {
|
|
1234
|
+
export interface MemorySourceConfig {
|
|
1235
|
+
mode: 'memory';
|
|
1236
|
+
columnarBelow?: number;
|
|
1237
|
+
/** The rows a memory source opens with; equivalent to top-level `rows`, which wins if both are given. */
|
|
1238
|
+
rows?: unknown[];
|
|
1239
|
+
}
|
|
1229
1240
|
|
|
1230
1241
|
/**
|
|
1231
1242
|
* How rows are ingested into the column store.
|
|
@@ -1333,8 +1344,33 @@ export interface RemoteRequest {
|
|
|
1333
1344
|
protocol: 1;
|
|
1334
1345
|
range: { start: number; end: number };
|
|
1335
1346
|
groupPath: string[];
|
|
1347
|
+
/**
|
|
1348
|
+
* The same ancestry as `groupPath`, but as the values the server returned
|
|
1349
|
+
* rather than their display strings (BACKLOG-0001325). Always present, empty
|
|
1350
|
+
* at the root, so a source can tell "no ancestors" from "a host that does not
|
|
1351
|
+
* send this".
|
|
1352
|
+
*
|
|
1353
|
+
* `groupPath` is stringified because it is a stable *identity* for expansion
|
|
1354
|
+
* state, and that is what it must stay: a numeric key `3` is `'3'` there and
|
|
1355
|
+
* an absent key is `''`, indistinguishable from a group whose key really is
|
|
1356
|
+
* the empty string. Useless for narrowing a query, then — which is what a
|
|
1357
|
+
* grouping engine needs it for — so the typed values travel beside it.
|
|
1358
|
+
*/
|
|
1359
|
+
groupValues: unknown[];
|
|
1336
1360
|
groupBy: ColumnRef[];
|
|
1337
1361
|
totals: ColumnRef[];
|
|
1362
|
+
/**
|
|
1363
|
+
* The named statistic each totalled column reduces with — `{ amount: 'sum' }`
|
|
1364
|
+
* (BACKLOG-0001325). `totals` has always said *which* columns want a subtotal
|
|
1365
|
+
* and never *what*, because the client reads the reduction off the column
|
|
1366
|
+
* model and a server had no way to.
|
|
1367
|
+
*
|
|
1368
|
+
* Only string reductions appear: a column totalling with a host function has
|
|
1369
|
+
* no name to send, and naming one that merely resembles it would put a
|
|
1370
|
+
* plausible wrong number on every group row. `groupTotal` wins over `total`,
|
|
1371
|
+
* the same precedence the client applies for the group scope.
|
|
1372
|
+
*/
|
|
1373
|
+
totalFns: Record<string, string>;
|
|
1338
1374
|
pivotBy: ColumnRef[];
|
|
1339
1375
|
pivotMode: boolean;
|
|
1340
1376
|
filters: FilterSet;
|
|
@@ -3197,7 +3233,22 @@ export interface PushdownCapabilities {
|
|
|
3197
3233
|
range?: boolean;
|
|
3198
3234
|
/** Whether it can report the count of matching rows. */
|
|
3199
3235
|
total?: boolean;
|
|
3200
|
-
/**
|
|
3236
|
+
/**
|
|
3237
|
+
* Whether it can answer the grid's grouped view — group rows, their counts,
|
|
3238
|
+
* their subtotals and their order — one level at a time, instead of returning
|
|
3239
|
+
* the leaves for the grid to group in the browser (BACKLOG-0001325).
|
|
3240
|
+
*
|
|
3241
|
+
* All or nothing, unlike `filter`. A filter splits because the engine
|
|
3242
|
+
* narrowing a superset and the grid narrowing what is left reach the same set;
|
|
3243
|
+
* a grouping cannot, because group rows counted over the wrong set are wrong
|
|
3244
|
+
* rows, not slow ones. So the push router refuses the whole grouped level —
|
|
3245
|
+
* and says why in `PushdownPlan.groupReason` — whenever anything else in the
|
|
3246
|
+
* query failed to push.
|
|
3247
|
+
*
|
|
3248
|
+
* An adapter declaring this must implement `executeGroupLevel`; one that
|
|
3249
|
+
* declares it without the method is re-planned without grouping and warned
|
|
3250
|
+
* about, rather than half-pushed.
|
|
3251
|
+
*/
|
|
3201
3252
|
group?: boolean;
|
|
3202
3253
|
/**
|
|
3203
3254
|
* What the adapter can persist back — the write-back contract (§4.1). `false`
|
|
@@ -3215,6 +3266,43 @@ export interface PushdownAdapter {
|
|
|
3215
3266
|
/** Run the part of the query the adapter declared it could handle. */
|
|
3216
3267
|
execute(query: RemoteRequest, request?: RemoteRequest):
|
|
3217
3268
|
Promise<{ rows: unknown[]; total?: number }>;
|
|
3269
|
+
/**
|
|
3270
|
+
* Answer one level of a grouped grid (BACKLOG-0001325). Present only when
|
|
3271
|
+
* `capabilities.group` opts in.
|
|
3272
|
+
*
|
|
3273
|
+
* The level is `query.groupValues.length`: the root asks for the outermost
|
|
3274
|
+
* grouping column's distinct values, expanding a group asks for the next
|
|
3275
|
+
* column's values within it, and past the last grouping column the children
|
|
3276
|
+
* are the leaves (`leaves: true`).
|
|
3277
|
+
*
|
|
3278
|
+
* A group row comes back in the shape the remote source already reads from a
|
|
3279
|
+
* grouping server: the grouping column's own id carries the key, `leafCount`
|
|
3280
|
+
* the group's row count, `totals` the subtotals keyed by column id. `total` is
|
|
3281
|
+
* how many group rows the level holds. At the root, `matchCount` and `grand`
|
|
3282
|
+
* carry the whole-set figures a grouped window cannot derive — the rows the
|
|
3283
|
+
* filter matched, and the grand total over them.
|
|
3284
|
+
*
|
|
3285
|
+
* `aggregates` is the subtotal list the source routed to the engine; anything
|
|
3286
|
+
* it could not route is named in `PushdownPlan.aggregates.client` and left
|
|
3287
|
+
* absent from the group row rather than computed over the wrong set.
|
|
3288
|
+
*/
|
|
3289
|
+
executeGroupLevel?(
|
|
3290
|
+
query: RemoteRequest,
|
|
3291
|
+
aggregates: Array<{ id: string; col: string; fn: string; weight?: string }>,
|
|
3292
|
+
request?: RemoteRequest,
|
|
3293
|
+
): Promise<{
|
|
3294
|
+
rows: unknown[];
|
|
3295
|
+
total?: number;
|
|
3296
|
+
leaves?: boolean;
|
|
3297
|
+
matchCount?: number;
|
|
3298
|
+
grand?: Record<string, unknown>;
|
|
3299
|
+
}>;
|
|
3300
|
+
/**
|
|
3301
|
+
* The row count before any filter (BACKLOG-0001325) — the denominator of
|
|
3302
|
+
* "1,204 of 100,000" under grouping, where the display count is group headers
|
|
3303
|
+
* rather than rows. Optional; a source falls back to the display count.
|
|
3304
|
+
*/
|
|
3305
|
+
unfilteredCount?(): Promise<number | null>;
|
|
3218
3306
|
/**
|
|
3219
3307
|
* Persist one mutation (§4.2). Present only when `capabilities.mutate` opts
|
|
3220
3308
|
* in. `createPushdownSource` synthesises an `edit.commit` that calls this for
|
|
@@ -3252,8 +3340,28 @@ export interface PushdownPlan {
|
|
|
3252
3340
|
};
|
|
3253
3341
|
/** Whether the whole result had to be fetched rather than a window. */
|
|
3254
3342
|
needsAll: boolean;
|
|
3255
|
-
/**
|
|
3343
|
+
/**
|
|
3344
|
+
* Which parts could not be pushed: `filter`, `sort`, `quick`, `where`,
|
|
3345
|
+
* `group`.
|
|
3346
|
+
*/
|
|
3256
3347
|
unpushed: string[];
|
|
3348
|
+
/**
|
|
3349
|
+
* Whether the engine answered the grid's grouped view for this request
|
|
3350
|
+
* (BACKLOG-0001325). False for an ungrouped query and for a grouped one the
|
|
3351
|
+
* engine was refused — `groupReason` says which.
|
|
3352
|
+
*/
|
|
3353
|
+
grouped: boolean;
|
|
3354
|
+
/**
|
|
3355
|
+
* Which grouping level a pushed grouped request asked for: 0 at the root, 1
|
|
3356
|
+
* inside a group, and so on. Zero when nothing was grouped.
|
|
3357
|
+
*/
|
|
3358
|
+
groupLevel: number;
|
|
3359
|
+
/**
|
|
3360
|
+
* Why a grouped request was *not* pushed, in a sentence, or `''` when it was
|
|
3361
|
+
* pushed or when nothing was grouped. Grouping is all or nothing, so this is
|
|
3362
|
+
* the whole story rather than a residual.
|
|
3363
|
+
*/
|
|
3364
|
+
groupReason: string;
|
|
3257
3365
|
/**
|
|
3258
3366
|
* Whether the whole result was fetched because `fullDataset` is on, rather
|
|
3259
3367
|
* than only because residual work forced it. When true, totals and statistics
|
|
@@ -4900,6 +5008,20 @@ export interface ClipboardOptions {
|
|
|
4900
5008
|
// Grid API (spec 18.3)
|
|
4901
5009
|
// ---------------------------------------------------------------------------
|
|
4902
5010
|
|
|
5011
|
+
/**
|
|
5012
|
+
* How much of the data a computed figure actually covers.
|
|
5013
|
+
*
|
|
5014
|
+
* `covered < total`, or `total === null`, means the figure is approximate.
|
|
5015
|
+
*/
|
|
5016
|
+
export interface StatCoverage {
|
|
5017
|
+
/** Rows the figure was computed over. */
|
|
5018
|
+
covered: number;
|
|
5019
|
+
/** Rows the source knows about, or `null` when it cannot know — never a guess. */
|
|
5020
|
+
total: number | null;
|
|
5021
|
+
/** True when a window bounded the computation, so the figure covers part of the data. */
|
|
5022
|
+
windowed: boolean;
|
|
5023
|
+
}
|
|
5024
|
+
|
|
4903
5025
|
export interface RowsApi {
|
|
4904
5026
|
/** Replace the data. Sort, filters, grouping and column layout are kept. */
|
|
4905
5027
|
load(rows: unknown[]): void;
|
|
@@ -4912,6 +5034,11 @@ export interface RowsApi {
|
|
|
4912
5034
|
totalCount(): number;
|
|
4913
5035
|
/** Data rows matching the filters, excluding group, footer and total rows. */
|
|
4914
5036
|
matchCount(): number;
|
|
5037
|
+
/**
|
|
5038
|
+
* How much of the data a figure computed from this grid covers, so a
|
|
5039
|
+
* statistic over a windowed source can say it is approximate.
|
|
5040
|
+
*/
|
|
5041
|
+
coverage(): StatCoverage;
|
|
4915
5042
|
data(): unknown[];
|
|
4916
5043
|
forEach(fn: (row: Row, index: number) => void): void;
|
|
4917
5044
|
/** Every row in the data, before any filter. Leaf rows, in physical order. */
|
|
@@ -6995,6 +7122,41 @@ export function duckdbAdapter(options: {
|
|
|
6995
7122
|
* (BACKLOG-0001065). `null` when the adapter was built with `count: false`.
|
|
6996
7123
|
*/
|
|
6997
7124
|
countSqlFor(query: RemoteRequest): { sql: string; params: unknown[] } | null;
|
|
7125
|
+
/**
|
|
7126
|
+
* The `GROUP BY` statement one level of a grouped grid becomes
|
|
7127
|
+
* (BACKLOG-0001325), exposed like {@link sqlFor} so a test can read it without
|
|
7128
|
+
* an engine. `keyCol` is the grouping column at the request's depth and
|
|
7129
|
+
* `keyAlias` the name its value comes back under.
|
|
7130
|
+
*/
|
|
7131
|
+
groupLevelSqlFor(
|
|
7132
|
+
query: RemoteRequest,
|
|
7133
|
+
aggregates?: Array<{ id: string; col: string; fn: string; weight?: string }>,
|
|
7134
|
+
): { sql: string; params: unknown[]; keyCol: string; keyAlias: string };
|
|
7135
|
+
/**
|
|
7136
|
+
* The statement that counts the *groups* at one level — a `count(*)` over the
|
|
7137
|
+
* grouped sub-select, which is not the matching row count (BACKLOG-0001325).
|
|
7138
|
+
* `null` when the adapter was built with `count: false`.
|
|
7139
|
+
*/
|
|
7140
|
+
groupCountSqlFor(query: RemoteRequest): { sql: string; params: unknown[] } | null;
|
|
7141
|
+
/**
|
|
7142
|
+
* The row query for the leaves of a group: the page statement with the parent
|
|
7143
|
+
* group path ANDed onto its `WHERE` (BACKLOG-0001325).
|
|
7144
|
+
*/
|
|
7145
|
+
groupLeafSqlFor(query: RemoteRequest): { sql: string; params: unknown[] };
|
|
7146
|
+
/**
|
|
7147
|
+
* The count of leaves inside one group (BACKLOG-0001325). `null` when the
|
|
7148
|
+
* adapter was built with `count: false`.
|
|
7149
|
+
*/
|
|
7150
|
+
groupLeafCountSqlFor(query: RemoteRequest): { sql: string; params: unknown[] } | null;
|
|
7151
|
+
/**
|
|
7152
|
+
* The whole-matching-set summary that rides alongside a root-level grouped
|
|
7153
|
+
* fetch: the matching row count and the grand total in one statement
|
|
7154
|
+
* (BACKLOG-0001325).
|
|
7155
|
+
*/
|
|
7156
|
+
groupSummarySqlFor(
|
|
7157
|
+
query: RemoteRequest,
|
|
7158
|
+
aggregates?: Array<{ id: string; col: string; fn: string; weight?: string }>,
|
|
7159
|
+
): { sql: string; params: unknown[] };
|
|
6998
7160
|
};
|
|
6999
7161
|
|
|
7000
7162
|
/**
|
|
@@ -7338,6 +7500,17 @@ export interface ChartAxis {
|
|
|
7338
7500
|
grid?: boolean;
|
|
7339
7501
|
/** Draw the tick labels. */
|
|
7340
7502
|
labels?: boolean;
|
|
7503
|
+
/**
|
|
7504
|
+
* Pin the x axis's scale rather than taking it from the column's type
|
|
7505
|
+
* (BACKLOG-0001344). The default, `'auto'`, is the rule stated in the charts
|
|
7506
|
+
* section: a temporal column type (`date`, `datetime`, `timestamp`,
|
|
7507
|
+
* `dateString`) draws a time axis, a numeric one draws a linear axis whatever
|
|
7508
|
+
* its distinct count, and everything else draws bands. `'band'` is how a
|
|
7509
|
+
* numeric code column — a quarter, a rating, a star count — asks for its
|
|
7510
|
+
* bands back; `'linear'` and `'time'` put a column the grid types as text
|
|
7511
|
+
* onto a continuous axis. Only the x axis reads it.
|
|
7512
|
+
*/
|
|
7513
|
+
scale?: 'auto' | 'linear' | 'time' | 'band' | 'category';
|
|
7341
7514
|
/** Show every nth category label, on a crowded category axis. */
|
|
7342
7515
|
every?: number;
|
|
7343
7516
|
/** Force the category labels' rotation rather than deciding it. */
|
|
@@ -7475,6 +7648,29 @@ export interface ChartLabels {
|
|
|
7475
7648
|
minGap?: number;
|
|
7476
7649
|
}
|
|
7477
7650
|
|
|
7651
|
+
/**
|
|
7652
|
+
* An optional geometry pack for a geomap, as one of the `modules/geo-*`
|
|
7653
|
+
* packages exports (BACKLOG-0001321). Generated at build time from a named
|
|
7654
|
+
* public source; `source`, `licence` and `attribution` record where the
|
|
7655
|
+
* geometry came from and what its licence requires. A single-layer pack
|
|
7656
|
+
* carries `topology` directly; a multi-layer pack (the UK) carries `layers`
|
|
7657
|
+
* instead, keyed by layer name, each with its own `topology`.
|
|
7658
|
+
*/
|
|
7659
|
+
export interface GeoPack {
|
|
7660
|
+
id: string;
|
|
7661
|
+
title: string;
|
|
7662
|
+
kind: string;
|
|
7663
|
+
projection?: ChartSpec['projection'];
|
|
7664
|
+
projectionOptions?: ChartSpec['projectionOptions'];
|
|
7665
|
+
source: { name: string; url: string; version: string; retrieved: string };
|
|
7666
|
+
licence: { name: string; url: string };
|
|
7667
|
+
/** The attribution line the licence requires, verbatim, or `''` when it asks for none. */
|
|
7668
|
+
attribution: string;
|
|
7669
|
+
topology?: object;
|
|
7670
|
+
layers?: Record<string, { name: string; topology: object }>;
|
|
7671
|
+
defaultLayer?: string;
|
|
7672
|
+
}
|
|
7673
|
+
|
|
7478
7674
|
/**
|
|
7479
7675
|
* What a chart draws and how.
|
|
7480
7676
|
*
|
|
@@ -7610,9 +7806,43 @@ export interface ChartSpec {
|
|
|
7610
7806
|
buckets?: number;
|
|
7611
7807
|
/** A diverging colour ramp, for heatmap and geomap. */
|
|
7612
7808
|
diverging?: boolean;
|
|
7613
|
-
/**
|
|
7809
|
+
/**
|
|
7810
|
+
* Country outlines, for a geomap drawing countries rather than continents.
|
|
7811
|
+
* Either GeoJSON, an object of code to SVG path data, or a geometry
|
|
7812
|
+
* {@link GeoPack} imported from an optional `modules/geo-*` package
|
|
7813
|
+
* (BACKLOG-0001321) — as the pack itself, or as `{ pack: id }` once its
|
|
7814
|
+
* module has been imported and registered.
|
|
7815
|
+
*/
|
|
7614
7816
|
shapes?: unknown;
|
|
7615
7817
|
codeProperty?: string;
|
|
7818
|
+
/**
|
|
7819
|
+
* Which layer of a multi-layer geometry pack to draw — the UK pack, for
|
|
7820
|
+
* instance, ships `regions`, `local-authorities` and `constituencies`
|
|
7821
|
+
* together (BACKLOG-0001321). Ignored for a single-layer pack.
|
|
7822
|
+
*/
|
|
7823
|
+
layer?: string;
|
|
7824
|
+
/**
|
|
7825
|
+
* The map projection a geomap draws through (BACKLOG-0001321): `'equalEarth'`
|
|
7826
|
+
* (the default for a world), `'robinson'`, `'mercator'`, `'equirectangular'`,
|
|
7827
|
+
* `'albers'`, `'transverseMercator'`, or a projection function of the
|
|
7828
|
+
* caller's own `(lon: number, lat: number) => [number, number]`. Left unset,
|
|
7829
|
+
* a geometry pack draws through the projection it declares.
|
|
7830
|
+
*/
|
|
7831
|
+
projection?: 'equalEarth' | 'robinson' | 'mercator' | 'equirectangular' | 'albers'
|
|
7832
|
+
| 'transverseMercator' | 'britishNationalGrid'
|
|
7833
|
+
| ((lon: number, lat: number) => [number, number]);
|
|
7834
|
+
/**
|
|
7835
|
+
* Parameters for the projections that take them: `parallels` and `centre`
|
|
7836
|
+
* for `albers`, `centre` for `transverseMercator` (BACKLOG-0001321).
|
|
7837
|
+
*/
|
|
7838
|
+
projectionOptions?: { parallels?: [number, number]; centre?: [number, number] };
|
|
7839
|
+
/**
|
|
7840
|
+
* A lon/lat reference grid under a geomap's regions, off by default
|
|
7841
|
+
* (BACKLOG-0001321 part 2). Only drawn over a geometry pack's fitted
|
|
7842
|
+
* projection — the schematic continents have no fitted projection to draw
|
|
7843
|
+
* one against. `step` is the spacing between lines in degrees (default 30).
|
|
7844
|
+
*/
|
|
7845
|
+
graticule?: boolean | { step?: number };
|
|
7616
7846
|
/** One chart per distinct value of this column. */
|
|
7617
7847
|
multiples?: string;
|
|
7618
7848
|
/** Draw to canvas past this many points. */
|