@lincyaw/aegis-ui 0.8.0 → 0.9.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 (118) hide show
  1. package/dist/components/ui/AgentHud.cjs +2 -0
  2. package/dist/components/ui/AgentHud.cjs.map +1 -0
  3. package/dist/components/ui/AgentHud.d.ts +23 -0
  4. package/dist/components/ui/AgentHud.js +45 -0
  5. package/dist/components/ui/AgentHud.js.map +1 -0
  6. package/dist/components/ui/ChartLegend.cjs +1 -1
  7. package/dist/components/ui/ChartLegend.cjs.map +1 -1
  8. package/dist/components/ui/ChartLegend.d.ts +2 -0
  9. package/dist/components/ui/ChartLegend.js +11 -10
  10. package/dist/components/ui/ChartLegend.js.map +1 -1
  11. package/dist/components/ui/ColumnChart.cjs +2 -0
  12. package/dist/components/ui/ColumnChart.cjs.map +1 -0
  13. package/dist/components/ui/ColumnChart.d.ts +46 -0
  14. package/dist/components/ui/ColumnChart.js +154 -0
  15. package/dist/components/ui/ColumnChart.js.map +1 -0
  16. package/dist/components/ui/DotRangeChart.cjs +2 -0
  17. package/dist/components/ui/DotRangeChart.cjs.map +1 -0
  18. package/dist/components/ui/DotRangeChart.d.ts +44 -0
  19. package/dist/components/ui/DotRangeChart.js +80 -0
  20. package/dist/components/ui/DotRangeChart.js.map +1 -0
  21. package/dist/components/ui/HeadlineStat.cjs +2 -0
  22. package/dist/components/ui/HeadlineStat.cjs.map +1 -0
  23. package/dist/components/ui/HeadlineStat.d.ts +10 -0
  24. package/dist/components/ui/HeadlineStat.js +22 -0
  25. package/dist/components/ui/HeadlineStat.js.map +1 -0
  26. package/dist/components/ui/Heatmap.cjs +2 -0
  27. package/dist/components/ui/Heatmap.cjs.map +1 -0
  28. package/dist/components/ui/Heatmap.d.ts +52 -0
  29. package/dist/components/ui/Heatmap.js +82 -0
  30. package/dist/components/ui/Heatmap.js.map +1 -0
  31. package/dist/components/ui/KeyMomentCard.cjs +2 -0
  32. package/dist/components/ui/KeyMomentCard.cjs.map +1 -0
  33. package/dist/components/ui/KeyMomentCard.d.ts +19 -0
  34. package/dist/components/ui/KeyMomentCard.js +45 -0
  35. package/dist/components/ui/KeyMomentCard.js.map +1 -0
  36. package/dist/components/ui/LineChart.cjs +2 -0
  37. package/dist/components/ui/LineChart.cjs.map +1 -0
  38. package/dist/components/ui/LineChart.d.ts +48 -0
  39. package/dist/components/ui/LineChart.js +199 -0
  40. package/dist/components/ui/LineChart.js.map +1 -0
  41. package/dist/components/ui/ParetoChart.cjs +1 -1
  42. package/dist/components/ui/ParetoChart.cjs.map +1 -1
  43. package/dist/components/ui/ParetoChart.d.ts +34 -2
  44. package/dist/components/ui/ParetoChart.js +250 -173
  45. package/dist/components/ui/ParetoChart.js.map +1 -1
  46. package/dist/components/ui/RankBar.cjs +1 -1
  47. package/dist/components/ui/RankBar.cjs.map +1 -1
  48. package/dist/components/ui/RankBar.d.ts +7 -3
  49. package/dist/components/ui/RankBar.js +64 -45
  50. package/dist/components/ui/RankBar.js.map +1 -1
  51. package/dist/components/ui/ReplayStepStrip.cjs +1 -1
  52. package/dist/components/ui/ReplayStepStrip.cjs.map +1 -1
  53. package/dist/components/ui/ReplayStepStrip.d.ts +13 -1
  54. package/dist/components/ui/ReplayStepStrip.js +99 -76
  55. package/dist/components/ui/ReplayStepStrip.js.map +1 -1
  56. package/dist/components/ui/ResultMatrix.cjs +2 -0
  57. package/dist/components/ui/ResultMatrix.cjs.map +1 -0
  58. package/dist/components/ui/ResultMatrix.d.ts +23 -0
  59. package/dist/components/ui/ResultMatrix.js +53 -0
  60. package/dist/components/ui/ResultMatrix.js.map +1 -0
  61. package/dist/components/ui/ScrollStory.cjs +2 -2
  62. package/dist/components/ui/ScrollStory.cjs.map +1 -1
  63. package/dist/components/ui/ScrollStory.d.ts +3 -1
  64. package/dist/components/ui/ScrollStory.js +34 -32
  65. package/dist/components/ui/ScrollStory.js.map +1 -1
  66. package/dist/components/ui/SeriesLabel.cjs +2 -0
  67. package/dist/components/ui/SeriesLabel.cjs.map +1 -0
  68. package/dist/components/ui/SeriesLabel.d.ts +21 -0
  69. package/dist/components/ui/SeriesLabel.js +38 -0
  70. package/dist/components/ui/SeriesLabel.js.map +1 -0
  71. package/dist/components/ui/StackedBar.cjs +1 -1
  72. package/dist/components/ui/StackedBar.cjs.map +1 -1
  73. package/dist/components/ui/StackedBar.d.ts +13 -1
  74. package/dist/components/ui/StackedBar.js +95 -74
  75. package/dist/components/ui/StackedBar.js.map +1 -1
  76. package/dist/components/ui/TableOfContents.cjs +1 -1
  77. package/dist/components/ui/TableOfContents.cjs.map +1 -1
  78. package/dist/components/ui/TableOfContents.js +31 -89
  79. package/dist/components/ui/TableOfContents.js.map +1 -1
  80. package/dist/components/ui/ThoughtCard.cjs +2 -0
  81. package/dist/components/ui/ThoughtCard.cjs.map +1 -0
  82. package/dist/components/ui/ThoughtCard.d.ts +23 -0
  83. package/dist/components/ui/ThoughtCard.js +55 -0
  84. package/dist/components/ui/ThoughtCard.js.map +1 -0
  85. package/dist/components/ui/index.d.ts +20 -0
  86. package/dist/hooks/index.d.ts +1 -0
  87. package/dist/hooks/useSectionSpy.cjs +2 -0
  88. package/dist/hooks/useSectionSpy.cjs.map +1 -0
  89. package/dist/hooks/useSectionSpy.d.ts +23 -0
  90. package/dist/hooks/useSectionSpy.js +78 -0
  91. package/dist/hooks/useSectionSpy.js.map +1 -0
  92. package/dist/index.cjs +1 -1
  93. package/dist/index.d.ts +4 -4
  94. package/dist/index.js +337 -310
  95. package/dist/index.js.map +1 -1
  96. package/dist/layouts/site/SiteAnchorNav.cjs +2 -0
  97. package/dist/layouts/site/SiteAnchorNav.cjs.map +1 -0
  98. package/dist/layouts/site/SiteAnchorNav.d.ts +22 -0
  99. package/dist/layouts/site/SiteAnchorNav.js +51 -0
  100. package/dist/layouts/site/SiteAnchorNav.js.map +1 -0
  101. package/dist/layouts/site/SiteSectionHeader.cjs +2 -0
  102. package/dist/layouts/site/SiteSectionHeader.cjs.map +1 -0
  103. package/dist/layouts/site/SiteSectionHeader.d.ts +20 -0
  104. package/dist/layouts/site/SiteSectionHeader.js +30 -0
  105. package/dist/layouts/site/SiteSectionHeader.js.map +1 -0
  106. package/dist/layouts/site/index.d.ts +4 -0
  107. package/dist/lib/chart.cjs +1 -1
  108. package/dist/lib/chart.cjs.map +1 -1
  109. package/dist/lib/chart.d.ts +8 -2
  110. package/dist/lib/chart.js +20 -16
  111. package/dist/lib/chart.js.map +1 -1
  112. package/dist/locale/strings.cjs +1 -1
  113. package/dist/locale/strings.cjs.map +1 -1
  114. package/dist/locale/strings.d.ts +2 -0
  115. package/dist/locale/strings.js +2 -0
  116. package/dist/locale/strings.js.map +1 -1
  117. package/dist/style.css +1 -1
  118. package/package.json +1 -1
@@ -1,292 +1,369 @@
1
- import { jsx as r, jsxs as K } from "react/jsx-runtime";
2
- import { useRef as Z, useMemo as ee } from "react";
3
- import { useElementWidth as te } from "../../hooks/useElementWidth.js";
4
- import { zeroAnchoredDomain as X, staggeredProgress as z, chartColorValue as re } from "../../lib/chart.js";
5
- import { ChartLegend as ae } from "./ChartLegend.js";
6
- import { EmptyState as oe } from "./EmptyState.js";
1
+ import { jsx as o, jsxs as me } from "react/jsx-runtime";
2
+ import { useId as ke, useRef as Ae, useMemo as Le } from "react";
3
+ import { useElementWidth as Ne } from "../../hooks/useElementWidth.js";
4
+ import { zeroAnchoredDomain as xe, staggeredProgress as Z, chartColorValue as Ee } from "../../lib/chart.js";
5
+ import { ChartLegend as Ie } from "./ChartLegend.js";
6
+ import { EmptyState as we } from "./EmptyState.js";
7
7
  /* empty css */
8
- import { useStrings as se } from "../../locale/useStrings.js";
9
- const ie = 320, F = 220, le = 56, ne = 16, ce = 28, ge = 44, me = 5, i = 8, U = 4;
10
- function N(a, d, f) {
11
- return f === "lower" ? a < d : a > d;
8
+ import { useStrings as Me } from "../../locale/useStrings.js";
9
+ const Pe = 320, de = 220, Be = 56, $e = 16, He = 28, Se = 44, B = 5, $ = 8, he = 4, Ce = 6.2, Re = 11, X = 14, Te = 520;
10
+ function K(r, m, i) {
11
+ return i === "lower" ? r < m : r > m;
12
12
  }
13
- function ve({
14
- points: a,
15
- xLabel: d,
16
- yLabel: f,
17
- xDirection: k = "lower",
18
- yDirection: A = "higher",
19
- formatX: B = String,
20
- formatY: L = String,
13
+ function je(r) {
14
+ return [...r].reduce(
15
+ (m, i) => m + ((i.codePointAt(0) ?? 0) > 255 ? Re : Ce),
16
+ 0
17
+ );
18
+ }
19
+ function De(r, m, i) {
20
+ const b = [], u = /* @__PURE__ */ new Map(), v = B + $ / 2;
21
+ for (const s of r) {
22
+ const h = je(s.label), k = [
23
+ { x: s.x + v, y: s.y + X / 3, anchor: "start" },
24
+ { x: s.x - v, y: s.y + X / 3, anchor: "end" },
25
+ { x: s.x - h / 2, y: s.y - v, anchor: "start" },
26
+ { x: s.x - h / 2, y: s.y + v + X, anchor: "start" }
27
+ ], A = (y) => {
28
+ const g = y.anchor === "end" ? y.x - h : y.x;
29
+ return {
30
+ l: g,
31
+ r: g + h,
32
+ t: y.y - X,
33
+ b: y.y
34
+ };
35
+ }, L = (y) => {
36
+ const { l: g, r: _, t: n, b: E } = A(y);
37
+ return g >= i.left && _ <= i.right && n >= i.top && E <= i.bottom;
38
+ }, H = (y) => {
39
+ const { l: g, r: _, t: n, b: E } = A(y);
40
+ return L(y) && b.every(
41
+ (c) => _ < c.l || g > c.r || E < c.t || n > c.b
42
+ ) && m.every(
43
+ (c) => c.key === s.key || c.x + B < g || c.x - B > _ || c.y + B < n || c.y - B > E
44
+ );
45
+ }, N = k.find(H) ?? k.find(L) ?? k[s.x > (i.left + i.right) / 2 ? 1 : 0];
46
+ b.push(A(N)), u.set(s.key, N);
47
+ }
48
+ return u;
49
+ }
50
+ function Fe({
51
+ points: r,
52
+ xLabel: m,
53
+ yLabel: i,
54
+ xDirection: b = "lower",
55
+ yDirection: u = "higher",
56
+ formatX: v = String,
57
+ formatY: s = String,
58
+ xScale: h = "linear",
59
+ xDomain: k,
60
+ yDomain: A,
61
+ xTicks: L,
62
+ yTicks: H,
63
+ labels: N = "front",
64
+ fadeDominated: y = !0,
65
+ highlightKeys: g,
66
+ maxHeight: _ = Pe,
21
67
  onSelect: n,
22
- legend: b,
23
- empty: S,
24
- emptyTitle: V,
25
- emptyDescription: W,
26
- progress: h,
27
- className: Y
68
+ legend: E,
69
+ empty: c,
70
+ emptyTitle: _e,
71
+ emptyDescription: fe,
72
+ progress: f,
73
+ frontProgress: ee,
74
+ className: pe
28
75
  }) {
29
- const j = se(), u = Z(null), y = te(u), P = [
76
+ const te = Me(), re = ke(), j = Ae(null), p = Ne(j), V = [
30
77
  "aegis-pareto",
31
- h === void 0 ? "" : "aegis-pareto--scroll",
32
- Y ?? ""
33
- ].filter(Boolean).join(" "), c = ee(() => {
34
- if (a.length === 0 || y === 0)
78
+ f === void 0 && ee === void 0 ? "" : "aegis-pareto--scroll",
79
+ pe ?? ""
80
+ ].filter(Boolean).join(" "), x = Le(() => {
81
+ if (r.length === 0 || p === 0)
35
82
  return null;
36
83
  const e = Math.round(
37
- Math.min(ie, Math.max(F, y / 2))
38
- ), [s, g] = X(a.map((t) => t.x)), [m, I] = X(a.map((t) => t.y)), M = le, C = y - ne, D = ce, $ = e - ge, v = (t) => M + (t - s) / (g - s) * (C - M), G = (t) => $ - (t - m) / (I - m) * ($ - D), O = a.filter(
39
- (t) => !a.some(
40
- (o) => o.key !== t.key && (N(o.x, t.x, k) || o.x === t.x) && (N(o.y, t.y, A) || o.y === t.y) && (N(o.x, t.x, k) || N(o.y, t.y, A))
84
+ Math.min(_, Math.max(de, p / 2))
85
+ ), a = r.map((t) => t.x), P = Math.min(...a), G = Math.max(...a), [F, ie] = k ?? (h === "log" ? (
86
+ // One value has no span to divide, so it sits mid-axis.
87
+ [
88
+ G > P ? P : P / 2,
89
+ G > P ? G : G * 2
90
+ ]
91
+ ) : xe(a)), [R, U] = A ?? xe(r.map((t) => t.y)), O = h === "log" ? Math.log10 : (t) => t, T = Be, q = p - $e, ce = He, J = e - Se, W = (t) => T + (O(t) - O(F)) / (O(ie) - O(F)) * (q - T), Q = (t) => J - (t - R) / (U - R) * (J - ce), ye = r.filter(
92
+ (t) => !r.some(
93
+ (l) => l.key !== t.key && (K(l.x, t.x, b) || l.x === t.x) && (K(l.y, t.y, u) || l.y === t.y) && (K(l.x, t.x, b) || K(l.y, t.y, u))
41
94
  )
42
- ).sort((t, o) => t.x - o.x), R = Array.from(
43
- { length: U },
44
- (t, o) => (o + 1) / U
45
- ), Q = new Map(
46
- [...a].sort((t, o) => v(t.x) - v(o.x)).map((t, o) => [t.key, o])
95
+ ).sort((t, l) => t.x - l.x), ge = Array.from(
96
+ { length: he },
97
+ (t, l) => (l + 1) / he
98
+ ), ve = new Map(
99
+ [...r].sort((t, l) => W(t.x) - W(l.x)).map((t, l) => [t.key, l])
47
100
  );
48
101
  return {
49
102
  height: e,
50
- order: Q,
51
- left: M,
52
- right: C,
53
- top: D,
54
- bottom: $,
55
- sx: v,
56
- sy: G,
57
- front: O,
58
- frontKeys: new Set(O.map((t) => t.key)),
59
- gridX: R.map((t) => v(s + (g - s) * t)),
60
- gridY: R.map((t) => G(m + (I - m) * t)),
61
- xLo: s,
62
- xHi: g,
63
- yLo: m,
64
- yHi: I
103
+ order: ve,
104
+ left: T,
105
+ right: q,
106
+ top: ce,
107
+ bottom: J,
108
+ sx: W,
109
+ sy: Q,
110
+ front: ye,
111
+ frontKeys: new Set(ye.map((t) => t.key)),
112
+ // Even shares of the plot, which on a log axis are even ratios.
113
+ gridX: L?.map(W) ?? ge.map((t) => T + (q - T) * t),
114
+ gridY: H?.map(Q) ?? ge.map((t) => Q(R + (U - R) * t)),
115
+ xLabels: L ?? [F, ie],
116
+ yLabels: H ?? [R, U]
65
117
  };
66
- }, [a, y, k, A]);
67
- if (a.length === 0)
68
- return /* @__PURE__ */ r("div", { ref: u, className: P, children: S === void 0 ? /* @__PURE__ */ r(
69
- oe,
118
+ }, [
119
+ r,
120
+ p,
121
+ b,
122
+ u,
123
+ h,
124
+ k,
125
+ A,
126
+ L,
127
+ H,
128
+ _
129
+ ]);
130
+ if (r.length === 0)
131
+ return /* @__PURE__ */ o("div", { ref: j, className: V, children: c === void 0 ? /* @__PURE__ */ o(
132
+ we,
70
133
  {
71
- title: V ?? j.paretoEmptyTitle,
72
- description: W
134
+ title: _e ?? te.paretoEmptyTitle,
135
+ description: fe
73
136
  }
74
- ) : /* @__PURE__ */ r(
137
+ ) : /* @__PURE__ */ o(
75
138
  "div",
76
139
  {
77
140
  className: "aegis-pareto__empty",
78
141
  style: {
79
- "--aegis-pareto-min-height": `${F.toString()}px`
142
+ "--aegis-pareto-min-height": `${de.toString()}px`
80
143
  },
81
- children: S
144
+ children: c
82
145
  }
83
146
  ) });
84
- if (!c)
85
- return /* @__PURE__ */ r("div", { ref: u, className: P });
86
- const { height: T, left: l, right: _, top: p, bottom: x, sx: E, sy: H, front: w, frontKeys: q } = c, J = (e, s) => {
87
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n?.(s));
147
+ if (!x)
148
+ return /* @__PURE__ */ o("div", { ref: j, className: V });
149
+ const { height: D, left: d, right: I, top: Y, bottom: w, sx: M, sy: S, front: oe, frontKeys: ae } = x, z = g === void 0 ? null : new Set(g), le = (e) => z !== null && !z.has(e), se = N === "all" && p >= Te, be = De(
150
+ r.filter(
151
+ (e) => se || ae.has(e.key) || (z?.has(e.key) ?? !1)
152
+ ).map((e) => ({
153
+ key: e.key,
154
+ label: e.label,
155
+ x: M(e.x),
156
+ y: S(e.y)
157
+ })),
158
+ r.map((e) => ({
159
+ key: e.key,
160
+ x: M(e.x),
161
+ y: S(e.y)
162
+ })),
163
+ // A label may run up into the space above the plot.
164
+ { left: d, right: I, top: 0, bottom: w }
165
+ ), ne = E?.map((e) => ({
166
+ key: e.key,
167
+ label: e.label,
168
+ color: e.color ?? "var(--bg-inverted)"
169
+ })) ?? (N === "all" && !se ? r.map((e) => ({
170
+ key: e.key,
171
+ label: e.label,
172
+ color: e.color ?? "var(--bg-inverted)"
173
+ })) : []), C = ee ?? (f === void 0 ? void 0 : Z(f, r.length, r.length + 1)), ue = (e, a) => {
174
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n?.(a));
88
175
  };
89
- return /* @__PURE__ */ K("div", { ref: u, className: P, children: [
90
- /* @__PURE__ */ K(
176
+ return /* @__PURE__ */ me("div", { ref: j, className: V, children: [
177
+ /* @__PURE__ */ me(
91
178
  "svg",
92
179
  {
93
180
  className: "aegis-pareto__svg",
94
- width: y,
95
- height: T,
96
- viewBox: `0 0 ${y.toString()} ${T.toString()}`,
181
+ width: p,
182
+ height: D,
183
+ viewBox: `0 0 ${p.toString()} ${D.toString()}`,
97
184
  role: n ? "group" : "img",
98
- "aria-label": j.paretoChartLabel(d, f),
185
+ "aria-label": te.paretoChartLabel(m, i),
99
186
  style: {
100
- "--aegis-pareto-count": a.length,
101
- ...h === void 0 ? {} : {
102
- "--aegis-pareto-front-progress": z(
103
- h,
104
- a.length,
105
- a.length + 1
106
- )
107
- }
187
+ "--aegis-pareto-count": r.length,
188
+ ...C === void 0 ? {} : { "--aegis-pareto-front-progress": C }
108
189
  },
109
190
  children: [
110
- c.gridY.map((e) => /* @__PURE__ */ r(
191
+ x.gridY.map((e) => /* @__PURE__ */ o(
111
192
  "line",
112
193
  {
113
194
  className: "aegis-pareto__grid",
114
- x1: l,
195
+ x1: d,
115
196
  y1: e,
116
- x2: _,
197
+ x2: I,
117
198
  y2: e
118
199
  },
119
200
  `gy-${e.toString()}`
120
201
  )),
121
- c.gridX.map((e) => /* @__PURE__ */ r(
202
+ x.gridX.map((e) => /* @__PURE__ */ o(
122
203
  "line",
123
204
  {
124
205
  className: "aegis-pareto__grid",
125
206
  x1: e,
126
- y1: p,
207
+ y1: Y,
127
208
  x2: e,
128
- y2: x
209
+ y2: w
129
210
  },
130
211
  `gx-${e.toString()}`
131
212
  )),
132
- /* @__PURE__ */ r(
213
+ /* @__PURE__ */ o(
133
214
  "line",
134
215
  {
135
216
  className: "aegis-pareto__axis",
136
- x1: l,
137
- y1: x,
138
- x2: _,
139
- y2: x
217
+ x1: d,
218
+ y1: w,
219
+ x2: I,
220
+ y2: w
140
221
  }
141
222
  ),
142
- /* @__PURE__ */ r(
223
+ /* @__PURE__ */ o(
143
224
  "line",
144
225
  {
145
226
  className: "aegis-pareto__axis",
146
- x1: l,
147
- y1: p,
148
- x2: l,
149
- y2: x
227
+ x1: d,
228
+ y1: Y,
229
+ x2: d,
230
+ y2: w
150
231
  }
151
232
  ),
152
- w.length > 1 && /* @__PURE__ */ r(
233
+ C !== void 0 && /* @__PURE__ */ o("clipPath", { id: re, children: /* @__PURE__ */ o(
234
+ "rect",
235
+ {
236
+ x: d,
237
+ y: 0,
238
+ width: (I - d) * C,
239
+ height: D
240
+ }
241
+ ) }),
242
+ oe.length > 1 && /* @__PURE__ */ o(
153
243
  "polyline",
154
244
  {
155
245
  className: "aegis-pareto__front",
156
- points: w.map(
157
- (e) => `${E(e.x).toString()},${H(e.y).toString()}`
246
+ clipPath: C === void 0 ? void 0 : `url(#${re})`,
247
+ points: oe.map(
248
+ (e) => `${M(e.x).toString()},${S(e.y).toString()}`
158
249
  ).join(" ")
159
250
  }
160
251
  ),
161
- a.map((e, s) => /* @__PURE__ */ r(
252
+ r.map((e, a) => /* @__PURE__ */ o(
162
253
  "circle",
163
254
  {
164
255
  className: [
165
256
  "aegis-pareto__point",
166
- q.has(e.key) ? "" : "aegis-pareto__point--dominated",
257
+ y && !ae.has(e.key) ? "aegis-pareto__point--dominated" : "",
258
+ le(e.key) ? "aegis-pareto__point--dimmed" : "",
167
259
  n ? "aegis-pareto__point--interactive" : ""
168
260
  ].filter(Boolean).join(" "),
169
261
  style: {
170
- fill: e.color === void 0 ? void 0 : re(e.color),
171
- "--aegis-pareto-index": s,
172
- ...h === void 0 ? {} : {
173
- "--aegis-pareto-point-progress": z(
174
- h,
175
- c.order.get(e.key) ?? s,
176
- a.length + 1
177
- )
178
- }
262
+ fill: e.color === void 0 ? void 0 : Ee(e.color),
263
+ "--aegis-pareto-index": a,
264
+ "--aegis-pareto-point-progress": f === void 0 ? 1 : Z(
265
+ f,
266
+ x.order.get(e.key) ?? a,
267
+ r.length + 1
268
+ )
179
269
  },
180
- cx: E(e.x),
181
- cy: H(e.y),
182
- r: me,
270
+ cx: M(e.x),
271
+ cy: S(e.y),
272
+ r: B,
183
273
  role: n ? "button" : void 0,
184
274
  tabIndex: n ? 0 : void 0,
185
275
  "aria-label": n ? e.label : void 0,
186
276
  onClick: n ? () => {
187
277
  n(e.key);
188
278
  } : void 0,
189
- onKeyDown: n ? (g) => {
190
- J(g, e.key);
279
+ onKeyDown: n ? (P) => {
280
+ ue(P, e.key);
191
281
  } : void 0,
192
- children: /* @__PURE__ */ r("title", { children: e.label })
282
+ children: /* @__PURE__ */ o("title", { children: e.label })
193
283
  },
194
284
  e.key
195
285
  )),
196
- w.map((e) => {
197
- const s = E(e.x), g = H(e.y), m = s > l + (_ - l) * 0.7;
198
- return /* @__PURE__ */ r(
286
+ r.map((e) => {
287
+ const a = be.get(e.key);
288
+ return a === void 0 ? null : /* @__PURE__ */ o(
199
289
  "text",
200
290
  {
201
- className: "aegis-pareto__point-label",
202
- x: m ? s - i : s + i,
203
- y: g < p + i * 2 ? g + i * 2 : g - i,
204
- textAnchor: m ? "end" : "start",
291
+ className: [
292
+ "aegis-pareto__point-label",
293
+ le(e.key) ? "aegis-pareto__point-label--dimmed" : ""
294
+ ].filter(Boolean).join(" "),
295
+ style: N === "all" ? {
296
+ "--aegis-pareto-front-progress": f === void 0 ? 1 : Z(
297
+ f,
298
+ x.order.get(e.key) ?? 0,
299
+ r.length + 1
300
+ )
301
+ } : void 0,
302
+ x: a.x,
303
+ y: a.y,
304
+ textAnchor: a.anchor,
205
305
  children: e.label
206
306
  },
207
307
  `label-${e.key}`
208
308
  );
209
309
  }),
210
- /* @__PURE__ */ r(
211
- "text",
212
- {
213
- className: "aegis-pareto__tick",
214
- x: l,
215
- y: x + i * 2,
216
- textAnchor: "middle",
217
- children: B(c.xLo)
218
- }
219
- ),
220
- /* @__PURE__ */ r(
310
+ x.xLabels.map((e, a) => /* @__PURE__ */ o(
221
311
  "text",
222
312
  {
223
313
  className: "aegis-pareto__tick",
224
- x: _,
225
- y: x + i * 2,
226
- textAnchor: "end",
227
- children: B(c.xHi)
228
- }
229
- ),
230
- /* @__PURE__ */ r(
231
- "text",
232
- {
233
- className: "aegis-pareto__tick",
234
- x: l - i,
235
- y: x,
236
- textAnchor: "end",
237
- dominantBaseline: "middle",
238
- children: L(c.yLo)
239
- }
240
- ),
241
- /* @__PURE__ */ r(
314
+ x: M(e),
315
+ y: w + $ * 2,
316
+ textAnchor: a === x.xLabels.length - 1 && M(e) >= I - 1 ? "end" : "middle",
317
+ children: v(e)
318
+ },
319
+ `x-${e.toString()}`
320
+ )),
321
+ x.yLabels.map((e) => /* @__PURE__ */ o(
242
322
  "text",
243
323
  {
244
324
  className: "aegis-pareto__tick",
245
- x: l - i,
246
- y: p,
325
+ x: d - $,
326
+ y: S(e),
247
327
  textAnchor: "end",
248
328
  dominantBaseline: "middle",
249
- children: L(c.yHi)
250
- }
251
- ),
252
- /* @__PURE__ */ r(
329
+ children: s(e)
330
+ },
331
+ `y-${e.toString()}`
332
+ )),
333
+ /* @__PURE__ */ o(
253
334
  "text",
254
335
  {
255
336
  className: "aegis-pareto__axis-label",
256
- x: _,
257
- y: T - i,
337
+ x: I,
338
+ y: D - $,
258
339
  textAnchor: "end",
259
- children: d
340
+ children: m
260
341
  }
261
342
  ),
262
- /* @__PURE__ */ r(
343
+ /* @__PURE__ */ o(
263
344
  "text",
264
345
  {
265
346
  className: "aegis-pareto__axis-label",
266
- x: l - i,
267
- y: p - i * 2,
347
+ x: d - $,
348
+ y: Y - $ * 2,
268
349
  textAnchor: "start",
269
- children: f
350
+ children: i
270
351
  }
271
352
  )
272
353
  ]
273
354
  }
274
355
  ),
275
- b !== void 0 && b.length > 0 ? /* @__PURE__ */ r(
276
- ae,
356
+ ne.length > 0 ? /* @__PURE__ */ o(
357
+ Ie,
277
358
  {
278
359
  className: "aegis-pareto__legend",
279
360
  shape: "dot",
280
- items: b.map((e) => ({
281
- key: e.key,
282
- label: e.label,
283
- color: e.color ?? "var(--bg-inverted)"
284
- }))
361
+ items: ne
285
362
  }
286
363
  ) : null
287
364
  ] });
288
365
  }
289
366
  export {
290
- ve as ParetoChart
367
+ Fe as ParetoChart
291
368
  };
292
369
  //# sourceMappingURL=ParetoChart.js.map