minerva-design 1.13.2 → 1.14.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.
Files changed (202) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/custom-elements.json +194 -12
  3. package/dist/angular/fesm2022/minerva-angular.mjs +20 -0
  4. package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
  5. package/dist/angular/types/minerva-angular.d.ts +10 -1
  6. package/dist/charts/canvas.d.cts +1 -0
  7. package/dist/charts/canvas.d.ts +1 -0
  8. package/dist/charts/engine/canvas.cjs +1 -1
  9. package/dist/charts/engine/canvas.cjs.map +1 -1
  10. package/dist/charts/engine/canvas.js +152 -128
  11. package/dist/charts/engine/canvas.js.map +1 -1
  12. package/dist/charts/engine/chart.cjs +1 -1
  13. package/dist/charts/engine/chart.cjs.map +1 -1
  14. package/dist/charts/engine/chart.js +475 -405
  15. package/dist/charts/engine/chart.js.map +1 -1
  16. package/dist/charts/engine/controller.cjs +2 -2
  17. package/dist/charts/engine/controller.cjs.map +1 -1
  18. package/dist/charts/engine/controller.js +263 -248
  19. package/dist/charts/engine/controller.js.map +1 -1
  20. package/dist/charts/engine/dom.cjs +1 -1
  21. package/dist/charts/engine/dom.cjs.map +1 -1
  22. package/dist/charts/engine/dom.d.cts +34 -0
  23. package/dist/charts/engine/dom.d.ts +34 -0
  24. package/dist/charts/engine/dom.js +62 -51
  25. package/dist/charts/engine/dom.js.map +1 -1
  26. package/dist/charts/engine/graph/chart.cjs +1 -1
  27. package/dist/charts/engine/graph/chart.cjs.map +1 -1
  28. package/dist/charts/engine/graph/chart.js +835 -821
  29. package/dist/charts/engine/graph/chart.js.map +1 -1
  30. package/dist/charts/engine/graph/dom.cjs +1 -1
  31. package/dist/charts/engine/graph/dom.cjs.map +1 -1
  32. package/dist/charts/engine/graph/dom.js +44 -51
  33. package/dist/charts/engine/graph/dom.js.map +1 -1
  34. package/dist/charts/engine/hover-rect.cjs +2 -0
  35. package/dist/charts/engine/hover-rect.cjs.map +1 -0
  36. package/dist/charts/engine/hover-rect.d.cts +10 -0
  37. package/dist/charts/engine/hover-rect.d.ts +10 -0
  38. package/dist/charts/engine/hover-rect.js +47 -0
  39. package/dist/charts/engine/hover-rect.js.map +1 -0
  40. package/dist/charts/engine/items.cjs +1 -1
  41. package/dist/charts/engine/items.cjs.map +1 -1
  42. package/dist/charts/engine/items.js +8 -8
  43. package/dist/charts/engine/model.cjs +1 -1
  44. package/dist/charts/engine/model.cjs.map +1 -1
  45. package/dist/charts/engine/model.js +191 -191
  46. package/dist/charts/engine/model.js.map +1 -1
  47. package/dist/charts/engine/orderbook/depth.cjs +1 -1
  48. package/dist/charts/engine/orderbook/depth.cjs.map +1 -1
  49. package/dist/charts/engine/orderbook/depth.js +63 -63
  50. package/dist/charts/engine/orderbook/heatmap.cjs +1 -1
  51. package/dist/charts/engine/orderbook/heatmap.cjs.map +1 -1
  52. package/dist/charts/engine/orderbook/heatmap.js +155 -155
  53. package/dist/charts/engine/orderbook/host.cjs +1 -1
  54. package/dist/charts/engine/orderbook/host.cjs.map +1 -1
  55. package/dist/charts/engine/orderbook/host.js +87 -75
  56. package/dist/charts/engine/orderbook/host.js.map +1 -1
  57. package/dist/charts/engine/orderbook/ladder.cjs +1 -1
  58. package/dist/charts/engine/orderbook/ladder.cjs.map +1 -1
  59. package/dist/charts/engine/orderbook/ladder.js +41 -41
  60. package/dist/charts/engine/orderbook/tape.cjs +1 -1
  61. package/dist/charts/engine/orderbook/tape.cjs.map +1 -1
  62. package/dist/charts/engine/orderbook/tape.js +31 -31
  63. package/dist/charts/engine/presets.cjs +2 -2
  64. package/dist/charts/engine/presets.cjs.map +1 -1
  65. package/dist/charts/engine/presets.js +15 -15
  66. package/dist/charts/engine/renderers/vector-gpu.cjs +24 -0
  67. package/dist/charts/engine/renderers/vector-gpu.cjs.map +1 -0
  68. package/dist/charts/engine/renderers/vector-gpu.d.cts +22 -0
  69. package/dist/charts/engine/renderers/vector-gpu.d.ts +22 -0
  70. package/dist/charts/engine/renderers/vector-gpu.js +301 -0
  71. package/dist/charts/engine/renderers/vector-gpu.js.map +1 -0
  72. package/dist/charts/engine/renderers/vector.cjs +2 -0
  73. package/dist/charts/engine/renderers/vector.cjs.map +1 -0
  74. package/dist/charts/engine/renderers/vector.d.cts +140 -0
  75. package/dist/charts/engine/renderers/vector.d.ts +140 -0
  76. package/dist/charts/engine/renderers/vector.js +568 -0
  77. package/dist/charts/engine/renderers/vector.js.map +1 -0
  78. package/dist/charts/engine/scene.cjs +1 -1
  79. package/dist/charts/engine/scene.cjs.map +1 -1
  80. package/dist/charts/engine/scene.d.cts +43 -3
  81. package/dist/charts/engine/scene.d.ts +43 -3
  82. package/dist/charts/engine/scene.js +411 -338
  83. package/dist/charts/engine/scene.js.map +1 -1
  84. package/dist/charts/engine/shapes/bullet.cjs +1 -1
  85. package/dist/charts/engine/shapes/bullet.cjs.map +1 -1
  86. package/dist/charts/engine/shapes/bullet.js +36 -36
  87. package/dist/charts/engine/shapes/calendar.cjs +1 -1
  88. package/dist/charts/engine/shapes/calendar.cjs.map +1 -1
  89. package/dist/charts/engine/shapes/calendar.js +53 -53
  90. package/dist/charts/engine/shapes/chart.cjs +1 -1
  91. package/dist/charts/engine/shapes/chart.cjs.map +1 -1
  92. package/dist/charts/engine/shapes/chart.d.cts +3 -2
  93. package/dist/charts/engine/shapes/chart.d.ts +3 -2
  94. package/dist/charts/engine/shapes/chart.js +192 -162
  95. package/dist/charts/engine/shapes/chart.js.map +1 -1
  96. package/dist/charts/engine/shapes/draw.cjs +1 -1
  97. package/dist/charts/engine/shapes/draw.cjs.map +1 -1
  98. package/dist/charts/engine/shapes/draw.js +87 -86
  99. package/dist/charts/engine/shapes/draw.js.map +1 -1
  100. package/dist/charts/engine/shapes/layout.cjs +2 -2
  101. package/dist/charts/engine/shapes/layout.cjs.map +1 -1
  102. package/dist/charts/engine/shapes/layout.d.cts +8 -7
  103. package/dist/charts/engine/shapes/layout.d.ts +8 -7
  104. package/dist/charts/engine/shapes/layout.js +262 -166
  105. package/dist/charts/engine/shapes/layout.js.map +1 -1
  106. package/dist/charts/engine/shapes/types.d.cts +13 -1
  107. package/dist/charts/engine/shapes/types.d.ts +13 -1
  108. package/dist/charts/engine/three-d/chart.cjs +1 -1
  109. package/dist/charts/engine/three-d/chart.cjs.map +1 -1
  110. package/dist/charts/engine/three-d/chart.js +266 -257
  111. package/dist/charts/engine/three-d/chart.js.map +1 -1
  112. package/dist/charts/engine/three-d/dom.cjs +1 -1
  113. package/dist/charts/engine/three-d/dom.cjs.map +1 -1
  114. package/dist/charts/engine/three-d/dom.js +28 -35
  115. package/dist/charts/engine/three-d/dom.js.map +1 -1
  116. package/dist/charts/engine/three-d/geometry.cjs +1 -1
  117. package/dist/charts/engine/three-d/geometry.cjs.map +1 -1
  118. package/dist/charts/engine/three-d/geometry.js +70 -70
  119. package/dist/charts/engine/three-d/overlay.cjs +1 -1
  120. package/dist/charts/engine/three-d/overlay.cjs.map +1 -1
  121. package/dist/charts/engine/three-d/overlay.js +15 -15
  122. package/dist/charts/engine/tooltip.cjs +2 -0
  123. package/dist/charts/engine/tooltip.cjs.map +1 -0
  124. package/dist/charts/engine/tooltip.d.cts +94 -0
  125. package/dist/charts/engine/tooltip.d.ts +94 -0
  126. package/dist/charts/engine/tooltip.js +242 -0
  127. package/dist/charts/engine/tooltip.js.map +1 -0
  128. package/dist/charts/engine/trading/chart.cjs +1 -1
  129. package/dist/charts/engine/trading/chart.cjs.map +1 -1
  130. package/dist/charts/engine/trading/chart.js +135 -135
  131. package/dist/charts/react/shapes.cjs +1 -1
  132. package/dist/charts/react/shapes.cjs.map +1 -1
  133. package/dist/charts/react/shapes.d.cts +10 -1
  134. package/dist/charts/react/shapes.d.ts +10 -1
  135. package/dist/charts/react/shapes.js +24 -19
  136. package/dist/charts/react/shapes.js.map +1 -1
  137. package/dist/core/contracts.cjs +1 -1
  138. package/dist/core/contracts.cjs.map +1 -1
  139. package/dist/core/contracts.js +1 -1
  140. package/dist/core/contracts.js.map +1 -1
  141. package/dist/native/charts/src/canvas.cjs +1 -1
  142. package/dist/native/charts/src/canvas.js +8 -7
  143. package/dist/native/charts/src/engine/canvas.cjs +1 -1
  144. package/dist/native/charts/src/engine/canvas.js +2 -0
  145. package/dist/native/charts/src/engine/controller.cjs +2 -2
  146. package/dist/native/charts/src/engine/controller.cjs.map +1 -1
  147. package/dist/native/charts/src/engine/controller.js +102 -87
  148. package/dist/native/charts/src/engine/controller.js.map +1 -1
  149. package/dist/native/charts/src/engine/hover-rect.cjs +2 -0
  150. package/dist/native/charts/src/engine/hover-rect.cjs.map +1 -0
  151. package/dist/native/charts/src/engine/hover-rect.js +47 -0
  152. package/dist/native/charts/src/engine/hover-rect.js.map +1 -0
  153. package/dist/native/charts/src/engine/scene.cjs +1 -1
  154. package/dist/native/charts/src/engine/scene.cjs.map +1 -1
  155. package/dist/native/charts/src/engine/scene.js +318 -245
  156. package/dist/native/charts/src/engine/scene.js.map +1 -1
  157. package/dist/native/charts/src/engine/shapes/draw.cjs +1 -1
  158. package/dist/native/charts/src/engine/shapes/draw.cjs.map +1 -1
  159. package/dist/native/charts/src/engine/shapes/draw.js +81 -80
  160. package/dist/native/charts/src/engine/shapes/draw.js.map +1 -1
  161. package/dist/native/charts/src/engine/shapes/layout.cjs +2 -2
  162. package/dist/native/charts/src/engine/shapes/layout.cjs.map +1 -1
  163. package/dist/native/charts/src/engine/shapes/layout.js +239 -143
  164. package/dist/native/charts/src/engine/shapes/layout.js.map +1 -1
  165. package/dist/native/charts/src/engine/tooltip.cjs +2 -0
  166. package/dist/native/charts/src/engine/tooltip.cjs.map +1 -0
  167. package/dist/native/charts/src/engine/tooltip.js +164 -0
  168. package/dist/native/charts/src/engine/tooltip.js.map +1 -0
  169. package/dist/native/components/Chart/scene.cjs +1 -1
  170. package/dist/native/components/Chart/scene.cjs.map +1 -1
  171. package/dist/native/components/Chart/scene.js +210 -187
  172. package/dist/native/components/Chart/scene.js.map +1 -1
  173. package/dist/native/source/components/Chart/scene.tsx +55 -2
  174. package/dist/taro/index.js +2026 -1626
  175. package/dist/uni/charts-canvas.js +1 -0
  176. package/dist/vue/components/Chart/BulletChart.vue.d.ts +2 -0
  177. package/dist/vue/components/Chart/CalendarHeatmap.vue.d.ts +2 -0
  178. package/dist/vue/components/Chart/ChordChart.vue.d.ts +2 -0
  179. package/dist/vue/components/Chart/DonutChart.vue.d.ts +2 -0
  180. package/dist/vue/components/Chart/FunnelChart.vue.d.ts +2 -0
  181. package/dist/vue/components/Chart/GaugeChart.vue.d.ts +2 -0
  182. package/dist/vue/components/Chart/PieChart.vue.d.ts +2 -0
  183. package/dist/vue/components/Chart/RadarChart.vue.d.ts +2 -0
  184. package/dist/vue/components/Chart/RadialBarChart.vue.d.ts +2 -0
  185. package/dist/vue/components/Chart/SankeyChart.vue.d.ts +2 -0
  186. package/dist/vue/components/Chart/SunburstChart.vue.d.ts +2 -0
  187. package/dist/vue/components/Chart/TreemapChart.vue.d.ts +2 -0
  188. package/dist/vue/components/Chart/props.d.ts +2 -0
  189. package/dist/vue/components/Chart/props.js +1 -0
  190. package/dist/vue/components/Chart/props.js.map +1 -1
  191. package/dist/vue/components/Chart/shape.d.ts +2 -1
  192. package/dist/vue/components/Chart/shape.js +2 -0
  193. package/dist/vue/components/Chart/shape.js.map +1 -1
  194. package/dist/vue/components/Chart/types.d.ts +2 -0
  195. package/dist/weapp/charts/canvas.js +2576 -1969
  196. package/dist/weapp/charts/core.js +1 -0
  197. package/dist/web-components/components/chart/shape-chart.d.ts +9 -7
  198. package/dist/web-components/components/chart/shape-chart.js +3 -0
  199. package/dist/web-components/components/chart/shape-chart.js.map +1 -1
  200. package/dist/web-components/components/chart/shapes-extended.d.ts +6 -6
  201. package/dist/web-components/components/chart/shapes-extended.js.map +1 -1
  202. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { mix as e, toCss as t } from "../color.js";
2
- import { resolveLocale as n } from "../locale.js";
1
+ import { resolveLocale as e } from "../locale.js";
2
+ import { mix as t, toCss as n } from "../color.js";
3
3
  import { font as r } from "../overlay.js";
4
4
  import { localeFormat as i } from "./labels.js";
5
5
  import { clamp as a, emptyLayout as o, finite as s, positive as c, resolveWith as l } from "./scene.js";
@@ -135,7 +135,7 @@ var u = 864e5, d = 3660, f = (e) => Math.floor(Date.UTC(e.getFullYear(), e.getMo
135
135
  count: g,
136
136
  integer: m
137
137
  };
138
- }, P = (e) => typeof e.weekStart == "number" && Number.isFinite(e.weekStart) ? (Math.round(e.weekStart) % 7 + 7) % 7 : w(n(e.locale)), F = (e, t) => {
138
+ }, P = (t) => typeof t.weekStart == "number" && Number.isFinite(t.weekStart) ? (Math.round(t.weekStart) % 7 + 7) % 7 : w(e(t.locale)), F = (e, t) => {
139
139
  if (!(t > 0)) return -1;
140
140
  let { thresholds: n } = e;
141
141
  for (let e = 0; e < n.length; e++) if (t <= n[e]) return e;
@@ -157,36 +157,36 @@ var u = 864e5, d = 3660, f = (e) => Math.floor(Date.UTC(e.getFullYear(), e.getMo
157
157
  } else o.push(e ? I(t(n[e - 1]), t(n[e])) : `\u2264 ${t(n[e])}`);
158
158
  }
159
159
  return o;
160
- }, R = (t) => e(t.background, t.text, .07), z = (t, n, r) => {
161
- let i = n.palette.length ? n.palette : [n.primary], a = l(n, t.color, i[0]);
160
+ }, R = (e) => t(e.background, e.text, .07), z = (e, n, r) => {
161
+ let i = n.palette.length ? n.palette : [n.primary], a = l(n, e.color, i[0]);
162
162
  return Array.from({ length: r }, (i, o) => {
163
- let s = t.colors?.[o];
164
- return s ? l(n, s, a) : e(n.background, a, r === 1 ? 1 : .32 + .68 * o / (r - 1));
163
+ let s = e.colors?.[o];
164
+ return s ? l(n, s, a) : t(n.background, a, r === 1 ? 1 : .32 + .68 * o / (r - 1));
165
165
  });
166
166
  }, B = (e, t, n) => {
167
167
  let r = N(e)?.count ?? 0;
168
168
  for (let e = 0; e < r; e++) n.set(`~L${e}`, +!t.has(e));
169
- }, V = (e, n, r) => {
169
+ }, V = (e, t, r) => {
170
170
  let a = N(e);
171
171
  if (!a) return [];
172
- let o = z(e, n, a.count);
173
- return L(a, e.format ?? i(e.locale)).map((e, n) => ({
174
- index: n,
172
+ let o = z(e, t, a.count);
173
+ return L(a, e.format ?? i(e.locale)).map((e, t) => ({
174
+ index: t,
175
175
  name: e,
176
- color: t(o[n]),
177
- hidden: r.has(n)
176
+ color: n(o[t]),
177
+ hidden: r.has(t)
178
178
  }));
179
179
  }, H = (e) => {
180
180
  let t = N(e);
181
181
  if (!t) return 1;
182
182
  let n = m(t.start).y, r = m(t.end).y;
183
183
  return r > n && t.end - t.start + 1 > 371 ? r - n + 1 : 1;
184
- }, U = 18, W = 12, G = 16, K = (n, i) => {
185
- let { theme: c, area: l, measure: u } = i, d = N(n);
184
+ }, U = 18, W = 12, G = 16, K = (e, i) => {
185
+ let { theme: c, area: l, measure: u } = i, d = N(e);
186
186
  if (!d) return o(i);
187
- let { start: f, end: p } = d, g = i.locale, b = P(n), x = (e) => (v(e) - b + 7) % 7, S = Math.max(0, s(n.gap, 3)), C = n.layout === "months", w = Math.max(2, s(n.maxCellSize, C ? 28 : 16)), T = r(c, 11), E = t(c.textMuted), O = m(f).y, I = m(p).y, L = [], B = [], V = 0, H;
187
+ let { start: f, end: p } = d, g = i.locale, b = P(e), x = (e) => (v(e) - b + 7) % 7, S = Math.max(0, s(e.gap, 3)), C = e.layout === "months", w = Math.max(2, s(e.maxCellSize, C ? 28 : 16)), T = r(c, 11), E = n(c.textMuted), O = m(f).y, I = m(p).y, L = [], B = [], V = 0, H;
188
188
  if (C) {
189
- let e = y(f, p), i = e.length, a = (n.monthLabels === !1 ? 0 : U) + (n.weekdayLabels === !1 ? 0 : 14), o = {
189
+ let t = y(f, p), i = t.length, a = (e.monthLabels === !1 ? 0 : U) + (e.weekdayLabels === !1 ? 0 : 14), o = {
190
190
  cols: 1,
191
191
  pitch: 0
192
192
  };
@@ -200,21 +200,21 @@ var u = 864e5, d = 3660, f = (e) => Math.floor(Date.UTC(e.getFullYear(), e.getMo
200
200
  let s = Math.max(2, o.pitch), u = Math.min(S, s * .25);
201
201
  V = Math.min(w, s - u), s = V + u, H = s;
202
202
  let d = o.cols, m = Math.ceil(i / d), _ = 7 * s - u, v = a + 6 * s - u, C = d * _ + (d - 1) * G, T = m * v + (m - 1) * G, A = l.x + Math.max(0, (l.width - C) / 2), M = l.y + Math.max(0, (l.height - T) / 2), N = I > O, P = r(c, 12, 600), F = Array.from({ length: 7 }, (e, t) => j(g, (b + t) % 7, "narrow"));
203
- e.forEach(({ y: e, m: i }, a) => {
203
+ t.forEach(({ y: t, m: i }, a) => {
204
204
  let o = A + a % d * (_ + G), l = M + Math.floor(a / d) * (v + G);
205
- n.monthLabels !== !1 && (L.push({
205
+ e.monthLabels !== !1 && (L.push({
206
206
  kind: "text",
207
207
  x: o,
208
208
  y: l + U / 2 - 1,
209
209
  text: N ? k(g, {
210
210
  month: "short",
211
211
  year: "numeric"
212
- }, h(e, i, 1), `${D[i]} ${e}`) : k(g, { month: "long" }, h(e, i, 1), D[i]),
212
+ }, h(t, i, 1), `${D[i]} ${t}`) : k(g, { month: "long" }, h(t, i, 1), D[i]),
213
213
  font: P,
214
- color: t(c.text, .88),
214
+ color: n(c.text, .88),
215
215
  align: "left",
216
216
  baseline: "middle"
217
- }), l += U), n.weekdayLabels !== !1 && (V >= 8 && F.forEach((e, t) => L.push({
217
+ }), l += U), e.weekdayLabels !== !1 && (V >= 8 && F.forEach((e, t) => L.push({
218
218
  kind: "text",
219
219
  x: o + t * s + V / 2,
220
220
  y: l + 6,
@@ -224,7 +224,7 @@ var u = 864e5, d = 3660, f = (e) => Math.floor(Date.UTC(e.getFullYear(), e.getMo
224
224
  align: "center",
225
225
  baseline: "middle"
226
226
  })), l += 14);
227
- let u = h(e, i, 1), m = Math.min(p, h(e, i + 1, 0)), y = x(u);
227
+ let u = h(t, i, 1), m = Math.min(p, h(t, i + 1, 0)), y = x(u);
228
228
  for (let e = Math.max(u, f); e <= m; e++) {
229
229
  let t = y + (e - u);
230
230
  B.push({
@@ -235,49 +235,49 @@ var u = 864e5, d = 3660, f = (e) => Math.floor(Date.UTC(e.getFullYear(), e.getMo
235
235
  }
236
236
  });
237
237
  } else {
238
- let e = [];
239
- if (I > O && p - f + 1 > 371) for (let t = O; t <= I; t++) e.push({
240
- s: Math.max(f, h(t, 0, 1)),
241
- e: Math.min(p, h(t, 11, 31)),
242
- year: t
238
+ let t = [];
239
+ if (I > O && p - f + 1 > 371) for (let e = O; e <= I; e++) t.push({
240
+ s: Math.max(f, h(e, 0, 1)),
241
+ e: Math.min(p, h(e, 11, 31)),
242
+ year: e
243
243
  });
244
- else e.push({
244
+ else t.push({
245
245
  s: f,
246
246
  e: p,
247
247
  year: null
248
248
  });
249
- let i = (e, t) => Math.floor((e - (t - x(t))) / 7), a = Math.max(...e.map((e) => i(e.e, e.s) + 1)), o = n.monthLabels !== !1 || e.length > 1 ? U : 0, s = n.weekdayLabels !== !1, d = Array.from({ length: 7 }, (e, t) => j(g, (b + t) % 7, "short")), m = s ? Math.max(...d.map((e) => u(e, T))) + 8 : 0, _ = r(c, 11, 600);
250
- e.length > 1 && (m = Math.max(m, u(String(I), _) + 8));
251
- let v = e.length, C = (l.width - m + S) / a, D = ((l.height - (v - 1) * W) / v - o + S) / 7, k = Math.max(2, Math.min(C, D)), M = Math.min(S, k * .25);
249
+ let i = (e, t) => Math.floor((e - (t - x(t))) / 7), a = Math.max(...t.map((e) => i(e.e, e.s) + 1)), o = e.monthLabels !== !1 || t.length > 1 ? U : 0, s = e.weekdayLabels !== !1, d = Array.from({ length: 7 }, (e, t) => j(g, (b + t) % 7, "short")), m = s ? Math.max(...d.map((e) => u(e, T))) + 8 : 0, _ = r(c, 11, 600);
250
+ t.length > 1 && (m = Math.max(m, u(String(I), _) + 8));
251
+ let v = t.length, C = (l.width - m + S) / a, D = ((l.height - (v - 1) * W) / v - o + S) / 7, k = Math.max(2, Math.min(C, D)), M = Math.min(S, k * .25);
252
252
  V = Math.min(w, k - M), k = V + M, H = k;
253
253
  let N = m + a * k - M, P = v * (o + 7 * k - M) + (v - 1) * W, F = l.x + Math.max(0, (l.width - N) / 2) + m, R = l.y + Math.max(0, (l.height - P) / 2), z = (e) => k >= 15 || [
254
254
  1,
255
255
  3,
256
256
  5
257
257
  ].includes((b + e) % 7);
258
- for (let r of e) {
259
- let e = R + o;
258
+ for (let r of t) {
259
+ let t = R + o;
260
260
  if (r.year !== null && L.push({
261
261
  kind: "text",
262
262
  x: F - m,
263
263
  y: R + o / 2,
264
264
  text: String(r.year),
265
265
  font: _,
266
- color: t(c.text, .85),
266
+ color: n(c.text, .85),
267
267
  align: "left",
268
268
  baseline: "middle"
269
- }), s && V >= 6 && d.forEach((t, n) => {
269
+ }), s && V >= 6 && d.forEach((e, n) => {
270
270
  z(n) && L.push({
271
271
  kind: "text",
272
272
  x: F - 6,
273
- y: e + n * k + V / 2,
274
- text: t,
273
+ y: t + n * k + V / 2,
274
+ text: e,
275
275
  font: T,
276
276
  color: E,
277
277
  align: "right",
278
278
  baseline: "middle"
279
279
  });
280
- }), n.monthLabels !== !1) {
280
+ }), e.monthLabels !== !1) {
281
281
  let e = i(r.e, r.s) + 1, t = [];
282
282
  for (let { y: n, m: a } of y(r.s, r.e)) {
283
283
  let o = Math.max(r.s, h(n, a, 1)), s = i(o, r.s) + +(o > r.s && x(o) > 0);
@@ -301,21 +301,21 @@ var u = 864e5, d = 3660, f = (e) => Math.floor(Date.UTC(e.getFullYear(), e.getMo
301
301
  }));
302
302
  });
303
303
  }
304
- for (let t = r.s; t <= r.e; t++) B.push({
305
- day: t,
306
- x: F + i(t, r.s) * k,
307
- y: e + x(t) * k
304
+ for (let e = r.s; e <= r.e; e++) B.push({
305
+ day: e,
306
+ x: F + i(e, r.s) * k,
307
+ y: t + x(e) * k
308
308
  });
309
309
  R += o + 7 * k - M + W;
310
310
  }
311
311
  }
312
- let K = z(n, c, d.count), q = R(c), J = K.map((e, t) => a(i.value(`~L${t}`, +!i.hidden.has(t)), 0, 1)), Y = a(s(n.radius, 2), 0, V / 2), X = t(c.text, .75), Z = Math.max(0, (H - V) / 2), Q = [];
313
- for (let n of B) {
314
- let r = d.values.get(n.day) ?? 0, a = F(d, r), o = a < 0 ? q : e(q, K[a], J[a] ?? 1), s = t(o), c = n.day - f;
312
+ let K = z(e, c, d.count), q = R(c), J = K.map((e, t) => a(i.value(`~L${t}`, +!i.hidden.has(t)), 0, 1)), Y = a(s(e.radius, 2), 0, V / 2), X = n(c.text, .75), Z = Math.max(0, (H - V) / 2), Q = [];
313
+ for (let e of B) {
314
+ let r = d.values.get(e.day) ?? 0, a = F(d, r), o = a < 0 ? q : t(q, K[a], J[a] ?? 1), s = n(o), c = e.day - f;
315
315
  L.push({
316
316
  kind: "rect",
317
- x: n.x,
318
- y: n.y,
317
+ x: e.x,
318
+ y: e.y,
319
319
  width: V,
320
320
  height: V,
321
321
  radius: Y,
@@ -327,18 +327,18 @@ var u = 864e5, d = 3660, f = (e) => Math.floor(Date.UTC(e.getFullYear(), e.getMo
327
327
  let l = d.max > 0 ? r / d.max : 0;
328
328
  Q.push({
329
329
  index: c,
330
- name: M(g, n.day),
330
+ name: M(g, e.day),
331
331
  value: r,
332
332
  percent: l,
333
333
  share: i.percent(l),
334
- color: a < 0 ? s : t(K[a]),
335
- x: n.x + V / 2,
336
- y: n.y + V / 2,
334
+ color: a < 0 ? s : n(K[a]),
335
+ x: e.x + V / 2,
336
+ y: e.y + V / 2,
337
337
  rows: [{
338
338
  name: i.labels.value,
339
339
  value: i.format(r)
340
340
  }],
341
- event: { date: _(n.day) }
341
+ event: { date: _(e.day) }
342
342
  });
343
343
  }
344
344
  Q.sort((e, t) => e.index - t.index);
@@ -1,2 +1,2 @@
1
- const e=require("../dom.cjs"),t=require("../theme.cjs"),n=require("./scene.cjs"),r=require("./draw.cjs"),i=require("./hit.cjs"),a=require("./layout.cjs"),o=require("./runtime.cjs");var s=6,c=0,l=(l,u)=>{let d=l.ownerDocument,f=d.defaultView,p=e.createChartDom(l);p.root.classList.add(`minerva-shape-chart`),p.foreground.style.display=`none`,p.hover.style.display=`none`;let m=p.background,h=null;try{h=m.getContext(`2d`)}catch{h=null}let g=o.createShapeRuntime(u),_=u,v=t.readTheme(p.root,_.palette),y=null,b=null,x=``,S=!1,C=null,w=!1,T=null,E={hover:new Set,click:new Set,toggle:new Set,drill:new Set},D=(e,t)=>{for(let n of[...E[e]])n(t)},O=d.createElement(`div`);O.id=`minerva-shape-chart-${++c}`,e.styleElement(O,{position:`absolute`,width:`1px`,height:`1px`,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`}),p.stage.appendChild(O),p.stage.setAttribute(`aria-describedby`,O.id),p.stage.tabIndex=0;let k=``,ee=(e,t)=>h?(t!==k&&(h.font=t,k=t),h.measureText(e).width):n.estimateText(e,t),A=()=>{C!==null&&(w?clearTimeout(C):f?.cancelAnimationFrame?.(C),C=null)},j=()=>{S||C!==null||(f&&typeof f.requestAnimationFrame==`function`?(w=!1,C=f.requestAnimationFrame(()=>F())):(w=!0,C=setTimeout(()=>F(),16)))},M=()=>_.tooltip===!1?null:typeof _.tooltip==`object`?_.tooltip:{},te=t=>{let n=M()?.render;if(n)return n(t);if(!y||!b)return null;let r=a.tooltipContent(y,b.hover);if(!r)return null;let i=d.createDocumentFragment(),o=d.createElement(`div`);e.styleElement(o,{display:`flex`,alignItems:`center`,gap:`6px`,fontWeight:`600`,marginBottom:`4px`,color:`var(--text-color, #1f2937)`,whiteSpace:`normal`,maxWidth:`260px`,overflowWrap:`anywhere`}),r.color&&o.appendChild(e.swatch(d,r.color,`dot`)),o.appendChild(d.createTextNode(r.title)),i.append(o);for(let t of r.rows){let n=d.createElement(`div`);e.styleElement(n,{display:`flex`,alignItems:`center`,gap:`8px`}),t.color&&n.appendChild(e.swatch(d,t.color,`dot`));let r=d.createElement(`span`);e.styleElement(r,{flex:`1 1 auto`,color:t.strong?`var(--text-color, #1f2937)`:`var(--text-secondary-color, #6b7280)`,fontWeight:t.strong?`600`:`400`}),r.textContent=t.name;let a=d.createElement(`span`);e.styleElement(a,{fontWeight:`600`,fontVariantNumeric:`tabular-nums`,marginLeft:`12px`}),a.textContent=t.value,n.append(r,a),i.append(n)}return i},N=(e=!1)=>{let t=p.tooltip,n=y&&b?a.hoverEvent(y,b.hover):null;if(!n||!y||!b||!M()||T?.moved){t.style.display=`none`,x=``;return}let r=`${n.index}:${n.indicator??``}`;if(e||r!==x){x=r;let e=te(n);if(e===null||e===``){t.replaceChildren(),x=``,t.style.display=`none`;return}typeof e==`string`?(t.textContent=e,t.style.whiteSpace=`pre`):(t.replaceChildren(e),t.style.whiteSpace=`nowrap`)}else if(!t.firstChild)return;t.style.display=`block`;let o=b.keyboard?i.hoverAnchor(y,b.hover)??b:b,s=p.stage.clientWidth,c=p.stage.clientHeight,{x:l,y:u}=a.placeShapeTooltip(y,b.hover,o,t.offsetWidth,t.offsetHeight,s,c);t.style.transform=`translate(${Math.round(l)}px, ${Math.round(u)}px)`},P=(e,t,n,r)=>{let i=!a.sameHover(b?.hover??null,e);b=e?{hover:e,x:t,y:n,keyboard:r}:null,p.stage.style.cursor=e&&!r?`pointer`:``,N(),i&&(j(),D(`hover`,y&&e?a.hoverEvent(y,e):null))};function F(){if(C=null,S)return;let e=p.stage.clientWidth,t=p.stage.clientHeight;if(!(e>0&&t>0))return;let n=f?.devicePixelRatio||1,i=Math.max(1,Math.round(e*n)),s=Math.max(1,Math.round(t*n));m.width!==i&&(m.width=i),m.height!==s&&(m.height=s),m.style.width=`${e}px`,m.style.height=`${t}px`,k=``;let c=g.frame(o.now(),{theme:v,width:e,height:t,measure:ee});if(y=c.scene,b&&!y.items.some(e=>e.index===b?.hover.index)&&(b=null,p.stage.style.cursor=``,D(`hover`,null)),h&&(h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,i,s),h.setTransform(n,0,0,n,0,0),r.drawShapeScene(h,y,b?.hover??null),k=``),N(),c.animating)j();else{let e=a.describeScene(y);O.textContent!==e&&(O.textContent=e)}}let I=()=>{let t=a.shapeLegend(_,v,g.hidden),n=a.legendConfig(_),r=[...p.legend.children].indexOf(d.activeElement);if(p.legend.replaceChildren(),p.legend.style.display=t?`flex`:`none`,!t)return;let i=n.position===`bottom`;p.legend.style.order=i?`1`:`0`,p.legend.style.padding=i?`8px 4px 0`:`0 4px 8px`,p.legend.style.justifyContent=`center`;for(let r of t){let t=d.createElement(n.toggle?`button`:`span`);t instanceof HTMLButtonElement&&(t.type=`button`,t.setAttribute(`aria-pressed`,String(!r.hidden)),t.addEventListener(`click`,()=>R(r.index))),e.styleElement(t,{display:`inline-flex`,alignItems:`center`,gap:`6px`,padding:`2px 4px`,margin:`0`,border:`0`,borderRadius:`4px`,background:`none`,font:`inherit`,color:`var(--text-secondary-color, #6b7280)`,cursor:n.toggle?`pointer`:`default`,opacity:r.hidden?`0.45`:`1`,textDecoration:r.hidden?`line-through`:`none`,transition:`opacity 120ms ease-out`}),t.append(e.swatch(d,r.color,`dot`),d.createTextNode(r.name)),p.legend.appendChild(t)}r>=0&&p.legend.children[r]?.focus()},L=()=>{p.stage.setAttribute(`aria-label`,_.ariaLabel??a.describeChart(_))};function R(e){if(S)return;let t=g.toggle(e);t&&(_.hidden||(I(),x=``,j()),D(`toggle`,t))}function z(e){if(S)return;let t=g.drill(e);t&&(_.type===`sunburst`&&!_.drillPath&&(x=``,j()),D(`drill`,t))}let B=e=>{if(_.type!==`sunburst`||_.drill===!1||!y)return;let t=y.items.find(t=>t.index===e.index);t?.drill&&z(t.drill)},V=e=>{let t=p.stage.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},H=(e,t)=>y?i.hitTestShapes(y,e,t,b?.hover??null):null,U=e=>{let{x:t,y:n}=V(e);if(T&&T.id===e.pointerId){if(Math.hypot(t-T.x,n-T.y)>s&&(T.moved=!0),T.touch)return}else if(e.pointerType===`touch`)return;P(H(t,n),t,n,!1)},W=e=>{let{x:t,y:n}=V(e);T={x:t,y:n,id:e.pointerId,touch:e.pointerType===`touch`,moved:!1}},G=e=>{let t=T;if(T=null,!t||t.id!==e.pointerId||t.moved){N();return}let{x:n,y:r}=V(e),i=H(n,r);if(P(i,n,r,!1),i&&y){let e=a.hoverEvent(y,i);e&&D(`click`,e),B(i)}},K=()=>{T=null,N()},q=e=>{e.pointerType!==`touch`&&(T=null,b&&!b.keyboard&&P(null,0,0,!1))},J=e=>{if(!y||!e)return;let t=i.hoverAnchor(y,e)??{x:0,y:0};P(e,t.x,t.y,!0),p.live.textContent=a.describeItem(y,e)},Y=e=>{if(!y)return;let t=b?.hover??null,n={ArrowRight:`next`,ArrowLeft:`prev`,ArrowUp:`up`,ArrowDown:`down`}[e.key];if(n){e.preventDefault(),J(i.stepHover(y,t,n));return}switch(e.key){case`Home`:case`End`:{let n=y.items;if(!n.length)return;e.preventDefault();let r=e.key===`Home`?n[0]:n[n.length-1];J(y.type===`radar`?{index:r.index,indicator:t?.indicator??0}:{index:r.index});break}case`Enter`:case` `:{if(!t)return;let n=a.hoverEvent(y,t);if(!n)return;e.preventDefault(),D(`click`,n),B(t);break}case`Backspace`:{if(_.type!==`sunburst`||_.drill===!1)return;let t=g.drillPath();if(!t.length)return;e.preventDefault(),z(t.slice(0,-1));break}case`Escape`:b&&(e.preventDefault(),P(null,0,0,!1))}},X=()=>{let e;try{e=p.stage.matches(`:focus-visible`)}catch{e=!0}e&&(p.stage.style.boxShadow=`inset 0 0 0 2px var(--primary-color, #4f46e5)`)},Z=()=>{p.stage.style.boxShadow=``,b?.keyboard&&P(null,0,0,!1)},Q=p.stage;Q.addEventListener(`pointermove`,U),Q.addEventListener(`pointerdown`,W),Q.addEventListener(`pointerup`,G),Q.addEventListener(`pointercancel`,K),Q.addEventListener(`pointerleave`,q),Q.addEventListener(`keydown`,Y),Q.addEventListener(`focus`,X),Q.addEventListener(`blur`,Z);let $=typeof ResizeObserver==`function`?new ResizeObserver(()=>j()):null;$?.observe(p.stage);let ne=()=>{S||(v=t.readTheme(p.root,_.palette),I(),x=``,j())},re=t.watchTheme(ne);return I(),L(),F(),{setOptions(e){if(S)return;let n=_;_=e,g.setOptions(e),(e.palette??[]).join()!==(n.palette??[]).join()&&(v=t.readTheme(p.root,e.palette)),e.type!==n.type&&b&&P(null,0,0,!1),I(),L(),x=``,j()},resize(){S||(A(),F())},refreshTheme:ne,toggle:R,getHidden:()=>g.hiddenIndexes(),drill:z,getDrillPath:()=>g.drillPath(),on(e,t){return E[e].add(t),()=>{E[e].delete(t)}},destroy(){S||(S=!0,A(),Q.removeEventListener(`pointermove`,U),Q.removeEventListener(`pointerdown`,W),Q.removeEventListener(`pointerup`,G),Q.removeEventListener(`pointercancel`,K),Q.removeEventListener(`pointerleave`,q),Q.removeEventListener(`keydown`,Y),Q.removeEventListener(`focus`,X),Q.removeEventListener(`blur`,Z),$?.disconnect(),re(),E.hover.clear(),E.click.clear(),E.toggle.clear(),E.drill.clear(),p.root.remove())}}};exports.createShapeChart=l;
1
+ const e=require("../tooltip.cjs"),t=require("../dom.cjs"),n=require("../renderers/follow.cjs"),r=require("../theme.cjs"),i=require("./scene.cjs"),a=require("../renderers/vector.cjs"),o=require("../renderers/vector-gpu.cjs"),s=require("./draw.cjs"),c=require("./hit.cjs"),l=require("./layout.cjs"),u=require("./runtime.cjs");var d=6,ee=0,f=(f,p)=>{let m=f.ownerDocument,h=m.defaultView,g=t.createChartDom(f);g.root.classList.add(`minerva-shape-chart`),g.foreground.style.display=`none`,g.hover.style.display=`none`;let _=g.background,v=null;try{v=_.getContext(`2d`)}catch{v=null}let y=u.createShapeRuntime(p),b=p,x=null,S=null,C=0,w=new a.VectorRecorder,T,te=()=>{if(T===void 0)try{T=g.foreground.getContext(`2d`)}catch{T=null}return T},E=r.readTheme(g.root,b.palette),D=null,O=null,k=``,A=!1,j=null,M=!1,N=null,P={hover:new Set,click:new Set,toggle:new Set,drill:new Set},F=(e,t)=>{for(let n of[...P[e]])n(t)},I=m.createElement(`div`);I.id=`minerva-shape-chart-${++ee}`,t.styleElement(I,{position:`absolute`,width:`1px`,height:`1px`,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`}),g.stage.appendChild(I),g.stage.setAttribute(`aria-describedby`,I.id),g.stage.tabIndex=0;let L=``,ne=(e,t)=>v?(t!==L&&(v.font=t,L=t),v.measureText(e).width):i.estimateText(e,t),R=()=>{j!==null&&(M?clearTimeout(j):h?.cancelAnimationFrame?.(j),j=null)},z=()=>{A||j!==null||(h&&typeof h.requestAnimationFrame==`function`?(M=!1,j=h.requestAnimationFrame(()=>U())):(M=!0,j=setTimeout(()=>U(),16)))},B=()=>b.tooltip===!1?null:typeof b.tooltip==`object`?b.tooltip:{},re=e=>{let n=B()?.render;if(n)return n(e);if(!D||!O)return null;let r=l.tooltipContent(D,O.hover);if(!r)return null;let i=m.createDocumentFragment(),a=m.createElement(`div`);t.styleElement(a,{display:`flex`,alignItems:`center`,gap:`6px`,fontWeight:`600`,marginBottom:`4px`,color:`var(--text-color, #1f2937)`,whiteSpace:`normal`,maxWidth:`260px`,overflowWrap:`anywhere`}),r.color&&a.appendChild(t.swatch(m,r.color,`dot`)),a.appendChild(m.createTextNode(r.title)),i.append(a);for(let e of r.rows){let n=m.createElement(`div`);t.styleElement(n,{display:`flex`,alignItems:`center`,gap:`8px`}),e.color&&n.appendChild(t.swatch(m,e.color,`dot`));let r=m.createElement(`span`);t.styleElement(r,{flex:`1 1 auto`,color:e.strong?`var(--text-color, #1f2937)`:`var(--text-secondary-color, #6b7280)`,fontWeight:e.strong?`600`:`400`}),r.textContent=e.name;let a=m.createElement(`span`);t.styleElement(a,{fontWeight:`600`,fontVariantNumeric:`tabular-nums`,marginLeft:`12px`}),a.textContent=e.value,n.append(r,a),i.append(n)}return i},V=(t=!1)=>{let n=g.tooltip,r=D&&O?l.hoverEvent(D,O.hover):null;if(!r||!D||!O||!B()||N?.moved){n.style.display=`none`,k=``;return}let i=`${r.index}:${r.indicator??``}`;if(t||i!==k){k=i;let e=re(r);if(e===null||e===``){n.replaceChildren(),k=``,n.style.display=`none`;return}typeof e==`string`?(n.textContent=e,n.style.whiteSpace=`pre`):(n.replaceChildren(e),n.style.whiteSpace=`nowrap`)}else if(!n.firstChild)return;n.style.display=`block`;let a=O.keyboard?c.hoverAnchor(D,O.hover)??O:O,o=D,s=O.hover;e.placeTooltipElement(n,g.stage,(e,t,n)=>l.placeShapeTooltip(o,s,a,e.width,e.height,t.width,t.height,n),{animate:!0})},H=(e,t,n,r)=>{let i=!l.sameHover(O?.hover??null,e);O=e?{hover:e,x:t,y:n,keyboard:r}:null,g.stage.style.cursor=e&&!r?`pointer`:``,V(),i&&(z(),F(`hover`,D&&e?l.hoverEvent(D,e):null))};function U(){if(j=null,A)return;let e=g.stage.clientWidth,t=g.stage.clientHeight;if(!(e>0&&t>0))return;let n=h?.devicePixelRatio||1,r=Math.max(1,Math.round(e*n)),i=Math.max(1,Math.round(t*n)),a=x,o=a?g.foreground:_,c=a?te():v;for(let n of a?[g.foreground,a.canvas]:[_])n.width!==r&&(n.width=r),n.height!==i&&(n.height=i),n.style.width=`${e}px`,n.style.height=`${t}px`;L=``;let d=y.frame(u.now(),{theme:E,width:e,height:t,measure:ne});if(D=d.scene,O&&!D.items.some(e=>e.index===O?.hover.index)&&(O=null,g.stage.style.cursor=``,F(`hover`,null)),a?(c&&(c.setTransform(1,0,0,1,0,0),c.clearRect(0,0,o.width,o.height)),w.reset(c,n),s.drawShapeScene(w,D,O?.hover??null),a.render(w.finish())):v&&(v.setTransform(1,0,0,1,0,0),v.clearRect(0,0,r,i),v.setTransform(n,0,0,n,0,0),s.drawShapeScene(v,D,O?.hover??null),L=``),V(),d.animating)z();else{let e=l.describeScene(D);I.textContent!==e&&(I.textContent=e)}}let W=()=>{let e=l.shapeLegend(b,E,y.hidden),n=l.legendConfig(b),r=[...g.legend.children].indexOf(m.activeElement);if(g.legend.replaceChildren(),g.legend.style.display=e?`flex`:`none`,!e)return;let i=n.position===`bottom`;g.legend.style.order=i?`1`:`0`,g.legend.style.padding=i?`8px 4px 0`:`0 4px 8px`,g.legend.style.justifyContent=`center`;for(let r of e){let e=m.createElement(n.toggle?`button`:`span`);e instanceof HTMLButtonElement&&(e.type=`button`,e.setAttribute(`aria-pressed`,String(!r.hidden)),e.addEventListener(`click`,()=>K(r.index))),t.styleElement(e,{display:`inline-flex`,alignItems:`center`,gap:`6px`,padding:`2px 4px`,margin:`0`,border:`0`,borderRadius:`4px`,background:`none`,font:`inherit`,color:`var(--text-secondary-color, #6b7280)`,cursor:n.toggle?`pointer`:`default`,opacity:r.hidden?`0.45`:`1`,textDecoration:r.hidden?`line-through`:`none`,transition:`opacity 120ms ease-out`}),e.append(t.swatch(m,r.color,`dot`),m.createTextNode(r.name)),g.legend.appendChild(e)}r>=0&&g.legend.children[r]?.focus()},G=()=>{g.stage.setAttribute(`aria-label`,b.ariaLabel??l.describeChart(b))};function K(e){if(A)return;let t=y.toggle(e);t&&(b.hidden||(W(),k=``,z()),F(`toggle`,t))}function q(e){if(A)return;let t=y.drill(e);t&&(b.type===`sunburst`&&!b.drillPath&&(k=``,z()),F(`drill`,t))}let J=e=>{if(b.type!==`sunburst`||b.drill===!1||!D)return;let t=D.items.find(t=>t.index===e.index);t?.drill&&q(t.drill)},Y=e=>{let t=g.stage.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},X=(e,t)=>D?c.hitTestShapes(D,e,t,O?.hover??null):null,Z=e=>{let{x:t,y:n}=Y(e);if(N&&N.id===e.pointerId){if(Math.hypot(t-N.x,n-N.y)>d&&(N.moved=!0),N.touch)return}else if(e.pointerType===`touch`)return;H(X(t,n),t,n,!1)},ie=e=>{let{x:t,y:n}=Y(e);N={x:t,y:n,id:e.pointerId,touch:e.pointerType===`touch`,moved:!1}},ae=e=>{let t=N;if(N=null,!t||t.id!==e.pointerId||t.moved){V();return}let{x:n,y:r}=Y(e),i=X(n,r);if(H(i,n,r,!1),i&&D){let e=l.hoverEvent(D,i);e&&F(`click`,e),J(i)}},oe=()=>{N=null,V()},se=e=>{e.pointerType!==`touch`&&(N=null,O&&!O.keyboard&&H(null,0,0,!1))},ce=e=>{if(!D||!e)return;let t=c.hoverAnchor(D,e)??{x:0,y:0};H(e,t.x,t.y,!0),g.live.textContent=l.describeItem(D,e)},le=e=>{if(!D)return;let t=O?.hover??null,n={ArrowRight:`next`,ArrowLeft:`prev`,ArrowUp:`up`,ArrowDown:`down`}[e.key];if(n){e.preventDefault(),ce(c.stepHover(D,t,n));return}switch(e.key){case`Home`:case`End`:{let n=D.items;if(!n.length)return;e.preventDefault();let r=e.key===`Home`?n[0]:n[n.length-1];ce(D.type===`radar`?{index:r.index,indicator:t?.indicator??0}:{index:r.index});break}case`Enter`:case` `:{if(!t)return;let n=l.hoverEvent(D,t);if(!n)return;e.preventDefault(),F(`click`,n),J(t);break}case`Backspace`:{if(b.type!==`sunburst`||b.drill===!1)return;let t=y.drillPath();if(!t.length)return;e.preventDefault(),q(t.slice(0,-1));break}case`Escape`:O&&(e.preventDefault(),H(null,0,0,!1))}},ue=()=>{let e;try{e=g.stage.matches(`:focus-visible`)}catch{e=!0}e&&(g.stage.style.boxShadow=`inset 0 0 0 2px var(--primary-color, #4f46e5)`)},de=()=>{g.stage.style.boxShadow=``,O?.keyboard&&H(null,0,0,!1)},Q=g.stage;Q.addEventListener(`pointermove`,Z),Q.addEventListener(`pointerdown`,ie),Q.addEventListener(`pointerup`,ae),Q.addEventListener(`pointercancel`,oe),Q.addEventListener(`pointerleave`,se),Q.addEventListener(`keydown`,le),Q.addEventListener(`focus`,ue),Q.addEventListener(`blur`,de);let fe=typeof ResizeObserver==`function`?new ResizeObserver(()=>z()):null;fe?.observe(g.stage);let pe=()=>{A||(E=r.readTheme(g.root,b.palette),W(),k=``,z())},me=r.watchTheme(pe),he=e=>{if(x&&(x.destroy(),x.canvas.remove()),x=e,S=e?.kind??`canvas2d`,g.root.dataset.renderer=S,e&&g.stage.insertBefore(e.canvas,g.foreground),_.style.display=e?`none`:``,g.foreground.style.display=e?``:`none`,!e){let e=te();e?.setTransform(1,0,0,1,0,0),e?.clearRect(0,0,g.foreground.width,g.foreground.height)}z()},$=async(e=new Set)=>{let n=++C,r=await o.createVectorRenderer(b.renderer,()=>t.createDataCanvas(m),t=>{A||x?.kind!==t||$(new Set([...e,t]))},e);if(A||n!==C){r?.destroy();return}he(r)};$();let ge=n.followDefaultRenderer(()=>b.renderer,()=>void $());return W(),G(),U(),{setOptions(e){if(A)return;let t=b;b=e,y.setOptions(e),(e.palette??[]).join()!==(t.palette??[]).join()&&(E=r.readTheme(g.root,e.palette)),e.type!==t.type&&O&&H(null,0,0,!1),(e.renderer??`auto`)!==(t.renderer??`auto`)&&$(),W(),G(),k=``,z()},resize(){A||(R(),U())},refreshTheme:pe,toggle:K,getHidden:()=>y.hiddenIndexes(),drill:q,getDrillPath:()=>y.drillPath(),getRenderer:()=>S,on(e,t){return P[e].add(t),()=>{P[e].delete(t)}},destroy(){A||(A=!0,R(),Q.removeEventListener(`pointermove`,Z),Q.removeEventListener(`pointerdown`,ie),Q.removeEventListener(`pointerup`,ae),Q.removeEventListener(`pointercancel`,oe),Q.removeEventListener(`pointerleave`,se),Q.removeEventListener(`keydown`,le),Q.removeEventListener(`focus`,ue),Q.removeEventListener(`blur`,de),fe?.disconnect(),me(),ge(),C++,x?.destroy(),x=null,P.hover.clear(),P.click.clear(),P.toggle.clear(),P.drill.clear(),g.root.remove())}}};exports.createShapeChart=f;
2
2
  //# sourceMappingURL=chart.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart.cjs","names":["createChartDom","createShapeRuntime","readTheme","estimateText","tooltipContent","swatch","hoverEvent","hoverAnchor","placeShapeTooltip","sameHover","now","describeScene","shapeLegend","legendConfig","describeChart","hitTestShapes","describeItem","stepHover","watchTheme","require_dom","require_theme","require_scene","require_draw","require_hit","require_layout","require_runtime","TAP_SLOP","uid","createShapeChart","doc","container","win","dom","canvas","ctx","runtime","initial","options","theme","scene","hover","tipKey","destroyed","frameId","frameIsTimeout","press","listeners","emit","listener","type","event","description","fontSet","measure","f","text","cancelFrame","schedule","render","tooltipOptions","tooltipNode","custom","content","fragment","header","row","el","n","v","updateTooltip","tip","key","force","anchor","stageW","stageH","left","top","setHover","changed","next","keyboard","width","height","dpr","pw","ph","frame","it","renderLegend","entries","config","focused","bottom","entry","item","toggle","updateAccessibility","index","drill","path","activate","hit","local","rect","hitAt","x","y","onPointerMove","onPointerDown","onPointerUp","p","onPointerCancel","onPointerLeave","focusItem","onKeyDown","current","direction","items","e","onFocus","visible","onBlur","stage","resizeObserver","refreshTheme","unwatchTheme","previous"],"sources":["../../../../../charts/src/engine/shapes/chart.ts"],"sourcesContent":["// createShapeChart: DOM host of the shape charts. One Canvas2D layer sized\n// with the device pixel ratio, the house legend / tooltip / live region of\n// createChartDom, pointer + keyboard interaction, resize and theme watching.\n\nimport { createChartDom, styleElement, swatch } from \"../dom\";\nimport { readTheme, watchTheme, type ChartTheme } from \"../theme\";\nimport { drawShapeScene } from \"./draw\";\nimport { hitTestShapes, hoverAnchor, stepHover } from \"./hit\";\nimport {\n describeChart,\n describeItem,\n describeScene,\n hoverEvent,\n legendConfig,\n placeShapeTooltip,\n sameHover,\n shapeLegend,\n tooltipContent,\n} from \"./layout\";\nimport { createShapeRuntime, now } from \"./runtime\";\nimport {\n estimateText,\n type MeasureText,\n type ShapeHover,\n type ShapeScene,\n} from \"./scene\";\nimport type {\n ShapeChartEventMap,\n ShapeChartInstance,\n ShapeChartOptions,\n ShapeHoverEvent,\n} from \"./types\";\n\n/** Pointer travel (px) under which a press counts as a click / tap */\nconst TAP_SLOP = 6;\n\nlet uid = 0;\n\ninterface HoverState {\n hover: ShapeHover;\n x: number;\n y: number;\n keyboard: boolean;\n}\n\n/**\n * Creates a pie / donut, radar, gauge, funnel, treemap, sankey, sunburst,\n * radial bar, calendar heatmap or bullet chart in `container` (drawn with\n * Canvas2D, themed by the Minerva CSS variables).\n */\nexport const createShapeChart = (\n container: HTMLElement,\n initial: ShapeChartOptions,\n): ShapeChartInstance => {\n const doc = container.ownerDocument;\n const win = doc.defaultView;\n const dom = createChartDom(container);\n dom.root.classList.add(\"minerva-shape-chart\");\n dom.foreground.style.display = \"none\";\n dom.hover.style.display = \"none\";\n const canvas = dom.background;\n let ctx: CanvasRenderingContext2D | null = null;\n try {\n ctx = canvas.getContext(\"2d\");\n } catch {\n ctx = null;\n }\n\n const runtime = createShapeRuntime(initial);\n let options = initial;\n let theme: ChartTheme = readTheme(dom.root, options.palette);\n let scene: ShapeScene | null = null;\n let hover: HoverState | null = null;\n let tipKey = \"\";\n let destroyed = false;\n let frameId: number | null = null;\n let frameIsTimeout = false;\n let press: {\n x: number;\n y: number;\n id: number;\n touch: boolean;\n moved: boolean;\n } | null = null;\n\n const listeners: {\n [K in keyof ShapeChartEventMap]: Set<\n (event: ShapeChartEventMap[K]) => void\n >;\n } = {\n hover: new Set(),\n click: new Set(),\n toggle: new Set(),\n drill: new Set(),\n };\n const emit = <K extends keyof ShapeChartEventMap>(\n type: K,\n event: ShapeChartEventMap[K],\n ) => {\n for (const listener of [...listeners[type]]) listener(event);\n };\n\n // screen-reader summary of the data\n const description = doc.createElement(\"div\");\n description.id = `minerva-shape-chart-${++uid}`;\n styleElement(description, {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n overflow: \"hidden\",\n clip: \"rect(0 0 0 0)\",\n clipPath: \"inset(50%)\",\n whiteSpace: \"nowrap\",\n });\n dom.stage.appendChild(description);\n dom.stage.setAttribute(\"aria-describedby\", description.id);\n dom.stage.tabIndex = 0;\n\n let fontSet = \"\";\n const measure: MeasureText = (text, f) => {\n if (!ctx) return estimateText(text, f);\n if (f !== fontSet) {\n ctx.font = f;\n fontSet = f;\n }\n return ctx.measureText(text).width;\n };\n\n // ------------------------------------------------------------- frames\n\n const cancelFrame = () => {\n if (frameId === null) return;\n if (frameIsTimeout) clearTimeout(frameId);\n else win?.cancelAnimationFrame?.(frameId);\n frameId = null;\n };\n\n const schedule = () => {\n if (destroyed || frameId !== null) return;\n if (win && typeof win.requestAnimationFrame === \"function\") {\n frameIsTimeout = false;\n frameId = win.requestAnimationFrame(() => render());\n } else {\n frameIsTimeout = true;\n frameId = setTimeout(() => render(), 16) as unknown as number;\n }\n };\n\n const tooltipOptions = () =>\n options.tooltip === false\n ? null\n : typeof options.tooltip === \"object\"\n ? options.tooltip\n : {};\n\n const tooltipNode = (event: ShapeHoverEvent): Node | string | null => {\n const custom = tooltipOptions()?.render;\n if (custom) return custom(event);\n if (!scene || !hover) return null;\n const content = tooltipContent(scene, hover.hover);\n if (!content) return null;\n const fragment = doc.createDocumentFragment();\n const header = doc.createElement(\"div\");\n styleElement(header, {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"6px\",\n fontWeight: \"600\",\n marginBottom: \"4px\",\n color: \"var(--text-color, #1f2937)\",\n // long titles (full names of truncated labels) wrap\n whiteSpace: \"normal\",\n maxWidth: \"260px\",\n overflowWrap: \"anywhere\",\n });\n if (content.color) header.appendChild(swatch(doc, content.color, \"dot\"));\n header.appendChild(doc.createTextNode(content.title));\n fragment.append(header);\n for (const row of content.rows) {\n const el = doc.createElement(\"div\");\n styleElement(el, { display: \"flex\", alignItems: \"center\", gap: \"8px\" });\n if (row.color) el.appendChild(swatch(doc, row.color, \"dot\"));\n const n = doc.createElement(\"span\");\n styleElement(n, {\n flex: \"1 1 auto\",\n color: row.strong\n ? \"var(--text-color, #1f2937)\"\n : \"var(--text-secondary-color, #6b7280)\",\n fontWeight: row.strong ? \"600\" : \"400\",\n });\n n.textContent = row.name;\n const v = doc.createElement(\"span\");\n styleElement(v, {\n fontWeight: \"600\",\n fontVariantNumeric: \"tabular-nums\",\n marginLeft: \"12px\",\n });\n v.textContent = row.value;\n el.append(n, v);\n fragment.append(el);\n }\n return fragment;\n };\n\n /** Fills (when the hovered item changed) and places the tooltip */\n const updateTooltip = (force = false) => {\n const tip = dom.tooltip;\n const event = scene && hover ? hoverEvent(scene, hover.hover) : null;\n if (!event || !scene || !hover || !tooltipOptions() || press?.moved) {\n tip.style.display = \"none\";\n tipKey = \"\";\n return;\n }\n const key = `${event.index}:${event.indicator ?? \"\"}`;\n if (force || key !== tipKey) {\n tipKey = key;\n const content = tooltipNode(event);\n if (content === null || content === \"\") {\n tip.replaceChildren();\n tipKey = \"\";\n tip.style.display = \"none\";\n return;\n }\n if (typeof content === \"string\") {\n tip.textContent = content;\n tip.style.whiteSpace = \"pre\";\n } else {\n tip.replaceChildren(content);\n tip.style.whiteSpace = \"nowrap\";\n }\n } else if (!tip.firstChild) {\n return;\n }\n tip.style.display = \"block\";\n const anchor = hover.keyboard\n ? (hoverAnchor(scene, hover.hover) ?? hover)\n : hover;\n const stageW = dom.stage.clientWidth;\n const stageH = dom.stage.clientHeight;\n const { x: left, y: top } = placeShapeTooltip(\n scene,\n hover.hover,\n anchor,\n tip.offsetWidth,\n tip.offsetHeight,\n stageW,\n stageH,\n );\n tip.style.transform = `translate(${Math.round(left)}px, ${Math.round(top)}px)`;\n };\n\n const setHover = (\n next: ShapeHover | null,\n x: number,\n y: number,\n keyboard: boolean,\n ) => {\n const changed = !sameHover(hover?.hover ?? null, next);\n hover = next ? { hover: next, x, y, keyboard } : null;\n dom.stage.style.cursor = next && !keyboard ? \"pointer\" : \"\";\n updateTooltip();\n if (!changed) return;\n schedule();\n emit(\"hover\", scene && next ? hoverEvent(scene, next) : null);\n };\n\n function render() {\n frameId = null;\n if (destroyed) return;\n const width = dom.stage.clientWidth;\n const height = dom.stage.clientHeight;\n if (!(width > 0 && height > 0)) return;\n const dpr = win?.devicePixelRatio || 1;\n const pw = Math.max(1, Math.round(width * dpr));\n const ph = Math.max(1, Math.round(height * dpr));\n if (canvas.width !== pw) canvas.width = pw;\n if (canvas.height !== ph) canvas.height = ph;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${height}px`;\n fontSet = \"\";\n const frame = runtime.frame(now(), { theme, width, height, measure });\n scene = frame.scene;\n if (hover && !scene.items.some((it) => it.index === hover?.hover.index)) {\n hover = null;\n dom.stage.style.cursor = \"\";\n emit(\"hover\", null);\n }\n if (ctx) {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, pw, ph);\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawShapeScene(ctx, scene, hover?.hover ?? null);\n fontSet = \"\";\n }\n updateTooltip();\n if (!frame.animating) {\n const text = describeScene(scene);\n if (description.textContent !== text) description.textContent = text;\n } else schedule();\n }\n\n // ------------------------------------------------------------- legend\n\n const renderLegend = () => {\n const entries = shapeLegend(options, theme, runtime.hidden);\n const config = legendConfig(options);\n const focused = [...dom.legend.children].indexOf(\n doc.activeElement as Element,\n );\n dom.legend.replaceChildren();\n dom.legend.style.display = entries ? \"flex\" : \"none\";\n if (!entries) return;\n const bottom = config.position === \"bottom\";\n dom.legend.style.order = bottom ? \"1\" : \"0\";\n dom.legend.style.padding = bottom ? \"8px 4px 0\" : \"0 4px 8px\";\n dom.legend.style.justifyContent = \"center\";\n for (const entry of entries) {\n const item = doc.createElement(config.toggle ? \"button\" : \"span\");\n if (item instanceof HTMLButtonElement) {\n item.type = \"button\";\n item.setAttribute(\"aria-pressed\", String(!entry.hidden));\n item.addEventListener(\"click\", () => toggle(entry.index));\n }\n styleElement(item, {\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"6px\",\n padding: \"2px 4px\",\n margin: \"0\",\n border: \"0\",\n borderRadius: \"4px\",\n background: \"none\",\n font: \"inherit\",\n color: \"var(--text-secondary-color, #6b7280)\",\n cursor: config.toggle ? \"pointer\" : \"default\",\n opacity: entry.hidden ? \"0.45\" : \"1\",\n textDecoration: entry.hidden ? \"line-through\" : \"none\",\n transition: \"opacity 120ms ease-out\",\n });\n item.append(\n swatch(doc, entry.color, \"dot\"),\n doc.createTextNode(entry.name),\n );\n dom.legend.appendChild(item);\n }\n if (focused >= 0)\n (dom.legend.children[focused] as HTMLElement | undefined)?.focus();\n };\n\n const updateAccessibility = () => {\n dom.stage.setAttribute(\n \"aria-label\",\n options.ariaLabel ?? describeChart(options),\n );\n };\n\n function toggle(index: number) {\n if (destroyed) return;\n const event = runtime.toggle(index);\n if (!event) return;\n if (!options.hidden) {\n renderLegend();\n tipKey = \"\";\n schedule();\n }\n emit(\"toggle\", event);\n }\n\n function drill(path: readonly string[]) {\n if (destroyed) return;\n const event = runtime.drill(path);\n if (!event) return;\n if (options.type === \"sunburst\" && !options.drillPath) {\n tipKey = \"\";\n schedule();\n }\n emit(\"drill\", event);\n }\n\n /** Sunburst: drills into / out of an activated item */\n const activate = (hit: ShapeHover) => {\n if (options.type !== \"sunburst\" || options.drill === false || !scene)\n return;\n const item = scene.items.find((it) => it.index === hit.index);\n if (item?.drill) drill(item.drill);\n };\n\n // -------------------------------------------------------- interaction\n\n const local = (event: { clientX: number; clientY: number }) => {\n const rect = dom.stage.getBoundingClientRect();\n return { x: event.clientX - rect.left, y: event.clientY - rect.top };\n };\n\n const hitAt = (x: number, y: number) =>\n scene ? hitTestShapes(scene, x, y, hover?.hover ?? null) : null;\n\n const onPointerMove = (event: PointerEvent) => {\n const { x, y } = local(event);\n if (press && press.id === event.pointerId) {\n if (Math.hypot(x - press.x, y - press.y) > TAP_SLOP) press.moved = true;\n if (press.touch) return;\n } else if (event.pointerType === \"touch\") return;\n setHover(hitAt(x, y), x, y, false);\n };\n\n const onPointerDown = (event: PointerEvent) => {\n const { x, y } = local(event);\n press = {\n x,\n y,\n id: event.pointerId,\n touch: event.pointerType === \"touch\",\n moved: false,\n };\n };\n\n const onPointerUp = (event: PointerEvent) => {\n const p = press;\n press = null;\n if (!p || p.id !== event.pointerId || p.moved) {\n updateTooltip();\n return;\n }\n const { x, y } = local(event);\n const hit = hitAt(x, y);\n // a tap shows the tooltip (there is no hover on touch screens)\n setHover(hit, x, y, false);\n if (hit && scene) {\n const e = hoverEvent(scene, hit);\n if (e) emit(\"click\", e);\n activate(hit);\n }\n };\n\n const onPointerCancel = () => {\n press = null;\n updateTooltip();\n };\n\n const onPointerLeave = (event: PointerEvent) => {\n if (event.pointerType === \"touch\") return;\n press = null;\n if (hover && !hover.keyboard) setHover(null, 0, 0, false);\n };\n\n const focusItem = (next: ShapeHover | null) => {\n if (!scene || !next) return;\n const anchor = hoverAnchor(scene, next) ?? { x: 0, y: 0 };\n setHover(next, anchor.x, anchor.y, true);\n dom.live.textContent = describeItem(scene, next);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (!scene) return;\n const current = hover?.hover ?? null;\n const keys: Record<string, \"next\" | \"prev\" | \"up\" | \"down\"> = {\n ArrowRight: \"next\",\n ArrowLeft: \"prev\",\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n };\n const direction = keys[event.key];\n if (direction) {\n event.preventDefault();\n focusItem(stepHover(scene, current, direction));\n return;\n }\n switch (event.key) {\n case \"Home\":\n case \"End\": {\n const items = scene.items;\n if (!items.length) return;\n event.preventDefault();\n const it = event.key === \"Home\" ? items[0] : items[items.length - 1];\n focusItem(\n scene.type === \"radar\"\n ? { index: it.index, indicator: current?.indicator ?? 0 }\n : { index: it.index },\n );\n break;\n }\n case \"Enter\":\n case \" \": {\n if (!current) return;\n const e = hoverEvent(scene, current);\n if (!e) return;\n event.preventDefault();\n emit(\"click\", e);\n activate(current);\n break;\n }\n case \"Backspace\": {\n if (options.type !== \"sunburst\" || options.drill === false) return;\n const path = runtime.drillPath();\n if (!path.length) return;\n event.preventDefault();\n drill(path.slice(0, -1));\n break;\n }\n case \"Escape\":\n if (hover) {\n event.preventDefault();\n setHover(null, 0, 0, false);\n }\n break;\n default:\n break;\n }\n };\n\n const onFocus = () => {\n let visible: boolean;\n try {\n visible = dom.stage.matches(\":focus-visible\");\n } catch {\n visible = true;\n }\n // inset, like an outline drawn inside the stage edge: the drawing keeps a\n // padding, so the ring never covers labels or leader lines\n if (visible)\n dom.stage.style.boxShadow =\n \"inset 0 0 0 2px var(--primary-color, #4f46e5)\";\n };\n\n const onBlur = () => {\n dom.stage.style.boxShadow = \"\";\n if (hover?.keyboard) setHover(null, 0, 0, false);\n };\n\n const stage = dom.stage;\n stage.addEventListener(\"pointermove\", onPointerMove);\n stage.addEventListener(\"pointerdown\", onPointerDown);\n stage.addEventListener(\"pointerup\", onPointerUp);\n stage.addEventListener(\"pointercancel\", onPointerCancel);\n stage.addEventListener(\"pointerleave\", onPointerLeave);\n stage.addEventListener(\"keydown\", onKeyDown);\n stage.addEventListener(\"focus\", onFocus);\n stage.addEventListener(\"blur\", onBlur);\n\n const resizeObserver =\n typeof ResizeObserver === \"function\"\n ? new ResizeObserver(() => schedule())\n : null;\n resizeObserver?.observe(dom.stage);\n\n const refreshTheme = () => {\n if (destroyed) return;\n theme = readTheme(dom.root, options.palette);\n renderLegend();\n tipKey = \"\";\n schedule();\n };\n const unwatchTheme = watchTheme(refreshTheme);\n\n renderLegend();\n updateAccessibility();\n render();\n\n return {\n setOptions(next) {\n if (destroyed) return;\n const previous = options;\n options = next;\n runtime.setOptions(next);\n if ((next.palette ?? []).join() !== (previous.palette ?? []).join())\n theme = readTheme(dom.root, next.palette);\n if (next.type !== previous.type && hover) setHover(null, 0, 0, false);\n renderLegend();\n updateAccessibility();\n tipKey = \"\";\n schedule();\n },\n resize() {\n if (destroyed) return;\n cancelFrame();\n render();\n },\n refreshTheme,\n toggle,\n getHidden: () => runtime.hiddenIndexes(),\n drill,\n getDrillPath: () => runtime.drillPath(),\n on(type, listener) {\n listeners[type].add(listener);\n return () => {\n listeners[type].delete(listener);\n };\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n cancelFrame();\n stage.removeEventListener(\"pointermove\", onPointerMove);\n stage.removeEventListener(\"pointerdown\", onPointerDown);\n stage.removeEventListener(\"pointerup\", onPointerUp);\n stage.removeEventListener(\"pointercancel\", onPointerCancel);\n stage.removeEventListener(\"pointerleave\", onPointerLeave);\n stage.removeEventListener(\"keydown\", onKeyDown);\n stage.removeEventListener(\"focus\", onFocus);\n stage.removeEventListener(\"blur\", onBlur);\n resizeObserver?.disconnect();\n unwatchTheme();\n listeners.hover.clear();\n listeners.click.clear();\n listeners.toggle.clear();\n listeners.drill.clear();\n dom.root.remove();\n },\n };\n};\n"],"mappings":"qLAkCA,IAAM0B,EAAW,EAEbC,EAAM,EAcGC,GACX,EACA,IACuB,CACvB,IAAMC,EAAMC,EAAU,cAChBC,EAAMF,EAAI,YACVG,EAAMhC,EAAAA,eAAe8B,CAAS,EACpCE,EAAI,KAAK,UAAU,IAAI,qBAAqB,EAC5C,EAAI,WAAW,MAAM,QAAU,OAC/B,EAAI,MAAM,MAAM,QAAU,OAC1B,IAAMC,EAASD,EAAI,WACfE,EAAuC,KAC3C,GAAI,CACF,EAAMD,EAAO,WAAW,IAAI,CAC9B,MAAQ,CACN,EAAM,IACR,CAEA,IAAME,EAAUlC,EAAAA,mBAAmBmC,CAAO,EACtCC,EAAUD,EACVE,EAAoBpC,EAAAA,UAAU8B,EAAI,KAAMK,EAAQ,OAAO,EACvDE,EAA2B,KAC3BC,EAA2B,KAC3BC,EAAS,GACTC,EAAY,GACZC,EAAyB,KACzBC,EAAiB,GACjBC,EAMO,KAELC,EAIF,CACF,MAAO,IAAI,IACX,MAAO,IAAI,IACX,OAAQ,IAAI,IACZ,MAAO,IAAI,GACb,EACMC,GACJ,EACA,IACG,CACH,IAAK,IAAMC,IAAY,CAAC,GAAGF,EAAUG,EAAK,EAAGD,EAASE,CAAK,CAC7D,EAGMC,EAActB,EAAI,cAAc,KAAK,EAC3C,EAAY,GAAK,uBAAuB,EAAEF,IAC1CR,EAAA,aAAagC,EAAa,CACxB,SAAU,WACV,MAAO,MACP,OAAQ,MACR,SAAU,SACV,KAAM,gBACN,SAAU,aACV,WAAY,QACd,CAAC,EACDnB,EAAI,MAAM,YAAYmB,CAAW,EACjCnB,EAAI,MAAM,aAAa,mBAAoBmB,EAAY,EAAE,EACzD,EAAI,MAAM,SAAW,EAErB,IAAIC,EAAU,GAC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AQ,WAAW6C,CAAI,GAClBA,EAAK,SAAW,CAAC,EAAA,CAAG,KAAK,KAAO+C,EAAS,SAAW,CAAC,EAAA,CAAG,KAAK,IAChE,EAAQ7H,EAAAA,UAAU8B,EAAI,KAAMgD,EAAK,OAAO,GACtCA,EAAK,OAAS+C,EAAS,MAAQvF,GAAOsC,EAAS,KAAM,EAAG,EAAG,EAAK,EACpEW,EAAa,EACbQ,EAAoB,EACpB,EAAS,GACTxC,EAAS,CACX,EACA,QAAS,CACHf,IACJc,EAAY,EACZE,EAAO,EACT,EACA,gBACA,SACA,cAAiBvB,EAAQ,cAAc,EACvC,QACA,iBAAoBA,EAAQ,UAAU,EACtC,GAAG,EAAM,EAAU,CAEjB,OADAW,EAAUG,EAAK,CAAC,IAAID,CAAQ,MACf,CACXF,EAAUG,EAAK,CAAC,OAAOD,CAAQ,CACjC,CACF,EACA,SAAU,CACJN,IACJ,EAAY,GACZc,EAAY,EACZmE,EAAM,oBAAoB,cAAef,CAAa,EACtDe,EAAM,oBAAoB,cAAed,CAAa,EACtDc,EAAM,oBAAoB,YAAab,CAAW,EAClDa,EAAM,oBAAoB,gBAAiBX,CAAe,EAC1DW,EAAM,oBAAoB,eAAgBV,CAAc,EACxDU,EAAM,oBAAoB,UAAWR,CAAS,EAC9CQ,EAAM,oBAAoB,QAASH,CAAO,EAC1CG,EAAM,oBAAoB,OAAQD,CAAM,EACxCE,GAAgB,WAAW,EAC3BE,GAAa,EACbhF,EAAU,MAAM,MAAM,EACtBA,EAAU,MAAM,MAAM,EACtBA,EAAU,OAAO,MAAM,EACvBA,EAAU,MAAM,MAAM,EACtBd,EAAI,KAAK,OAAO,EAClB,CACF,CACF"}
1
+ {"version":3,"file":"chart.cjs","names":["createChartDom","createShapeRuntime","VectorRecorder","readTheme","estimateText","tooltipContent","swatch","hoverEvent","hoverAnchor","placeShapeTooltip","sameHover","now","describeScene","shapeLegend","legendConfig","describeChart","hitTestShapes","describeItem","stepHover","watchTheme","createVectorRenderer","createDataCanvas","followDefaultRenderer","require_tooltip","require_dom","require_follow","require_theme","require_scene","require_vector","require_vector_gpu","require_draw","require_hit","require_layout","require_runtime","TAP_SLOP","uid","createShapeChart","doc","container","win","dom","canvas","ctx","runtime","initial","options","vector","backend","rendererToken","recorder","text","textCtx","theme","scene","hover","tipKey","destroyed","frameId","frameIsTimeout","press","listeners","emit","listener","type","event","description","fontSet","measure","f","cancelFrame","schedule","render","tooltipOptions","tooltipNode","custom","content","fragment","header","row","el","n","v","updateTooltip","tip","key","force","anchor","shown","hovered","size","stage","bounds","setHover","changed","next","keyboard","width","height","dpr","pw","ph","gpu","target","target2d","layer","frame","it","renderLegend","entries","config","focused","bottom","entry","item","toggle","updateAccessibility","index","drill","path","activate","hit","local","rect","hitAt","x","y","onPointerMove","onPointerDown","onPointerUp","p","onPointerCancel","onPointerLeave","focusItem","onKeyDown","current","direction","items","e","onFocus","visible","onBlur","resizeObserver","refreshTheme","unwatchTheme","applyBackend","t","initRenderer","token","kind","exclude","unfollowDefault","previous"],"sources":["../../../../../charts/src/engine/shapes/chart.ts"],"sourcesContent":["// createShapeChart: DOM host of the shape charts. The shapes are drawn on\n// the GPU (WebGPU, then WebGL2 / WebGL) with the text on a 2D canvas above\n// them, or on one Canvas2D layer; plus the house legend / tooltip / live\n// region of createChartDom, pointer + keyboard interaction, resize and theme\n// watching.\n\nimport { createChartDom, createDataCanvas, styleElement, swatch } from \"../dom\";\nimport {\n createVectorRenderer,\n type VectorRenderer,\n} from \"../renderers/vector-gpu\";\nimport { VectorRecorder } from \"../renderers/vector\";\nimport { followDefaultRenderer } from \"../renderers/follow\";\nimport type { ChartRendererKind } from \"../types\";\nimport { readTheme, watchTheme, type ChartTheme } from \"../theme\";\nimport { placeTooltipElement } from \"../tooltip\";\nimport { drawShapeScene } from \"./draw\";\nimport { hitTestShapes, hoverAnchor, stepHover } from \"./hit\";\nimport {\n describeChart,\n describeItem,\n describeScene,\n hoverEvent,\n legendConfig,\n placeShapeTooltip,\n sameHover,\n shapeLegend,\n tooltipContent,\n} from \"./layout\";\nimport { createShapeRuntime, now } from \"./runtime\";\nimport {\n estimateText,\n type MeasureText,\n type ShapeHover,\n type ShapeScene,\n} from \"./scene\";\nimport type {\n ShapeChartEventMap,\n ShapeChartInstance,\n ShapeChartOptions,\n ShapeHoverEvent,\n} from \"./types\";\n\n/** Pointer travel (px) under which a press counts as a click / tap */\nconst TAP_SLOP = 6;\n\nlet uid = 0;\n\ninterface HoverState {\n hover: ShapeHover;\n x: number;\n y: number;\n keyboard: boolean;\n}\n\n/**\n * Creates a pie / donut, radar, gauge, funnel, treemap, sankey, sunburst,\n * radial bar, calendar heatmap, bullet or chord chart in `container` (drawn\n * on the GPU when available, else with Canvas2D; themed by the Minerva CSS\n * variables).\n */\nexport const createShapeChart = (\n container: HTMLElement,\n initial: ShapeChartOptions,\n): ShapeChartInstance => {\n const doc = container.ownerDocument;\n const win = doc.defaultView;\n const dom = createChartDom(container);\n dom.root.classList.add(\"minerva-shape-chart\");\n dom.foreground.style.display = \"none\";\n dom.hover.style.display = \"none\";\n const canvas = dom.background;\n let ctx: CanvasRenderingContext2D | null = null;\n try {\n ctx = canvas.getContext(\"2d\");\n } catch {\n ctx = null;\n }\n\n const runtime = createShapeRuntime(initial);\n let options = initial;\n /** GPU backend of the shapes; null while starting and with Canvas2D */\n let vector: VectorRenderer | null = null;\n /** Backend in use, once chosen */\n let backend: ChartRendererKind | null = null;\n let rendererToken = 0;\n const recorder = new VectorRecorder();\n let text: CanvasRenderingContext2D | null | undefined;\n /** 2D context of the text layer drawn above the GPU canvas */\n const textCtx = () => {\n if (text === undefined) {\n try {\n text = dom.foreground.getContext(\"2d\");\n } catch {\n text = null;\n }\n }\n return text;\n };\n let theme: ChartTheme = readTheme(dom.root, options.palette);\n let scene: ShapeScene | null = null;\n let hover: HoverState | null = null;\n let tipKey = \"\";\n let destroyed = false;\n let frameId: number | null = null;\n let frameIsTimeout = false;\n let press: {\n x: number;\n y: number;\n id: number;\n touch: boolean;\n moved: boolean;\n } | null = null;\n\n const listeners: {\n [K in keyof ShapeChartEventMap]: Set<\n (event: ShapeChartEventMap[K]) => void\n >;\n } = {\n hover: new Set(),\n click: new Set(),\n toggle: new Set(),\n drill: new Set(),\n };\n const emit = <K extends keyof ShapeChartEventMap>(\n type: K,\n event: ShapeChartEventMap[K],\n ) => {\n for (const listener of [...listeners[type]]) listener(event);\n };\n\n // screen-reader summary of the data\n const description = doc.createElement(\"div\");\n description.id = `minerva-shape-chart-${++uid}`;\n styleElement(description, {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n overflow: \"hidden\",\n clip: \"rect(0 0 0 0)\",\n clipPath: \"inset(50%)\",\n whiteSpace: \"nowrap\",\n });\n dom.stage.appendChild(description);\n dom.stage.setAttribute(\"aria-describedby\", description.id);\n dom.stage.tabIndex = 0;\n\n let fontSet = \"\";\n const measure: MeasureText = (text, f) => {\n if (!ctx) return estimateText(text, f);\n if (f !== fontSet) {\n ctx.font = f;\n fontSet = f;\n }\n return ctx.measureText(text).width;\n };\n\n // ------------------------------------------------------------- frames\n\n const cancelFrame = () => {\n if (frameId === null) return;\n if (frameIsTimeout) clearTimeout(frameId);\n else win?.cancelAnimationFrame?.(frameId);\n frameId = null;\n };\n\n const schedule = () => {\n if (destroyed || frameId !== null) return;\n if (win && typeof win.requestAnimationFrame === \"function\") {\n frameIsTimeout = false;\n frameId = win.requestAnimationFrame(() => render());\n } else {\n frameIsTimeout = true;\n frameId = setTimeout(() => render(), 16) as unknown as number;\n }\n };\n\n const tooltipOptions = () =>\n options.tooltip === false\n ? null\n : typeof options.tooltip === \"object\"\n ? options.tooltip\n : {};\n\n const tooltipNode = (event: ShapeHoverEvent): Node | string | null => {\n const custom = tooltipOptions()?.render;\n if (custom) return custom(event);\n if (!scene || !hover) return null;\n const content = tooltipContent(scene, hover.hover);\n if (!content) return null;\n const fragment = doc.createDocumentFragment();\n const header = doc.createElement(\"div\");\n styleElement(header, {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"6px\",\n fontWeight: \"600\",\n marginBottom: \"4px\",\n color: \"var(--text-color, #1f2937)\",\n // long titles (full names of truncated labels) wrap\n whiteSpace: \"normal\",\n maxWidth: \"260px\",\n overflowWrap: \"anywhere\",\n });\n if (content.color) header.appendChild(swatch(doc, content.color, \"dot\"));\n header.appendChild(doc.createTextNode(content.title));\n fragment.append(header);\n for (const row of content.rows) {\n const el = doc.createElement(\"div\");\n styleElement(el, { display: \"flex\", alignItems: \"center\", gap: \"8px\" });\n if (row.color) el.appendChild(swatch(doc, row.color, \"dot\"));\n const n = doc.createElement(\"span\");\n styleElement(n, {\n flex: \"1 1 auto\",\n color: row.strong\n ? \"var(--text-color, #1f2937)\"\n : \"var(--text-secondary-color, #6b7280)\",\n fontWeight: row.strong ? \"600\" : \"400\",\n });\n n.textContent = row.name;\n const v = doc.createElement(\"span\");\n styleElement(v, {\n fontWeight: \"600\",\n fontVariantNumeric: \"tabular-nums\",\n marginLeft: \"12px\",\n });\n v.textContent = row.value;\n el.append(n, v);\n fragment.append(el);\n }\n return fragment;\n };\n\n /** Fills (when the hovered item changed) and places the tooltip */\n const updateTooltip = (force = false) => {\n const tip = dom.tooltip;\n const event = scene && hover ? hoverEvent(scene, hover.hover) : null;\n if (!event || !scene || !hover || !tooltipOptions() || press?.moved) {\n tip.style.display = \"none\";\n tipKey = \"\";\n return;\n }\n const key = `${event.index}:${event.indicator ?? \"\"}`;\n if (force || key !== tipKey) {\n tipKey = key;\n const content = tooltipNode(event);\n if (content === null || content === \"\") {\n tip.replaceChildren();\n tipKey = \"\";\n tip.style.display = \"none\";\n return;\n }\n if (typeof content === \"string\") {\n tip.textContent = content;\n tip.style.whiteSpace = \"pre\";\n } else {\n tip.replaceChildren(content);\n tip.style.whiteSpace = \"nowrap\";\n }\n } else if (!tip.firstChild) {\n return;\n }\n tip.style.display = \"block\";\n const anchor = hover.keyboard\n ? (hoverAnchor(scene, hover.hover) ?? hover)\n : hover;\n const shown = scene;\n const hovered = hover.hover;\n placeTooltipElement(\n tip,\n dom.stage,\n (size, stage, bounds) =>\n placeShapeTooltip(\n shown,\n hovered,\n anchor,\n size.width,\n size.height,\n stage.width,\n stage.height,\n bounds,\n ),\n { animate: true },\n );\n };\n\n const setHover = (\n next: ShapeHover | null,\n x: number,\n y: number,\n keyboard: boolean,\n ) => {\n const changed = !sameHover(hover?.hover ?? null, next);\n hover = next ? { hover: next, x, y, keyboard } : null;\n dom.stage.style.cursor = next && !keyboard ? \"pointer\" : \"\";\n updateTooltip();\n if (!changed) return;\n schedule();\n emit(\"hover\", scene && next ? hoverEvent(scene, next) : null);\n };\n\n function render() {\n frameId = null;\n if (destroyed) return;\n const width = dom.stage.clientWidth;\n const height = dom.stage.clientHeight;\n if (!(width > 0 && height > 0)) return;\n const dpr = win?.devicePixelRatio || 1;\n const pw = Math.max(1, Math.round(width * dpr));\n const ph = Math.max(1, Math.round(height * dpr));\n // the GPU draws the shapes, the foreground canvas the text above them\n const gpu = vector;\n const target = gpu ? dom.foreground : canvas;\n const target2d = gpu ? textCtx() : ctx;\n for (const layer of gpu ? [dom.foreground, gpu.canvas] : [canvas]) {\n if (layer.width !== pw) layer.width = pw;\n if (layer.height !== ph) layer.height = ph;\n layer.style.width = `${width}px`;\n layer.style.height = `${height}px`;\n }\n fontSet = \"\";\n const frame = runtime.frame(now(), { theme, width, height, measure });\n scene = frame.scene;\n if (hover && !scene.items.some((it) => it.index === hover?.hover.index)) {\n hover = null;\n dom.stage.style.cursor = \"\";\n emit(\"hover\", null);\n }\n if (gpu) {\n if (target2d) {\n target2d.setTransform(1, 0, 0, 1, 0, 0);\n target2d.clearRect(0, 0, target.width, target.height);\n }\n recorder.reset(target2d, dpr);\n drawShapeScene(\n recorder as unknown as CanvasRenderingContext2D,\n scene,\n hover?.hover ?? null,\n );\n gpu.render(recorder.finish());\n } else if (ctx) {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, pw, ph);\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawShapeScene(ctx, scene, hover?.hover ?? null);\n fontSet = \"\";\n }\n updateTooltip();\n if (!frame.animating) {\n const text = describeScene(scene);\n if (description.textContent !== text) description.textContent = text;\n } else schedule();\n }\n\n // ------------------------------------------------------------- legend\n\n const renderLegend = () => {\n const entries = shapeLegend(options, theme, runtime.hidden);\n const config = legendConfig(options);\n const focused = [...dom.legend.children].indexOf(\n doc.activeElement as Element,\n );\n dom.legend.replaceChildren();\n dom.legend.style.display = entries ? \"flex\" : \"none\";\n if (!entries) return;\n const bottom = config.position === \"bottom\";\n dom.legend.style.order = bottom ? \"1\" : \"0\";\n dom.legend.style.padding = bottom ? \"8px 4px 0\" : \"0 4px 8px\";\n dom.legend.style.justifyContent = \"center\";\n for (const entry of entries) {\n const item = doc.createElement(config.toggle ? \"button\" : \"span\");\n if (item instanceof HTMLButtonElement) {\n item.type = \"button\";\n item.setAttribute(\"aria-pressed\", String(!entry.hidden));\n item.addEventListener(\"click\", () => toggle(entry.index));\n }\n styleElement(item, {\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"6px\",\n padding: \"2px 4px\",\n margin: \"0\",\n border: \"0\",\n borderRadius: \"4px\",\n background: \"none\",\n font: \"inherit\",\n color: \"var(--text-secondary-color, #6b7280)\",\n cursor: config.toggle ? \"pointer\" : \"default\",\n opacity: entry.hidden ? \"0.45\" : \"1\",\n textDecoration: entry.hidden ? \"line-through\" : \"none\",\n transition: \"opacity 120ms ease-out\",\n });\n item.append(\n swatch(doc, entry.color, \"dot\"),\n doc.createTextNode(entry.name),\n );\n dom.legend.appendChild(item);\n }\n if (focused >= 0)\n (dom.legend.children[focused] as HTMLElement | undefined)?.focus();\n };\n\n const updateAccessibility = () => {\n dom.stage.setAttribute(\n \"aria-label\",\n options.ariaLabel ?? describeChart(options),\n );\n };\n\n function toggle(index: number) {\n if (destroyed) return;\n const event = runtime.toggle(index);\n if (!event) return;\n if (!options.hidden) {\n renderLegend();\n tipKey = \"\";\n schedule();\n }\n emit(\"toggle\", event);\n }\n\n function drill(path: readonly string[]) {\n if (destroyed) return;\n const event = runtime.drill(path);\n if (!event) return;\n if (options.type === \"sunburst\" && !options.drillPath) {\n tipKey = \"\";\n schedule();\n }\n emit(\"drill\", event);\n }\n\n /** Sunburst: drills into / out of an activated item */\n const activate = (hit: ShapeHover) => {\n if (options.type !== \"sunburst\" || options.drill === false || !scene)\n return;\n const item = scene.items.find((it) => it.index === hit.index);\n if (item?.drill) drill(item.drill);\n };\n\n // -------------------------------------------------------- interaction\n\n const local = (event: { clientX: number; clientY: number }) => {\n const rect = dom.stage.getBoundingClientRect();\n return { x: event.clientX - rect.left, y: event.clientY - rect.top };\n };\n\n const hitAt = (x: number, y: number) =>\n scene ? hitTestShapes(scene, x, y, hover?.hover ?? null) : null;\n\n const onPointerMove = (event: PointerEvent) => {\n const { x, y } = local(event);\n if (press && press.id === event.pointerId) {\n if (Math.hypot(x - press.x, y - press.y) > TAP_SLOP) press.moved = true;\n if (press.touch) return;\n } else if (event.pointerType === \"touch\") return;\n setHover(hitAt(x, y), x, y, false);\n };\n\n const onPointerDown = (event: PointerEvent) => {\n const { x, y } = local(event);\n press = {\n x,\n y,\n id: event.pointerId,\n touch: event.pointerType === \"touch\",\n moved: false,\n };\n };\n\n const onPointerUp = (event: PointerEvent) => {\n const p = press;\n press = null;\n if (!p || p.id !== event.pointerId || p.moved) {\n updateTooltip();\n return;\n }\n const { x, y } = local(event);\n const hit = hitAt(x, y);\n // a tap shows the tooltip (there is no hover on touch screens)\n setHover(hit, x, y, false);\n if (hit && scene) {\n const e = hoverEvent(scene, hit);\n if (e) emit(\"click\", e);\n activate(hit);\n }\n };\n\n const onPointerCancel = () => {\n press = null;\n updateTooltip();\n };\n\n const onPointerLeave = (event: PointerEvent) => {\n if (event.pointerType === \"touch\") return;\n press = null;\n if (hover && !hover.keyboard) setHover(null, 0, 0, false);\n };\n\n const focusItem = (next: ShapeHover | null) => {\n if (!scene || !next) return;\n const anchor = hoverAnchor(scene, next) ?? { x: 0, y: 0 };\n setHover(next, anchor.x, anchor.y, true);\n dom.live.textContent = describeItem(scene, next);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (!scene) return;\n const current = hover?.hover ?? null;\n const keys: Record<string, \"next\" | \"prev\" | \"up\" | \"down\"> = {\n ArrowRight: \"next\",\n ArrowLeft: \"prev\",\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n };\n const direction = keys[event.key];\n if (direction) {\n event.preventDefault();\n focusItem(stepHover(scene, current, direction));\n return;\n }\n switch (event.key) {\n case \"Home\":\n case \"End\": {\n const items = scene.items;\n if (!items.length) return;\n event.preventDefault();\n const it = event.key === \"Home\" ? items[0] : items[items.length - 1];\n focusItem(\n scene.type === \"radar\"\n ? { index: it.index, indicator: current?.indicator ?? 0 }\n : { index: it.index },\n );\n break;\n }\n case \"Enter\":\n case \" \": {\n if (!current) return;\n const e = hoverEvent(scene, current);\n if (!e) return;\n event.preventDefault();\n emit(\"click\", e);\n activate(current);\n break;\n }\n case \"Backspace\": {\n if (options.type !== \"sunburst\" || options.drill === false) return;\n const path = runtime.drillPath();\n if (!path.length) return;\n event.preventDefault();\n drill(path.slice(0, -1));\n break;\n }\n case \"Escape\":\n if (hover) {\n event.preventDefault();\n setHover(null, 0, 0, false);\n }\n break;\n default:\n break;\n }\n };\n\n const onFocus = () => {\n let visible: boolean;\n try {\n visible = dom.stage.matches(\":focus-visible\");\n } catch {\n visible = true;\n }\n // inset, like an outline drawn inside the stage edge: the drawing keeps a\n // padding, so the ring never covers labels or leader lines\n if (visible)\n dom.stage.style.boxShadow =\n \"inset 0 0 0 2px var(--primary-color, #4f46e5)\";\n };\n\n const onBlur = () => {\n dom.stage.style.boxShadow = \"\";\n if (hover?.keyboard) setHover(null, 0, 0, false);\n };\n\n const stage = dom.stage;\n stage.addEventListener(\"pointermove\", onPointerMove);\n stage.addEventListener(\"pointerdown\", onPointerDown);\n stage.addEventListener(\"pointerup\", onPointerUp);\n stage.addEventListener(\"pointercancel\", onPointerCancel);\n stage.addEventListener(\"pointerleave\", onPointerLeave);\n stage.addEventListener(\"keydown\", onKeyDown);\n stage.addEventListener(\"focus\", onFocus);\n stage.addEventListener(\"blur\", onBlur);\n\n const resizeObserver =\n typeof ResizeObserver === \"function\"\n ? new ResizeObserver(() => schedule())\n : null;\n resizeObserver?.observe(dom.stage);\n\n const refreshTheme = () => {\n if (destroyed) return;\n theme = readTheme(dom.root, options.palette);\n renderLegend();\n tipKey = \"\";\n schedule();\n };\n const unwatchTheme = watchTheme(refreshTheme);\n\n // ------------------------------------------------------------- renderer\n\n const applyBackend = (next: VectorRenderer | null) => {\n if (vector) {\n vector.destroy();\n vector.canvas.remove();\n }\n vector = next;\n backend = next?.kind ?? \"canvas2d\";\n dom.root.dataset.renderer = backend;\n if (next) dom.stage.insertBefore(next.canvas, dom.foreground);\n canvas.style.display = next ? \"none\" : \"\";\n dom.foreground.style.display = next ? \"\" : \"none\";\n if (!next) {\n const t = textCtx();\n t?.setTransform(1, 0, 0, 1, 0, 0);\n t?.clearRect(0, 0, dom.foreground.width, dom.foreground.height);\n }\n schedule();\n };\n\n /**\n * Starts the GPU backend (WebGPU, then WebGL2 / WebGL, like the other\n * charts); the first frames are drawn with Canvas2D meanwhile\n */\n const initRenderer = async (exclude: Set<ChartRendererKind> = new Set()) => {\n const token = ++rendererToken;\n const next = await createVectorRenderer(\n options.renderer,\n () => createDataCanvas(doc),\n (kind) => {\n if (destroyed || vector?.kind !== kind) return;\n void initRenderer(new Set([...exclude, kind]));\n },\n exclude,\n );\n if (destroyed || token !== rendererToken) {\n next?.destroy();\n return;\n }\n applyBackend(next);\n };\n void initRenderer();\n const unfollowDefault = followDefaultRenderer(\n () => options.renderer,\n () => void initRenderer(),\n );\n\n renderLegend();\n updateAccessibility();\n render();\n\n return {\n setOptions(next) {\n if (destroyed) return;\n const previous = options;\n options = next;\n runtime.setOptions(next);\n if ((next.palette ?? []).join() !== (previous.palette ?? []).join())\n theme = readTheme(dom.root, next.palette);\n if (next.type !== previous.type && hover) setHover(null, 0, 0, false);\n if ((next.renderer ?? \"auto\") !== (previous.renderer ?? \"auto\"))\n void initRenderer();\n renderLegend();\n updateAccessibility();\n tipKey = \"\";\n schedule();\n },\n resize() {\n if (destroyed) return;\n cancelFrame();\n render();\n },\n refreshTheme,\n toggle,\n getHidden: () => runtime.hiddenIndexes(),\n drill,\n getDrillPath: () => runtime.drillPath(),\n getRenderer: () => backend,\n on(type, listener) {\n listeners[type].add(listener);\n return () => {\n listeners[type].delete(listener);\n };\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n cancelFrame();\n stage.removeEventListener(\"pointermove\", onPointerMove);\n stage.removeEventListener(\"pointerdown\", onPointerDown);\n stage.removeEventListener(\"pointerup\", onPointerUp);\n stage.removeEventListener(\"pointercancel\", onPointerCancel);\n stage.removeEventListener(\"pointerleave\", onPointerLeave);\n stage.removeEventListener(\"keydown\", onKeyDown);\n stage.removeEventListener(\"focus\", onFocus);\n stage.removeEventListener(\"blur\", onBlur);\n resizeObserver?.disconnect();\n unwatchTheme();\n unfollowDefault();\n rendererToken++;\n vector?.destroy();\n vector = null;\n listeners.hover.clear();\n listeners.click.clear();\n listeners.toggle.clear();\n listeners.drill.clear();\n dom.root.remove();\n },\n };\n};\n"],"mappings":"oUA4CA,IAAMkC,EAAW,EAEbC,GAAM,EAeGC,GACX,EACA,IACuB,CACvB,IAAMC,EAAMC,EAAU,cAChBC,EAAMF,EAAI,YACVG,EAAMxC,EAAAA,eAAesC,CAAS,EACpCE,EAAI,KAAK,UAAU,IAAI,qBAAqB,EAC5C,EAAI,WAAW,MAAM,QAAU,OAC/B,EAAI,MAAM,MAAM,QAAU,OAC1B,IAAMC,EAASD,EAAI,WACfE,EAAuC,KAC3C,GAAI,CACF,EAAMD,EAAO,WAAW,IAAI,CAC9B,MAAQ,CACN,EAAM,IACR,CAEA,IAAME,EAAU1C,EAAAA,mBAAmB2C,CAAO,EACtCC,EAAUD,E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K,GAC/DE,EAAK,UAAY,WAAayD,EAAS,UAAY,SACtDL,EAAkB,EACpBvC,EAAa,EACbQ,EAAoB,EACpB,EAAS,GACT7C,EAAS,CACX,EACA,QAAS,CACHd,IACJa,EAAY,EACZE,EAAO,EACT,EACA,gBACA,SACA,cAAiB5B,EAAQ,cAAc,EACvC,QACA,iBAAoBA,EAAQ,UAAU,EACtC,gBAAmBI,EACnB,GAAG,EAAM,EAAU,CAEjB,OADAa,EAAUG,EAAK,CAAC,IAAID,CAAQ,MACf,CACXF,EAAUG,EAAK,CAAC,OAAOD,CAAQ,CACjC,CACF,EACA,SAAU,CACJN,IACJ,EAAY,GACZa,EAAY,EACZqB,EAAM,oBAAoB,cAAeoC,CAAa,EACtDpC,EAAM,oBAAoB,cAAeqC,EAAa,EACtDrC,EAAM,oBAAoB,YAAasC,EAAW,EAClDtC,EAAM,oBAAoB,gBAAiBwC,EAAe,EAC1DxC,EAAM,oBAAoB,eAAgByC,EAAc,EACxDzC,EAAM,oBAAoB,UAAW2C,EAAS,EAC9C3C,EAAM,oBAAoB,QAASgD,EAAO,EAC1ChD,EAAM,oBAAoB,OAAQkD,EAAM,EACxCC,IAAgB,WAAW,EAC3BE,GAAa,EACbO,GAAgB,EAChB,IACAxG,GAAQ,QAAQ,EAChB,EAAS,KACTc,EAAU,MAAM,MAAM,EACtBA,EAAU,MAAM,MAAM,EACtBA,EAAU,OAAO,MAAM,EACvBA,EAAU,MAAM,MAAM,EACtBpB,EAAI,KAAK,OAAO,EAClB,CACF,CACF"}
@@ -1,7 +1,8 @@
1
1
  import { ShapeChartInstance, ShapeChartOptions } from './types.cjs';
2
2
  /**
3
3
  * Creates a pie / donut, radar, gauge, funnel, treemap, sankey, sunburst,
4
- * radial bar, calendar heatmap or bullet chart in `container` (drawn with
5
- * Canvas2D, themed by the Minerva CSS variables).
4
+ * radial bar, calendar heatmap, bullet or chord chart in `container` (drawn
5
+ * on the GPU when available, else with Canvas2D; themed by the Minerva CSS
6
+ * variables).
6
7
  */
7
8
  export declare const createShapeChart: (container: HTMLElement, initial: ShapeChartOptions) => ShapeChartInstance;
@@ -1,7 +1,8 @@
1
1
  import { ShapeChartInstance, ShapeChartOptions } from './types.js';
2
2
  /**
3
3
  * Creates a pie / donut, radar, gauge, funnel, treemap, sankey, sunburst,
4
- * radial bar, calendar heatmap or bullet chart in `container` (drawn with
5
- * Canvas2D, themed by the Minerva CSS variables).
4
+ * radial bar, calendar heatmap, bullet or chord chart in `container` (drawn
5
+ * on the GPU when available, else with Canvas2D; themed by the Minerva CSS
6
+ * variables).
6
7
  */
7
8
  export declare const createShapeChart: (container: HTMLElement, initial: ShapeChartOptions) => ShapeChartInstance;