@ac-kit/model-chart 0.2.0 → 0.3.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/CHANGELOG.md +194 -0
- package/README.md +106 -0
- package/dist/geographic/index.d.ts +2 -0
- package/dist/geographic/index.d.ts.map +1 -0
- package/dist/geographic/index.js +2 -0
- package/dist/geographic/index.js.map +1 -0
- package/dist/geographic/project-geographic-layer.d.ts +54 -0
- package/dist/geographic/project-geographic-layer.d.ts.map +1 -0
- package/dist/geographic/project-geographic-layer.js +214 -0
- package/dist/geographic/project-geographic-layer.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/layout/_fit.d.ts +12 -0
- package/dist/layout/_fit.d.ts.map +1 -0
- package/dist/layout/_fit.js +52 -0
- package/dist/layout/_fit.js.map +1 -0
- package/dist/layout/index.d.ts +4 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +4 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/layout-hierarchy.d.ts +35 -0
- package/dist/layout/layout-hierarchy.d.ts.map +1 -0
- package/dist/layout/layout-hierarchy.js +98 -0
- package/dist/layout/layout-hierarchy.js.map +1 -0
- package/dist/layout/layout-network.d.ts +45 -0
- package/dist/layout/layout-network.d.ts.map +1 -0
- package/dist/layout/layout-network.js +197 -0
- package/dist/layout/layout-network.js.map +1 -0
- package/dist/layout/options.d.ts +29 -0
- package/dist/layout/options.d.ts.map +1 -0
- package/dist/layout/options.js +2 -0
- package/dist/layout/options.js.map +1 -0
- package/dist/render/_fallback-chain.d.ts +13 -0
- package/dist/render/_fallback-chain.d.ts.map +1 -0
- package/dist/render/_fallback-chain.js +41 -0
- package/dist/render/_fallback-chain.js.map +1 -0
- package/dist/render/capabilities.d.ts +13 -0
- package/dist/render/capabilities.d.ts.map +1 -1
- package/dist/render/capabilities.js +40 -10
- package/dist/render/capabilities.js.map +1 -1
- package/dist/resolve/_calendar-interval.d.ts +10 -0
- package/dist/resolve/_calendar-interval.d.ts.map +1 -0
- package/dist/resolve/_calendar-interval.js +27 -0
- package/dist/resolve/_calendar-interval.js.map +1 -0
- package/dist/resolve/_coords.d.ts +35 -0
- package/dist/resolve/_coords.d.ts.map +1 -0
- package/dist/resolve/_coords.js +354 -0
- package/dist/resolve/_coords.js.map +1 -0
- package/dist/resolve/_grid-field.d.ts +16 -0
- package/dist/resolve/_grid-field.d.ts.map +1 -0
- package/dist/resolve/_grid-field.js +23 -0
- package/dist/resolve/_grid-field.js.map +1 -0
- package/dist/resolve/_guides.d.ts +16 -0
- package/dist/resolve/_guides.d.ts.map +1 -0
- package/dist/resolve/_guides.js +66 -0
- package/dist/resolve/_guides.js.map +1 -0
- package/dist/resolve/_options.d.ts +17 -0
- package/dist/resolve/_options.d.ts.map +1 -0
- package/dist/resolve/_options.js +38 -0
- package/dist/resolve/_options.js.map +1 -0
- package/dist/resolve/errors.d.ts +63 -0
- package/dist/resolve/errors.d.ts.map +1 -0
- package/dist/resolve/errors.js +91 -0
- package/dist/resolve/errors.js.map +1 -0
- package/dist/resolve/options.d.ts +30 -0
- package/dist/resolve/options.d.ts.map +1 -0
- package/dist/resolve/options.js +2 -0
- package/dist/resolve/options.js.map +1 -0
- package/dist/resolve/scale-ticks.d.ts +91 -0
- package/dist/resolve/scale-ticks.d.ts.map +1 -0
- package/dist/resolve/scale-ticks.js +231 -0
- package/dist/resolve/scale-ticks.js.map +1 -0
- package/dist/resolve/scale-transform.d.ts +102 -0
- package/dist/resolve/scale-transform.d.ts.map +1 -0
- package/dist/resolve/scale-transform.js +466 -0
- package/dist/resolve/scale-transform.js.map +1 -0
- package/dist/resolve/scale.d.ts +139 -0
- package/dist/resolve/scale.d.ts.map +1 -0
- package/dist/resolve/scale.js +710 -0
- package/dist/resolve/scale.js.map +1 -0
- package/dist/resolve/series.d.ts +26 -0
- package/dist/resolve/series.d.ts.map +1 -0
- package/dist/resolve/series.js +105 -0
- package/dist/resolve/series.js.map +1 -0
- package/dist/resolve/view-types.d.ts +223 -0
- package/dist/resolve/view-types.d.ts.map +1 -0
- package/dist/resolve/view-types.js +2 -0
- package/dist/resolve/view-types.js.map +1 -0
- package/dist/resolve/view.d.ts +43 -0
- package/dist/resolve/view.d.ts.map +1 -0
- package/dist/resolve/view.js +621 -0
- package/dist/resolve/view.js.map +1 -0
- package/dist/spec/channel.d.ts +3 -1
- package/dist/spec/channel.d.ts.map +1 -1
- package/dist/spec/channel.js.map +1 -1
- package/dist/spec/coord.d.ts +17 -0
- package/dist/spec/coord.d.ts.map +1 -1
- package/dist/spec/data-sources.js.map +1 -1
- package/dist/spec/mark.d.ts +6 -1
- package/dist/spec/mark.d.ts.map +1 -1
- package/dist/spec/scale.d.ts +21 -2
- package/dist/spec/scale.d.ts.map +1 -1
- package/dist/spec/transform.d.ts +32 -6
- package/dist/spec/transform.d.ts.map +1 -1
- package/dist/transform/aggregate.d.ts +28 -0
- package/dist/transform/aggregate.d.ts.map +1 -0
- package/dist/transform/aggregate.js +463 -0
- package/dist/transform/aggregate.js.map +1 -0
- package/dist/transform/apply-transforms.d.ts +26 -0
- package/dist/transform/apply-transforms.d.ts.map +1 -0
- package/dist/transform/apply-transforms.js +66 -0
- package/dist/transform/apply-transforms.js.map +1 -0
- package/dist/transform/bin.d.ts +30 -0
- package/dist/transform/bin.d.ts.map +1 -0
- package/dist/transform/bin.js +169 -0
- package/dist/transform/bin.js.map +1 -0
- package/dist/transform/columns.d.ts +24 -0
- package/dist/transform/columns.d.ts.map +1 -0
- package/dist/transform/columns.js +77 -0
- package/dist/transform/columns.js.map +1 -0
- package/dist/transform/filter.d.ts +11 -0
- package/dist/transform/filter.d.ts.map +1 -0
- package/dist/transform/filter.js +64 -0
- package/dist/transform/filter.js.map +1 -0
- package/dist/transform/group-rows.d.ts +25 -0
- package/dist/transform/group-rows.d.ts.map +1 -0
- package/dist/transform/group-rows.js +52 -0
- package/dist/transform/group-rows.js.map +1 -0
- package/dist/transform/sort.d.ts +10 -0
- package/dist/transform/sort.d.ts.map +1 -0
- package/dist/transform/sort.js +63 -0
- package/dist/transform/sort.js.map +1 -0
- package/dist/transform/stack.d.ts +37 -0
- package/dist/transform/stack.d.ts.map +1 -0
- package/dist/transform/stack.js +218 -0
- package/dist/transform/stack.js.map +1 -0
- package/package.json +22 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_guides.d.ts","sourceRoot":"","sources":["../../src/resolve/_guides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAkBrD,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,CAEvE;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CACvB,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,SAAS,aAAa,EAAE,GACjC,aAAa,CAyBf;AAED,sEAAsE;AACtE,wBAAgB,YAAY,CAC3B,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,MAAM,EAAE,WAAW,CAAC,YAAY,EAAE,aAAa,CAAC,GAC9C,aAAa,EAAE,CAqBjB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { fieldTitle } from "@ac-kit/model-dataset";
|
|
2
|
+
import { isFieldEncoding } from "../spec/encoding.js";
|
|
3
|
+
import { scaleChannelOf } from "./scale.js";
|
|
4
|
+
const AXIS_CHANNELS_ = new Set([
|
|
5
|
+
"x",
|
|
6
|
+
"y",
|
|
7
|
+
"z",
|
|
8
|
+
"theta",
|
|
9
|
+
"radius",
|
|
10
|
+
]);
|
|
11
|
+
const CONTINUOUS_KINDS_ = new Set([
|
|
12
|
+
"linear",
|
|
13
|
+
"log",
|
|
14
|
+
"pow",
|
|
15
|
+
"symlog",
|
|
16
|
+
"time",
|
|
17
|
+
]);
|
|
18
|
+
/** The title of a set of fields: their titles, distinct, joined by ", ". */
|
|
19
|
+
export function fieldsTitle_(fields) {
|
|
20
|
+
return [...new Set(fields.map((field) => fieldTitle(field)))].join(", ");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The guide of one scale, from the encodings it serves (in encoding order): the
|
|
24
|
+
* first title, tick count, tick values and gridline setting that is given wins,
|
|
25
|
+
* and any `hidden` hides it.
|
|
26
|
+
*/
|
|
27
|
+
export function guideOf_(channel, scale, encodings) {
|
|
28
|
+
const kind = AXIS_CHANNELS_.has(channel) ? "axis" : "legend";
|
|
29
|
+
const specs = encodings.map((encoding) => kind === "axis" ? encoding.axis : encoding.legend);
|
|
30
|
+
const axes = kind === "axis" ? encodings.map((encoding) => encoding.axis) : [];
|
|
31
|
+
const title = specs.find((spec) => spec?.title !== undefined)?.title ??
|
|
32
|
+
encodings.find((encoding) => encoding.title !== undefined)?.title ??
|
|
33
|
+
fieldsTitle_(scale.fields);
|
|
34
|
+
const grid = axes.find((axis) => axis?.grid !== undefined)?.grid ??
|
|
35
|
+
(kind === "axis" &&
|
|
36
|
+
(channel === "x" || channel === "y") &&
|
|
37
|
+
CONTINUOUS_KINDS_.has(scale.kind));
|
|
38
|
+
return {
|
|
39
|
+
kind,
|
|
40
|
+
channel,
|
|
41
|
+
title,
|
|
42
|
+
hidden: specs.some((spec) => spec?.hidden === true),
|
|
43
|
+
grid: kind === "axis" && grid,
|
|
44
|
+
tickCount: axes.find((axis) => axis?.tickCount !== undefined)?.tickCount,
|
|
45
|
+
tickValues: axes.find((axis) => axis?.tickValues !== undefined)?.tickValues,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** The guides of a panel, one per scale, in the order of `scales`. */
|
|
49
|
+
export function panelGuides_(specs, scales) {
|
|
50
|
+
const guides = [];
|
|
51
|
+
for (const [channel, scale] of scales) {
|
|
52
|
+
const encodings = [];
|
|
53
|
+
for (const spec of specs) {
|
|
54
|
+
for (const [encoded, encoding] of Object.entries(spec.encoding)) {
|
|
55
|
+
if (encoding !== undefined &&
|
|
56
|
+
isFieldEncoding(encoding) &&
|
|
57
|
+
scaleChannelOf(encoded) === channel) {
|
|
58
|
+
encodings.push(encoding);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
guides.push(guideOf_(channel, scale, encodings));
|
|
63
|
+
}
|
|
64
|
+
return guides;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=_guides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_guides.js","sourceRoot":"","sources":["../../src/resolve/_guides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,uBAAuB,CAAC;AAIzE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5C,MAAM,cAAc,GAA8B,IAAI,GAAG,CAAC;IACzD,GAAG;IACH,GAAG;IACH,GAAG;IACH,OAAO;IACP,QAAQ;CACR,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAuC,IAAI,GAAG,CAAC;IACrE,QAAQ;IACR,KAAK;IACL,KAAK;IACL,QAAQ;IACR,MAAM;CACN,CAAC,CAAC;AAEH,4EAA4E;AAC5E,MAAM,UAAU,YAAY,CAAC,MAAkC;IAC9D,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC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3
|
+
/** {@link ResolveOptions} checked, with their defaults. */
|
|
4
|
+
export type CheckedResolveOptions_ = {
|
|
5
|
+
readonly timeZone: string;
|
|
6
|
+
readonly weekStart: CalendarWeekday;
|
|
7
|
+
readonly tickCount: number | undefined;
|
|
8
|
+
readonly maxBins: number | undefined;
|
|
9
|
+
readonly classCount: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @throws {RangeError} An unknown zone, a `weekStart` outside 1 … 7, a
|
|
13
|
+
* `tickCount` or `maxBins` that is not a positive integer, or a `classCount`
|
|
14
|
+
* that is not an integer ≥ 2.
|
|
15
|
+
*/
|
|
16
|
+
export declare function checkResolveOptions_(options: ResolveOptions): CheckedResolveOptions_;
|
|
17
|
+
//# sourceMappingURL=_options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_options.d.ts","sourceRoot":"","sources":["../../src/resolve/_options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,2DAA2D;AAC3D,MAAM,MAAM,sBAAsB,GAAG;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC5B,CAAC;AAKF;;;;GAIG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,cAAc,GACrB,sBAAsB,CA4BxB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { isTimeZone } from "@ac-kit/core";
|
|
2
|
+
const DEFAULT_CLASS_COUNT_ = 5;
|
|
3
|
+
const DEFAULT_WEEK_START_ = 7;
|
|
4
|
+
/**
|
|
5
|
+
* @throws {RangeError} An unknown zone, a `weekStart` outside 1 … 7, a
|
|
6
|
+
* `tickCount` or `maxBins` that is not a positive integer, or a `classCount`
|
|
7
|
+
* that is not an integer ≥ 2.
|
|
8
|
+
*/
|
|
9
|
+
export function checkResolveOptions_(options) {
|
|
10
|
+
const timeZone = options.timeZone ?? "UTC";
|
|
11
|
+
if (!isTimeZone(timeZone)) {
|
|
12
|
+
throw new RangeError(`Unknown time zone "${timeZone}"`);
|
|
13
|
+
}
|
|
14
|
+
const weekStart = options.weekStart ?? DEFAULT_WEEK_START_;
|
|
15
|
+
if (!Number.isInteger(weekStart) || weekStart < 1 || weekStart > 7) {
|
|
16
|
+
throw new RangeError(`weekStart ${weekStart} is outside 1 … 7`);
|
|
17
|
+
}
|
|
18
|
+
for (const [name, value] of [
|
|
19
|
+
["tickCount", options.tickCount],
|
|
20
|
+
["maxBins", options.maxBins],
|
|
21
|
+
]) {
|
|
22
|
+
if (value !== undefined && !(Number.isInteger(value) && value > 0)) {
|
|
23
|
+
throw new RangeError(`${name} ${value} is not a positive integer`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const classCount = options.classCount ?? DEFAULT_CLASS_COUNT_;
|
|
27
|
+
if (!Number.isInteger(classCount) || classCount < 2) {
|
|
28
|
+
throw new RangeError(`classCount ${classCount} is not an integer ≥ 2`);
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
timeZone,
|
|
32
|
+
weekStart,
|
|
33
|
+
tickCount: options.tickCount,
|
|
34
|
+
maxBins: options.maxBins,
|
|
35
|
+
classCount,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=_options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_options.js","sourceRoot":"","sources":["../../src/resolve/_options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,MAAM,oBAAo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AE,OAAO,CAAC,SAAS;QAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,UAAU;KACV,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Channel } from "../spec/channel.js";
|
|
2
|
+
import type { CoordKind } from "../spec/coord.js";
|
|
3
|
+
import type { Mark } from "../spec/mark.js";
|
|
4
|
+
import type { TransformSpec } from "../spec/transform.js";
|
|
5
|
+
/**
|
|
6
|
+
* A scale the spec makes impossible: a kind incompatible with the field or
|
|
7
|
+
* source, a malformed explicit domain, parameters out of range, or conflicting
|
|
8
|
+
* kinds on a shared scale.
|
|
9
|
+
*/
|
|
10
|
+
export declare class InvalidScaleError extends Error {
|
|
11
|
+
readonly channel: Channel;
|
|
12
|
+
constructor(channel: Channel, message: string);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A transform's parameters or fields don't fit: a bin on a nominal field, a
|
|
16
|
+
* `step` ≤ 0, an `as` naming an existing field.
|
|
17
|
+
*/
|
|
18
|
+
export declare class InvalidTransformError extends Error {
|
|
19
|
+
readonly transform: TransformSpec["kind"];
|
|
20
|
+
readonly index: number;
|
|
21
|
+
constructor(transform: TransformSpec["kind"], index: number, message: string, options?: ErrorOptions);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* An encoding the mark or coordinate system can't read: a `link` without
|
|
25
|
+
* `source` and `target`, a `parallel` coordinate system without axes.
|
|
26
|
+
*/
|
|
27
|
+
export declare class InvalidEncodingError extends Error {
|
|
28
|
+
readonly channel: Channel | undefined;
|
|
29
|
+
constructor(channel: Channel | undefined, message: string);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A coordinate parameter out of range: an `innerRadius` outside [0, 1), equal
|
|
33
|
+
* or non-finite angles.
|
|
34
|
+
*/
|
|
35
|
+
export declare class InvalidCoordError extends Error {
|
|
36
|
+
readonly coord: CoordKind;
|
|
37
|
+
constructor(coord: CoordKind, message: string);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A mark or transform the layer's source kind can't feed: a `surface` on a
|
|
41
|
+
* frame, a `line` or `bin` on a grid.
|
|
42
|
+
*/
|
|
43
|
+
export declare class InvalidLayerSourceError extends Error {
|
|
44
|
+
readonly sourceName: string | undefined;
|
|
45
|
+
readonly mark: Mark;
|
|
46
|
+
constructor(sourceName: string | undefined, mark: Mark, message: string);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A hierarchy that isn't a tree: no root, several roots, an unknown parent, or
|
|
50
|
+
* a cycle (rows unreachable from the root).
|
|
51
|
+
*/
|
|
52
|
+
export declare class InvalidHierarchyError extends Error {
|
|
53
|
+
readonly row: number;
|
|
54
|
+
readonly reason: "no-root" | "several-roots" | "unknown-parent" | "cycle";
|
|
55
|
+
constructor(row: number, reason: "no-root" | "several-roots" | "unknown-parent" | "cycle", message: string);
|
|
56
|
+
}
|
|
57
|
+
/** A link endpoint missing from the explicit `nodes` source. */
|
|
58
|
+
export declare class InvalidNetworkError extends Error {
|
|
59
|
+
readonly row: number;
|
|
60
|
+
readonly endpoint: "source" | "target";
|
|
61
|
+
constructor(row: number, endpoint: "source" | "target", message: string);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/resolve/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,YAAY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ACD;AAED,gEAAgE;AAChE,qBAAa,mBAAoB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAEvC,YAAY,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,QAAQ,EAAE,OAAO,EAAE,MAAM,EAKtE;CACD"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A scale the spec makes impossible: a kind incompatible with the field or
|
|
3
|
+
* source, a malformed explicit domain, parameters out of range, or conflicting
|
|
4
|
+
* kinds on a shared scale.
|
|
5
|
+
*/
|
|
6
|
+
export class InvalidScaleError extends Error {
|
|
7
|
+
channel;
|
|
8
|
+
constructor(channel, message) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = "InvalidScaleError";
|
|
11
|
+
this.channel = channel;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A transform's parameters or fields don't fit: a bin on a nominal field, a
|
|
16
|
+
* `step` ≤ 0, an `as` naming an existing field.
|
|
17
|
+
*/
|
|
18
|
+
export class InvalidTransformError extends Error {
|
|
19
|
+
transform;
|
|
20
|
+
index;
|
|
21
|
+
constructor(transform, index, message, options) {
|
|
22
|
+
super(message, options);
|
|
23
|
+
this.name = "InvalidTransformError";
|
|
24
|
+
this.transform = transform;
|
|
25
|
+
this.index = index;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* An encoding the mark or coordinate system can't read: a `link` without
|
|
30
|
+
* `source` and `target`, a `parallel` coordinate system without axes.
|
|
31
|
+
*/
|
|
32
|
+
export class InvalidEncodingError extends Error {
|
|
33
|
+
channel;
|
|
34
|
+
constructor(channel, message) {
|
|
35
|
+
super(message);
|
|
36
|
+
this.name = "InvalidEncodingError";
|
|
37
|
+
this.channel = channel;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A coordinate parameter out of range: an `innerRadius` outside [0, 1), equal
|
|
42
|
+
* or non-finite angles.
|
|
43
|
+
*/
|
|
44
|
+
export class InvalidCoordError extends Error {
|
|
45
|
+
coord;
|
|
46
|
+
constructor(coord, message) {
|
|
47
|
+
super(message);
|
|
48
|
+
this.name = "InvalidCoordError";
|
|
49
|
+
this.coord = coord;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A mark or transform the layer's source kind can't feed: a `surface` on a
|
|
54
|
+
* frame, a `line` or `bin` on a grid.
|
|
55
|
+
*/
|
|
56
|
+
export class InvalidLayerSourceError extends Error {
|
|
57
|
+
sourceName;
|
|
58
|
+
mark;
|
|
59
|
+
constructor(sourceName, mark, message) {
|
|
60
|
+
super(message);
|
|
61
|
+
this.name = "InvalidLayerSourceError";
|
|
62
|
+
this.sourceName = sourceName;
|
|
63
|
+
this.mark = mark;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A hierarchy that isn't a tree: no root, several roots, an unknown parent, or
|
|
68
|
+
* a cycle (rows unreachable from the root).
|
|
69
|
+
*/
|
|
70
|
+
export class InvalidHierarchyError extends Error {
|
|
71
|
+
row;
|
|
72
|
+
reason;
|
|
73
|
+
constructor(row, reason, message) {
|
|
74
|
+
super(message);
|
|
75
|
+
this.name = "InvalidHierarchyError";
|
|
76
|
+
this.row = row;
|
|
77
|
+
this.reason = reason;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/** A link endpoint missing from the explicit `nodes` source. */
|
|
81
|
+
export class InvalidNetworkError extends Error {
|
|
82
|
+
row;
|
|
83
|
+
endpoint;
|
|
84
|
+
constructor(row, endpoint, message) {
|
|
85
|
+
super(message);
|
|
86
|
+
this.name = "InvalidNetworkError";
|
|
87
|
+
this.row = row;
|
|
88
|
+
this.endpoint = endpoint;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/resolve/errors.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAClC,OAAO,CAAU;IAE1B,YAAY,OAAgB,EAAE,OAAe;QAC5C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IACtC,SAAS,CAAwB;IACjC,KAAK,CAAS;IAEvB,YACC,SAAgC,EAChC,KAAa,EACb,OAAe,EACf,OAAsB;QAEtB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACrC,OAAO,CAAsB;IAEtC,YAAY,OAA4B,EAAE,OAAe;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAClC,KAAK,CAAY;IAE1B,YAAY,KAAgB,EAAE,OAAe;QAC5C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACxC,UAAU,CAAqB;IAC/B,IAAI,CAAO;IAEpB,YAAY,UAA8B,EAAE,IAAU,EAAE,OAAe;QACtE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IACtC,GAAG,CAAS;IACZ,MAAM,CAA2D;IAE1E,YACC,GAAW,EACX,MAAgE,EAChE,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;CACD;AAED,gEAAgE;AAChE,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACpC,GAAG,CAAS;IACZ,QAAQ,CAAsB;IAEvC,YAAY,GAAW,EAAE,QAA6B,EAAE,OAAe;QACtE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC;CACD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CalendarWeekday } from "@ac-kit/core";
|
|
2
|
+
/** The knobs every resolve function shares; each is optional. */
|
|
3
|
+
export type ResolveOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* IANA zone or UTC offset (core `isTimeZone`). Default `"UTC"`. Affects only
|
|
6
|
+
* calendar ticks, temporal `nice` and temporal bins.
|
|
7
|
+
*/
|
|
8
|
+
readonly timeZone?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Day weekly ticks and bins fall on (1 = Monday … 7 = Sunday). Default 7,
|
|
11
|
+
* core `calendarTicks`' default.
|
|
12
|
+
*/
|
|
13
|
+
readonly weekStart?: CalendarWeekday;
|
|
14
|
+
/**
|
|
15
|
+
* The count `nice` rounds to, unless the encoding's `AxisSpec.tickCount` says
|
|
16
|
+
* otherwise. Positive integer. Default 10 (d3).
|
|
17
|
+
*/
|
|
18
|
+
readonly tickCount?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Bin count of a `bin` with neither `maxBins` nor `step`. Positive integer.
|
|
21
|
+
* Default 10 (Vega-Lite).
|
|
22
|
+
*/
|
|
23
|
+
readonly maxBins?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Output classes of `quantile` and `quantize` scales: the renderer's palette
|
|
26
|
+
* or glyph-ramp length. Integer ≥ 2. Default 5.
|
|
27
|
+
*/
|
|
28
|
+
readonly classCount?: number;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/resolve/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,iEAAiE;AACjE,MAAM,MAAM,cAAc,GAAG;IAC5B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/resolve/options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { CalendarTickUnit } from "@ac-kit/core";
|
|
2
|
+
import type { Value } from "@ac-kit/model-dataset";
|
|
3
|
+
import type { ResolvedScale } from "./scale.js";
|
|
4
|
+
export type ScaleTick = {
|
|
5
|
+
readonly value: Value;
|
|
6
|
+
/**
|
|
7
|
+
* Transformed space. Discrete scales: the index of the band start; add
|
|
8
|
+
* `bandwidth / (2·step)` for its centre.
|
|
9
|
+
*/
|
|
10
|
+
readonly position: number;
|
|
11
|
+
/**
|
|
12
|
+
* False only for a log tick that is not exactly a whole power of the base
|
|
13
|
+
* (math-scalar `isIntegerPower`, no tolerance).
|
|
14
|
+
*/
|
|
15
|
+
readonly major: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type ScaleTicks = {
|
|
18
|
+
readonly kind: "numeric";
|
|
19
|
+
readonly ticks: readonly ScaleTick[];
|
|
20
|
+
/**
|
|
21
|
+
* Decimals that tell the ticks apart: `tickFormatPrecision` of the step
|
|
22
|
+
* for generated linear and pow ticks; for symlog ticks and for `values`,
|
|
23
|
+
* those that print every returned tick exactly.
|
|
24
|
+
*/
|
|
25
|
+
readonly precision: number;
|
|
26
|
+
} | {
|
|
27
|
+
readonly kind: "log";
|
|
28
|
+
readonly ticks: readonly ScaleTick[];
|
|
29
|
+
readonly base: number;
|
|
30
|
+
} | {
|
|
31
|
+
readonly kind: "time";
|
|
32
|
+
readonly ticks: readonly ScaleTick[];
|
|
33
|
+
readonly unit: CalendarTickUnit;
|
|
34
|
+
readonly step: number;
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: "discrete";
|
|
37
|
+
readonly ticks: readonly ScaleTick[];
|
|
38
|
+
} | {
|
|
39
|
+
readonly kind: "thresholds";
|
|
40
|
+
readonly ticks: readonly ScaleTick[];
|
|
41
|
+
} | {
|
|
42
|
+
readonly kind: "none";
|
|
43
|
+
};
|
|
44
|
+
export type ScaleTicksOptions = {
|
|
45
|
+
/** About this many. Positive. Default 10. */
|
|
46
|
+
readonly count?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Transformed-space range (a zoomed view). Default the domain's. Swapped ends
|
|
49
|
+
* are accepted.
|
|
50
|
+
*/
|
|
51
|
+
readonly visible?: readonly [low: number, high: number];
|
|
52
|
+
/**
|
|
53
|
+
* `AxisSpec.tickValues`: exactly these values (those in `visible`), in order,
|
|
54
|
+
* positioned.
|
|
55
|
+
*/
|
|
56
|
+
readonly values?: readonly Value[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* The ticks of a scale:
|
|
60
|
+
*
|
|
61
|
+
* - Linear, pow: math-scalar `ticks` over the data range whose transform lies in
|
|
62
|
+
* `visible`, with the `tickFormatPrecision` of that range;
|
|
63
|
+
* - Symlog: math-scalar `symlogTicks` with the scale's constant over that data
|
|
64
|
+
* range (decades beyond `±constant`, linear ticks inside), with the decimals
|
|
65
|
+
* that print every one of them exactly (core `shortestFractionDigits`, at
|
|
66
|
+
* most 100);
|
|
67
|
+
* - Log: math-scalar `logTicks`, sub-decade ticks being minor;
|
|
68
|
+
* - Time: core `calendarTicks` in the scale's zone and week start, with the unit
|
|
69
|
+
* and step they chose (also reported when `values` replaces the ticks);
|
|
70
|
+
* - Discrete: every index in `visible`;
|
|
71
|
+
* - Binning: the thresholds;
|
|
72
|
+
* - Identity: `{ kind: "none" }`.
|
|
73
|
+
*
|
|
74
|
+
* `values` replaces the computed ticks of every kind: those within `visible`
|
|
75
|
+
* (for discrete scales, those in the domain), in the order given, with the
|
|
76
|
+
* precision that prints each one returned exactly; log values off an exact
|
|
77
|
+
* whole power of the base are minor, as generated ticks are.
|
|
78
|
+
*
|
|
79
|
+
* A tick is kept when its transformed position lies in `visible`; the data
|
|
80
|
+
* range is the exact preimage of `visible` (a bound equal to the transform of a
|
|
81
|
+
* domain end stands for that end), never a rounded inverse, so a `visible`
|
|
82
|
+
* equal to the transformed domain gives exactly the domain's ticks.
|
|
83
|
+
*
|
|
84
|
+
* O(ticks), time: plus zone transitions in Temporal operations; a zoomed pow,
|
|
85
|
+
* log or symlog range adds at most 128 transforms. Allocates the result.
|
|
86
|
+
*
|
|
87
|
+
* @throws {RangeError} `count` not a positive number, or `visible` holding NaN;
|
|
88
|
+
* calendar errors propagate.
|
|
89
|
+
*/
|
|
90
|
+
export declare function scaleTicks(scale: ResolvedScale, options?: ScaleTicksOptions): ScaleTicks;
|
|
91
|
+
//# sourceMappingURL=scale-ticks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale-ticks.d.ts","sourceRoot":"","sources":["../../src/resolve/scale-ticks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAerD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAGX,aAAa,EACb,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,SAAS,GAAG;IACvB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,UAAU,GACnB;IACA,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC1B,GACD;IACA,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACrB,GACD;IACA,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,QAAQ,CA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