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