@opendata-ai/openchart-vanilla 9.0.0-rc.1 → 9.0.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 +10 -0
- package/dist/{chunk-T6IPHUN4.js → chunk-42WVDS3V.js} +186 -38
- package/dist/chunk-42WVDS3V.js.map +1 -0
- package/dist/{chunk-46E3QB6O.js → chunk-6GRMMSQA.js} +2 -2
- package/dist/{chunk-A5C4VCUO.js → chunk-7XFFPRQ7.js} +13 -4
- package/dist/chunk-7XFFPRQ7.js.map +1 -0
- package/dist/chunk-E3ETKTJQ.js +130 -0
- package/dist/chunk-E3ETKTJQ.js.map +1 -0
- package/dist/{chunk-5ZLSMZRM.js → chunk-HQ5GADZ4.js} +9 -8
- package/dist/{chunk-5ZLSMZRM.js.map → chunk-HQ5GADZ4.js.map} +1 -1
- package/dist/{chunk-ERPYVYFW.js → chunk-NGNHQOXO.js} +1065 -972
- package/dist/chunk-NGNHQOXO.js.map +1 -0
- package/dist/{chunk-RBXIZJPE.js → chunk-OEJHSKFZ.js} +2 -2
- package/dist/{chunk-CMIJA63X.js → chunk-RWP23N4D.js} +3 -3
- package/dist/chunk-SKQAAHHR.js +533 -0
- package/dist/chunk-SKQAAHHR.js.map +1 -0
- package/dist/{chunk-NLKQ5AOA.js → chunk-XR4B3SPC.js} +70 -30
- package/dist/chunk-XR4B3SPC.js.map +1 -0
- package/dist/export-gif.js +4 -4
- package/dist/graph-3d/index.js +4 -4
- package/dist/index.d.ts +41 -51
- package/dist/index.js +85 -216
- package/dist/index.js.map +1 -1
- package/dist/simulation-worker.js +26 -26
- package/dist/static.d.ts +10 -21
- package/dist/static.js +417 -118
- package/dist/static.js.map +1 -1
- package/dist/story/index.js +7 -7
- package/dist/styles.css.map +1 -1
- package/package.json +4 -7
- package/dist/chunk-6YPRYQKD.js +0 -297
- package/dist/chunk-6YPRYQKD.js.map +0 -1
- package/dist/chunk-A5C4VCUO.js.map +0 -1
- package/dist/chunk-ERPYVYFW.js.map +0 -1
- package/dist/chunk-FFP5GXIP.js +0 -45
- package/dist/chunk-FFP5GXIP.js.map +0 -1
- package/dist/chunk-NLKQ5AOA.js.map +0 -1
- package/dist/chunk-T6IPHUN4.js.map +0 -1
- /package/dist/{chunk-46E3QB6O.js.map → chunk-6GRMMSQA.js.map} +0 -0
- /package/dist/{chunk-RBXIZJPE.js.map → chunk-OEJHSKFZ.js.map} +0 -0
- /package/dist/{chunk-CMIJA63X.js.map → chunk-RWP23N4D.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
copyComputedThemeProperties,
|
|
3
3
|
injectThemeStyleBlock
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7XFFPRQ7.js";
|
|
5
5
|
|
|
6
6
|
// src/export.ts
|
|
7
7
|
function getSVGDimensions(svg) {
|
|
@@ -309,4 +309,4 @@ export {
|
|
|
309
309
|
exportJPG,
|
|
310
310
|
exportCSV
|
|
311
311
|
};
|
|
312
|
-
//# sourceMappingURL=chunk-
|
|
312
|
+
//# sourceMappingURL=chunk-OEJHSKFZ.js.map
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
getSVGBackgroundColor,
|
|
6
6
|
getSVGDimensions,
|
|
7
7
|
rasterizeSVGToCanvas
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OEJHSKFZ.js";
|
|
9
9
|
import {
|
|
10
10
|
injectThemeStyleBlock
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7XFFPRQ7.js";
|
|
12
12
|
|
|
13
13
|
// src/export-gif.ts
|
|
14
14
|
import {
|
|
@@ -245,4 +245,4 @@ export {
|
|
|
245
245
|
applyFrameState,
|
|
246
246
|
exportGIF
|
|
247
247
|
};
|
|
248
|
-
//# sourceMappingURL=chunk-
|
|
248
|
+
//# sourceMappingURL=chunk-RWP23N4D.js.map
|
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderLegend,
|
|
3
|
+
stampAnimationVars
|
|
4
|
+
} from "./chunk-NGNHQOXO.js";
|
|
5
|
+
import {
|
|
6
|
+
createRenderContext,
|
|
7
|
+
renderAttributionBrand,
|
|
8
|
+
renderChromeElement,
|
|
9
|
+
stampThemeProperties
|
|
10
|
+
} from "./chunk-XR4B3SPC.js";
|
|
11
|
+
import {
|
|
12
|
+
createSVGElement
|
|
13
|
+
} from "./chunk-E3ETKTJQ.js";
|
|
14
|
+
|
|
15
|
+
// src/barlist-renderer.ts
|
|
16
|
+
function setAttrs(el, attrs) {
|
|
17
|
+
for (const [key, value] of Object.entries(attrs)) {
|
|
18
|
+
el.setAttribute(key, String(value));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function renderChrome(parent, layout, ctx = createRenderContext()) {
|
|
22
|
+
const g = createSVGElement("g", ctx.factory);
|
|
23
|
+
g.setAttribute("class", "oc-chrome");
|
|
24
|
+
const { chrome } = layout;
|
|
25
|
+
const bottomOffset = layout.area.y + layout.area.height;
|
|
26
|
+
for (const key of ["title", "subtitle", "source", "byline", "footer"]) {
|
|
27
|
+
const el = chrome[key];
|
|
28
|
+
if (!el) continue;
|
|
29
|
+
const isBottom = key === "source" || key === "byline" || key === "footer";
|
|
30
|
+
renderChromeElement(
|
|
31
|
+
g,
|
|
32
|
+
isBottom ? { ...el, y: bottomOffset + el.y } : el,
|
|
33
|
+
`oc-${key}`,
|
|
34
|
+
key,
|
|
35
|
+
layout.measureText,
|
|
36
|
+
void 0,
|
|
37
|
+
ctx
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
parent.appendChild(g);
|
|
41
|
+
}
|
|
42
|
+
function renderRows(parent, layout, animation, ctx = createRenderContext()) {
|
|
43
|
+
const g = createSVGElement("g", ctx.factory);
|
|
44
|
+
g.setAttribute("class", "oc-barlist-rows");
|
|
45
|
+
if (ctx.interactive) g.setAttribute("role", "list");
|
|
46
|
+
for (const row of layout.rows) {
|
|
47
|
+
const rowGroup = createSVGElement("g", ctx.factory);
|
|
48
|
+
rowGroup.setAttribute("class", "oc-barlist-row");
|
|
49
|
+
rowGroup.setAttribute("data-row-index", String(row.index));
|
|
50
|
+
if (ctx.interactive) rowGroup.setAttribute("role", "listitem");
|
|
51
|
+
if (ctx.interactive && row.aria?.label) {
|
|
52
|
+
rowGroup.setAttribute("aria-label", row.aria.label);
|
|
53
|
+
}
|
|
54
|
+
if (animation?.enter) {
|
|
55
|
+
rowGroup.setAttribute("data-animation-index", String(row.animationIndex));
|
|
56
|
+
const style = rowGroup.style;
|
|
57
|
+
style.setProperty("--oc-mark-index", String(row.animationIndex));
|
|
58
|
+
style.setProperty("--oc-row-delay", `${row.animationIndex * 40}ms`);
|
|
59
|
+
}
|
|
60
|
+
const labelEl = createSVGElement("text", ctx.factory);
|
|
61
|
+
setAttrs(labelEl, {
|
|
62
|
+
x: row.label.x,
|
|
63
|
+
y: row.label.y,
|
|
64
|
+
"dominant-baseline": "central",
|
|
65
|
+
"text-anchor": "start",
|
|
66
|
+
"font-family": row.label.style.fontFamily,
|
|
67
|
+
"font-size": row.label.style.fontSize,
|
|
68
|
+
"font-weight": row.label.style.fontWeight
|
|
69
|
+
});
|
|
70
|
+
labelEl.style.setProperty("fill", row.label.style.fill);
|
|
71
|
+
labelEl.textContent = row.label.text;
|
|
72
|
+
if (row.fullLabel && row.fullLabel !== row.label.text) {
|
|
73
|
+
const labelGroup = createSVGElement("g", ctx.factory);
|
|
74
|
+
labelGroup.setAttribute("class", "oc-barlist-label");
|
|
75
|
+
const title = createSVGElement("title", ctx.factory);
|
|
76
|
+
title.textContent = row.fullLabel;
|
|
77
|
+
labelGroup.appendChild(title);
|
|
78
|
+
labelGroup.appendChild(labelEl);
|
|
79
|
+
rowGroup.appendChild(labelGroup);
|
|
80
|
+
} else rowGroup.appendChild(labelEl);
|
|
81
|
+
if (row.subtitle?.visible) {
|
|
82
|
+
const subEl = createSVGElement("text", ctx.factory);
|
|
83
|
+
setAttrs(subEl, {
|
|
84
|
+
x: row.subtitle.x,
|
|
85
|
+
y: row.subtitle.y,
|
|
86
|
+
"dominant-baseline": "central",
|
|
87
|
+
"text-anchor": "start",
|
|
88
|
+
"font-family": row.subtitle.style.fontFamily,
|
|
89
|
+
"font-size": row.subtitle.style.fontSize,
|
|
90
|
+
"font-weight": row.subtitle.style.fontWeight
|
|
91
|
+
});
|
|
92
|
+
subEl.style.setProperty(
|
|
93
|
+
"fill",
|
|
94
|
+
row.subtitle.style.fill
|
|
95
|
+
);
|
|
96
|
+
subEl.textContent = row.subtitle.text;
|
|
97
|
+
rowGroup.appendChild(subEl);
|
|
98
|
+
}
|
|
99
|
+
const trackRect = createSVGElement("rect", ctx.factory);
|
|
100
|
+
setAttrs(trackRect, {
|
|
101
|
+
x: row.track.x,
|
|
102
|
+
y: row.track.y,
|
|
103
|
+
width: row.track.width,
|
|
104
|
+
height: row.track.height,
|
|
105
|
+
rx: row.track.cornerRadius,
|
|
106
|
+
fill: ctx.interactive ? "currentColor" : layout.theme.colors.text,
|
|
107
|
+
"fill-opacity": 0.06
|
|
108
|
+
});
|
|
109
|
+
trackRect.setAttribute("class", "oc-barlist-track");
|
|
110
|
+
rowGroup.appendChild(trackRect);
|
|
111
|
+
const barRect = createSVGElement("rect", ctx.factory);
|
|
112
|
+
setAttrs(barRect, {
|
|
113
|
+
x: row.bar.x,
|
|
114
|
+
y: row.bar.y,
|
|
115
|
+
width: row.bar.width,
|
|
116
|
+
height: row.bar.height,
|
|
117
|
+
rx: row.bar.cornerRadius,
|
|
118
|
+
fill: row.bar.fill
|
|
119
|
+
});
|
|
120
|
+
barRect.setAttribute("class", "oc-barlist-bar");
|
|
121
|
+
barRect.setAttribute("data-mark", "bar");
|
|
122
|
+
for (const [field, value] of Object.entries(row.identity ?? {}))
|
|
123
|
+
barRect.setAttribute(`data-${field}`, value);
|
|
124
|
+
const description = row.authoredDescription ?? row.aria.label;
|
|
125
|
+
if (!ctx.interactive && description !== void 0) {
|
|
126
|
+
const title = createSVGElement("title", ctx.factory);
|
|
127
|
+
title.textContent = description;
|
|
128
|
+
barRect.appendChild(title);
|
|
129
|
+
}
|
|
130
|
+
rowGroup.appendChild(barRect);
|
|
131
|
+
const valueEl = createSVGElement("text", ctx.factory);
|
|
132
|
+
setAttrs(valueEl, {
|
|
133
|
+
x: row.valueLabel.x,
|
|
134
|
+
y: row.valueLabel.y,
|
|
135
|
+
"dominant-baseline": "central",
|
|
136
|
+
"text-anchor": "end",
|
|
137
|
+
"font-family": row.valueLabel.style.fontFamily,
|
|
138
|
+
"font-size": row.valueLabel.style.fontSize,
|
|
139
|
+
"font-weight": row.valueLabel.style.fontWeight
|
|
140
|
+
});
|
|
141
|
+
valueEl.style.setProperty(
|
|
142
|
+
"fill",
|
|
143
|
+
row.valueLabel.style.fill
|
|
144
|
+
);
|
|
145
|
+
valueEl.textContent = row.valueLabel.text;
|
|
146
|
+
rowGroup.appendChild(valueEl);
|
|
147
|
+
g.appendChild(rowGroup);
|
|
148
|
+
}
|
|
149
|
+
parent.appendChild(g);
|
|
150
|
+
}
|
|
151
|
+
function renderBarListSVG(layout, opts) {
|
|
152
|
+
const ctx = opts?.context ?? createRenderContext();
|
|
153
|
+
const { width, height, a11y, animation } = layout;
|
|
154
|
+
const animate = ctx.interactive && opts?.animate && !!animation?.enter;
|
|
155
|
+
const svg = createSVGElement("svg", ctx.factory);
|
|
156
|
+
svg.setAttribute("viewBox", `0 0 ${width} ${height}`);
|
|
157
|
+
if (a11y.hidden) svg.setAttribute("aria-hidden", "true");
|
|
158
|
+
else svg.setAttribute("role", ctx.interactive ? "list" : "img");
|
|
159
|
+
svg.style.height = `${height}px`;
|
|
160
|
+
if (!a11y.hidden && a11y.altText) {
|
|
161
|
+
svg.setAttribute("aria-label", a11y.altText);
|
|
162
|
+
}
|
|
163
|
+
const classes = animate ? "oc-barlist oc-animate" : "oc-barlist";
|
|
164
|
+
svg.setAttribute("class", classes);
|
|
165
|
+
if (ctx.interactive) stampThemeProperties(svg, layout.theme);
|
|
166
|
+
if (animate && animation?.enter) {
|
|
167
|
+
stampAnimationVars(svg, {
|
|
168
|
+
duration: animation.enter.duration,
|
|
169
|
+
spring: animation.enter.spring,
|
|
170
|
+
stagger: 40
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
renderChrome(svg, layout, ctx);
|
|
174
|
+
for (const group of layout.groups ?? []) {
|
|
175
|
+
if (group.separator) {
|
|
176
|
+
const rule = createSVGElement("line", ctx.factory);
|
|
177
|
+
setAttrs(rule, {
|
|
178
|
+
x1: group.separator.x1,
|
|
179
|
+
x2: group.separator.x2,
|
|
180
|
+
y1: group.separator.y,
|
|
181
|
+
y2: group.separator.y,
|
|
182
|
+
stroke: layout.theme.colors.neutral.border,
|
|
183
|
+
"stroke-width": 1
|
|
184
|
+
});
|
|
185
|
+
rule.setAttribute("class", "oc-barlist-group-rule");
|
|
186
|
+
svg.appendChild(rule);
|
|
187
|
+
}
|
|
188
|
+
const label = createSVGElement("text", ctx.factory);
|
|
189
|
+
setAttrs(label, {
|
|
190
|
+
x: group.label.x,
|
|
191
|
+
y: group.label.y,
|
|
192
|
+
"dominant-baseline": "central",
|
|
193
|
+
"font-family": group.label.style.fontFamily,
|
|
194
|
+
"font-size": group.label.style.fontSize,
|
|
195
|
+
"font-weight": group.label.style.fontWeight,
|
|
196
|
+
fill: group.label.style.fill
|
|
197
|
+
});
|
|
198
|
+
label.setAttribute("class", "oc-barlist-group-label");
|
|
199
|
+
label.textContent = group.label.text;
|
|
200
|
+
svg.appendChild(label);
|
|
201
|
+
}
|
|
202
|
+
renderRows(svg, layout, animate ? animation : void 0, ctx);
|
|
203
|
+
for (const reference of layout.referenceLines ?? []) {
|
|
204
|
+
const line = createSVGElement("line", ctx.factory);
|
|
205
|
+
setAttrs(line, {
|
|
206
|
+
x1: reference.x,
|
|
207
|
+
x2: reference.x,
|
|
208
|
+
y1: reference.y1,
|
|
209
|
+
y2: reference.y2,
|
|
210
|
+
stroke: reference.stroke,
|
|
211
|
+
"stroke-width": reference.strokeWidth
|
|
212
|
+
});
|
|
213
|
+
if (reference.strokeDasharray) line.setAttribute("stroke-dasharray", reference.strokeDasharray);
|
|
214
|
+
line.setAttribute("class", "oc-barlist-refline");
|
|
215
|
+
svg.appendChild(line);
|
|
216
|
+
if (reference.label) {
|
|
217
|
+
const label = createSVGElement("text", ctx.factory);
|
|
218
|
+
setAttrs(label, {
|
|
219
|
+
x: reference.label.x,
|
|
220
|
+
y: reference.label.y,
|
|
221
|
+
"text-anchor": "middle",
|
|
222
|
+
"font-family": reference.label.style.fontFamily,
|
|
223
|
+
"font-size": reference.label.style.fontSize,
|
|
224
|
+
"font-weight": reference.label.style.fontWeight,
|
|
225
|
+
fill: reference.label.style.fill
|
|
226
|
+
});
|
|
227
|
+
label.textContent = reference.label.text;
|
|
228
|
+
svg.appendChild(label);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
renderAttributionBrand(
|
|
232
|
+
svg,
|
|
233
|
+
layout.chrome,
|
|
234
|
+
layout.chrome.bottomAnchorY ?? layout.area.y + layout.area.height,
|
|
235
|
+
layout.measureText,
|
|
236
|
+
void 0,
|
|
237
|
+
ctx
|
|
238
|
+
);
|
|
239
|
+
return svg;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// src/tilemap-renderer.ts
|
|
243
|
+
function setAttrs2(el, attrs) {
|
|
244
|
+
for (const [key, value] of Object.entries(attrs)) {
|
|
245
|
+
el.setAttribute(key, String(value));
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
function renderChrome2(parent, layout, ctx = createRenderContext()) {
|
|
249
|
+
const g = createSVGElement("g", ctx.factory);
|
|
250
|
+
g.setAttribute("class", "oc-chrome");
|
|
251
|
+
const { chrome, measureText } = layout;
|
|
252
|
+
const bottomOffset = chrome.bottomAnchorY ?? layout.area.y + layout.area.height;
|
|
253
|
+
if (chrome.title) {
|
|
254
|
+
renderChromeElement(g, chrome.title, "oc-title", "title", measureText, void 0, ctx);
|
|
255
|
+
}
|
|
256
|
+
if (chrome.subtitle) {
|
|
257
|
+
renderChromeElement(g, chrome.subtitle, "oc-subtitle", "subtitle", measureText, void 0, ctx);
|
|
258
|
+
}
|
|
259
|
+
if (chrome.source) {
|
|
260
|
+
renderChromeElement(
|
|
261
|
+
g,
|
|
262
|
+
{ ...chrome.source, y: bottomOffset + chrome.source.y },
|
|
263
|
+
"oc-source",
|
|
264
|
+
"source",
|
|
265
|
+
measureText,
|
|
266
|
+
void 0,
|
|
267
|
+
ctx
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
if (chrome.byline) {
|
|
271
|
+
renderChromeElement(
|
|
272
|
+
g,
|
|
273
|
+
{ ...chrome.byline, y: bottomOffset + chrome.byline.y },
|
|
274
|
+
"oc-byline",
|
|
275
|
+
"byline",
|
|
276
|
+
measureText,
|
|
277
|
+
void 0,
|
|
278
|
+
ctx
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
if (chrome.footer) {
|
|
282
|
+
renderChromeElement(
|
|
283
|
+
g,
|
|
284
|
+
{ ...chrome.footer, y: bottomOffset + chrome.footer.y },
|
|
285
|
+
"oc-footer",
|
|
286
|
+
"footer",
|
|
287
|
+
measureText,
|
|
288
|
+
void 0,
|
|
289
|
+
ctx
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
parent.appendChild(g);
|
|
293
|
+
}
|
|
294
|
+
function renderTiles(parent, tiles, animation, ctx = createRenderContext()) {
|
|
295
|
+
const g = createSVGElement("g", ctx.factory);
|
|
296
|
+
g.setAttribute("class", "oc-tilemap-tiles");
|
|
297
|
+
g.setAttribute("role", "list");
|
|
298
|
+
const tileDelays = [];
|
|
299
|
+
if (animation?.enter) {
|
|
300
|
+
const baseStagger = 800 / Math.max(tiles.length, 1);
|
|
301
|
+
let seed = 17;
|
|
302
|
+
for (let i = 0; i < tiles.length; i++) {
|
|
303
|
+
const idx = tiles[i].animationIndex ?? i;
|
|
304
|
+
seed = seed * 1103515245 + 12345 & 2147483647;
|
|
305
|
+
const jitter = (seed % 1e3 / 1e3 - 0.5) * 0.8;
|
|
306
|
+
tileDelays.push(Math.max(0, Math.round(idx * baseStagger * (1 + jitter))));
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
for (let i = 0; i < tiles.length; i++) {
|
|
310
|
+
const tile = tiles[i];
|
|
311
|
+
const tileGroup = createSVGElement("g", ctx.factory);
|
|
312
|
+
tileGroup.setAttribute("class", "oc-tilemap-tile");
|
|
313
|
+
tileGroup.setAttribute("data-state", tile.stateCode);
|
|
314
|
+
tileGroup.setAttribute("role", "listitem");
|
|
315
|
+
if (tile.aria?.label) {
|
|
316
|
+
tileGroup.setAttribute("aria-label", tile.aria.label);
|
|
317
|
+
}
|
|
318
|
+
if (animation?.enter) {
|
|
319
|
+
const idx = tile.animationIndex ?? i;
|
|
320
|
+
tileGroup.setAttribute("data-animation-index", String(idx));
|
|
321
|
+
tileGroup.style.setProperty(
|
|
322
|
+
"--oc-mark-index",
|
|
323
|
+
String(idx)
|
|
324
|
+
);
|
|
325
|
+
tileGroup.style.setProperty(
|
|
326
|
+
"--oc-tile-delay",
|
|
327
|
+
`${tileDelays[i]}ms`
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
const rect = createSVGElement("rect", ctx.factory);
|
|
331
|
+
setAttrs2(rect, {
|
|
332
|
+
x: tile.x,
|
|
333
|
+
y: tile.y,
|
|
334
|
+
width: tile.size,
|
|
335
|
+
height: tile.size,
|
|
336
|
+
rx: tile.cornerRadius,
|
|
337
|
+
fill: tile.fill,
|
|
338
|
+
"fill-opacity": tile.fillOpacity ?? 1,
|
|
339
|
+
stroke: tile.stroke,
|
|
340
|
+
"stroke-width": tile.strokeWidth
|
|
341
|
+
});
|
|
342
|
+
tileGroup.appendChild(rect);
|
|
343
|
+
const codeLabel = createSVGElement("text", ctx.factory);
|
|
344
|
+
setAttrs2(codeLabel, {
|
|
345
|
+
x: tile.label.x,
|
|
346
|
+
y: tile.label.y,
|
|
347
|
+
"text-anchor": "middle",
|
|
348
|
+
"dominant-baseline": "central",
|
|
349
|
+
"font-family": tile.label.style.fontFamily,
|
|
350
|
+
"font-size": tile.label.style.fontSize,
|
|
351
|
+
"font-weight": tile.label.style.fontWeight,
|
|
352
|
+
// A hair of tracking is what keeps a two-letter code legible at 8px now
|
|
353
|
+
// that it is set at 600 instead of 700.
|
|
354
|
+
"letter-spacing": "0.02em"
|
|
355
|
+
});
|
|
356
|
+
codeLabel.style.setProperty(
|
|
357
|
+
"fill",
|
|
358
|
+
tile.label.style.fill
|
|
359
|
+
);
|
|
360
|
+
codeLabel.textContent = tile.label.text;
|
|
361
|
+
tileGroup.appendChild(codeLabel);
|
|
362
|
+
if (tile.valueLabel.visible && tile.valueLabel.text) {
|
|
363
|
+
const valueLabel = createSVGElement("text", ctx.factory);
|
|
364
|
+
setAttrs2(valueLabel, {
|
|
365
|
+
x: tile.valueLabel.x,
|
|
366
|
+
y: tile.valueLabel.y,
|
|
367
|
+
"text-anchor": "middle",
|
|
368
|
+
"dominant-baseline": "central",
|
|
369
|
+
"font-family": tile.valueLabel.style.fontFamily,
|
|
370
|
+
"font-size": tile.valueLabel.style.fontSize,
|
|
371
|
+
"font-weight": tile.valueLabel.style.fontWeight
|
|
372
|
+
});
|
|
373
|
+
valueLabel.style.setProperty(
|
|
374
|
+
"fill",
|
|
375
|
+
tile.valueLabel.style.fill
|
|
376
|
+
);
|
|
377
|
+
valueLabel.textContent = tile.valueLabel.text;
|
|
378
|
+
tileGroup.appendChild(valueLabel);
|
|
379
|
+
}
|
|
380
|
+
g.appendChild(tileGroup);
|
|
381
|
+
}
|
|
382
|
+
parent.appendChild(g);
|
|
383
|
+
}
|
|
384
|
+
function renderGradientLegend(parent, layout, ctx = createRenderContext()) {
|
|
385
|
+
if (!layout.gradientLegend) return;
|
|
386
|
+
const { gradientLegend } = layout;
|
|
387
|
+
const g = createSVGElement("g", ctx.factory);
|
|
388
|
+
g.setAttribute("class", "oc-tilemap-legend");
|
|
389
|
+
const defs = parent.querySelector("defs") || createSVGElement("defs", ctx.factory);
|
|
390
|
+
const exists = parent.querySelector("defs");
|
|
391
|
+
if (!exists) {
|
|
392
|
+
parent.insertBefore(defs, parent.firstChild);
|
|
393
|
+
}
|
|
394
|
+
const gradientId = ctx.ids.next("oc-tilemap-legend-gradient");
|
|
395
|
+
const grad = createSVGElement("linearGradient", ctx.factory);
|
|
396
|
+
grad.id = gradientId;
|
|
397
|
+
grad.setAttribute("x1", "0%");
|
|
398
|
+
grad.setAttribute("y1", "0%");
|
|
399
|
+
grad.setAttribute("x2", "100%");
|
|
400
|
+
grad.setAttribute("y2", "0%");
|
|
401
|
+
for (const stop of gradientLegend.colorStops) {
|
|
402
|
+
const s = createSVGElement("stop", ctx.factory);
|
|
403
|
+
const attrs = {
|
|
404
|
+
offset: `${stop.offset * 100}%`,
|
|
405
|
+
"stop-color": stop.color
|
|
406
|
+
};
|
|
407
|
+
if (stop.opacity !== void 0) {
|
|
408
|
+
attrs["stop-opacity"] = stop.opacity;
|
|
409
|
+
}
|
|
410
|
+
setAttrs2(s, attrs);
|
|
411
|
+
grad.appendChild(s);
|
|
412
|
+
}
|
|
413
|
+
defs.appendChild(grad);
|
|
414
|
+
const barHeight = gradientLegend.bounds.height;
|
|
415
|
+
const bar = createSVGElement("rect", ctx.factory);
|
|
416
|
+
setAttrs2(bar, {
|
|
417
|
+
x: gradientLegend.bounds.x,
|
|
418
|
+
y: gradientLegend.bounds.y,
|
|
419
|
+
width: gradientLegend.bounds.width,
|
|
420
|
+
height: barHeight,
|
|
421
|
+
fill: `url(#${gradientId})`,
|
|
422
|
+
"shape-rendering": "crispEdges"
|
|
423
|
+
});
|
|
424
|
+
g.appendChild(bar);
|
|
425
|
+
const minText = createSVGElement("text", ctx.factory);
|
|
426
|
+
setAttrs2(minText, {
|
|
427
|
+
x: gradientLegend.bounds.x,
|
|
428
|
+
y: gradientLegend.bounds.y + gradientLegend.bounds.height + 14,
|
|
429
|
+
"text-anchor": "start",
|
|
430
|
+
"font-family": gradientLegend.labelStyle.fontFamily,
|
|
431
|
+
"font-size": gradientLegend.labelStyle.fontSize,
|
|
432
|
+
"font-weight": gradientLegend.labelStyle.fontWeight
|
|
433
|
+
});
|
|
434
|
+
minText.style.setProperty(
|
|
435
|
+
"fill",
|
|
436
|
+
gradientLegend.labelStyle.fill
|
|
437
|
+
);
|
|
438
|
+
minText.textContent = gradientLegend.minLabel;
|
|
439
|
+
g.appendChild(minText);
|
|
440
|
+
const maxText = createSVGElement("text", ctx.factory);
|
|
441
|
+
setAttrs2(maxText, {
|
|
442
|
+
x: gradientLegend.bounds.x + gradientLegend.bounds.width,
|
|
443
|
+
y: gradientLegend.bounds.y + gradientLegend.bounds.height + 14,
|
|
444
|
+
"text-anchor": "end",
|
|
445
|
+
"font-family": gradientLegend.labelStyle.fontFamily,
|
|
446
|
+
"font-size": gradientLegend.labelStyle.fontSize,
|
|
447
|
+
"font-weight": gradientLegend.labelStyle.fontWeight
|
|
448
|
+
});
|
|
449
|
+
maxText.style.setProperty(
|
|
450
|
+
"fill",
|
|
451
|
+
gradientLegend.labelStyle.fill
|
|
452
|
+
);
|
|
453
|
+
maxText.textContent = gradientLegend.maxLabel;
|
|
454
|
+
g.appendChild(maxText);
|
|
455
|
+
if (gradientLegend.noData) {
|
|
456
|
+
const nd = gradientLegend.noData;
|
|
457
|
+
const swatch = createSVGElement("rect", ctx.factory);
|
|
458
|
+
swatch.setAttribute("class", "oc-legend-nodata");
|
|
459
|
+
setAttrs2(swatch, {
|
|
460
|
+
x: nd.x,
|
|
461
|
+
y: nd.y,
|
|
462
|
+
width: nd.size,
|
|
463
|
+
height: nd.size,
|
|
464
|
+
fill: nd.fill,
|
|
465
|
+
"shape-rendering": "crispEdges"
|
|
466
|
+
});
|
|
467
|
+
g.appendChild(swatch);
|
|
468
|
+
const ndLabel = createSVGElement("text", ctx.factory);
|
|
469
|
+
setAttrs2(ndLabel, {
|
|
470
|
+
x: nd.labelX,
|
|
471
|
+
y: nd.labelY,
|
|
472
|
+
"text-anchor": "start",
|
|
473
|
+
"font-family": gradientLegend.labelStyle.fontFamily,
|
|
474
|
+
"font-size": gradientLegend.labelStyle.fontSize,
|
|
475
|
+
"font-weight": gradientLegend.labelStyle.fontWeight
|
|
476
|
+
});
|
|
477
|
+
ndLabel.style.setProperty(
|
|
478
|
+
"fill",
|
|
479
|
+
gradientLegend.labelStyle.fill
|
|
480
|
+
);
|
|
481
|
+
ndLabel.textContent = nd.label;
|
|
482
|
+
g.appendChild(ndLabel);
|
|
483
|
+
}
|
|
484
|
+
parent.appendChild(g);
|
|
485
|
+
}
|
|
486
|
+
function renderTileMapSVG(layout, opts) {
|
|
487
|
+
const ctx = opts?.context ?? createRenderContext();
|
|
488
|
+
const { width, height, tiles, a11y, animation } = layout;
|
|
489
|
+
const animate = opts?.animate && !!animation?.enter;
|
|
490
|
+
const svg = createSVGElement("svg", ctx.factory);
|
|
491
|
+
svg.setAttribute("viewBox", `0 0 ${width} ${height}`);
|
|
492
|
+
svg.setAttribute("role", "img");
|
|
493
|
+
if (a11y.altText) {
|
|
494
|
+
svg.setAttribute("aria-label", a11y.altText);
|
|
495
|
+
}
|
|
496
|
+
const classes = animate ? "oc-tilemap oc-animate" : "oc-tilemap";
|
|
497
|
+
svg.setAttribute("class", classes);
|
|
498
|
+
stampThemeProperties(svg, layout.theme);
|
|
499
|
+
if (animate && animation?.enter) {
|
|
500
|
+
const stagger = Math.max(5, Math.round(800 / Math.max(tiles.length, 1)));
|
|
501
|
+
stampAnimationVars(svg, {
|
|
502
|
+
duration: animation.enter.duration,
|
|
503
|
+
spring: animation.enter.spring,
|
|
504
|
+
stagger,
|
|
505
|
+
annotationDelay: animation.annotationDelay,
|
|
506
|
+
ease: animation.enter.ease
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
const defs = createSVGElement("defs", ctx.factory);
|
|
510
|
+
svg.appendChild(defs);
|
|
511
|
+
renderChrome2(svg, layout, ctx);
|
|
512
|
+
renderTiles(svg, tiles, animate ? animation : void 0, ctx);
|
|
513
|
+
if (layout.categoricalLegend) {
|
|
514
|
+
renderLegend(svg, layout.categoricalLegend, void 0, ctx);
|
|
515
|
+
} else {
|
|
516
|
+
renderGradientLegend(svg, layout, ctx);
|
|
517
|
+
}
|
|
518
|
+
renderAttributionBrand(
|
|
519
|
+
svg,
|
|
520
|
+
layout.chrome,
|
|
521
|
+
layout.chrome.bottomAnchorY ?? layout.area.y + layout.area.height,
|
|
522
|
+
layout.measureText,
|
|
523
|
+
void 0,
|
|
524
|
+
ctx
|
|
525
|
+
);
|
|
526
|
+
return svg;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export {
|
|
530
|
+
renderBarListSVG,
|
|
531
|
+
renderTileMapSVG
|
|
532
|
+
};
|
|
533
|
+
//# sourceMappingURL=chunk-SKQAAHHR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/barlist-renderer.ts","../src/tilemap-renderer.ts"],"sourcesContent":["import { createRenderContext, type RenderContext } from './render-context';\nimport { createSVGElement } from './renderers/svg-dom';\n/**\n * BarList SVG renderer: converts a BarListLayout into SVG DOM elements.\n *\n * Creates an <svg> with rows of label + track + bar + value. Animation is\n * pure CSS, driven by data attributes and CSS custom properties.\n */\n\nimport type { BarListLayout, ResolvedAnimation } from '@opendata-ai/openchart-core';\nimport { stampAnimationVars } from './animation-vars';\nimport { renderAttributionBrand } from './renderers/brand';\nimport { renderChromeElement } from './renderers/chrome';\nimport { stampThemeProperties } from './theme-tokens';\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction setAttrs(el: SVGElement, attrs: Record<string, string | number>): void {\n for (const [key, value] of Object.entries(attrs)) {\n el.setAttribute(key, String(value));\n }\n}\n\n// ---------------------------------------------------------------------------\n// Chrome rendering\n// ---------------------------------------------------------------------------\n\nfunction renderChrome(\n parent: SVGElement,\n layout: BarListLayout,\n ctx: RenderContext = createRenderContext(),\n): void {\n const g = createSVGElement('g', ctx.factory);\n g.setAttribute('class', 'oc-chrome');\n\n const { chrome } = layout;\n const bottomOffset = layout.area.y + layout.area.height;\n\n for (const key of ['title', 'subtitle', 'source', 'byline', 'footer'] as const) {\n const el = chrome[key];\n if (!el) continue;\n\n const isBottom = key === 'source' || key === 'byline' || key === 'footer';\n renderChromeElement(\n g,\n isBottom ? { ...el, y: bottomOffset + el.y } : el,\n `oc-${key}`,\n key,\n layout.measureText,\n undefined,\n ctx,\n );\n }\n\n parent.appendChild(g);\n}\n\n// ---------------------------------------------------------------------------\n// Watermark rendering\n// ---------------------------------------------------------------------------\n\n// ---------------------------------------------------------------------------\n// Row rendering\n// ---------------------------------------------------------------------------\n\nfunction renderRows(\n parent: SVGElement,\n layout: BarListLayout,\n animation?: ResolvedAnimation,\n ctx: RenderContext = createRenderContext(),\n): void {\n const g = createSVGElement('g', ctx.factory);\n g.setAttribute('class', 'oc-barlist-rows');\n if (ctx.interactive) g.setAttribute('role', 'list');\n\n for (const row of layout.rows) {\n const rowGroup = createSVGElement('g', ctx.factory);\n rowGroup.setAttribute('class', 'oc-barlist-row');\n rowGroup.setAttribute('data-row-index', String(row.index));\n if (ctx.interactive) rowGroup.setAttribute('role', 'listitem');\n if (ctx.interactive && row.aria?.label) {\n rowGroup.setAttribute('aria-label', row.aria.label);\n }\n\n if (animation?.enter) {\n rowGroup.setAttribute('data-animation-index', String(row.animationIndex));\n const style = (rowGroup as SVGElement & ElementCSSInlineStyle).style;\n style.setProperty('--oc-mark-index', String(row.animationIndex));\n style.setProperty('--oc-row-delay', `${row.animationIndex * 40}ms`);\n }\n\n // Label text\n const labelEl = createSVGElement('text', ctx.factory);\n setAttrs(labelEl, {\n x: row.label.x,\n y: row.label.y,\n 'dominant-baseline': 'central',\n 'text-anchor': 'start',\n 'font-family': row.label.style.fontFamily,\n 'font-size': row.label.style.fontSize,\n 'font-weight': row.label.style.fontWeight,\n });\n (labelEl as SVGElement & ElementCSSInlineStyle).style.setProperty('fill', row.label.style.fill);\n labelEl.textContent = row.label.text;\n if (row.fullLabel && row.fullLabel !== row.label.text) {\n const labelGroup = createSVGElement('g', ctx.factory);\n labelGroup.setAttribute('class', 'oc-barlist-label');\n const title = createSVGElement('title', ctx.factory);\n title.textContent = row.fullLabel;\n labelGroup.appendChild(title);\n labelGroup.appendChild(labelEl);\n rowGroup.appendChild(labelGroup);\n } else rowGroup.appendChild(labelEl);\n\n // Subtitle text (if present)\n if (row.subtitle?.visible) {\n const subEl = createSVGElement('text', ctx.factory);\n setAttrs(subEl, {\n x: row.subtitle.x,\n y: row.subtitle.y,\n 'dominant-baseline': 'central',\n 'text-anchor': 'start',\n 'font-family': row.subtitle.style.fontFamily,\n 'font-size': row.subtitle.style.fontSize,\n 'font-weight': row.subtitle.style.fontWeight,\n });\n (subEl as SVGElement & ElementCSSInlineStyle).style.setProperty(\n 'fill',\n row.subtitle.style.fill,\n );\n subEl.textContent = row.subtitle.text;\n rowGroup.appendChild(subEl);\n }\n\n // Track (muted background bar)\n const trackRect = createSVGElement('rect', ctx.factory);\n setAttrs(trackRect, {\n x: row.track.x,\n y: row.track.y,\n width: row.track.width,\n height: row.track.height,\n rx: row.track.cornerRadius,\n fill: ctx.interactive ? 'currentColor' : layout.theme.colors.text,\n 'fill-opacity': 0.06,\n });\n trackRect.setAttribute('class', 'oc-barlist-track');\n rowGroup.appendChild(trackRect);\n\n // Fill bar\n const barRect = createSVGElement('rect', ctx.factory);\n setAttrs(barRect, {\n x: row.bar.x,\n y: row.bar.y,\n width: row.bar.width,\n height: row.bar.height,\n rx: row.bar.cornerRadius,\n fill: row.bar.fill,\n });\n barRect.setAttribute('class', 'oc-barlist-bar');\n barRect.setAttribute('data-mark', 'bar');\n for (const [field, value] of Object.entries(row.identity ?? {}))\n barRect.setAttribute(`data-${field}`, value);\n const description = row.authoredDescription ?? row.aria.label;\n if (!ctx.interactive && description !== undefined) {\n const title = createSVGElement('title', ctx.factory);\n title.textContent = description;\n barRect.appendChild(title);\n }\n rowGroup.appendChild(barRect);\n\n // Value label (right-aligned)\n const valueEl = createSVGElement('text', ctx.factory);\n setAttrs(valueEl, {\n x: row.valueLabel.x,\n y: row.valueLabel.y,\n 'dominant-baseline': 'central',\n 'text-anchor': 'end',\n 'font-family': row.valueLabel.style.fontFamily,\n 'font-size': row.valueLabel.style.fontSize,\n 'font-weight': row.valueLabel.style.fontWeight,\n });\n (valueEl as SVGElement & ElementCSSInlineStyle).style.setProperty(\n 'fill',\n row.valueLabel.style.fill,\n );\n valueEl.textContent = row.valueLabel.text;\n rowGroup.appendChild(valueEl);\n\n g.appendChild(rowGroup);\n }\n\n parent.appendChild(g);\n}\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\nexport function renderBarListSVG(\n layout: BarListLayout,\n opts?: { animate?: boolean; context?: RenderContext },\n): SVGSVGElement {\n const ctx = opts?.context ?? createRenderContext();\n const { width, height, a11y, animation } = layout;\n const animate = ctx.interactive && opts?.animate && !!animation?.enter;\n\n const svg = createSVGElement('svg', ctx.factory) as SVGSVGElement;\n svg.setAttribute('viewBox', `0 0 ${width} ${height}`);\n if (a11y.hidden) svg.setAttribute('aria-hidden', 'true');\n else svg.setAttribute('role', ctx.interactive ? 'list' : 'img');\n // No explicit width attribute — CSS width:100% on .oc-barlist-root handles it.\n // Explicit pixel height via inline style avoids iOS Safari's height:100% quirk.\n svg.style.height = `${height}px`;\n if (!a11y.hidden && a11y.altText) {\n svg.setAttribute('aria-label', a11y.altText);\n }\n\n const classes = animate ? 'oc-barlist oc-animate' : 'oc-barlist';\n svg.setAttribute('class', classes);\n if (ctx.interactive) stampThemeProperties(svg, layout.theme);\n\n if (animate && animation?.enter) {\n stampAnimationVars(svg, {\n duration: animation.enter.duration,\n spring: animation.enter.spring,\n stagger: 40,\n });\n }\n\n renderChrome(svg, layout, ctx);\n for (const group of layout.groups ?? []) {\n if (group.separator) {\n const rule = createSVGElement('line', ctx.factory);\n setAttrs(rule, {\n x1: group.separator.x1,\n x2: group.separator.x2,\n y1: group.separator.y,\n y2: group.separator.y,\n stroke: layout.theme.colors.neutral.border,\n 'stroke-width': 1,\n });\n rule.setAttribute('class', 'oc-barlist-group-rule');\n svg.appendChild(rule);\n }\n const label = createSVGElement('text', ctx.factory);\n setAttrs(label, {\n x: group.label.x,\n y: group.label.y,\n 'dominant-baseline': 'central',\n 'font-family': group.label.style.fontFamily,\n 'font-size': group.label.style.fontSize,\n 'font-weight': group.label.style.fontWeight,\n fill: group.label.style.fill,\n });\n label.setAttribute('class', 'oc-barlist-group-label');\n label.textContent = group.label.text;\n svg.appendChild(label);\n }\n renderRows(svg, layout, animate ? animation : undefined, ctx);\n for (const reference of layout.referenceLines ?? []) {\n const line = createSVGElement('line', ctx.factory);\n setAttrs(line, {\n x1: reference.x,\n x2: reference.x,\n y1: reference.y1,\n y2: reference.y2,\n stroke: reference.stroke,\n 'stroke-width': reference.strokeWidth,\n });\n if (reference.strokeDasharray) line.setAttribute('stroke-dasharray', reference.strokeDasharray);\n line.setAttribute('class', 'oc-barlist-refline');\n svg.appendChild(line);\n if (reference.label) {\n const label = createSVGElement('text', ctx.factory);\n setAttrs(label, {\n x: reference.label.x,\n y: reference.label.y,\n 'text-anchor': 'middle',\n 'font-family': reference.label.style.fontFamily,\n 'font-size': reference.label.style.fontSize,\n 'font-weight': reference.label.style.fontWeight,\n fill: reference.label.style.fill,\n });\n label.textContent = reference.label.text;\n svg.appendChild(label);\n }\n }\n\n renderAttributionBrand(\n svg,\n layout.chrome,\n layout.chrome.bottomAnchorY ?? layout.area.y + layout.area.height,\n layout.measureText,\n undefined,\n ctx,\n );\n\n return svg;\n}\n","import { createRenderContext, type RenderContext } from './render-context';\nimport { createSVGElement } from './renderers/svg-dom';\n/**\n * TileMap SVG renderer: converts a TileMapLayout into SVG DOM elements.\n *\n * Creates an <svg> with tile rectangles, state code labels, value labels,\n * gradient legend, and chrome. All styling via inline SVG attributes from\n * layout data. Animation is pure CSS, driven by data attributes.\n */\n\nimport type {\n ResolvedAnimation,\n TileMapLayout,\n TileMapTileMark,\n} from '@opendata-ai/openchart-core';\nimport { stampAnimationVars } from './animation-vars';\nimport { renderAttributionBrand } from './renderers/brand';\nimport { renderChromeElement } from './renderers/chrome';\nimport { renderLegend } from './renderers/legend';\nimport { stampThemeProperties } from './theme-tokens';\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction setAttrs(el: SVGElement, attrs: Record<string, string | number>): void {\n for (const [key, value] of Object.entries(attrs)) {\n el.setAttribute(key, String(value));\n }\n}\n\n// ---------------------------------------------------------------------------\n// Chrome rendering (delegates to the shared helper for text wrapping)\n// ---------------------------------------------------------------------------\n\nfunction renderChrome(\n parent: SVGElement,\n layout: TileMapLayout,\n ctx: RenderContext = createRenderContext(),\n): void {\n const g = createSVGElement('g', ctx.factory);\n g.setAttribute('class', 'oc-chrome');\n\n const { chrome, measureText } = layout;\n const bottomOffset = chrome.bottomAnchorY ?? layout.area.y + layout.area.height;\n\n if (chrome.title) {\n renderChromeElement(g, chrome.title, 'oc-title', 'title', measureText, undefined, ctx);\n }\n if (chrome.subtitle) {\n renderChromeElement(g, chrome.subtitle, 'oc-subtitle', 'subtitle', measureText, undefined, ctx);\n }\n if (chrome.source) {\n renderChromeElement(\n g,\n { ...chrome.source, y: bottomOffset + chrome.source.y },\n 'oc-source',\n 'source',\n measureText,\n undefined,\n ctx,\n );\n }\n if (chrome.byline) {\n renderChromeElement(\n g,\n { ...chrome.byline, y: bottomOffset + chrome.byline.y },\n 'oc-byline',\n 'byline',\n measureText,\n undefined,\n ctx,\n );\n }\n if (chrome.footer) {\n renderChromeElement(\n g,\n { ...chrome.footer, y: bottomOffset + chrome.footer.y },\n 'oc-footer',\n 'footer',\n measureText,\n undefined,\n ctx,\n );\n }\n\n parent.appendChild(g);\n}\n\n// ---------------------------------------------------------------------------\n// Watermark rendering\n// ---------------------------------------------------------------------------\n\n// ---------------------------------------------------------------------------\n// Tiles rendering\n// ---------------------------------------------------------------------------\n\nfunction renderTiles(\n parent: SVGElement,\n tiles: TileMapTileMark[],\n animation?: ResolvedAnimation,\n ctx: RenderContext = createRenderContext(),\n): void {\n const g = createSVGElement('g', ctx.factory);\n g.setAttribute('class', 'oc-tilemap-tiles');\n g.setAttribute('role', 'list');\n\n // Compute per-tile delays with jitter for organic feel.\n // Base delay spreads tiles across ~800ms window, jitter adds +-40% variation\n // so some tiles pop in clusters while others have longer gaps.\n const tileDelays: number[] = [];\n if (animation?.enter) {\n const baseStagger = 800 / Math.max(tiles.length, 1);\n let seed = 17;\n for (let i = 0; i < tiles.length; i++) {\n const idx = tiles[i].animationIndex ?? i;\n seed = (seed * 1103515245 + 12345) & 0x7fffffff;\n const jitter = ((seed % 1000) / 1000 - 0.5) * 0.8;\n tileDelays.push(Math.max(0, Math.round(idx * baseStagger * (1 + jitter))));\n }\n }\n\n for (let i = 0; i < tiles.length; i++) {\n const tile = tiles[i];\n const tileGroup = createSVGElement('g', ctx.factory);\n tileGroup.setAttribute('class', 'oc-tilemap-tile');\n tileGroup.setAttribute('data-state', tile.stateCode);\n tileGroup.setAttribute('role', 'listitem');\n if (tile.aria?.label) {\n tileGroup.setAttribute('aria-label', tile.aria.label);\n }\n\n if (animation?.enter) {\n const idx = tile.animationIndex ?? i;\n tileGroup.setAttribute('data-animation-index', String(idx));\n (tileGroup as SVGElement & ElementCSSInlineStyle).style.setProperty(\n '--oc-mark-index',\n String(idx),\n );\n (tileGroup as SVGElement & ElementCSSInlineStyle).style.setProperty(\n '--oc-tile-delay',\n `${tileDelays[i]}ms`,\n );\n }\n\n // Tile background rect\n const rect = createSVGElement('rect', ctx.factory);\n setAttrs(rect, {\n x: tile.x,\n y: tile.y,\n width: tile.size,\n height: tile.size,\n rx: tile.cornerRadius,\n fill: tile.fill,\n 'fill-opacity': tile.fillOpacity ?? 1,\n stroke: tile.stroke,\n 'stroke-width': tile.strokeWidth,\n });\n tileGroup.appendChild(rect);\n\n // State code label\n const codeLabel = createSVGElement('text', ctx.factory);\n setAttrs(codeLabel, {\n x: tile.label.x,\n y: tile.label.y,\n 'text-anchor': 'middle',\n 'dominant-baseline': 'central',\n 'font-family': tile.label.style.fontFamily,\n 'font-size': tile.label.style.fontSize,\n 'font-weight': tile.label.style.fontWeight,\n // A hair of tracking is what keeps a two-letter code legible at 8px now\n // that it is set at 600 instead of 700.\n 'letter-spacing': '0.02em',\n });\n (codeLabel as SVGElement & ElementCSSInlineStyle).style.setProperty(\n 'fill',\n tile.label.style.fill,\n );\n codeLabel.textContent = tile.label.text;\n tileGroup.appendChild(codeLabel);\n\n // Value label (if visible)\n if (tile.valueLabel.visible && tile.valueLabel.text) {\n const valueLabel = createSVGElement('text', ctx.factory);\n setAttrs(valueLabel, {\n x: tile.valueLabel.x,\n y: tile.valueLabel.y,\n 'text-anchor': 'middle',\n 'dominant-baseline': 'central',\n 'font-family': tile.valueLabel.style.fontFamily,\n 'font-size': tile.valueLabel.style.fontSize,\n 'font-weight': tile.valueLabel.style.fontWeight,\n });\n (valueLabel as SVGElement & ElementCSSInlineStyle).style.setProperty(\n 'fill',\n tile.valueLabel.style.fill,\n );\n valueLabel.textContent = tile.valueLabel.text;\n tileGroup.appendChild(valueLabel);\n }\n\n g.appendChild(tileGroup);\n }\n\n parent.appendChild(g);\n}\n\n// ---------------------------------------------------------------------------\n// Gradient legend rendering\n// ---------------------------------------------------------------------------\n\nfunction renderGradientLegend(\n parent: SVGElement,\n layout: TileMapLayout,\n ctx: RenderContext = createRenderContext(),\n): void {\n if (!layout.gradientLegend) return;\n\n const { gradientLegend } = layout;\n const g = createSVGElement('g', ctx.factory);\n g.setAttribute('class', 'oc-tilemap-legend');\n\n // Build linear gradient in defs\n const defs = parent.querySelector('defs') || createSVGElement('defs', ctx.factory);\n const exists = parent.querySelector('defs');\n if (!exists) {\n parent.insertBefore(defs, parent.firstChild);\n }\n\n const gradientId = ctx.ids.next('oc-tilemap-legend-gradient');\n const grad = createSVGElement('linearGradient', ctx.factory);\n grad.id = gradientId;\n grad.setAttribute('x1', '0%');\n grad.setAttribute('y1', '0%');\n grad.setAttribute('x2', '100%');\n grad.setAttribute('y2', '0%');\n\n for (const stop of gradientLegend.colorStops) {\n const s = createSVGElement('stop', ctx.factory);\n const attrs: Record<string, string | number> = {\n offset: `${stop.offset * 100}%`,\n 'stop-color': stop.color,\n };\n if (stop.opacity !== undefined) {\n attrs['stop-opacity'] = stop.opacity;\n }\n setAttrs(s, attrs);\n grad.appendChild(s);\n }\n\n (defs as SVGElement).appendChild(grad);\n\n // Gradient bar: square-cornered, so it reads as a color scale rather than a\n // pill-shaped UI control.\n const barHeight = gradientLegend.bounds.height;\n const bar = createSVGElement('rect', ctx.factory);\n setAttrs(bar, {\n x: gradientLegend.bounds.x,\n y: gradientLegend.bounds.y,\n width: gradientLegend.bounds.width,\n height: barHeight,\n fill: `url(#${gradientId})`,\n 'shape-rendering': 'crispEdges',\n });\n g.appendChild(bar);\n\n // Min label\n const minText = createSVGElement('text', ctx.factory);\n setAttrs(minText, {\n x: gradientLegend.bounds.x,\n y: gradientLegend.bounds.y + gradientLegend.bounds.height + 14,\n 'text-anchor': 'start',\n 'font-family': gradientLegend.labelStyle.fontFamily,\n 'font-size': gradientLegend.labelStyle.fontSize,\n 'font-weight': gradientLegend.labelStyle.fontWeight,\n });\n (minText as SVGElement & ElementCSSInlineStyle).style.setProperty(\n 'fill',\n gradientLegend.labelStyle.fill,\n );\n minText.textContent = gradientLegend.minLabel;\n g.appendChild(minText);\n\n // Max label\n const maxText = createSVGElement('text', ctx.factory);\n setAttrs(maxText, {\n x: gradientLegend.bounds.x + gradientLegend.bounds.width,\n y: gradientLegend.bounds.y + gradientLegend.bounds.height + 14,\n 'text-anchor': 'end',\n 'font-family': gradientLegend.labelStyle.fontFamily,\n 'font-size': gradientLegend.labelStyle.fontSize,\n 'font-weight': gradientLegend.labelStyle.fontWeight,\n });\n (maxText as SVGElement & ElementCSSInlineStyle).style.setProperty(\n 'fill',\n gradientLegend.labelStyle.fill,\n );\n maxText.textContent = gradientLegend.maxLabel;\n g.appendChild(maxText);\n\n // Detached \"no data\" swatch, keyed beside the ramp rather than at its low end.\n if (gradientLegend.noData) {\n const nd = gradientLegend.noData;\n const swatch = createSVGElement('rect', ctx.factory);\n swatch.setAttribute('class', 'oc-legend-nodata');\n setAttrs(swatch, {\n x: nd.x,\n y: nd.y,\n width: nd.size,\n height: nd.size,\n fill: nd.fill,\n 'shape-rendering': 'crispEdges',\n });\n g.appendChild(swatch);\n\n const ndLabel = createSVGElement('text', ctx.factory);\n setAttrs(ndLabel, {\n x: nd.labelX,\n y: nd.labelY,\n 'text-anchor': 'start',\n 'font-family': gradientLegend.labelStyle.fontFamily,\n 'font-size': gradientLegend.labelStyle.fontSize,\n 'font-weight': gradientLegend.labelStyle.fontWeight,\n });\n (ndLabel as SVGElement & ElementCSSInlineStyle).style.setProperty(\n 'fill',\n gradientLegend.labelStyle.fill,\n );\n ndLabel.textContent = nd.label;\n g.appendChild(ndLabel);\n }\n\n parent.appendChild(g);\n}\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\n/**\n * Render a TileMapLayout to an SVG element.\n */\nexport function renderTileMapSVG(\n layout: TileMapLayout,\n opts?: { animate?: boolean; context?: RenderContext },\n): SVGSVGElement {\n const ctx = opts?.context ?? createRenderContext();\n const { width, height, tiles, a11y, animation } = layout;\n const animate = opts?.animate && !!animation?.enter;\n\n const svg = createSVGElement('svg', ctx.factory) as SVGSVGElement;\n svg.setAttribute('viewBox', `0 0 ${width} ${height}`);\n svg.setAttribute('role', 'img');\n if (a11y.altText) {\n svg.setAttribute('aria-label', a11y.altText);\n }\n\n const classes = animate ? 'oc-tilemap oc-animate' : 'oc-tilemap';\n svg.setAttribute('class', classes);\n stampThemeProperties(svg, layout.theme);\n\n if (animate && animation?.enter) {\n // Target ~1s total: stagger window ~800ms + per-tile pop ~200ms\n const stagger = Math.max(5, Math.round(800 / Math.max(tiles.length, 1)));\n stampAnimationVars(svg, {\n duration: animation.enter.duration,\n spring: animation.enter.spring,\n stagger,\n annotationDelay: animation.annotationDelay,\n ease: animation.enter.ease,\n });\n }\n\n // Empty defs element (will be filled by gradient legend)\n const defs = createSVGElement('defs', ctx.factory);\n svg.appendChild(defs);\n\n // Render chrome\n renderChrome(svg, layout, ctx);\n\n // Render tiles\n renderTiles(svg, tiles, animate ? animation : undefined, ctx);\n\n // Render legend (gradient for quantitative, categorical for nominal)\n if (layout.categoricalLegend) {\n renderLegend(svg, layout.categoricalLegend, undefined, ctx);\n } else {\n renderGradientLegend(svg, layout, ctx);\n }\n\n // Render watermark\n renderAttributionBrand(\n svg,\n layout.chrome,\n layout.chrome.bottomAnchorY ?? layout.area.y + layout.area.height,\n layout.measureText,\n undefined,\n ctx,\n );\n\n return svg;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAS,SAAS,IAAgB,OAA8C;AAC9E,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,OAAG,aAAa,KAAK,OAAO,KAAK,CAAC;AAAA,EACpC;AACF;AAMA,SAAS,aACP,QACA,QACA,MAAqB,oBAAoB,GACnC;AACN,QAAM,IAAI,iBAAiB,KAAK,IAAI,OAAO;AAC3C,IAAE,aAAa,SAAS,WAAW;AAEnC,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,eAAe,OAAO,KAAK,IAAI,OAAO,KAAK;AAEjD,aAAW,OAAO,CAAC,SAAS,YAAY,UAAU,UAAU,QAAQ,GAAY;AAC9E,UAAM,KAAK,OAAO,GAAG;AACrB,QAAI,CAAC,GAAI;AAET,UAAM,WAAW,QAAQ,YAAY,QAAQ,YAAY,QAAQ;AACjE;AAAA,MACE;AAAA,MACA,WAAW,EAAE,GAAG,IAAI,GAAG,eAAe,GAAG,EAAE,IAAI;AAAA,MAC/C,MAAM,GAAG;AAAA,MACT;AAAA,MACA,OAAO;A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