gofish-ir 0.1.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 +56 -0
- package/dist/frontend/examples.d.ts +48 -0
- package/dist/frontend/examples.d.ts.map +1 -0
- package/dist/frontend/examples.js +140 -0
- package/dist/frontend/index.d.ts +5 -0
- package/dist/frontend/index.d.ts.map +1 -0
- package/dist/frontend/index.js +4 -0
- package/dist/frontend/jsonSchema.d.ts +393 -0
- package/dist/frontend/jsonSchema.d.ts.map +1 -0
- package/dist/frontend/jsonSchema.js +288 -0
- package/dist/frontend/schema.d.ts +255 -0
- package/dist/frontend/schema.d.ts.map +1 -0
- package/dist/frontend/schema.js +69 -0
- package/dist/frontend/v0.json +506 -0
- package/dist/frontend/validate.d.ts +27 -0
- package/dist/frontend/validate.d.ts.map +1 -0
- package/dist/frontend/validate.js +591 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# gofish-ir
|
|
2
|
+
|
|
3
|
+
Serialized intermediate representation (IR) for GoFish chart specifications.
|
|
4
|
+
|
|
5
|
+
This package provides the canonical TypeScript types, runtime validator, and
|
|
6
|
+
(coming soon) JSON Schema for the JSON-serializable form of a GoFish chart —
|
|
7
|
+
the artifact produced by the v3 fluent API at construction time, consumed by
|
|
8
|
+
downstream tools (the renderer, the Python bridge, and the Olli accessibility
|
|
9
|
+
adapter).
|
|
10
|
+
|
|
11
|
+
## Status
|
|
12
|
+
|
|
13
|
+
**v0 — frontend stage only.** This release publishes the IR captured at the
|
|
14
|
+
_frontend_ of the GoFish compiler: the chart specification before macro
|
|
15
|
+
expansion and elaboration. The schema matches the existing widget wire
|
|
16
|
+
format exactly (lowercase `type` discriminators, `__combinator` flag on
|
|
17
|
+
combinator-form marks, channel slots accept strings/numbers/sentinels). This
|
|
18
|
+
is intentional — v0 is "publish what already exists" so consumers can ship
|
|
19
|
+
against a typed schema today.
|
|
20
|
+
|
|
21
|
+
Subsequent breaking releases will layer in the design improvements documented
|
|
22
|
+
in the architecture essay at
|
|
23
|
+
[`apps/docs/docs/internals/frontend/serialization.md`](../../apps/docs/docs/internals/frontend/serialization.md):
|
|
24
|
+
PascalCase type tags, the `field`/`datum`/`literal` channel-expression split,
|
|
25
|
+
the `__combinator` removal, side-table-free inline annotation, etc. Each is a
|
|
26
|
+
lockstep migration across Python + JS + Olli.
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { Frontend } from "gofish-ir";
|
|
32
|
+
|
|
33
|
+
const spec: Frontend.FrontendIRDocument = {
|
|
34
|
+
irVersion: 0,
|
|
35
|
+
ir: "gofish-frontend",
|
|
36
|
+
root: {
|
|
37
|
+
type: "chart",
|
|
38
|
+
data: { type: "inline", rows: [{ category: "A", value: 5 }] },
|
|
39
|
+
operators: [{ type: "spread", by: "category", dir: "x" }],
|
|
40
|
+
mark: { type: "rect", h: "value" },
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const result = Frontend.validate(spec);
|
|
45
|
+
if (!result.valid) {
|
|
46
|
+
console.error(result.errors);
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Design
|
|
51
|
+
|
|
52
|
+
See
|
|
53
|
+
[`apps/docs/docs/internals/frontend/serialization.md`](../../apps/docs/docs/internals/frontend/serialization.md)
|
|
54
|
+
for the full design discussion: schema-shape decisions, multi-stage strategy,
|
|
55
|
+
prior-art lineage (ESTree/Babel, GHC HsSyn/HIE, Lean Syntax/Expr, Vega-Lite),
|
|
56
|
+
and what v0.1+ will change.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical example frontend-IR documents.
|
|
3
|
+
*
|
|
4
|
+
* These are the testbed for the validator and serve as worked examples for
|
|
5
|
+
* downstream consumers (Olli, the Python wrapper, alternative renderers).
|
|
6
|
+
* Each example covers a distinct shape of the schema.
|
|
7
|
+
*/
|
|
8
|
+
import type { FrontendIRDocument } from "./schema.js";
|
|
9
|
+
/**
|
|
10
|
+
* A simple bar chart:
|
|
11
|
+
* chart(seafood).flow(spread({by: "lake", dir: "x"}))
|
|
12
|
+
* .mark(rect({h: "count", fill: "species"}).name("bars"))
|
|
13
|
+
*
|
|
14
|
+
* Exercises: chart root, inline data, single operator, leaf mark with channel
|
|
15
|
+
* properties, the `.name()` user-supplied name via `origin.name`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const exampleBarChart: FrontendIRDocument;
|
|
18
|
+
/**
|
|
19
|
+
* A layer of two charts on the same canvas.
|
|
20
|
+
*
|
|
21
|
+
* Exercises: layer root, multiple chart children, the `select`-style data
|
|
22
|
+
* reference (one chart selects from a named layer in the other).
|
|
23
|
+
*/
|
|
24
|
+
export declare const exampleLayer: FrontendIRDocument;
|
|
25
|
+
/**
|
|
26
|
+
* A scatter chart: data → scatter operator with explicit x/y channels.
|
|
27
|
+
*
|
|
28
|
+
* Exercises: scatter operator with channel values, leaf mark without label.
|
|
29
|
+
*/
|
|
30
|
+
export declare const exampleScatter: FrontendIRDocument;
|
|
31
|
+
/**
|
|
32
|
+
* A treemap, built combinator-form: a `treemap` combinator wraps rect leaves.
|
|
33
|
+
*
|
|
34
|
+
* Exercises: combinator-form mark in the mark tree (with `__combinator: true`),
|
|
35
|
+
* nested children.
|
|
36
|
+
*/
|
|
37
|
+
export declare const exampleTreemap: FrontendIRDocument;
|
|
38
|
+
/**
|
|
39
|
+
* A bare mark not wrapped in a chart (e.g. an icon or static decoration).
|
|
40
|
+
*
|
|
41
|
+
* Exercises: raw-mark root, simple leaf mark with literal channel values.
|
|
42
|
+
*/
|
|
43
|
+
export declare const exampleCustomMark: FrontendIRDocument;
|
|
44
|
+
export declare const allExamples: ReadonlyArray<{
|
|
45
|
+
name: string;
|
|
46
|
+
doc: FrontendIRDocument;
|
|
47
|
+
}>;
|
|
48
|
+
//# sourceMappingURL=examples.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"examples.d.ts","sourceRoot":"","sources":["../../src/frontend/examples.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,kBAuB7B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,kBAmB1B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,kBAgB5B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,kBAoB5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,kBAa/B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,kBAAkB,CAAC;CACzB,CAMA,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical example frontend-IR documents.
|
|
3
|
+
*
|
|
4
|
+
* These are the testbed for the validator and serve as worked examples for
|
|
5
|
+
* downstream consumers (Olli, the Python wrapper, alternative renderers).
|
|
6
|
+
* Each example covers a distinct shape of the schema.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A simple bar chart:
|
|
10
|
+
* chart(seafood).flow(spread({by: "lake", dir: "x"}))
|
|
11
|
+
* .mark(rect({h: "count", fill: "species"}).name("bars"))
|
|
12
|
+
*
|
|
13
|
+
* Exercises: chart root, inline data, single operator, leaf mark with channel
|
|
14
|
+
* properties, the `.name()` user-supplied name via `origin.name`.
|
|
15
|
+
*/
|
|
16
|
+
export const exampleBarChart = {
|
|
17
|
+
irVersion: 0,
|
|
18
|
+
ir: "gofish-frontend",
|
|
19
|
+
root: {
|
|
20
|
+
type: "chart",
|
|
21
|
+
data: {
|
|
22
|
+
type: "inline",
|
|
23
|
+
rows: [
|
|
24
|
+
{ lake: "A", species: "trout", count: 12 },
|
|
25
|
+
{ lake: "A", species: "bass", count: 8 },
|
|
26
|
+
{ lake: "B", species: "trout", count: 5 },
|
|
27
|
+
{ lake: "B", species: "bass", count: 14 },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
operators: [{ type: "spread", by: "lake", dir: "x" }],
|
|
31
|
+
mark: {
|
|
32
|
+
type: "rect",
|
|
33
|
+
origin: { name: "bars" },
|
|
34
|
+
h: "count",
|
|
35
|
+
fill: "species",
|
|
36
|
+
},
|
|
37
|
+
options: { w: 500, h: 300, axes: true },
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* A layer of two charts on the same canvas.
|
|
42
|
+
*
|
|
43
|
+
* Exercises: layer root, multiple chart children, the `select`-style data
|
|
44
|
+
* reference (one chart selects from a named layer in the other).
|
|
45
|
+
*/
|
|
46
|
+
export const exampleLayer = {
|
|
47
|
+
irVersion: 0,
|
|
48
|
+
ir: "gofish-frontend",
|
|
49
|
+
root: {
|
|
50
|
+
type: "layer",
|
|
51
|
+
charts: [
|
|
52
|
+
{
|
|
53
|
+
type: "chart",
|
|
54
|
+
data: { type: "inline", rows: [{ x: 1, y: 2 }] },
|
|
55
|
+
operators: [{ type: "scatter", x: "x", y: "y" }],
|
|
56
|
+
mark: { type: "circle", origin: { name: "points" }, r: 4 },
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: "chart",
|
|
60
|
+
data: { type: "select", layer: "points" },
|
|
61
|
+
mark: { type: "ref", selection: "points" },
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* A scatter chart: data → scatter operator with explicit x/y channels.
|
|
68
|
+
*
|
|
69
|
+
* Exercises: scatter operator with channel values, leaf mark without label.
|
|
70
|
+
*/
|
|
71
|
+
export const exampleScatter = {
|
|
72
|
+
irVersion: 0,
|
|
73
|
+
ir: "gofish-frontend",
|
|
74
|
+
root: {
|
|
75
|
+
type: "chart",
|
|
76
|
+
data: {
|
|
77
|
+
type: "inline",
|
|
78
|
+
rows: [
|
|
79
|
+
{ mpg: 22, hp: 110 },
|
|
80
|
+
{ mpg: 19, hp: 150 },
|
|
81
|
+
{ mpg: 30, hp: 88 },
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
operators: [{ type: "scatter", x: "hp", y: "mpg" }],
|
|
85
|
+
mark: { type: "circle", r: 3, fill: "steelblue" },
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* A treemap, built combinator-form: a `treemap` combinator wraps rect leaves.
|
|
90
|
+
*
|
|
91
|
+
* Exercises: combinator-form mark in the mark tree (with `__combinator: true`),
|
|
92
|
+
* nested children.
|
|
93
|
+
*/
|
|
94
|
+
export const exampleTreemap = {
|
|
95
|
+
irVersion: 0,
|
|
96
|
+
ir: "gofish-frontend",
|
|
97
|
+
root: {
|
|
98
|
+
type: "chart",
|
|
99
|
+
data: {
|
|
100
|
+
type: "inline",
|
|
101
|
+
rows: [
|
|
102
|
+
{ region: "north", value: 100 },
|
|
103
|
+
{ region: "south", value: 60 },
|
|
104
|
+
{ region: "east", value: 80 },
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
mark: {
|
|
108
|
+
type: "treemap",
|
|
109
|
+
__combinator: true,
|
|
110
|
+
options: { valueField: "value" },
|
|
111
|
+
children: [{ type: "rect", fill: "region" }],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* A bare mark not wrapped in a chart (e.g. an icon or static decoration).
|
|
117
|
+
*
|
|
118
|
+
* Exercises: raw-mark root, simple leaf mark with literal channel values.
|
|
119
|
+
*/
|
|
120
|
+
export const exampleCustomMark = {
|
|
121
|
+
irVersion: 0,
|
|
122
|
+
ir: "gofish-frontend",
|
|
123
|
+
root: {
|
|
124
|
+
type: "raw-mark",
|
|
125
|
+
mark: {
|
|
126
|
+
type: "text",
|
|
127
|
+
origin: { name: "title" },
|
|
128
|
+
text: "Catch by Lake",
|
|
129
|
+
fontSize: 16,
|
|
130
|
+
},
|
|
131
|
+
options: { w: 200, h: 40 },
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
export const allExamples = [
|
|
135
|
+
{ name: "bar chart", doc: exampleBarChart },
|
|
136
|
+
{ name: "layer", doc: exampleLayer },
|
|
137
|
+
{ name: "scatter", doc: exampleScatter },
|
|
138
|
+
{ name: "treemap", doc: exampleTreemap },
|
|
139
|
+
{ name: "raw-mark", doc: exampleCustomMark },
|
|
140
|
+
];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./schema.js";
|
|
2
|
+
export { validate, type ValidationResult, type ValidationError, } from "./validate.js";
|
|
3
|
+
export { exampleBarChart, exampleLayer, exampleScatter, exampleTreemap, exampleCustomMark, allExamples, } from "./examples.js";
|
|
4
|
+
export { FRONTEND_IR_JSON_SCHEMA } from "./jsonSchema.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/frontend/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,QAAQ,EACR,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hand-written JSON Schema for the GoFish frontend IR (v0).
|
|
3
|
+
*
|
|
4
|
+
* Structural only — defines the document shape, the discriminator unions
|
|
5
|
+
* for operators / marks / channel values, and the validity envelope. Full
|
|
6
|
+
* field-level coverage matches `validate.ts`; this file is the wire
|
|
7
|
+
* artifact (consumed by external tooling, language servers, and the
|
|
8
|
+
* Python wrapper's parity-test harness).
|
|
9
|
+
*/
|
|
10
|
+
export declare const FRONTEND_IR_JSON_SCHEMA: {
|
|
11
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
12
|
+
readonly $id: "https://gofish.graphics/schema/frontend/v0.json";
|
|
13
|
+
readonly title: "GoFish Frontend IR";
|
|
14
|
+
readonly description: "Source-level chart specification produced by the v3 fluent API.";
|
|
15
|
+
readonly type: "object";
|
|
16
|
+
readonly required: readonly ["irVersion", "ir", "root"];
|
|
17
|
+
readonly additionalProperties: false;
|
|
18
|
+
readonly properties: {
|
|
19
|
+
readonly irVersion: {
|
|
20
|
+
readonly const: 0;
|
|
21
|
+
};
|
|
22
|
+
readonly ir: {
|
|
23
|
+
readonly const: "gofish-frontend";
|
|
24
|
+
};
|
|
25
|
+
readonly $schema: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
};
|
|
28
|
+
readonly root: {
|
|
29
|
+
readonly $ref: "#/$defs/Root";
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
readonly $defs: {
|
|
33
|
+
readonly Root: {
|
|
34
|
+
readonly oneOf: readonly [{
|
|
35
|
+
readonly $ref: "#/$defs/ChartIR";
|
|
36
|
+
}, {
|
|
37
|
+
readonly $ref: "#/$defs/LayerIR";
|
|
38
|
+
}, {
|
|
39
|
+
readonly $ref: "#/$defs/RawMarkIR";
|
|
40
|
+
}];
|
|
41
|
+
};
|
|
42
|
+
readonly Origin: {
|
|
43
|
+
readonly type: "object";
|
|
44
|
+
readonly properties: {
|
|
45
|
+
readonly name: {
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
};
|
|
48
|
+
readonly stack: {
|
|
49
|
+
readonly type: "string";
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly Meta: {
|
|
54
|
+
readonly type: "object";
|
|
55
|
+
readonly description: "Optional inline annotations populated by later passes. v0 emitters leave it absent.";
|
|
56
|
+
};
|
|
57
|
+
readonly DataIR: {
|
|
58
|
+
readonly oneOf: readonly [{
|
|
59
|
+
readonly type: "object";
|
|
60
|
+
readonly required: readonly ["type", "rows"];
|
|
61
|
+
readonly properties: {
|
|
62
|
+
readonly type: {
|
|
63
|
+
readonly const: "inline";
|
|
64
|
+
};
|
|
65
|
+
readonly rows: {
|
|
66
|
+
readonly type: "array";
|
|
67
|
+
readonly items: {
|
|
68
|
+
readonly type: "object";
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}, {
|
|
73
|
+
readonly type: "object";
|
|
74
|
+
readonly required: readonly ["type", "layer"];
|
|
75
|
+
readonly properties: {
|
|
76
|
+
readonly type: {
|
|
77
|
+
readonly const: "select";
|
|
78
|
+
};
|
|
79
|
+
readonly layer: {
|
|
80
|
+
readonly type: "string";
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
}, {
|
|
84
|
+
readonly type: "object";
|
|
85
|
+
readonly required: readonly ["type"];
|
|
86
|
+
readonly properties: {
|
|
87
|
+
readonly type: {
|
|
88
|
+
readonly const: "external";
|
|
89
|
+
};
|
|
90
|
+
readonly id: {
|
|
91
|
+
readonly type: "string";
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}];
|
|
95
|
+
};
|
|
96
|
+
readonly ChartIR: {
|
|
97
|
+
readonly type: "object";
|
|
98
|
+
readonly required: readonly ["type", "mark"];
|
|
99
|
+
readonly properties: {
|
|
100
|
+
readonly type: {
|
|
101
|
+
readonly const: "chart";
|
|
102
|
+
};
|
|
103
|
+
readonly data: {
|
|
104
|
+
readonly oneOf: readonly [{
|
|
105
|
+
readonly $ref: "#/$defs/DataIR";
|
|
106
|
+
}, {
|
|
107
|
+
readonly type: "null";
|
|
108
|
+
}];
|
|
109
|
+
};
|
|
110
|
+
readonly operators: {
|
|
111
|
+
readonly type: "array";
|
|
112
|
+
readonly items: {
|
|
113
|
+
readonly $ref: "#/$defs/OperatorIR";
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
readonly mark: {
|
|
117
|
+
readonly $ref: "#/$defs/MarkIR";
|
|
118
|
+
};
|
|
119
|
+
readonly options: {
|
|
120
|
+
readonly type: "object";
|
|
121
|
+
};
|
|
122
|
+
readonly zOrder: {
|
|
123
|
+
readonly type: "number";
|
|
124
|
+
};
|
|
125
|
+
readonly origin: {
|
|
126
|
+
readonly $ref: "#/$defs/Origin";
|
|
127
|
+
};
|
|
128
|
+
readonly meta: {
|
|
129
|
+
readonly $ref: "#/$defs/Meta";
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
readonly LayerIR: {
|
|
134
|
+
readonly type: "object";
|
|
135
|
+
readonly required: readonly ["type", "charts"];
|
|
136
|
+
readonly properties: {
|
|
137
|
+
readonly type: {
|
|
138
|
+
readonly const: "layer";
|
|
139
|
+
};
|
|
140
|
+
readonly charts: {
|
|
141
|
+
readonly type: "array";
|
|
142
|
+
readonly items: {
|
|
143
|
+
readonly $ref: "#/$defs/ChartIR";
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
readonly options: {
|
|
147
|
+
readonly type: "object";
|
|
148
|
+
};
|
|
149
|
+
readonly origin: {
|
|
150
|
+
readonly $ref: "#/$defs/Origin";
|
|
151
|
+
};
|
|
152
|
+
readonly meta: {
|
|
153
|
+
readonly $ref: "#/$defs/Meta";
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
readonly RawMarkIR: {
|
|
158
|
+
readonly type: "object";
|
|
159
|
+
readonly required: readonly ["type", "mark"];
|
|
160
|
+
readonly properties: {
|
|
161
|
+
readonly type: {
|
|
162
|
+
readonly const: "raw-mark";
|
|
163
|
+
};
|
|
164
|
+
readonly mark: {
|
|
165
|
+
readonly $ref: "#/$defs/MarkIR";
|
|
166
|
+
};
|
|
167
|
+
readonly options: {
|
|
168
|
+
readonly type: "object";
|
|
169
|
+
};
|
|
170
|
+
readonly origin: {
|
|
171
|
+
readonly $ref: "#/$defs/Origin";
|
|
172
|
+
};
|
|
173
|
+
readonly meta: {
|
|
174
|
+
readonly $ref: "#/$defs/Meta";
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
readonly OperatorIR: {
|
|
179
|
+
readonly type: "object";
|
|
180
|
+
readonly required: readonly ["type"];
|
|
181
|
+
readonly properties: {
|
|
182
|
+
readonly type: {
|
|
183
|
+
readonly enum: readonly ["derive", "spread", "stack", "group", "scatter", "table", "log"];
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
readonly MarkIR: {
|
|
188
|
+
readonly oneOf: readonly [{
|
|
189
|
+
readonly $ref: "#/$defs/LeafMarkIR";
|
|
190
|
+
}, {
|
|
191
|
+
readonly $ref: "#/$defs/CombinatorMarkIR";
|
|
192
|
+
}, {
|
|
193
|
+
readonly $ref: "#/$defs/RefMarkIR";
|
|
194
|
+
}];
|
|
195
|
+
};
|
|
196
|
+
readonly LeafMarkIR: {
|
|
197
|
+
readonly type: "object";
|
|
198
|
+
readonly required: readonly ["type"];
|
|
199
|
+
readonly properties: {
|
|
200
|
+
readonly type: {
|
|
201
|
+
readonly enum: readonly ["rect", "circle", "line", "area", "blank", "ellipse", "petal", "text", "image", "polygon", "mark-fn"];
|
|
202
|
+
};
|
|
203
|
+
readonly name: {
|
|
204
|
+
readonly type: "string";
|
|
205
|
+
};
|
|
206
|
+
readonly label: {
|
|
207
|
+
readonly $ref: "#/$defs/LabelIR";
|
|
208
|
+
};
|
|
209
|
+
readonly constraints: {
|
|
210
|
+
readonly type: "array";
|
|
211
|
+
readonly items: {
|
|
212
|
+
readonly $ref: "#/$defs/ConstraintIR";
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
readonly zOrder: {
|
|
216
|
+
readonly type: "number";
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
readonly CombinatorMarkIR: {
|
|
221
|
+
readonly type: "object";
|
|
222
|
+
readonly required: readonly ["type", "__combinator", "children"];
|
|
223
|
+
readonly properties: {
|
|
224
|
+
readonly type: {
|
|
225
|
+
readonly enum: readonly ["spread", "stack", "scatter", "group", "table", "layer", "arrow", "connect", "treemap", "over", "inside", "xor", "out", "atop", "mask"];
|
|
226
|
+
};
|
|
227
|
+
readonly __combinator: {
|
|
228
|
+
readonly const: true;
|
|
229
|
+
};
|
|
230
|
+
readonly options: {
|
|
231
|
+
readonly type: "object";
|
|
232
|
+
};
|
|
233
|
+
readonly children: {
|
|
234
|
+
readonly type: "array";
|
|
235
|
+
readonly items: {
|
|
236
|
+
readonly $ref: "#/$defs/MarkIR";
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
readonly name: {
|
|
240
|
+
readonly type: "string";
|
|
241
|
+
};
|
|
242
|
+
readonly label: {
|
|
243
|
+
readonly $ref: "#/$defs/LabelIR";
|
|
244
|
+
};
|
|
245
|
+
readonly constraints: {
|
|
246
|
+
readonly type: "array";
|
|
247
|
+
readonly items: {
|
|
248
|
+
readonly $ref: "#/$defs/ConstraintIR";
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
readonly zOrder: {
|
|
252
|
+
readonly type: "number";
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
readonly RefMarkIR: {
|
|
257
|
+
readonly type: "object";
|
|
258
|
+
readonly required: readonly ["type", "selection"];
|
|
259
|
+
readonly properties: {
|
|
260
|
+
readonly type: {
|
|
261
|
+
readonly const: "ref";
|
|
262
|
+
};
|
|
263
|
+
readonly selection: {
|
|
264
|
+
readonly oneOf: readonly [{
|
|
265
|
+
readonly type: "string";
|
|
266
|
+
}, {
|
|
267
|
+
readonly type: "array";
|
|
268
|
+
readonly items: {
|
|
269
|
+
readonly oneOf: readonly [{
|
|
270
|
+
readonly type: "string";
|
|
271
|
+
}, {
|
|
272
|
+
readonly type: "number";
|
|
273
|
+
}];
|
|
274
|
+
};
|
|
275
|
+
}];
|
|
276
|
+
};
|
|
277
|
+
readonly name: {
|
|
278
|
+
readonly type: "string";
|
|
279
|
+
};
|
|
280
|
+
readonly label: {
|
|
281
|
+
readonly $ref: "#/$defs/LabelIR";
|
|
282
|
+
};
|
|
283
|
+
readonly zOrder: {
|
|
284
|
+
readonly type: "number";
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
readonly LabelIR: {
|
|
289
|
+
readonly oneOf: readonly [{
|
|
290
|
+
readonly type: "boolean";
|
|
291
|
+
}, {
|
|
292
|
+
readonly type: "string";
|
|
293
|
+
}, {
|
|
294
|
+
readonly type: "object";
|
|
295
|
+
readonly required: readonly ["accessor"];
|
|
296
|
+
readonly properties: {
|
|
297
|
+
readonly accessor: {
|
|
298
|
+
readonly type: "string";
|
|
299
|
+
};
|
|
300
|
+
readonly position: {
|
|
301
|
+
readonly type: "string";
|
|
302
|
+
};
|
|
303
|
+
readonly fontSize: {
|
|
304
|
+
readonly type: "number";
|
|
305
|
+
};
|
|
306
|
+
readonly color: {
|
|
307
|
+
readonly type: "string";
|
|
308
|
+
};
|
|
309
|
+
readonly offset: {
|
|
310
|
+
readonly type: "number";
|
|
311
|
+
};
|
|
312
|
+
readonly minSpace: {
|
|
313
|
+
readonly type: "number";
|
|
314
|
+
};
|
|
315
|
+
readonly rotate: {
|
|
316
|
+
readonly type: "number";
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
}];
|
|
320
|
+
};
|
|
321
|
+
readonly ConstraintIR: {
|
|
322
|
+
readonly type: "object";
|
|
323
|
+
readonly required: readonly ["type", "refs"];
|
|
324
|
+
readonly properties: {
|
|
325
|
+
readonly type: {
|
|
326
|
+
readonly enum: readonly ["align", "distribute", "zAbove", "zBelow"];
|
|
327
|
+
};
|
|
328
|
+
readonly options: {
|
|
329
|
+
readonly type: "object";
|
|
330
|
+
};
|
|
331
|
+
readonly refs: {
|
|
332
|
+
readonly type: "array";
|
|
333
|
+
readonly items: {
|
|
334
|
+
readonly type: "string";
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
readonly ChannelValue: {
|
|
340
|
+
readonly description: "Right-hand side of a channel slot. Bare primitives for the shorthand path; tagged objects for the explicit field/datum/literal constructors and Python-bridge sentinels.";
|
|
341
|
+
readonly oneOf: readonly [{
|
|
342
|
+
readonly type: "string";
|
|
343
|
+
}, {
|
|
344
|
+
readonly type: "number";
|
|
345
|
+
}, {
|
|
346
|
+
readonly type: "boolean";
|
|
347
|
+
}, {
|
|
348
|
+
readonly type: "null";
|
|
349
|
+
}, {
|
|
350
|
+
readonly type: "object";
|
|
351
|
+
readonly required: readonly ["type", "name"];
|
|
352
|
+
readonly properties: {
|
|
353
|
+
readonly type: {
|
|
354
|
+
readonly const: "field";
|
|
355
|
+
};
|
|
356
|
+
readonly name: {
|
|
357
|
+
readonly type: "string";
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
}, {
|
|
361
|
+
readonly type: "object";
|
|
362
|
+
readonly required: readonly ["type", "value"];
|
|
363
|
+
readonly properties: {
|
|
364
|
+
readonly type: {
|
|
365
|
+
readonly const: "literal";
|
|
366
|
+
};
|
|
367
|
+
readonly value: {};
|
|
368
|
+
};
|
|
369
|
+
}, {
|
|
370
|
+
readonly type: "object";
|
|
371
|
+
readonly required: readonly ["type", "datum"];
|
|
372
|
+
readonly properties: {
|
|
373
|
+
readonly type: {
|
|
374
|
+
readonly const: "datum";
|
|
375
|
+
};
|
|
376
|
+
readonly datum: {};
|
|
377
|
+
readonly measure: {
|
|
378
|
+
readonly type: "string";
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
}, {
|
|
382
|
+
readonly type: "object";
|
|
383
|
+
readonly required: readonly ["__gofish_lambda"];
|
|
384
|
+
readonly properties: {
|
|
385
|
+
readonly __gofish_lambda: {
|
|
386
|
+
readonly type: "string";
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
}];
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
//# sourceMappingURL=jsonSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonSchema.d.ts","sourceRoot":"","sources":["../../src/frontend/jsonSchema.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsR1B,CAAC"}
|