@altnovatrail/picture-kit 0.0.0-stage → 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/LICENSE +201 -0
- package/NOTICE +7 -0
- package/README.md +27 -2
- package/lib/emoji.d.ts +16 -0
- package/lib/emoji.js +64 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +10 -0
- package/lib/kind.d.ts +22 -0
- package/lib/kind.js +2 -0
- package/lib/kinds/balance.d.ts +34 -0
- package/lib/kinds/balance.js +217 -0
- package/lib/kinds/branches.d.ts +33 -0
- package/lib/kinds/branches.js +473 -0
- package/lib/kinds/calendar.d.ts +55 -0
- package/lib/kinds/calendar.js +532 -0
- package/lib/kinds/chart.d.ts +48 -0
- package/lib/kinds/chart.js +645 -0
- package/lib/kinds/choices.d.ts +14 -0
- package/lib/kinds/choices.js +53 -0
- package/lib/kinds/clock.d.ts +36 -0
- package/lib/kinds/clock.js +219 -0
- package/lib/kinds/coins.d.ts +37 -0
- package/lib/kinds/coins.js +550 -0
- package/lib/kinds/column.d.ts +37 -0
- package/lib/kinds/column.js +410 -0
- package/lib/kinds/commands-parts.d.ts +12 -0
- package/lib/kinds/commands-parts.js +24 -0
- package/lib/kinds/commands.d.ts +66 -0
- package/lib/kinds/commands.js +789 -0
- package/lib/kinds/containers.d.ts +52 -0
- package/lib/kinds/containers.js +758 -0
- package/lib/kinds/countfig.d.ts +41 -0
- package/lib/kinds/countfig.js +372 -0
- package/lib/kinds/cubes.d.ts +70 -0
- package/lib/kinds/cubes.js +371 -0
- package/lib/kinds/die.d.ts +32 -0
- package/lib/kinds/die.js +301 -0
- package/lib/kinds/domino.d.ts +37 -0
- package/lib/kinds/domino.js +450 -0
- package/lib/kinds/dotgrid.d.ts +38 -0
- package/lib/kinds/dotgrid.js +411 -0
- package/lib/kinds/figure.d.ts +62 -0
- package/lib/kinds/figure.js +687 -0
- package/lib/kinds/fold-parts.d.ts +73 -0
- package/lib/kinds/fold-parts.js +315 -0
- package/lib/kinds/fold.d.ts +52 -0
- package/lib/kinds/fold.js +650 -0
- package/lib/kinds/fraction.d.ts +50 -0
- package/lib/kinds/fraction.js +568 -0
- package/lib/kinds/gauges.d.ts +53 -0
- package/lib/kinds/gauges.js +880 -0
- package/lib/kinds/gears.d.ts +40 -0
- package/lib/kinds/gears.js +787 -0
- package/lib/kinds/grid.d.ts +45 -0
- package/lib/kinds/grid.js +591 -0
- package/lib/kinds/groups.d.ts +23 -0
- package/lib/kinds/groups.js +335 -0
- package/lib/kinds/index.d.ts +3 -0
- package/lib/kinds/index.js +87 -0
- package/lib/kinds/lanes.d.ts +36 -0
- package/lib/kinds/lanes.js +220 -0
- package/lib/kinds/layers.d.ts +31 -0
- package/lib/kinds/layers.js +419 -0
- package/lib/kinds/line.d.ts +38 -0
- package/lib/kinds/line.js +739 -0
- package/lib/kinds/magic-parts.d.ts +72 -0
- package/lib/kinds/magic-parts.js +186 -0
- package/lib/kinds/magic.d.ts +66 -0
- package/lib/kinds/magic.js +664 -0
- package/lib/kinds/map.d.ts +32 -0
- package/lib/kinds/map.js +370 -0
- package/lib/kinds/matchsticks.d.ts +26 -0
- package/lib/kinds/matchsticks.js +434 -0
- package/lib/kinds/necklace.d.ts +27 -0
- package/lib/kinds/necklace.js +342 -0
- package/lib/kinds/net.d.ts +47 -0
- package/lib/kinds/net.js +241 -0
- package/lib/kinds/overlay.d.ts +50 -0
- package/lib/kinds/overlay.js +519 -0
- package/lib/kinds/pieces.d.ts +41 -0
- package/lib/kinds/pieces.js +420 -0
- package/lib/kinds/pipes.d.ts +46 -0
- package/lib/kinds/pipes.js +657 -0
- package/lib/kinds/plane-parts.d.ts +105 -0
- package/lib/kinds/plane-parts.js +372 -0
- package/lib/kinds/plane.d.ts +35 -0
- package/lib/kinds/plane.js +755 -0
- package/lib/kinds/pyramid.d.ts +26 -0
- package/lib/kinds/pyramid.js +228 -0
- package/lib/kinds/ropes.d.ts +30 -0
- package/lib/kinds/ropes.js +571 -0
- package/lib/kinds/shapes.d.ts +59 -0
- package/lib/kinds/shapes.js +490 -0
- package/lib/kinds/solids.d.ts +78 -0
- package/lib/kinds/solids.js +1058 -0
- package/lib/kinds/tangram.d.ts +52 -0
- package/lib/kinds/tangram.js +713 -0
- package/lib/kinds/target.d.ts +39 -0
- package/lib/kinds/target.js +761 -0
- package/lib/kinds/tiles.d.ts +55 -0
- package/lib/kinds/tiles.js +606 -0
- package/lib/kinds/venn.d.ts +38 -0
- package/lib/kinds/venn.js +710 -0
- package/lib/noto.d.ts +2 -0
- package/lib/noto.js +212 -0
- package/lib/objects.d.ts +7 -0
- package/lib/objects.js +226 -0
- package/lib/pen.d.ts +32 -0
- package/lib/pen.js +60 -0
- package/lib/read.d.ts +9 -0
- package/lib/read.js +49 -0
- package/lib/render.d.ts +24 -0
- package/lib/render.js +68 -0
- package/lib/solve/balance.d.ts +46 -0
- package/lib/solve/balance.js +118 -0
- package/lib/style.d.ts +70 -0
- package/lib/style.js +39 -0
- package/lib/svg.d.ts +22 -0
- package/lib/svg.js +48 -0
- package/lib/things.d.ts +40 -0
- package/lib/things.js +269 -0
- package/package.json +28 -4
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Kind } from "../kind.ts";
|
|
2
|
+
import { type ColorName } from "../style.ts";
|
|
3
|
+
import { type Thing } from "../things.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Tiles: square or hexagonal tiles in a row, a grid or a ring, touching or
|
|
6
|
+
* apart. A tile has a fill and a pattern — coloured lines joining the
|
|
7
|
+
* midpoints of its edges, coloured parts, dots, a thing — or is the "?" a
|
|
8
|
+
* question asks about, or an empty place. A tile may be turned in steps of
|
|
9
|
+
* its symmetry; the program turns the pattern itself, by edges and corners,
|
|
10
|
+
* so a turned tile is exactly the tile the scene means.
|
|
11
|
+
*/
|
|
12
|
+
export declare const tileShapes: readonly ["square", "hexagon"];
|
|
13
|
+
export type TileShape = (typeof tileShapes)[number];
|
|
14
|
+
export declare const layouts: readonly ["row", "grid", "ring"];
|
|
15
|
+
export type Layout = (typeof layouts)[number];
|
|
16
|
+
export declare const squareEdges: readonly ["top", "right", "bottom", "left"];
|
|
17
|
+
export declare const hexEdges: readonly ["top-right", "right", "bottom-right", "bottom-left", "left", "top-left"];
|
|
18
|
+
export declare const squareParts: readonly ["half", "diagonal", "quarter", "wedge", "corner"];
|
|
19
|
+
export declare const hexParts: readonly ["wedge", "third", "half"];
|
|
20
|
+
export type Link = {
|
|
21
|
+
from: string;
|
|
22
|
+
to: string;
|
|
23
|
+
color: ColorName;
|
|
24
|
+
straight?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type Part = {
|
|
27
|
+
part: string;
|
|
28
|
+
color: ColorName;
|
|
29
|
+
at?: number;
|
|
30
|
+
};
|
|
31
|
+
export type Tile = {
|
|
32
|
+
fill?: ColorName;
|
|
33
|
+
links?: Link[];
|
|
34
|
+
parts?: Part[];
|
|
35
|
+
dots?: {
|
|
36
|
+
count: number;
|
|
37
|
+
color?: ColorName;
|
|
38
|
+
};
|
|
39
|
+
thing?: Thing;
|
|
40
|
+
turn?: number;
|
|
41
|
+
ask?: true;
|
|
42
|
+
empty?: true;
|
|
43
|
+
label?: string;
|
|
44
|
+
};
|
|
45
|
+
export type TilesScene = {
|
|
46
|
+
kind: "tiles";
|
|
47
|
+
shape: TileShape;
|
|
48
|
+
layout: Layout;
|
|
49
|
+
columns?: number;
|
|
50
|
+
rows?: number;
|
|
51
|
+
apart?: boolean;
|
|
52
|
+
tiles: Tile[];
|
|
53
|
+
centre?: Tile;
|
|
54
|
+
};
|
|
55
|
+
export declare const tiles: Kind;
|
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
import { margin } from "../kind.js";
|
|
2
|
+
import { int, isObj, list, oneOf, only, text } from "../read.js";
|
|
3
|
+
import { colorNames, colors, faint, ink, isColor, outline, soft, } from "../style.js";
|
|
4
|
+
import { n, poly } from "../svg.js";
|
|
5
|
+
import { checkThing, drawThing, wordOf } from "../things.js";
|
|
6
|
+
/**
|
|
7
|
+
* Tiles: square or hexagonal tiles in a row, a grid or a ring, touching or
|
|
8
|
+
* apart. A tile has a fill and a pattern — coloured lines joining the
|
|
9
|
+
* midpoints of its edges, coloured parts, dots, a thing — or is the "?" a
|
|
10
|
+
* question asks about, or an empty place. A tile may be turned in steps of
|
|
11
|
+
* its symmetry; the program turns the pattern itself, by edges and corners,
|
|
12
|
+
* so a turned tile is exactly the tile the scene means.
|
|
13
|
+
*/
|
|
14
|
+
export const tileShapes = ["square", "hexagon"];
|
|
15
|
+
export const layouts = ["row", "grid", "ring"];
|
|
16
|
+
export const squareEdges = ["top", "right", "bottom", "left"];
|
|
17
|
+
export const hexEdges = [
|
|
18
|
+
"top-right",
|
|
19
|
+
"right",
|
|
20
|
+
"bottom-right",
|
|
21
|
+
"bottom-left",
|
|
22
|
+
"left",
|
|
23
|
+
"top-left",
|
|
24
|
+
];
|
|
25
|
+
export const squareParts = ["half", "diagonal", "quarter", "wedge", "corner"];
|
|
26
|
+
export const hexParts = ["wedge", "third", "half"];
|
|
27
|
+
const tileMembers = ["fill", "links", "parts", "dots", "thing", "turn", "ask", "empty", "label"];
|
|
28
|
+
function edgesOf(shape) {
|
|
29
|
+
return shape === "square" ? squareEdges : hexEdges;
|
|
30
|
+
}
|
|
31
|
+
function sidesOf(shape) {
|
|
32
|
+
return shape === "square" ? 4 : 6;
|
|
33
|
+
}
|
|
34
|
+
/** ringCount is how many tiles go round a ring of the shape. */
|
|
35
|
+
function ringCount(scene) {
|
|
36
|
+
if (scene.shape === "hexagon")
|
|
37
|
+
return 6;
|
|
38
|
+
const c = scene.columns ?? 3;
|
|
39
|
+
const r = scene.rows ?? 3;
|
|
40
|
+
return 2 * (c + r) - 4;
|
|
41
|
+
}
|
|
42
|
+
function checkTile(t, path, scene, problems) {
|
|
43
|
+
const shape = scene.shape;
|
|
44
|
+
if (!isObj(t)) {
|
|
45
|
+
problems.push(`${path}: must be a tile`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
only(t, tileMembers, path, problems);
|
|
49
|
+
if (t.label !== undefined) {
|
|
50
|
+
text(t.label, `${path}.label`, problems, 3);
|
|
51
|
+
if (scene.layout !== "row")
|
|
52
|
+
problems.push(`${path}.label: a label goes only under a row`);
|
|
53
|
+
}
|
|
54
|
+
if (t.ask !== undefined || t.empty !== undefined) {
|
|
55
|
+
if (t.ask !== undefined && t.ask !== true)
|
|
56
|
+
problems.push(`${path}.ask: must be true`);
|
|
57
|
+
if (t.empty !== undefined && t.empty !== true)
|
|
58
|
+
problems.push(`${path}.empty: must be true`);
|
|
59
|
+
if (t.ask !== undefined && t.empty !== undefined)
|
|
60
|
+
problems.push(`${path}: a tile is ask or empty, not both`);
|
|
61
|
+
for (const m of ["fill", "links", "parts", "dots", "thing", "turn"])
|
|
62
|
+
if (t[m] !== undefined)
|
|
63
|
+
problems.push(`${path}.${m}: a tile that is ask or empty has no pattern`);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (t.fill !== undefined && !isColor(t.fill))
|
|
67
|
+
problems.push(`${path}.fill: must be a colour: ${colorNames.join(", ")}`);
|
|
68
|
+
const sides = sidesOf(shape);
|
|
69
|
+
if (t.turn !== undefined)
|
|
70
|
+
int(t.turn, `${path}.turn`, problems, 0, sides - 1);
|
|
71
|
+
const edges = edgesOf(shape);
|
|
72
|
+
if (t.links !== undefined) {
|
|
73
|
+
const used = new Set();
|
|
74
|
+
list(t.links, `${path}.links`, problems, 1, sides / 2).forEach((l, i) => {
|
|
75
|
+
const at = `${path}.links[${i}]`;
|
|
76
|
+
if (!isObj(l)) {
|
|
77
|
+
problems.push(`${at}: must be a line from an edge to an edge`);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
only(l, ["from", "to", "color", "straight"], at, problems);
|
|
81
|
+
for (const end of ["from", "to"]) {
|
|
82
|
+
const e = oneOf(l[end], edges, `${at}.${end}`, problems);
|
|
83
|
+
if (edges.includes(l[end])) {
|
|
84
|
+
if (used.has(e))
|
|
85
|
+
problems.push(`${at}.${end}: the ${e} edge already has a line`);
|
|
86
|
+
used.add(e);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (l.from === l.to && edges.includes(l.from))
|
|
90
|
+
problems.push(`${at}.to: a line joins two different edges`);
|
|
91
|
+
if (!isColor(l.color))
|
|
92
|
+
problems.push(`${at}.color: must be a colour`);
|
|
93
|
+
if (l.straight !== undefined && typeof l.straight !== "boolean")
|
|
94
|
+
problems.push(`${at}.straight: must be true or false`);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (t.parts !== undefined) {
|
|
98
|
+
const kinds = shape === "square" ? squareParts : hexParts;
|
|
99
|
+
list(t.parts, `${path}.parts`, problems, 1, sides).forEach((p, i) => {
|
|
100
|
+
const at = `${path}.parts[${i}]`;
|
|
101
|
+
if (!isObj(p)) {
|
|
102
|
+
problems.push(`${at}: must be a part and a colour`);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
only(p, ["part", "color", "at"], at, problems);
|
|
106
|
+
oneOf(p.part, kinds, `${at}.part`, problems);
|
|
107
|
+
if (!isColor(p.color))
|
|
108
|
+
problems.push(`${at}.color: must be a colour`);
|
|
109
|
+
if (p.at !== undefined)
|
|
110
|
+
int(p.at, `${at}.at`, problems, 0, sides - 1);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (t.dots !== undefined) {
|
|
114
|
+
if (!isObj(t.dots))
|
|
115
|
+
problems.push(`${path}.dots: must hold a count`);
|
|
116
|
+
else {
|
|
117
|
+
only(t.dots, ["count", "color"], `${path}.dots`, problems);
|
|
118
|
+
int(t.dots.count, `${path}.dots.count`, problems, 1, 9);
|
|
119
|
+
if (t.dots.color !== undefined && !isColor(t.dots.color))
|
|
120
|
+
problems.push(`${path}.dots.color: must be a colour`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (t.thing !== undefined) {
|
|
124
|
+
checkThing(t.thing, `${path}.thing`, problems);
|
|
125
|
+
if (t.dots !== undefined)
|
|
126
|
+
problems.push(`${path}.thing: a tile holds dots or a thing, not both`);
|
|
127
|
+
if (t.links !== undefined)
|
|
128
|
+
problems.push(`${path}.thing: a tile holds lines or a thing, not both`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Geometry. A tile is drawn around its centre; its vertices go clockwise, and
|
|
132
|
+
// edge k joins vertex k and vertex k + 1, so a turn of one step moves every
|
|
133
|
+
// edge to the next one.
|
|
134
|
+
function vertices(shape, cx, cy, s) {
|
|
135
|
+
if (shape === "square") {
|
|
136
|
+
const h = s / 2;
|
|
137
|
+
return [
|
|
138
|
+
{ x: cx - h, y: cy - h },
|
|
139
|
+
{ x: cx + h, y: cy - h },
|
|
140
|
+
{ x: cx + h, y: cy + h },
|
|
141
|
+
{ x: cx - h, y: cy + h },
|
|
142
|
+
];
|
|
143
|
+
}
|
|
144
|
+
const r = s / Math.sqrt(3);
|
|
145
|
+
return Array.from({ length: 6 }, (_, k) => {
|
|
146
|
+
const a = (-90 + 60 * k) * (Math.PI / 180);
|
|
147
|
+
return { x: cx + r * Math.cos(a), y: cy + r * Math.sin(a) };
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function mid(a, b) {
|
|
151
|
+
return { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };
|
|
152
|
+
}
|
|
153
|
+
/** meet is where the lines through a, b and through c, d cross, if they do. */
|
|
154
|
+
function meet(a, b, c, d) {
|
|
155
|
+
const d1 = { x: b.x - a.x, y: b.y - a.y };
|
|
156
|
+
const d2 = { x: d.x - c.x, y: d.y - c.y };
|
|
157
|
+
const den = d1.x * d2.y - d1.y * d2.x;
|
|
158
|
+
if (Math.abs(den) < 1e-9)
|
|
159
|
+
return undefined;
|
|
160
|
+
const t = ((c.x - a.x) * d2.y - (c.y - a.y) * d2.x) / den;
|
|
161
|
+
return { x: a.x + t * d1.x, y: a.y + t * d1.y };
|
|
162
|
+
}
|
|
163
|
+
/** turnPoint turns p about c by steps of a tile's symmetry, clockwise. */
|
|
164
|
+
function turnPoint(p, c, steps, sides) {
|
|
165
|
+
const q = ((steps % sides) + sides) % sides;
|
|
166
|
+
if (q === 0)
|
|
167
|
+
return p;
|
|
168
|
+
const dx = p.x - c.x;
|
|
169
|
+
const dy = p.y - c.y;
|
|
170
|
+
if (sides === 4) {
|
|
171
|
+
// Quarter turns swap coordinates, so they stay exact.
|
|
172
|
+
if (q === 1)
|
|
173
|
+
return { x: c.x - dy, y: c.y + dx };
|
|
174
|
+
if (q === 2)
|
|
175
|
+
return { x: c.x - dx, y: c.y - dy };
|
|
176
|
+
return { x: c.x + dy, y: c.y - dx };
|
|
177
|
+
}
|
|
178
|
+
const a = (q * 2 * Math.PI) / sides;
|
|
179
|
+
return {
|
|
180
|
+
x: c.x + dx * Math.cos(a) - dy * Math.sin(a),
|
|
181
|
+
y: c.y + dx * Math.sin(a) + dy * Math.cos(a),
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function linkPath(v, a, b, straight) {
|
|
185
|
+
const k = v.length;
|
|
186
|
+
const ea = [v[a], v[(a + 1) % k]];
|
|
187
|
+
const eb = [v[b], v[(b + 1) % k]];
|
|
188
|
+
const ma = mid(...ea);
|
|
189
|
+
const mb = mid(...eb);
|
|
190
|
+
const p = straight ? undefined : meet(ea[0], ea[1], eb[0], eb[1]);
|
|
191
|
+
if (!p)
|
|
192
|
+
return `M${n(ma.x)} ${n(ma.y)}L${n(mb.x)} ${n(mb.y)}`;
|
|
193
|
+
const r = Math.hypot(ma.x - p.x, ma.y - p.y);
|
|
194
|
+
const from = Math.atan2(ma.y - p.y, ma.x - p.x);
|
|
195
|
+
const to = Math.atan2(mb.y - p.y, mb.x - p.x);
|
|
196
|
+
const sweep = (((to - from) % (2 * Math.PI)) + 2 * Math.PI) % (2 * Math.PI) < Math.PI ? 1 : 0;
|
|
197
|
+
return `M${n(ma.x)} ${n(ma.y)}A${n(r)} ${n(r)} 0 0 ${sweep} ${n(mb.x)} ${n(mb.y)}`;
|
|
198
|
+
}
|
|
199
|
+
function partPath(shape, part, k, c, s) {
|
|
200
|
+
if (shape === "hexagon") {
|
|
201
|
+
const v = vertices(shape, c.x, c.y, s);
|
|
202
|
+
const span = part === "wedge" ? 1 : part === "third" ? 2 : 3;
|
|
203
|
+
const pts = [c];
|
|
204
|
+
for (let i = 0; i <= span; i++)
|
|
205
|
+
pts.push(v[(k + i) % 6]);
|
|
206
|
+
return poly(pts);
|
|
207
|
+
}
|
|
208
|
+
const h = s / 2;
|
|
209
|
+
const t = (x, y) => turnPoint({ x: c.x + x, y: c.y + y }, c, k, 4);
|
|
210
|
+
switch (part) {
|
|
211
|
+
case "half":
|
|
212
|
+
return poly([t(-h, -h), t(h, -h), t(h, 0), t(-h, 0)]);
|
|
213
|
+
case "diagonal":
|
|
214
|
+
return poly([t(-h, -h), t(h, -h), t(-h, h)]);
|
|
215
|
+
case "quarter":
|
|
216
|
+
return poly([t(-h, -h), t(0, -h), t(0, 0), t(-h, 0)]);
|
|
217
|
+
case "wedge":
|
|
218
|
+
return poly([t(-h, -h), t(h, -h), t(0, 0)]);
|
|
219
|
+
default: {
|
|
220
|
+
const o = t(-h, -h);
|
|
221
|
+
const a = t(0, -h);
|
|
222
|
+
const b = t(-h, 0);
|
|
223
|
+
return `M${n(o.x)} ${n(o.y)}L${n(a.x)} ${n(a.y)}A${n(h)} ${n(h)} 0 0 1 ${n(b.x)} ${n(b.y)}Z`;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/** The places of dots, as a die shows them, in units of a tile's half. */
|
|
228
|
+
const dotPlaces = {
|
|
229
|
+
1: [[0, 0]],
|
|
230
|
+
2: [
|
|
231
|
+
[-1, -1],
|
|
232
|
+
[1, 1],
|
|
233
|
+
],
|
|
234
|
+
3: [
|
|
235
|
+
[-1, -1],
|
|
236
|
+
[0, 0],
|
|
237
|
+
[1, 1],
|
|
238
|
+
],
|
|
239
|
+
4: [
|
|
240
|
+
[-1, -1],
|
|
241
|
+
[1, -1],
|
|
242
|
+
[1, 1],
|
|
243
|
+
[-1, 1],
|
|
244
|
+
],
|
|
245
|
+
5: [
|
|
246
|
+
[-1, -1],
|
|
247
|
+
[1, -1],
|
|
248
|
+
[0, 0],
|
|
249
|
+
[1, 1],
|
|
250
|
+
[-1, 1],
|
|
251
|
+
],
|
|
252
|
+
6: [
|
|
253
|
+
[-1, -1],
|
|
254
|
+
[-1, 0],
|
|
255
|
+
[-1, 1],
|
|
256
|
+
[1, -1],
|
|
257
|
+
[1, 0],
|
|
258
|
+
[1, 1],
|
|
259
|
+
],
|
|
260
|
+
7: [
|
|
261
|
+
[-1, -1],
|
|
262
|
+
[-1, 0],
|
|
263
|
+
[-1, 1],
|
|
264
|
+
[0, 0],
|
|
265
|
+
[1, -1],
|
|
266
|
+
[1, 0],
|
|
267
|
+
[1, 1],
|
|
268
|
+
],
|
|
269
|
+
8: [
|
|
270
|
+
[-1, -1],
|
|
271
|
+
[0, -1],
|
|
272
|
+
[1, -1],
|
|
273
|
+
[-1, 0],
|
|
274
|
+
[1, 0],
|
|
275
|
+
[-1, 1],
|
|
276
|
+
[0, 1],
|
|
277
|
+
[1, 1],
|
|
278
|
+
],
|
|
279
|
+
9: [
|
|
280
|
+
[-1, -1],
|
|
281
|
+
[0, -1],
|
|
282
|
+
[1, -1],
|
|
283
|
+
[-1, 0],
|
|
284
|
+
[0, 0],
|
|
285
|
+
[1, 0],
|
|
286
|
+
[-1, 1],
|
|
287
|
+
[0, 1],
|
|
288
|
+
[1, 1],
|
|
289
|
+
],
|
|
290
|
+
};
|
|
291
|
+
function tilePath(shape, c, s) {
|
|
292
|
+
return poly(vertices(shape, c.x, c.y, s));
|
|
293
|
+
}
|
|
294
|
+
/** drawFace draws a tile's fill and pattern; its outline comes later. */
|
|
295
|
+
function drawFace(pen, shape, tile, c, s) {
|
|
296
|
+
const sides = sidesOf(shape);
|
|
297
|
+
const turn = tile.turn ?? 0;
|
|
298
|
+
pen.el("path", { d: tilePath(shape, c, s), fill: colors[tile.fill ?? "white"].fill });
|
|
299
|
+
for (const p of tile.parts ?? [])
|
|
300
|
+
pen.el("path", {
|
|
301
|
+
d: partPath(shape, p.part, (p.at ?? 0) + turn, c, s),
|
|
302
|
+
fill: colors[p.color].fill,
|
|
303
|
+
stroke: ink,
|
|
304
|
+
"stroke-width": 1.5,
|
|
305
|
+
"stroke-linejoin": "round",
|
|
306
|
+
});
|
|
307
|
+
const side = shape === "square" ? s : s / Math.sqrt(3);
|
|
308
|
+
const width = side * 0.13;
|
|
309
|
+
const v = vertices(shape, c.x, c.y, s);
|
|
310
|
+
const edges = edgesOf(shape);
|
|
311
|
+
for (const l of tile.links ?? []) {
|
|
312
|
+
const a = (edges.indexOf(l.from) + turn) % sides;
|
|
313
|
+
const b = (edges.indexOf(l.to) + turn) % sides;
|
|
314
|
+
const d = linkPath(v, a, b, l.straight === true);
|
|
315
|
+
pen.el("path", { d, fill: "none", stroke: ink, "stroke-width": width + 3 });
|
|
316
|
+
pen.el("path", { d, fill: "none", stroke: colors[l.color].fill, "stroke-width": width });
|
|
317
|
+
}
|
|
318
|
+
if (tile.dots) {
|
|
319
|
+
const unit = shape === "square" ? s * 0.27 : s * 0.25;
|
|
320
|
+
const color = tile.dots.color ?? "black";
|
|
321
|
+
for (const [x, y] of dotPlaces[tile.dots.count] ?? []) {
|
|
322
|
+
const p = turnPoint({ x: c.x + x * unit, y: c.y + y * unit }, c, turn, sides);
|
|
323
|
+
pen.el("circle", {
|
|
324
|
+
cx: p.x,
|
|
325
|
+
cy: p.y,
|
|
326
|
+
r: s * 0.085,
|
|
327
|
+
fill: colors[color].fill,
|
|
328
|
+
stroke: ink,
|
|
329
|
+
"stroke-width": 1.5,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
if (tile.thing !== undefined) {
|
|
334
|
+
const deg = (turn * 360) / sides;
|
|
335
|
+
if (deg !== 0)
|
|
336
|
+
pen.add(`<g transform="rotate(${deg} ${n(c.x)} ${n(c.y)})">`);
|
|
337
|
+
drawThing(pen, tile.thing, c.x, c.y, s * (shape === "square" ? 0.66 : 0.6));
|
|
338
|
+
if (deg !== 0)
|
|
339
|
+
pen.add("</g>");
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
/** places lays the tiles out, centred on 0, 0 per their layout. */
|
|
343
|
+
function places(scene, s) {
|
|
344
|
+
const gap = scene.apart ? s * 0.22 : 0;
|
|
345
|
+
const out = [];
|
|
346
|
+
if (scene.shape === "square") {
|
|
347
|
+
const step = s + gap;
|
|
348
|
+
const at = (col, row) => ({ x: col * step, y: row * step });
|
|
349
|
+
if (scene.layout === "row")
|
|
350
|
+
scene.tiles.forEach((tile, i) => {
|
|
351
|
+
out.push({ tile, c: at(i, 0) });
|
|
352
|
+
});
|
|
353
|
+
else if (scene.layout === "grid") {
|
|
354
|
+
const cols = scene.columns ?? 3;
|
|
355
|
+
scene.tiles.forEach((tile, i) => {
|
|
356
|
+
out.push({ tile, c: at(i % cols, Math.floor(i / cols)) });
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
const cols = scene.columns ?? 3;
|
|
361
|
+
const rows = scene.rows ?? 3;
|
|
362
|
+
const cells = [];
|
|
363
|
+
for (let x = 0; x < cols; x++)
|
|
364
|
+
cells.push([x, 0]);
|
|
365
|
+
for (let y = 1; y < rows; y++)
|
|
366
|
+
cells.push([cols - 1, y]);
|
|
367
|
+
for (let x = cols - 2; x >= 0; x--)
|
|
368
|
+
cells.push([x, rows - 1]);
|
|
369
|
+
for (let y = rows - 2; y >= 1; y--)
|
|
370
|
+
cells.push([0, y]);
|
|
371
|
+
scene.tiles.forEach((tile, i) => {
|
|
372
|
+
out.push({ tile, c: at(...cells[i]) });
|
|
373
|
+
});
|
|
374
|
+
if (scene.centre)
|
|
375
|
+
out.push({ tile: scene.centre, c: at(1, 1) });
|
|
376
|
+
}
|
|
377
|
+
return out;
|
|
378
|
+
}
|
|
379
|
+
const dx = s + gap;
|
|
380
|
+
const dy = (s * Math.sqrt(3)) / 2 + gap * 0.87;
|
|
381
|
+
if (scene.layout === "row")
|
|
382
|
+
scene.tiles.forEach((tile, i) => {
|
|
383
|
+
out.push({ tile, c: { x: i * dx, y: 0 } });
|
|
384
|
+
});
|
|
385
|
+
else if (scene.layout === "grid") {
|
|
386
|
+
const cols = scene.columns ?? 3;
|
|
387
|
+
scene.tiles.forEach((tile, i) => {
|
|
388
|
+
const row = Math.floor(i / cols);
|
|
389
|
+
out.push({ tile, c: { x: (i % cols) * dx + (row % 2 === 1 ? dx / 2 : 0), y: row * dy } });
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
scene.tiles.forEach((tile, i) => {
|
|
394
|
+
const a = ((-120 + 60 * i) * Math.PI) / 180;
|
|
395
|
+
out.push({ tile, c: { x: dx * Math.cos(a), y: dx * Math.sin(a) } });
|
|
396
|
+
});
|
|
397
|
+
if (scene.centre)
|
|
398
|
+
out.push({ tile: scene.centre, c: { x: 0, y: 0 } });
|
|
399
|
+
}
|
|
400
|
+
return out;
|
|
401
|
+
}
|
|
402
|
+
/** across is how many tiles side by side the layout is at its widest. */
|
|
403
|
+
function across(scene) {
|
|
404
|
+
if (scene.layout === "row")
|
|
405
|
+
return scene.tiles.length;
|
|
406
|
+
if (scene.layout === "ring")
|
|
407
|
+
return scene.shape === "hexagon" ? 3 : (scene.columns ?? 3);
|
|
408
|
+
const cols = scene.columns ?? 3;
|
|
409
|
+
return scene.shape === "hexagon" && scene.tiles.length > cols ? cols + 0.5 : cols;
|
|
410
|
+
}
|
|
411
|
+
// Words for the text that reads the picture.
|
|
412
|
+
const squareCorners = ["top-left", "top-right", "bottom-right", "bottom-left"];
|
|
413
|
+
function sayPart(shape, p, turn) {
|
|
414
|
+
const sides = sidesOf(shape);
|
|
415
|
+
const k = ((p.at ?? 0) + turn) % sides;
|
|
416
|
+
const color = colors[p.color].word;
|
|
417
|
+
if (shape === "hexagon") {
|
|
418
|
+
const at = (i) => hexEdges[(k + i) % 6];
|
|
419
|
+
if (p.part === "wedge")
|
|
420
|
+
return `the ${color} wedge at the ${at(0)} edge`;
|
|
421
|
+
if (p.part === "third")
|
|
422
|
+
return `the ${color} third at the ${at(0)} and ${at(1)} edges`;
|
|
423
|
+
return `the ${color} half along the ${at(0)}, ${at(1)} and ${at(2)} edges`;
|
|
424
|
+
}
|
|
425
|
+
switch (p.part) {
|
|
426
|
+
case "half":
|
|
427
|
+
return `the ${color} ${squareEdges[k]} half`;
|
|
428
|
+
case "diagonal":
|
|
429
|
+
return `the ${color} ${squareCorners[k]} half, cut on the diagonal`;
|
|
430
|
+
case "quarter":
|
|
431
|
+
return `the ${color} ${squareCorners[k]} quarter`;
|
|
432
|
+
case "wedge":
|
|
433
|
+
return `the ${color} triangle from the centre to the ${squareEdges[k]} edge`;
|
|
434
|
+
default:
|
|
435
|
+
return `a ${color} quarter circle in the ${squareCorners[k]} corner`;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
function sayTile(shape, tile) {
|
|
439
|
+
if (tile.ask)
|
|
440
|
+
return "a question mark";
|
|
441
|
+
if (tile.empty)
|
|
442
|
+
return "an empty place";
|
|
443
|
+
const sides = sidesOf(shape);
|
|
444
|
+
const turn = tile.turn ?? 0;
|
|
445
|
+
const edges = edgesOf(shape);
|
|
446
|
+
const bits = [`${colors[tile.fill ?? "white"].word}`];
|
|
447
|
+
for (const p of tile.parts ?? [])
|
|
448
|
+
bits.push(sayPart(shape, p, turn));
|
|
449
|
+
for (const l of tile.links ?? []) {
|
|
450
|
+
const a = edges[(edges.indexOf(l.from) + turn) % sides];
|
|
451
|
+
const b = edges[(edges.indexOf(l.to) + turn) % sides];
|
|
452
|
+
const straight = l.straight === true ||
|
|
453
|
+
(shape === "square"
|
|
454
|
+
? (edges.indexOf(l.from) - edges.indexOf(l.to) + 4) % 2 === 0
|
|
455
|
+
: (edges.indexOf(l.from) - edges.indexOf(l.to) + 6) % 6 === 3);
|
|
456
|
+
bits.push(`a ${colors[l.color].word} ${straight ? "line" : "arc"} joining the ${a} and ${b} edges`);
|
|
457
|
+
}
|
|
458
|
+
if (tile.dots) {
|
|
459
|
+
const k = tile.dots.count;
|
|
460
|
+
bits.push(`${k} ${colors[tile.dots.color ?? "black"].word} dot${k === 1 ? "" : "s"}`);
|
|
461
|
+
}
|
|
462
|
+
if (tile.thing !== undefined) {
|
|
463
|
+
const turned = turn === 0
|
|
464
|
+
? ""
|
|
465
|
+
: shape === "square"
|
|
466
|
+
? [
|
|
467
|
+
"",
|
|
468
|
+
" turned a quarter turn clockwise",
|
|
469
|
+
" upside down",
|
|
470
|
+
" turned a quarter turn anticlockwise",
|
|
471
|
+
][turn]
|
|
472
|
+
: ` turned ${turn * 60} degrees clockwise`;
|
|
473
|
+
bits.push(`${/^[aeiou]/.test(wordOf(tile.thing)) ? "an" : "a"} ${wordOf(tile.thing)}${turned}`);
|
|
474
|
+
}
|
|
475
|
+
return bits.length === 1 ? `${bits[0]}, plain` : `${bits[0]}, with ${bits.slice(1).join(", ")}`;
|
|
476
|
+
}
|
|
477
|
+
export const tiles = {
|
|
478
|
+
kind: "tiles",
|
|
479
|
+
members: ["kind", "shape", "layout", "columns", "rows", "apart", "tiles", "centre"],
|
|
480
|
+
check(scene, problems) {
|
|
481
|
+
only(scene, this.members, "scene", problems);
|
|
482
|
+
const shape = oneOf(scene.shape, tileShapes, "shape", problems);
|
|
483
|
+
const layout = oneOf(scene.layout, layouts, "layout", problems);
|
|
484
|
+
if (scene.apart !== undefined && typeof scene.apart !== "boolean")
|
|
485
|
+
problems.push("apart: must be true or false");
|
|
486
|
+
if (scene.columns !== undefined) {
|
|
487
|
+
if (layout === "row")
|
|
488
|
+
problems.push("columns: a row has no columns");
|
|
489
|
+
else if (layout === "ring" && shape === "hexagon")
|
|
490
|
+
problems.push("columns: a ring of hexagons is always 6 round one");
|
|
491
|
+
else
|
|
492
|
+
int(scene.columns, "columns", problems, layout === "ring" ? 3 : 1, 6);
|
|
493
|
+
}
|
|
494
|
+
if (scene.rows !== undefined) {
|
|
495
|
+
if (layout !== "ring" || shape !== "square")
|
|
496
|
+
problems.push("rows: only a ring of squares has rows; a grid has as many as its tiles fill");
|
|
497
|
+
else
|
|
498
|
+
int(scene.rows, "rows", problems, 3, 5);
|
|
499
|
+
}
|
|
500
|
+
if (problems.length > 0)
|
|
501
|
+
return;
|
|
502
|
+
const most = layout === "row" ? 8 : layout === "grid" ? 36 : ringCount(scene);
|
|
503
|
+
const tilesList = list(scene.tiles, "tiles", problems, 1, most);
|
|
504
|
+
if (layout === "ring" && tilesList.length !== most)
|
|
505
|
+
problems.push(`tiles: a ring of ${shape === "square" ? `${scene.columns ?? 3} by ${scene.rows ?? 3} squares` : "hexagons"} holds exactly ${most}, clockwise from the top left`);
|
|
506
|
+
if (layout === "grid") {
|
|
507
|
+
const cols = scene.columns ?? 3;
|
|
508
|
+
if (Math.ceil(tilesList.length / cols) > 6)
|
|
509
|
+
problems.push("tiles: a grid holds at most 6 rows");
|
|
510
|
+
}
|
|
511
|
+
tilesList.forEach((t, i) => {
|
|
512
|
+
checkTile(t, `tiles[${i}]`, scene, problems);
|
|
513
|
+
});
|
|
514
|
+
if (scene.centre !== undefined) {
|
|
515
|
+
if (layout !== "ring")
|
|
516
|
+
problems.push("centre: only a ring has a centre");
|
|
517
|
+
else if (shape === "square" && ((scene.columns ?? 3) !== 3 || (scene.rows ?? 3) !== 3))
|
|
518
|
+
problems.push("centre: only a ring of 3 by 3 squares has a centre tile");
|
|
519
|
+
else
|
|
520
|
+
checkTile(scene.centre, "centre", scene, problems);
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
draw(scene, pen) {
|
|
524
|
+
const typed = scene;
|
|
525
|
+
const shape = typed.shape;
|
|
526
|
+
const wide = across(typed);
|
|
527
|
+
const gapRatio = typed.apart ? 0.22 : 0;
|
|
528
|
+
const s = Math.min(typed.layout === "row" ? 90 : 86, 600 / (wide + gapRatio * Math.max(0, wide - 1)));
|
|
529
|
+
const placed = places(typed, s);
|
|
530
|
+
// The box round every tile, so the picture starts at the margin.
|
|
531
|
+
const half = shape === "square" ? s / 2 : s / Math.sqrt(3);
|
|
532
|
+
const halfW = s / 2;
|
|
533
|
+
const xs = placed.map((p) => p.c.x);
|
|
534
|
+
const ys = placed.map((p) => p.c.y);
|
|
535
|
+
const left = Math.min(...xs) - halfW;
|
|
536
|
+
const top = Math.min(...ys) - half;
|
|
537
|
+
const width = Math.max(...xs) + halfW - left;
|
|
538
|
+
const height = Math.max(...ys) + half - top;
|
|
539
|
+
const at = (p) => ({ x: p.x - left + margin, y: p.y - top + margin });
|
|
540
|
+
// Missing tiles first, so that the tiles round them keep whole outlines.
|
|
541
|
+
for (const p of placed) {
|
|
542
|
+
if (!p.tile.ask && !p.tile.empty)
|
|
543
|
+
continue;
|
|
544
|
+
const c = at(p.c);
|
|
545
|
+
pen.el("path", {
|
|
546
|
+
d: tilePath(shape, c, s),
|
|
547
|
+
fill: p.tile.ask ? "#ffffff" : soft,
|
|
548
|
+
stroke: p.tile.ask ? ink : faint,
|
|
549
|
+
"stroke-width": outline,
|
|
550
|
+
"stroke-dasharray": "6 5",
|
|
551
|
+
"stroke-linejoin": "round",
|
|
552
|
+
});
|
|
553
|
+
if (p.tile.ask)
|
|
554
|
+
pen.text(c.x, c.y, "?", { size: s * 0.5 });
|
|
555
|
+
}
|
|
556
|
+
for (const p of placed)
|
|
557
|
+
if (!p.tile.ask && !p.tile.empty)
|
|
558
|
+
drawFace(pen, shape, p.tile, at(p.c), s);
|
|
559
|
+
for (const p of placed)
|
|
560
|
+
if (!p.tile.ask && !p.tile.empty)
|
|
561
|
+
pen.el("path", {
|
|
562
|
+
d: tilePath(shape, at(p.c), s),
|
|
563
|
+
fill: "none",
|
|
564
|
+
stroke: ink,
|
|
565
|
+
"stroke-width": outline,
|
|
566
|
+
"stroke-linejoin": "round",
|
|
567
|
+
});
|
|
568
|
+
let bottom = height + 2 * margin;
|
|
569
|
+
if (typed.tiles.some((t) => t.label)) {
|
|
570
|
+
for (const p of placed) {
|
|
571
|
+
if (!p.tile.label)
|
|
572
|
+
continue;
|
|
573
|
+
const c = at(p.c);
|
|
574
|
+
pen.text(c.x, margin + height + 20, p.tile.label, { size: 18 });
|
|
575
|
+
}
|
|
576
|
+
bottom += 32;
|
|
577
|
+
}
|
|
578
|
+
return { width: width + 2 * margin, height: bottom };
|
|
579
|
+
},
|
|
580
|
+
describe(scene) {
|
|
581
|
+
const typed = scene;
|
|
582
|
+
const shape = typed.shape;
|
|
583
|
+
const noun = shape === "square" ? "square tile" : "hexagonal tile";
|
|
584
|
+
const k = typed.tiles.length;
|
|
585
|
+
const say = (t, name) => `${name}: ${sayTile(shape, t)}.`;
|
|
586
|
+
const touch = typed.apart ? "apart" : "touching";
|
|
587
|
+
if (typed.layout === "row") {
|
|
588
|
+
const named = (t, i) => say(t, t.label ? `Tile ${t.label}` : `Tile ${i + 1}`);
|
|
589
|
+
return `A row of ${k} ${noun}${k === 1 ? "" : "s"}, ${touch}, from left to right. ${typed.tiles.map((t, i) => named(t, i)).join(" ")}`;
|
|
590
|
+
}
|
|
591
|
+
if (typed.layout === "grid") {
|
|
592
|
+
const cols = typed.columns ?? 3;
|
|
593
|
+
const rows = Math.ceil(k / cols);
|
|
594
|
+
const shift = shape === "hexagon" ? " (every second row shifted half a tile to the right)" : "";
|
|
595
|
+
const words = typed.tiles.map((t, i) => say(t, `Row ${Math.floor(i / cols) + 1}, tile ${(i % cols) + 1}`));
|
|
596
|
+
return `A grid of ${k} ${noun}s, ${touch}, ${rows} row${rows === 1 ? "" : "s"} of up to ${cols}${shift}, row by row from the top left. ${words.join(" ")}`;
|
|
597
|
+
}
|
|
598
|
+
const round = shape === "square"
|
|
599
|
+
? `${k} square tiles round the edge of a ${typed.columns ?? 3} by ${typed.rows ?? 3} square`
|
|
600
|
+
: "6 hexagonal tiles round a middle place";
|
|
601
|
+
const centre = typed.centre ? ` ${say(typed.centre, "In the middle")}` : "";
|
|
602
|
+
return `A ring of ${round}, ${touch}, clockwise from the top left. ${typed.tiles
|
|
603
|
+
.map((t, i) => say(t, `Tile ${i + 1}`))
|
|
604
|
+
.join(" ")}${centre}`;
|
|
605
|
+
},
|
|
606
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Kind } from "../kind.ts";
|
|
2
|
+
import { type ColorName } from "../style.ts";
|
|
3
|
+
import { type Thing } from "../things.ts";
|
|
4
|
+
/**
|
|
5
|
+
* A Venn or Euler diagram: one to three circles, each a set with a label and
|
|
6
|
+
* a colour of its own, arranged by a layout — overlapping, one inside
|
|
7
|
+
* another, apart, in a chain —, and maybe a box around them, the whole that
|
|
8
|
+
* the sets are taken from. A part of the picture is named by the sets it is
|
|
9
|
+
* inside, "in": [1, 2] for inside sets 1 and 2 and no other, "in": [] for the
|
|
10
|
+
* box outside every circle. A part holds a number, a "?", texts or things;
|
|
11
|
+
* the picture puts each in a place of its own, whole inside its part and
|
|
12
|
+
* clear of every line, so a part shows exactly what the scene says.
|
|
13
|
+
*/
|
|
14
|
+
export declare const vennLayouts: readonly ["overlap", "inside", "apart", "chain", "nested"];
|
|
15
|
+
export type VennLayout = (typeof vennLayouts)[number];
|
|
16
|
+
export type VennSet = {
|
|
17
|
+
label?: string;
|
|
18
|
+
thing?: Thing;
|
|
19
|
+
color?: ColorName;
|
|
20
|
+
};
|
|
21
|
+
export type Text = string | {
|
|
22
|
+
ask: true;
|
|
23
|
+
};
|
|
24
|
+
export type Region = {
|
|
25
|
+
in: number[];
|
|
26
|
+
count?: number;
|
|
27
|
+
texts?: Text[];
|
|
28
|
+
things?: Thing[];
|
|
29
|
+
ask?: true;
|
|
30
|
+
};
|
|
31
|
+
export type VennScene = {
|
|
32
|
+
kind: "venn";
|
|
33
|
+
sets: VennSet[];
|
|
34
|
+
layout?: VennLayout;
|
|
35
|
+
regions?: Region[];
|
|
36
|
+
box?: true | string;
|
|
37
|
+
};
|
|
38
|
+
export declare const venn: Kind;
|