@chartguard/runtime-echarts 0.0.0-stage → 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ChartGuard contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,27 @@
1
- # Temporary Holding Version
1
+ # @chartguard/runtime-echarts
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A safe `setOption` for Apache ECharts: the option is checked as the call will apply it to this chart, then set. Nothing is patched; call it instead of `chart.setOption`.
4
+
5
+ **Status:** pre-release (0.x). Coverage is partial, and the API and settings may still change between minor versions.
6
+
7
+ ```sh
8
+ npm install @chartguard/runtime-echarts
9
+ ```
10
+
11
+ ```ts
12
+ import * as echarts from "echarts";
13
+ import { setOption } from "@chartguard/runtime-echarts";
14
+
15
+ const chart = echarts.init(element);
16
+ setOption(chart, option, undefined, { options: { libraryVersion: echarts.version } });
17
+ setOption(chart, { series: [{ data: next }] }); // a merge update: checked against the series it merges into
18
+ ```
19
+
20
+ - **A fresh option** (the chart has none yet, `notMerge`, or `replaceMerge` naming `series`) needs a `type` on every series: echarts drops one without it ("Unknown series"); ChartGuard reports `CFG_REQUIRED $.series[i].type`.
21
+ - **A merge update** may leave the type out: when its series name no `id` or `name`, each one is checked as the type of the series it merges into, matched by position as echarts matches it (an entry that is not an object takes no series), and one beyond the chart's series is reported (echarts drops it). A disposed chart sets nothing: nothing is claimed about what it would drop. What the chart holds is read once per call. What an update leaves out (the axes it does not repeat) is not a finding; a rule about it is reported as unresolved.
22
+ - `checkOption(chart, option, settings?)` gives the same result without setting anything.
23
+ - **What is registered**: pass the namespace you call `use` on (`{ echarts }`, from `echarts/core`). Each call then reads what it has registered: a series or component that is not registered is a confirmed `CFG_UNREGISTERED` error (echarts would drop it or throw). `registriesOf(echarts)` gives the same context for your own validation.
24
+ - **Reporting**: `onResult(result, { fresh })` receives every result; without it, a result with confirmed errors is written with `console.warn`. **Blocking**: `{ block: true }` does not set an invalid option.
25
+ - Pass `libraryVersion: echarts.version`: an ECharts instance does not say which version it is. `validator` replaces the shipped schema (for example `withExtensions([...])` from `@chartguard/config-echarts`).
26
+
27
+ The option you pass is never changed and its getters are never run.
@@ -0,0 +1,6 @@
1
+ /** Never monkey-patches global APIs. Caller owns the original factory and side effects. */
2
+ export declare const validateBeforeCreate: import("@chartguard/core").ValidateBeforeCreate;
3
+ export { type EChartsRuntime, registriesOf } from './registries.js';
4
+ export type { EChartsInstance, SetOptionGuard, SetOptionSettings } from './set-option.js';
5
+ export { checkOption, setOption } from './set-option.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,2FAA2F;AAC3F,eAAO,MAAM,oBAAoB,iDAAkD,CAAC;AAEpF,OAAO,EAAE,KAAK,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ import { validate } from '@chartguard/config-echarts';
2
+ import { createValidateBeforeCreate } from '@chartguard/core';
3
+ /** Never monkey-patches global APIs. Caller owns the original factory and side effects. */
4
+ export const validateBeforeCreate = createValidateBeforeCreate('echarts', validate);
5
+ export { registriesOf } from './registries.js';
6
+ export { checkOption, setOption } from './set-option.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAE9D,2FAA2F;AAC3F,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAEpF,OAAO,EAAuB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type RegistryContext } from '@chartguard/core';
2
+ /** The part of the `echarts` (or `echarts/core`) namespace the registry context is read from. */
3
+ export interface EChartsRuntime {
4
+ readonly ComponentModel?: unknown;
5
+ }
6
+ /**
7
+ * The registry context of a live ECharts (CG-04-05): every series and component class it has
8
+ * registered now, as echarts names them (`series.bar`, `dataZoom.slider`, `grid`), read through its
9
+ * own class registry (`ComponentModel.getAllClassMainTypes`/`getClassesByMainType`, echarts@6.1.0
10
+ * `lib/util/clazz.js`). Pass the namespace the application calls `use` on (`echarts/core`), or the
11
+ * full `echarts`. A namespace without that registry gives no context, so no claim.
12
+ */
13
+ export declare function registriesOf(echarts: EChartsRuntime): Readonly<Record<string, RegistryContext>>;
14
+ //# sourceMappingURL=registries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registries.d.ts","sourceRoot":"","sources":["../src/registries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAErE,iGAAiG;AACjG,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;CAClC;AAiBD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAa/F"}
@@ -0,0 +1,35 @@
1
+ import { isContainer } from '@chartguard/core';
2
+ /**
3
+ * A property of the runtime, read as the runtime exposes it: a bundler's module namespace exports
4
+ * are getters (esbuild `__export`), so reading only data properties would find no registry. This is
5
+ * the library, never the caller's option, whose getters are never run.
6
+ */
7
+ const read = (value, key) => isContainer(value) || typeof value === 'function' ? value[key] : undefined;
8
+ const listerOf = (model, key) => {
9
+ const method = read(model, key);
10
+ return typeof method === 'function' ? method : undefined;
11
+ };
12
+ /**
13
+ * The registry context of a live ECharts (CG-04-05): every series and component class it has
14
+ * registered now, as echarts names them (`series.bar`, `dataZoom.slider`, `grid`), read through its
15
+ * own class registry (`ComponentModel.getAllClassMainTypes`/`getClassesByMainType`, echarts@6.1.0
16
+ * `lib/util/clazz.js`). Pass the namespace the application calls `use` on (`echarts/core`), or the
17
+ * full `echarts`. A namespace without that registry gives no context, so no claim.
18
+ */
19
+ export function registriesOf(echarts) {
20
+ const model = read(echarts, 'ComponentModel');
21
+ const mainTypes = listerOf(model, 'getAllClassMainTypes');
22
+ const classes = listerOf(model, 'getClassesByMainType');
23
+ if (mainTypes === undefined || classes === undefined)
24
+ return {};
25
+ const listed = mainTypes();
26
+ if (!Array.isArray(listed))
27
+ return {};
28
+ const types = listed.flatMap((mainType) => {
29
+ const found = typeof mainType === 'string' ? classes(mainType) : undefined;
30
+ return Array.isArray(found) ? found.map((item) => read(item, 'type')) : [];
31
+ });
32
+ const names = types.filter((type) => typeof type === 'string');
33
+ return { echarts: { names: [...new Set(names)].sort(), complete: true } };
34
+ }
35
+ //# sourceMappingURL=registries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registries.js","sourceRoot":"","sources":["../src/registries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAwB,MAAM,kBAAkB,CAAC;AAOrE;;;;GAIG;AACH,MAAM,IAAI,GAAG,CAAC,KAAc,EAAE,GAAW,EAAW,EAAE,CACrD,WAAW,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAE,KAAiC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAIzG,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,GAAW,EAAsB,EAAE;IACpE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAChC,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAE,MAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;AACtE,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,OAAuB;IACnD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC;IACxD,IAAI,SAAS,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAChE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,CAAC;IACtC,MAAM,KAAK,GAAI,MAAoB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QACxD,MAAM,KAAK,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3E,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3F,CAAC,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;IAC/E,OAAO,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC;AAC3E,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { type ConfigValidator, type ValidationOptions, type ValidationResult } from '@chartguard/core';
2
+ import { type EChartsRuntime } from './registries.js';
3
+ /** What `chart.setOption` takes besides the option: `notMerge` as a boolean, or the settings object. */
4
+ export type SetOptionSettings = boolean | {
5
+ readonly notMerge?: boolean;
6
+ readonly replaceMerge?: string | readonly string[];
7
+ readonly lazyUpdate?: boolean;
8
+ readonly silent?: boolean;
9
+ };
10
+ /** The part of an ECharts instance this path uses. */
11
+ export interface EChartsInstance {
12
+ setOption(option: unknown, settings?: unknown): void;
13
+ getOption(): unknown;
14
+ }
15
+ /** How `setOption` and `checkOption` validate: the validator, its options, the runtime and where results go. */
16
+ export interface SetOptionGuard {
17
+ /** Replaces the shipped `validate`, e.g. `withExtensions([...])`. */
18
+ readonly validator?: ConfigValidator;
19
+ /** Passed to every validation: `libraryVersion: echarts.version`, `registries`. */
20
+ readonly options?: ValidationOptions;
21
+ /**
22
+ * The namespace the chart's runtime registers on (`echarts/core` after `use`, or `echarts`): what it
23
+ * has registered is read on every call (`registriesOf`). A registry id named in `options` wins.
24
+ */
25
+ readonly echarts?: EChartsRuntime;
26
+ /** Receives every result; without it, a result with confirmed errors is written with `console.warn`. */
27
+ readonly onResult?: (result: ValidationResult, event: {
28
+ readonly fresh: boolean;
29
+ }) => void;
30
+ /** An invalid option is not set: the chart keeps what it has. */
31
+ readonly block?: boolean;
32
+ }
33
+ /** The option as `chart.setOption(option, settings)` would apply it, validated; nothing is set. */
34
+ export declare function checkOption(chart: EChartsInstance, option: unknown, settings?: SetOptionSettings, guard?: SetOptionGuard): ValidationResult;
35
+ /**
36
+ * The safe `setOption` path (CG-04-03): the option is validated as the call applies it to this chart,
37
+ * reported, then set with its settings unless `block` and invalid. Nothing is patched.
38
+ */
39
+ export declare function setOption(chart: EChartsInstance, option: unknown, settings?: SetOptionSettings, guard?: SetOptionGuard): ValidationResult;
40
+ //# sourceMappingURL=set-option.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-option.d.ts","sourceRoot":"","sources":["../src/set-option.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,eAAe,EAMpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,cAAc,EAAgB,MAAM,iBAAiB,CAAC;AAEpE,wGAAwG;AACxG,MAAM,MAAM,iBAAiB,GAC1B,OAAO,GACP;IACA,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACnD,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEL,sDAAsD;AACtD,MAAM,WAAW,eAAe;IAC/B,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACrD,SAAS,IAAI,OAAO,CAAC;CACrB;AAED,gHAAgH;AAChH,MAAM,WAAW,cAAc;IAC9B,qEAAqE;IACrE,QAAQ,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC;IACrC,mFAAmF;IACnF,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;IAClC,wGAAwG;IACxG,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3F,iEAAiE;IACjE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CACzB;AAyKD,mGAAmG;AACnG,wBAAgB,WAAW,CAC1B,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,OAAO,EACf,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,KAAK,GAAE,cAAmB,GACxB,gBAAgB,CAElB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACxB,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,OAAO,EACf,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,KAAK,GAAE,cAAmB,GACxB,gBAAgB,CAMlB"}
@@ -0,0 +1,162 @@
1
+ import { validate } from '@chartguard/config-echarts';
2
+ import { isContainer, isRecord, ownDataProperty, result } from '@chartguard/core';
3
+ import { registriesOf } from './registries.js';
4
+ const own = (value, key) => {
5
+ if (!isContainer(value))
6
+ return undefined;
7
+ const entry = ownDataProperty(value, key);
8
+ return entry.found ? entry.value : undefined;
9
+ };
10
+ /**
11
+ * Whether the call sets the series afresh: the chart holds no option yet (`held` is what
12
+ * `getOption()` returned), `notMerge`, or `replaceMerge` naming `series`. Then echarts looks every
13
+ * series up by its own `type`.
14
+ */
15
+ function isFresh(held, settings) {
16
+ if (held === undefined || settings === true)
17
+ return true;
18
+ if (!isRecord(settings))
19
+ return false;
20
+ const replaced = settings.replaceMerge;
21
+ const names = Array.isArray(replaced) ? replaced : [replaced];
22
+ return settings.notMerge === true || names.includes('series');
23
+ }
24
+ /** A series list as items with their paths: `series: […]` or a single `series: {…}`. */
25
+ function itemsAt(series, path) {
26
+ if (Array.isArray(series))
27
+ return series.map((item, index) => ({ item, path: `${path}[${String(index)}]` }));
28
+ return series === undefined ? [] : [{ item: series, path }];
29
+ }
30
+ /** An item without its own `type` (an accessor is not known, so it claims nothing). */
31
+ const untyped = (item) => isRecord(item) && !Object.hasOwn(item, 'type');
32
+ /**
33
+ * echarts drops a series it cannot find a model for by type ("Unknown series", `SOURCES` in
34
+ * sources.ts): an untyped item of a fresh option, or of a merge beyond the
35
+ * series the chart has when the update names none by `id` or `name`.
36
+ */
37
+ function dropped(path) {
38
+ return {
39
+ code: 'CFG_REQUIRED',
40
+ severity: 'error',
41
+ confidence: 'certain',
42
+ path: `${path}.type`,
43
+ message: 'This series has no type and no series to merge into: echarts drops it ("Unknown series").'
44
+ };
45
+ }
46
+ /** The series the chart holds, in order (`held` is what `getOption()` returned). */
47
+ function heldSeries(held) {
48
+ const series = own(held, 'series');
49
+ return Array.isArray(series) ? series : [];
50
+ }
51
+ /** A merge without `id` or `name`: items merge into the chart's series by position. */
52
+ const byIndex = (items) => items.every(({ item }) => own(item, 'id') === undefined && own(item, 'name') === undefined);
53
+ /** echarts' `isObject`: what a component list keeps; anything else it sets to `null` and skips. */
54
+ const isObjectLike = (value) => typeof value === 'function' || (typeof value === 'object' && value !== null);
55
+ /** A component echarts made for itself (`isComponentIdInternal`): a merge by position never lands on it. */
56
+ const isInternal = (series) => {
57
+ const id = own(series, 'id');
58
+ return (typeof id === 'string' || typeof id === 'number') && String(id).startsWith('\0_ec_\0');
59
+ };
60
+ /**
61
+ * For each item of the update, the held series it merges into, as echarts maps by position
62
+ * (`mappingByIndex`, `SOURCES` in sources.ts): each item takes the first series no item took
63
+ * yet that is not internal; an item that is not an object takes none; past the held series
64
+ * an item is new (`undefined`). K3.
65
+ */
66
+ function slots(items, held) {
67
+ const taken = new Set();
68
+ return items.map((item) => {
69
+ if (!isObjectLike(item))
70
+ return undefined;
71
+ const free = held.findIndex((series, index) => !taken.has(index) && !isInternal(series));
72
+ if (free === -1)
73
+ return undefined;
74
+ taken.add(free);
75
+ return free;
76
+ });
77
+ }
78
+ /** The option as the merge applies it: each untyped item with the type of the series it merges into. */
79
+ function merged(option, types) {
80
+ const series = own(option, 'series');
81
+ if (!Array.isArray(series) || !isRecord(option))
82
+ return option;
83
+ const typed = series.map((item, index) => {
84
+ const type = types[index];
85
+ if (!untyped(item) || typeof type !== 'string' || !isRecord(item))
86
+ return item;
87
+ return Object.defineProperties({}, { ...Object.getOwnPropertyDescriptors(item), type: { value: type, enumerable: true } });
88
+ });
89
+ return Object.defineProperties({}, { ...Object.getOwnPropertyDescriptors(option), series: { value: typed, enumerable: true } });
90
+ }
91
+ /** A merge by position: the update typed as it merges, and the untyped items that land on no series. */
92
+ function mergeByIndex(option, series, held) {
93
+ const existing = heldSeries(held);
94
+ const landing = slots(series.map(({ item }) => item), existing);
95
+ const types = landing.map((slot) => (slot === undefined ? undefined : own(existing[slot], 'type')));
96
+ const missing = series
97
+ .filter(({ item }, index) => untyped(item) && landing[index] === undefined)
98
+ .map(({ path }) => dropped(path));
99
+ return { view: merged(option, types), missing };
100
+ }
101
+ /** The guard's options with the registry context of `guard.echarts`, read now. */
102
+ function optionsOf({ options, echarts }) {
103
+ if (echarts === undefined)
104
+ return options;
105
+ const registries = { ...registriesOf(echarts), ...options?.registries };
106
+ return Object.keys(registries).length === 0 ? options : { ...options, registries };
107
+ }
108
+ function warn(checked) {
109
+ if (checked.valid)
110
+ return;
111
+ const listed = checked.diagnostics
112
+ .filter(({ severity }) => severity === 'error')
113
+ .map(({ path, message }) => `${path} (${message})`)
114
+ .join('; ');
115
+ console.warn(`ChartGuard: ${checked.library} option invalid: ${listed}`);
116
+ }
117
+ /**
118
+ * The option as the call applies it to a chart holding `held` (what `getOption()` returned, read
119
+ * once: it clones the whole option, K5), validated. A disposed chart (`null`) sets nothing: the
120
+ * option is checked as a partial one, with no claim about what the chart would drop (K4).
121
+ */
122
+ function inspect(held, option, settings, guard) {
123
+ const validator = guard.validator ?? validate;
124
+ const options = optionsOf(guard);
125
+ const fresh = held !== null && isFresh(held, settings);
126
+ const series = itemsAt(own(option, 'series'), '$.series');
127
+ const based = itemsAt(own(own(option, 'baseOption'), 'series'), '$.baseOption.series');
128
+ let view = option;
129
+ let missing = [];
130
+ if (fresh)
131
+ missing = [...series, ...based].filter(({ item }) => untyped(item)).map(({ path }) => dropped(path));
132
+ else if (held !== null && byIndex(series))
133
+ ({ view, missing } = mergeByIndex(option, series, held));
134
+ // A merge update is partial by design: what it leaves out, the chart already has.
135
+ const checked = validator(view, fresh ? options : { ...options, incomplete: true });
136
+ return {
137
+ checked: {
138
+ ...checked,
139
+ ...result(checked.library, checked.schemaVersion, checked.coverage, [...checked.diagnostics, ...missing])
140
+ },
141
+ fresh
142
+ };
143
+ }
144
+ /** The option as `chart.setOption(option, settings)` would apply it, validated; nothing is set. */
145
+ export function checkOption(chart, option, settings, guard = {}) {
146
+ return inspect(chart.getOption(), option, settings, guard).checked;
147
+ }
148
+ /**
149
+ * The safe `setOption` path (CG-04-03): the option is validated as the call applies it to this chart,
150
+ * reported, then set with its settings unless `block` and invalid. Nothing is patched.
151
+ */
152
+ export function setOption(chart, option, settings, guard = {}) {
153
+ const { checked, fresh } = inspect(chart.getOption(), option, settings, guard);
154
+ if (guard.onResult === undefined)
155
+ warn(checked);
156
+ else
157
+ guard.onResult(checked, { fresh });
158
+ if (guard.block !== true || checked.valid)
159
+ chart.setOption(option, settings);
160
+ return checked;
161
+ }
162
+ //# sourceMappingURL=set-option.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-option.js","sourceRoot":"","sources":["../src/set-option.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAGN,WAAW,EACX,QAAQ,EACR,eAAe,EACf,MAAM,EAGN,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAuB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAsCpE,MAAM,GAAG,GAAG,CAAC,KAAc,EAAE,GAAW,EAAW,EAAE;IACpD,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1C,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1C,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9C,CAAC,CAAC;AAEF;;;;GAIG;AACH,SAAS,OAAO,CAAC,IAAa,EAAE,QAAuC;IACtE,IAAI,IAAI,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACzD,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IACtC,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC;IACvC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC9D,OAAO,QAAQ,CAAC,QAAQ,KAAK,IAAI,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC/D,CAAC;AAED,wFAAwF;AACxF,SAA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,EAAE;YACR,GAAG,OAAO;YACV,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,CAAC;SACzG;QACD,KAAK;KACL,CAAC;AACH,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,WAAW,CAC1B,KAAsB,EACtB,MAAe,EACf,QAA4B,EAC5B,QAAwB,EAAE;IAE1B,OAAO,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC;AACpE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CACxB,KAAsB,EACtB,MAAe,EACf,QAA4B,EAC5B,QAAwB,EAAE;IAE1B,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC/E,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS;QAAE,IAAI,CAAC,OAAO,CAAC,CAAC;;QAC3C,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACxC,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK;QAAE,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7E,OAAO,OAAO,CAAC;AAChB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The ECharts behaviour the wrapper rests on, each a pointer into the pinned echarts checked by a test
3
+ * (E37): a series whose type has no registered model is dropped ("Unknown series", `dropped` in
4
+ * set-option.ts); a merge maps items to the held series by position (`mappingByIndex`): an item that is
5
+ * not an object is set to `null` and takes none, and an internal series is skipped (`slots`); a fresh
6
+ * option (`replaceAll`) or a `replaceMerge` of `series` merges no item into a held series (`isFresh`).
7
+ */
8
+ export declare const SOURCES: readonly ["echarts@6.1.0 lib/model/Global.js:303 error(\"Unknown series \" + subType);", "echarts@6.1.0 lib/model/Global.js:261 !oldCmptList ? 'replaceAll' : replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType) ? 'replaceMerge' : 'normalMerge';", "echarts@6.1.0 lib/util/model.js:156 if (!isObject(cmptOption)) {", "echarts@6.1.0 lib/util/model.js:270 // In mode \"replaceMerge\", here no not-mapped-non-internal-existing.", "echarts@6.1.0 lib/util/model.js:252 function mappingByIndex(result, newCmptOptions, brandNew) {", "echarts@6.1.0 lib/util/model.js:269 ) && (resultItem.newOption || isComponentIdInternal(resultItem.existing) ||", "echarts@6.1.0 lib/util/model.js:402 return cmptOption && cmptOption.id != null && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;"];
9
+ //# sourceMappingURL=sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../src/sources.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,+yBAQV,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The ECharts behaviour the wrapper rests on, each a pointer into the pinned echarts checked by a test
3
+ * (E37): a series whose type has no registered model is dropped ("Unknown series", `dropped` in
4
+ * set-option.ts); a merge maps items to the held series by position (`mappingByIndex`): an item that is
5
+ * not an object is set to `null` and takes none, and an internal series is skipped (`slots`); a fresh
6
+ * option (`replaceAll`) or a `replaceMerge` of `series` merges no item into a held series (`isFresh`).
7
+ */
8
+ export const SOURCES = [
9
+ 'echarts@6.1.0 lib/model/Global.js:303 error("Unknown series " + subType);',
10
+ "echarts@6.1.0 lib/model/Global.js:261 !oldCmptList ? 'replaceAll' : replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType) ? 'replaceMerge' : 'normalMerge';",
11
+ 'echarts@6.1.0 lib/util/model.js:156 if (!isObject(cmptOption)) {',
12
+ 'echarts@6.1.0 lib/util/model.js:270 // In mode "replaceMerge", here no not-mapped-non-internal-existing.',
13
+ 'echarts@6.1.0 lib/util/model.js:252 function mappingByIndex(result, newCmptOptions, brandNew) {',
14
+ 'echarts@6.1.0 lib/util/model.js:269 ) && (resultItem.newOption || isComponentIdInternal(resultItem.existing) ||',
15
+ 'echarts@6.1.0 lib/util/model.js:402 return cmptOption && cmptOption.id != null && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;'
16
+ ];
17
+ //# sourceMappingURL=sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sources.js","sourceRoot":"","sources":["../src/sources.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACtB,2EAA2E;IAC3E,wKAAwK;IACxK,kEAAkE;IAClE,0GAA0G;IAC1G,iGAAiG;IACjG,iHAAiH;IACjH,iKAAiK;CACxJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,48 @@
1
1
  {
2
- "name": "@chartguard/runtime-echarts",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@chartguard/runtime-echarts",
3
+ "version": "0.1.1",
4
+ "description": "Optional opt-in runtime validation wrapper for echarts",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/dovicsin/chartguard.git",
10
+ "directory": "packages/integrations/echarts-runtime"
11
+ },
12
+ "sideEffects": false,
13
+ "engines": {
14
+ "node": ">=22.12.0"
15
+ },
16
+ "files": [
17
+ "dist/",
18
+ "README.md"
19
+ ],
20
+ "main": "./dist/index.js",
21
+ "types": "./dist/index.d.ts",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "import": "./dist/index.js",
26
+ "default": "./dist/index.js"
27
+ }
28
+ },
29
+ "scripts": {
30
+ "build": "tsc -b",
31
+ "test": "node --test tests/*.test.mjs"
32
+ },
33
+ "dependencies": {
34
+ "@chartguard/core": "0.1.1",
35
+ "@chartguard/config-echarts": "0.1.1"
36
+ },
37
+ "peerDependencies": {
38
+ "echarts": "^6.1.0"
39
+ },
40
+ "peerDependenciesMeta": {
41
+ "echarts": {
42
+ "optional": false
43
+ }
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ }
48
+ }