@embeddable.com/remarkable-ui 0.1.48 → 0.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BarChartDefaultHorizontalPro.js +3 -3
- package/dist/BarChartDefaultPro.js +3 -3
- package/dist/BarChartGroupedHorizontalPro.js +3 -3
- package/dist/BarChartGroupedPro.js +3 -3
- package/dist/BarChartStackedHorizontalPro.js +3 -3
- package/dist/BarChartStackedPro.js +3 -3
- package/dist/{ChartCard-CMgDz_bs.js → ChartCard-k190CXR0.js} +29 -29
- package/dist/{ChartCard-CMgDz_bs.js.map → ChartCard-k190CXR0.js.map} +1 -1
- package/dist/{ComparisonPeriod.type.emb-C1o3iM9L.js → ComparisonPeriod.type.emb-Dgl2VM4_.js} +2 -2
- package/dist/{ComparisonPeriod.type.emb-C1o3iM9L.js.map → ComparisonPeriod.type.emb-Dgl2VM4_.js.map} +1 -1
- package/dist/ComparisonPeriodSelectFieldPro.js +4 -4
- package/dist/DateRangeSelectFieldPro.js +2 -2
- package/dist/DonutChartPro.js +2 -2
- package/dist/DonutLabelChartPro.js +2 -2
- package/dist/{EditorCard-CJoUz4uM.js → EditorCard-BNBH4Y9F.js} +17 -17
- package/dist/{EditorCard-CJoUz4uM.js.map → EditorCard-BNBH4Y9F.js.map} +1 -1
- package/dist/HeatMap-ylrlKLQI.js +223 -0
- package/dist/HeatMap-ylrlKLQI.js.map +1 -0
- package/dist/HeatMapPro.js +138 -0
- package/dist/HeatMapPro.js.map +1 -0
- package/dist/{KpiChart-C6zepuhF.js → KpiChart-DJ5el66E.js} +16 -16
- package/dist/{KpiChart-C6zepuhF.js.map → KpiChart-DJ5el66E.js.map} +1 -1
- package/dist/KpiChartNumberComparisonPro.js +6 -6
- package/dist/KpiChartNumberPro.js +4 -4
- package/dist/LineChartComparisonDefaultPro.js +5 -5
- package/dist/LineChartDefaultPro.js +3 -3
- package/dist/LineChartGroupedPro.js +3 -3
- package/dist/MultiSelectFieldPro.js +2 -2
- package/dist/PieChartPro.js +2 -2
- package/dist/PivotTable-awuBNY8c.js +273 -0
- package/dist/PivotTable-awuBNY8c.js.map +1 -0
- package/dist/PivotTablePro.js +39 -39
- package/dist/PivotTablePro.js.map +1 -1
- package/dist/{SingleSelectField-CJNiLfee.js → SingleSelectField-CY0TwkyW.js} +3 -3
- package/dist/{SingleSelectField-CJNiLfee.js.map → SingleSelectField-CY0TwkyW.js.map} +1 -1
- package/dist/SingleSelectFieldPro.js +2 -2
- package/dist/TableChartPaginated.js +3 -3
- package/dist/{bars.utils-vXPRJDGQ.js → bars.utils-cZSSvRai.js} +4 -4
- package/dist/{bars.utils-vXPRJDGQ.js.map → bars.utils-cZSSvRai.js.map} +1 -1
- package/dist/{charts.utils-HfNL9dVl.js → charts.utils-LgE4AEAw.js} +4 -4
- package/dist/charts.utils-LgE4AEAw.js.map +1 -0
- package/dist/{component.constants-CFaxyNCw.js → component.constants-D0ea4CW4.js} +1363 -1357
- package/dist/{component.constants-CFaxyNCw.js.map → component.constants-D0ea4CW4.js.map} +1 -1
- package/dist/embeddable-components.json +12 -11
- package/dist/embeddable-lifecycle.js +1 -1
- package/dist/embeddable-theme-2b917.js +1 -1
- package/dist/{formatter.utils-Cu4uKJSZ.js → formatter.utils-DBUd3PfE.js} +2 -2
- package/dist/{formatter.utils-Cu4uKJSZ.js.map → formatter.utils-DBUd3PfE.js.map} +1 -1
- package/dist/{index-C4BiW71l.js → index-BGf7vP5k.js} +5 -5
- package/dist/{index-C4BiW71l.js.map → index-BGf7vP5k.js.map} +1 -1
- package/dist/{index-DW-LmiPi.js → index-BpujEeVe.js} +11 -11
- package/dist/{index-DW-LmiPi.js.map → index-BpujEeVe.js.map} +1 -1
- package/dist/{index-DvMr1tvf.js → index-C_G6mJoE.js} +4 -4
- package/dist/{index-DvMr1tvf.js.map → index-C_G6mJoE.js.map} +1 -1
- package/dist/{index-CxxeUDMD.js → index-DGb59RGF.js} +13 -13
- package/dist/{index-CxxeUDMD.js.map → index-DGb59RGF.js.map} +1 -1
- package/dist/{index-DvEWwlqq.js → index-D_TXLv5w.js} +30 -30
- package/dist/{index-DvEWwlqq.js.map → index-D_TXLv5w.js.map} +1 -1
- package/dist/{index-BAfVF5iP.js → index-DuWcnytb.js} +10 -10
- package/dist/{index-BAfVF5iP.js.map → index-DuWcnytb.js.map} +1 -1
- package/dist/index.js +94 -91
- package/dist/index.js.map +1 -1
- package/dist/object.utils-D_Zzon-H.js.map +1 -1
- package/dist/{pies.utils-JpKM3rVw.js → pies.utils-DpY3U9c2.js} +4 -4
- package/dist/{pies.utils-JpKM3rVw.js.map → pies.utils-DpY3U9c2.js.map} +1 -1
- package/dist/remarkable-pro/components/charts/tables/HeatMapPro/index.d.ts +29 -0
- package/dist/remarkable-pro/components/charts/tables/HeatMapPro/index.d.ts.map +1 -0
- package/dist/remarkable-pro/components/component.constants.d.ts +7 -0
- package/dist/remarkable-pro/components/component.constants.d.ts.map +1 -1
- package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.d.ts +3 -0
- package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.d.ts.map +1 -0
- package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.stories.d.ts +9 -0
- package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.stories.d.ts.map +1 -0
- package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.types.d.ts +30 -0
- package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.types.d.ts.map +1 -0
- package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.utils.d.ts +43 -0
- package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.utils.d.ts.map +1 -0
- package/dist/remarkable-ui/charts/tables/PivotTable/PivotTable.d.ts.map +1 -1
- package/dist/remarkable-ui/charts/tables/PivotTable/PivotTable.types.d.ts +1 -0
- package/dist/remarkable-ui/charts/tables/PivotTable/PivotTable.types.d.ts.map +1 -1
- package/dist/remarkable-ui/charts/tables/tables.utils.d.ts +6 -0
- package/dist/remarkable-ui/charts/tables/tables.utils.d.ts.map +1 -0
- package/dist/remarkable-ui/index.d.ts +2 -0
- package/dist/remarkable-ui/index.d.ts.map +1 -1
- package/dist/remarkable-ui.css +2 -2
- package/dist/tables.utils-D7KXdM2S.js +9 -0
- package/dist/tables.utils-D7KXdM2S.js.map +1 -0
- package/dist/{timeRange.utils-Z2lmKTCB.js → timeRange.utils-B9kyLPq_.js} +2 -2
- package/dist/{timeRange.utils-Z2lmKTCB.js.map → timeRange.utils-B9kyLPq_.js.map} +1 -1
- package/package.json +1 -1
- package/dist/PivotTable-SNPquHl0.js +0 -253
- package/dist/PivotTable-SNPquHl0.js.map +0 -1
- package/dist/charts.utils-HfNL9dVl.js.map +0 -1
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { j as f, ah as M } from "./component.constants-D0ea4CW4.js";
|
|
2
|
+
import { useMemo as F, useCallback as z } from "react";
|
|
3
|
+
import { g as $ } from "./tables.utils-D7KXdM2S.js";
|
|
4
|
+
const Q = "_heatMapContainer_o9smx_1", U = "_tableContainer_o9smx_6", q = "_fullWidth_o9smx_22", J = "_table_o9smx_6", Y = "_heatMapCell_o9smx_61", Z = "_header_o9smx_84", h = {
|
|
5
|
+
heatMapContainer: Q,
|
|
6
|
+
tableContainer: U,
|
|
7
|
+
fullWidth: q,
|
|
8
|
+
table: J,
|
|
9
|
+
heatMapCell: Y,
|
|
10
|
+
header: Z
|
|
11
|
+
}, N = (t) => t < 0 ? 0 : t > 1 ? 1 : t, P = (t) => 1 - (1 - t) * (1 - t), w = (t, e, r) => t + (e - t) * r, V = 0.35, D = "#000000", v = "#FFFFFF", S = (t) => String(t ?? ""), tt = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i, R = /* @__PURE__ */ new Map(), G = (t) => {
|
|
12
|
+
if (!t || t[0] !== "#") return t;
|
|
13
|
+
const e = t.slice(1).toLowerCase();
|
|
14
|
+
return e.length === 3 ? `#${e[0]}${e[0]}${e[1]}${e[1]}${e[2]}${e[2]}` : e.length === 6 ? `#${e}` : t.toLowerCase();
|
|
15
|
+
}, et = (t) => {
|
|
16
|
+
if (!t) return t;
|
|
17
|
+
const e = R.get(t);
|
|
18
|
+
if (e) return e;
|
|
19
|
+
if (t.startsWith("#")) {
|
|
20
|
+
const p = G(t);
|
|
21
|
+
return R.set(t, p), p;
|
|
22
|
+
}
|
|
23
|
+
if (typeof document > "u")
|
|
24
|
+
return t;
|
|
25
|
+
const r = document.createElement("span");
|
|
26
|
+
r.style.color = t, document.body.appendChild(r);
|
|
27
|
+
const o = getComputedStyle(r).color || "";
|
|
28
|
+
r.remove();
|
|
29
|
+
const s = o.match(tt);
|
|
30
|
+
if (!s) return t;
|
|
31
|
+
const [, a = "0", l = "0", x = "0"] = s, b = (p) => Number(p).toString(16).padStart(2, "0"), _ = `#${b(a)}${b(l)}${b(x)}`.toLowerCase();
|
|
32
|
+
return R.set(t, _), _;
|
|
33
|
+
}, j = (t) => {
|
|
34
|
+
const e = G(et(t)).slice(1);
|
|
35
|
+
if (e.length !== 6) return { r: 0, g: 0, b: 0 };
|
|
36
|
+
const r = parseInt(e, 16);
|
|
37
|
+
return { r: r >> 16 & 255, g: r >> 8 & 255, b: r & 255 };
|
|
38
|
+
}, rt = (t, e, r) => {
|
|
39
|
+
const o = (s) => Math.round(s).toString(16).padStart(2, "0");
|
|
40
|
+
return `#${o(t)}${o(e)}${o(r)}`;
|
|
41
|
+
}, k = (t, e, r) => {
|
|
42
|
+
const o = j(t), s = j(e);
|
|
43
|
+
return rt(w(o.r, s.r, r), w(o.g, s.g, r), w(o.b, s.b, r));
|
|
44
|
+
}, nt = (t) => {
|
|
45
|
+
const { r: e, g: r, b: o } = j(t);
|
|
46
|
+
return (e * 299 + r * 587 + o * 114) / 1e3;
|
|
47
|
+
}, st = (t) => nt(t) < 150 ? "#FFFFFF" : "#212129", ot = (t, e, r, o = 0.5) => {
|
|
48
|
+
const s = N(o);
|
|
49
|
+
return (a) => {
|
|
50
|
+
const l = N(a);
|
|
51
|
+
return l <= s ? k(t, e, s === 0 ? 1 : l / s) : k(e, r, (l - s) / (1 - s));
|
|
52
|
+
};
|
|
53
|
+
}, ct = (t) => {
|
|
54
|
+
const e = t.trim();
|
|
55
|
+
if (!e.endsWith("%")) return null;
|
|
56
|
+
const r = Number.parseFloat(e.slice(0, -1));
|
|
57
|
+
return Number.isFinite(r) ? N(r / 100) : null;
|
|
58
|
+
}, I = (t, e, r, o) => {
|
|
59
|
+
if (t == null) return o;
|
|
60
|
+
if (typeof t == "number" && Number.isFinite(t)) return t;
|
|
61
|
+
const s = typeof t == "string" ? ct(t) : null;
|
|
62
|
+
if (s != null) return e + s * (r - e);
|
|
63
|
+
const a = Number(t);
|
|
64
|
+
return Number.isFinite(a) ? a : o;
|
|
65
|
+
}, at = (t) => {
|
|
66
|
+
if (t == null) return t;
|
|
67
|
+
const e = Number(t);
|
|
68
|
+
return Number.isFinite(e) ? e : t;
|
|
69
|
+
}, B = (t, e) => {
|
|
70
|
+
const r = e && Number.isFinite(Number(e)) ? Number(e) : e;
|
|
71
|
+
return at(t ?? r);
|
|
72
|
+
}, lt = (t, e) => typeof t != "number" || !Number.isFinite(t) ? "white" : e(t), it = (t, e, r) => e ? typeof t == "string" || t == null || Number.isNaN(t) ? t : r != null && r.format ? r.format(Number(t)) : t : null, ut = (t, e) => {
|
|
73
|
+
const r = e - t;
|
|
74
|
+
return r === 0 ? 0.5 : ((t + e) / 2 - t) / r;
|
|
75
|
+
}, ft = ({
|
|
76
|
+
domainMin: t,
|
|
77
|
+
domainMax: e,
|
|
78
|
+
rawMin: r,
|
|
79
|
+
rawMax: o,
|
|
80
|
+
minColor: s,
|
|
81
|
+
midColor: a,
|
|
82
|
+
maxColor: l
|
|
83
|
+
}) => {
|
|
84
|
+
const x = ut(t, e), b = ot(s, a, l, x), _ = Math.max(1e-6, t - r), p = Math.max(1e-6, o - e), C = e - t;
|
|
85
|
+
if (C === 0) {
|
|
86
|
+
const m = b(0.5);
|
|
87
|
+
return (y) => m;
|
|
88
|
+
}
|
|
89
|
+
return (m) => {
|
|
90
|
+
if (!Number.isFinite(m)) return b(0.5);
|
|
91
|
+
const y = (m - t) / C;
|
|
92
|
+
if (y <= 0) {
|
|
93
|
+
const g = Math.max(0, t - m) / _, i = P(N(g)) * V;
|
|
94
|
+
return i > 0 ? k(s, v, i) : s;
|
|
95
|
+
}
|
|
96
|
+
if (y >= 1) {
|
|
97
|
+
const g = Math.max(0, m - e) / p, i = P(N(g)) * V;
|
|
98
|
+
return i > 0 ? k(l, D, i) : l;
|
|
99
|
+
}
|
|
100
|
+
return b(y);
|
|
101
|
+
};
|
|
102
|
+
}, gt = ({
|
|
103
|
+
data: t,
|
|
104
|
+
showValues: e = !1,
|
|
105
|
+
className: r,
|
|
106
|
+
columnDimension: o,
|
|
107
|
+
rowDimension: s,
|
|
108
|
+
measure: a,
|
|
109
|
+
minThreshold: l,
|
|
110
|
+
maxThreshold: x,
|
|
111
|
+
minColor: b,
|
|
112
|
+
midColor: _,
|
|
113
|
+
maxColor: p,
|
|
114
|
+
columnWidth: C,
|
|
115
|
+
firstColumnWidth: m,
|
|
116
|
+
displayNullAs: y
|
|
117
|
+
}) => {
|
|
118
|
+
const { rawMin: g, rawMax: i } = F(() => {
|
|
119
|
+
let n = 1 / 0, c = -1 / 0;
|
|
120
|
+
for (const d of t) {
|
|
121
|
+
const u = B(d[a.key], y);
|
|
122
|
+
u != null && typeof u == "number" && Number.isFinite(u) && (u < n && (n = u), u > c && (c = u));
|
|
123
|
+
}
|
|
124
|
+
return !Number.isFinite(n) || !Number.isFinite(c) ? { rawMin: 0, rawMax: 0 } : { rawMin: n, rawMax: c };
|
|
125
|
+
}, [t, a.key, y]), { domainMin: E, domainMax: L } = F(() => {
|
|
126
|
+
const n = I(l, g, i, g), c = I(x, g, i, i);
|
|
127
|
+
return n <= c ? { domainMin: n, domainMax: c } : { domainMin: c, domainMax: n };
|
|
128
|
+
}, [l, x, g, i]), O = F(
|
|
129
|
+
() => Array.from(
|
|
130
|
+
new Set(
|
|
131
|
+
t.map((n) => n[o.key]).filter((n) => n != null).map(S)
|
|
132
|
+
)
|
|
133
|
+
),
|
|
134
|
+
[t, o.key]
|
|
135
|
+
), W = F(
|
|
136
|
+
() => Array.from(
|
|
137
|
+
new Set(
|
|
138
|
+
t.map((n) => n[s.key]).filter((n) => n != null).map(S)
|
|
139
|
+
)
|
|
140
|
+
),
|
|
141
|
+
[t, s.key]
|
|
142
|
+
), A = F(() => {
|
|
143
|
+
const n = /* @__PURE__ */ new Map();
|
|
144
|
+
for (const c of t) {
|
|
145
|
+
const d = S(c[s.key]), u = S(c[o.key]);
|
|
146
|
+
n.has(d) || n.set(d, /* @__PURE__ */ new Map()), n.get(d).set(u, c);
|
|
147
|
+
}
|
|
148
|
+
return n;
|
|
149
|
+
}, [t, s.key, o.key]), K = z(
|
|
150
|
+
(n) => ft({
|
|
151
|
+
domainMin: E,
|
|
152
|
+
domainMax: L,
|
|
153
|
+
rawMin: g,
|
|
154
|
+
rawMax: i,
|
|
155
|
+
minColor: b,
|
|
156
|
+
midColor: _,
|
|
157
|
+
maxColor: p
|
|
158
|
+
})(n),
|
|
159
|
+
[E, L, g, i, b, _, p]
|
|
160
|
+
);
|
|
161
|
+
return /* @__PURE__ */ f.jsx("div", { className: M(h.heatMapContainer, r), children: /* @__PURE__ */ f.jsx(
|
|
162
|
+
"div",
|
|
163
|
+
{
|
|
164
|
+
className: M(
|
|
165
|
+
h.tableContainer,
|
|
166
|
+
(!C || !m) && h.fullWidth
|
|
167
|
+
),
|
|
168
|
+
children: /* @__PURE__ */ f.jsxs("table", { className: h.table, "aria-label": "Heat map", children: [
|
|
169
|
+
/* @__PURE__ */ f.jsx("thead", { children: /* @__PURE__ */ f.jsxs("tr", { children: [
|
|
170
|
+
/* @__PURE__ */ f.jsx(
|
|
171
|
+
"th",
|
|
172
|
+
{
|
|
173
|
+
className: M(h.heatMapCell, h.header),
|
|
174
|
+
style: $(m),
|
|
175
|
+
children: a.label
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
O.map((n, c) => /* @__PURE__ */ f.jsx(
|
|
179
|
+
"th",
|
|
180
|
+
{
|
|
181
|
+
className: M(h.heatMapCell, h.header),
|
|
182
|
+
style: $(C),
|
|
183
|
+
children: o.format ? o.format(n) : n
|
|
184
|
+
},
|
|
185
|
+
`col-${n}-${c}`
|
|
186
|
+
))
|
|
187
|
+
] }) }),
|
|
188
|
+
/* @__PURE__ */ f.jsx("tbody", { children: W.map((n) => /* @__PURE__ */ f.jsxs("tr", { children: [
|
|
189
|
+
/* @__PURE__ */ f.jsx(
|
|
190
|
+
"th",
|
|
191
|
+
{
|
|
192
|
+
className: M(h.heatMapCell, h.header),
|
|
193
|
+
scope: "row",
|
|
194
|
+
style: $(m),
|
|
195
|
+
children: s.format ? s.format(n) : n
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
O.map((c) => {
|
|
199
|
+
var T;
|
|
200
|
+
const d = (T = A.get(n)) == null ? void 0 : T.get(c), u = B(d == null ? void 0 : d[a.key], y), H = lt(u, K), X = st(H);
|
|
201
|
+
return /* @__PURE__ */ f.jsx(
|
|
202
|
+
"td",
|
|
203
|
+
{
|
|
204
|
+
className: M(h.heatMapCell),
|
|
205
|
+
style: {
|
|
206
|
+
background: H,
|
|
207
|
+
color: X,
|
|
208
|
+
...$(C)
|
|
209
|
+
},
|
|
210
|
+
children: it(u, e, a)
|
|
211
|
+
},
|
|
212
|
+
`cell-${n}-${c}`
|
|
213
|
+
);
|
|
214
|
+
})
|
|
215
|
+
] }, `row-${n}`)) })
|
|
216
|
+
] })
|
|
217
|
+
}
|
|
218
|
+
) });
|
|
219
|
+
};
|
|
220
|
+
export {
|
|
221
|
+
gt as H
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=HeatMap-ylrlKLQI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeatMap-ylrlKLQI.js","sources":["../src/remarkable-ui/charts/tables/HeatMap/HeatMap.utils.ts","../src/remarkable-ui/charts/tables/HeatMap/HeatMap.tsx"],"sourcesContent":["import { HeatMapPropsMeasure, HeatMapPropsThreshold } from './HeatMap.types';\n\n/* -------------------------------------------------------------------------- */\n/* Core math + tiny helpers */\n/* -------------------------------------------------------------------------- */\n\nconst clamp01 = (x: number) => (x < 0 ? 0 : x > 1 ? 1 : x);\nconst easeOutQuad = (x: number) => 1 - (1 - x) * (1 - x);\nconst lerp = (a: number, b: number, t: number) => a + (b - a) * t;\n\n/** Max darkening applied for values outside the domain (0..1). Lower = lighter tails. */\nconst OUTSIDE_DARKEN_MAX = 0.35;\n/** Darkest color to lerp toward when outside domain (kept as const for tree-shakeability). */\nconst LERP_DARKEST_COLOR = '#000000';\nconst LERP_LIGHTEST_COLOR = '#FFFFFF';\n\nexport const idOf = (v: unknown) => String(v ?? '');\n\n/* -------------------------------------------------------------------------- */\n/* Color parsing / conversion */\n/* - Resolves hex/rgb/hsl/named/var(...) to a hex string (#rrggbb) */\n/* - Memoized to avoid repeated DOM work */\n/* -------------------------------------------------------------------------- */\n\nconst CSS_RGB_REGEX = /rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)/i;\nconst COLOR_CACHE = new Map<string, string>();\n\n/** Normalizes short or long hex to lowercase #rrggbb; returns input if not hex. */\nconst normalizeHex = (hex: string) => {\n if (!hex || hex[0] !== '#') return hex;\n const v = hex.slice(1).toLowerCase();\n if (v.length === 3) return `#${v[0]}${v[0]}${v[1]}${v[1]}${v[2]}${v[2]}`;\n if (v.length === 6) return `#${v}`;\n return hex.toLowerCase();\n};\n\n/**\n * Resolves any CSS color (hex, rgb/rgba, hsl/hsla, named, var(--token)) into #rrggbb.\n * SSR-safe: returns input unchanged if `document` is not available.\n */\nconst resolveCssColorToHex = (input: string): string => {\n if (!input) return input;\n const cached = COLOR_CACHE.get(input);\n if (cached) return cached;\n\n // Quick-path for hex.\n if (input.startsWith('#')) {\n const hex = normalizeHex(input);\n COLOR_CACHE.set(input, hex);\n return hex;\n }\n\n if (typeof document === 'undefined') {\n // SSR: cannot resolve computed styles → return as-is (caller should accept).\n return input;\n }\n\n // Use the browser to compute final color (resolves var(...), named, hsl, etc.)\n const el = document.createElement('span');\n el.style.color = input;\n document.body.appendChild(el);\n const computed = getComputedStyle(el).color || '';\n el.remove();\n\n // Expect \"rgb(...)\" or \"rgba(...)\" now.\n const m = computed.match(CSS_RGB_REGEX);\n if (!m) return input;\n\n const [, r = '0', g = '0', b = '0'] = m;\n const toHex = (n: string) => Number(n).toString(16).padStart(2, '0');\n const hex = `#${toHex(r)}${toHex(g)}${toHex(b)}`.toLowerCase();\n COLOR_CACHE.set(input, hex);\n return hex;\n};\n\nconst hexToRgb = (color: string) => {\n const hex = normalizeHex(resolveCssColorToHex(color)).slice(1);\n // Guard against bad inputs\n if (hex.length !== 6) return { r: 0, g: 0, b: 0 };\n const i = parseInt(hex, 16);\n return { r: (i >> 16) & 255, g: (i >> 8) & 255, b: i & 255 };\n};\n\nconst rgbToHex = (r: number, g: number, b: number) => {\n const to = (x: number) => Math.round(x).toString(16).padStart(2, '0');\n return `#${to(r)}${to(g)}${to(b)}`;\n};\n\n/** Linear interpolation between two colors (0..1). */\nexport const lerpColor = (a: string, b: string, t: number) => {\n const A = hexToRgb(a);\n const B = hexToRgb(b);\n return rgbToHex(lerp(A.r, B.r, t), lerp(A.g, B.g, t), lerp(A.b, B.b, t));\n};\n\n/** YIQ perceived brightness, used to pick white/black text. */\nconst getBrightness = (color: string) => {\n const { r, g, b } = hexToRgb(color);\n return (r * 299 + g * 587 + b * 114) / 1000;\n};\n\n/** Returns '#FFFFFF' for dark backgrounds, '#212129' for light ones. */\nexport const getCellColor = (backgroundColor: string) => {\n return getBrightness(backgroundColor) < 150 ? '#FFFFFF' : '#212129';\n};\n\n/* -------------------------------------------------------------------------- */\n/* Scales / thresholds */\n/* -------------------------------------------------------------------------- */\n\n/** Creates a diverging scale: t∈[0..1] → color blended across [min→mid→max]. */\nconst makeDiverging = (minC: string, midC: string, maxC: string, midpoint = 0.5) => {\n const m = clamp01(midpoint);\n return (t: number) => {\n const x = clamp01(t);\n return x <= m\n ? lerpColor(minC, midC, m === 0 ? 1 : x / m)\n : lerpColor(midC, maxC, (x - m) / (1 - m));\n };\n};\n\n/** Parses \"NN%\" → 0..1; otherwise null. */\nconst parsePercentString = (s: string): number | null => {\n const t = s.trim();\n if (!t.endsWith('%')) return null;\n const n = Number.parseFloat(t.slice(0, -1));\n return Number.isFinite(n) ? clamp01(n / 100) : null;\n};\n\n/**\n * Converts a flexible threshold into a RAW domain value.\n * - number → raw value\n * - \"NN%\" → percentage of [rawMin..rawMax]\n * - undefined/invalid → fallback\n */\nexport const thresholdToRaw = (\n t: HeatMapPropsThreshold,\n rawMin: number,\n rawMax: number,\n fallback: number,\n): number => {\n if (t == null) return fallback;\n if (typeof t === 'number' && Number.isFinite(t)) return t;\n const asPct = typeof t === 'string' ? parsePercentString(t) : null;\n if (asPct != null) return rawMin + asPct * (rawMax - rawMin);\n\n // Last-chance: numeric string without %\n const maybe = Number(t as unknown as string);\n return Number.isFinite(maybe) ? maybe : fallback;\n};\n\n/* -------------------------------------------------------------------------- */\n/* Cell value helpers */\n/* -------------------------------------------------------------------------- */\n\nconst toFiniteOrSelf = (v: number | string | undefined): number | string | undefined => {\n if (v == null) return v;\n const n = Number(v);\n return Number.isFinite(n) ? n : v;\n};\n\n/**\n * Normalizes the raw cell value for display/compute:\n * - if nullish, uses `displayNullAs` (if numeric string, coerces to number)\n * - if numeric-like, returns as number\n * - otherwise returns original string\n */\nexport const getCellValue = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any,\n displayNullAs: string | number | undefined,\n): string | number | undefined => {\n const fallback =\n displayNullAs && Number.isFinite(Number(displayNullAs)) ? Number(displayNullAs) : displayNullAs;\n return toFiniteOrSelf(value ?? fallback);\n};\n\n/** Returns the background color for a given cell value using a prepared mapper. */\nexport const getCellBackground = (\n value: number | string | undefined,\n colorForValue: (t: number) => string,\n): string => {\n if (typeof value !== 'number' || !Number.isFinite(value)) return 'white';\n return colorForValue(value);\n};\n\n/** Formats the cell’s display text (respects showValues & measure.format). */\nexport const getCellDisplayValue = (\n value: number | string | undefined,\n showValues: boolean,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n measure: HeatMapPropsMeasure<any>,\n) => {\n if (!showValues) return null;\n if (typeof value === 'string' || value == null || Number.isNaN(value as number)) return value;\n return measure?.format ? measure.format(Number(value)) : value;\n};\n\n/* -------------------------------------------------------------------------- */\n/* Color mapper factory */\n/* -------------------------------------------------------------------------- */\n\n/** Returns midpoint in [0..1] for the diverging scale given raw min/max. */\nconst getMidPoint = (domainMin: number, domainMax: number) => {\n const range = domainMax - domainMin;\n if (range === 0) return 0.5;\n return ((domainMin + domainMax) / 2 - domainMin) / range;\n};\n\n/**\n * Builds a fast `(value:number) => color` mapper.\n *\n * Behavior:\n * - Inside [domainMin..domainMax]: interpolate via diverging scale.\n * - Below domain: darken from `minColor` toward black, eased & capped.\n * - Above domain: darken from `maxColor` toward black, eased & capped.\n * - Degenerate domain: always returns mid color.\n */\nexport const createColorForValue = ({\n domainMin,\n domainMax,\n rawMin,\n rawMax,\n minColor,\n midColor,\n maxColor,\n}: {\n domainMin: number;\n domainMax: number;\n rawMin: number;\n rawMax: number;\n minColor: string;\n midColor: string;\n maxColor: string;\n}) => {\n const midPoint = getMidPoint(domainMin, domainMax);\n const scale = makeDiverging(minColor, midColor, maxColor, midPoint);\n\n const leftTailLen = Math.max(1e-6, domainMin - rawMin);\n const rightTailLen = Math.max(1e-6, rawMax - domainMax);\n const domRange = domainMax - domainMin;\n\n if (domRange === 0) {\n // Degenerate domain → fixed color\n const mid = scale(0.5);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n return (_v: number) => mid;\n }\n\n return (v: number) => {\n if (!Number.isFinite(v)) return scale(0.5);\n\n const t = (v - domainMin) / domRange;\n\n if (t <= 0) {\n const dist = Math.max(0, domainMin - v) / leftTailLen;\n const strength = easeOutQuad(clamp01(dist)) * OUTSIDE_DARKEN_MAX;\n return strength > 0 ? lerpColor(minColor, LERP_LIGHTEST_COLOR, strength) : minColor;\n }\n\n if (t >= 1) {\n const dist = Math.max(0, v - domainMax) / rightTailLen;\n const strength = easeOutQuad(clamp01(dist)) * OUTSIDE_DARKEN_MAX;\n return strength > 0 ? lerpColor(maxColor, LERP_DARKEST_COLOR, strength) : maxColor;\n }\n\n return scale(t);\n };\n};\n","import { useMemo, useCallback } from 'react';\nimport styles from './HeatMap.module.css';\nimport clsx from 'clsx';\nimport { HeatMapProps } from './HeatMap.types';\nimport {\n createColorForValue,\n getCellBackground,\n getCellColor,\n getCellDisplayValue,\n getCellValue,\n idOf,\n thresholdToRaw,\n} from './HeatMap.utils';\nimport { getTableCellWidthStyle } from '../tables.utils';\n\nexport const HeatMap = <T extends Record<string, unknown>>({\n data,\n showValues = false,\n className,\n columnDimension,\n rowDimension,\n measure,\n minThreshold,\n maxThreshold,\n minColor,\n midColor,\n maxColor,\n columnWidth,\n firstColumnWidth,\n displayNullAs,\n}: HeatMapProps<T>) => {\n // 1. Get raw min/max from data\n const { rawMin, rawMax } = useMemo(() => {\n let min = Infinity;\n let max = -Infinity;\n for (const d of data) {\n const value = getCellValue(d[measure.key], displayNullAs);\n\n if (value != null && typeof value === 'number' && Number.isFinite(value)) {\n if (value < min) min = value;\n if (value > max) max = value;\n }\n }\n if (!Number.isFinite(min) || !Number.isFinite(max)) return { rawMin: 0, rawMax: 0 };\n return { rawMin: min, rawMax: max };\n }, [data, measure.key, displayNullAs]);\n\n // 2. Resolve thresholds to a raw domain\n const { domainMin, domainMax } = useMemo(() => {\n const domMin = thresholdToRaw(minThreshold, rawMin, rawMax, rawMin);\n const domMax = thresholdToRaw(maxThreshold, rawMin, rawMax, rawMax);\n return domMin <= domMax\n ? { domainMin: domMin, domainMax: domMax }\n : { domainMin: domMax, domainMax: domMin };\n }, [minThreshold, maxThreshold, rawMin, rawMax]);\n\n const columnValues = useMemo(\n () =>\n Array.from(\n new Set(\n data\n .map((d) => d[columnDimension.key])\n .filter((v) => v != null)\n .map(idOf),\n ),\n ),\n [data, columnDimension.key],\n );\n\n const rowValues = useMemo(\n () =>\n Array.from(\n new Set(\n data\n .map((d) => d[rowDimension.key])\n .filter((v) => v != null)\n .map(idOf),\n ),\n ),\n [data, rowDimension.key],\n );\n\n // 3. Store data in a map for fast lookup\n const cellMap = useMemo(() => {\n const map = new Map<string, Map<string, Record<string, unknown>>>();\n for (const d of data) {\n const r = idOf(d[rowDimension.key]);\n const c = idOf(d[columnDimension.key]);\n if (!map.has(r)) map.set(r, new Map());\n map.get(r)!.set(c, d as Record<string, unknown>);\n }\n return map;\n }, [data, rowDimension.key, columnDimension.key]);\n\n // 4. Create color scale function\n const colorForValue = useCallback(\n (v: number) => {\n return createColorForValue({\n domainMin,\n domainMax,\n rawMin,\n rawMax,\n minColor,\n midColor,\n maxColor,\n })(v);\n },\n [domainMin, domainMax, rawMin, rawMax, minColor, midColor, maxColor],\n );\n\n return (\n <div className={clsx(styles.heatMapContainer, className)}>\n <div\n className={clsx(\n styles.tableContainer,\n (!columnWidth || !firstColumnWidth) && styles.fullWidth,\n )}\n >\n <table className={styles.table} aria-label=\"Heat map\">\n <thead>\n <tr>\n <th\n className={clsx(styles.heatMapCell, styles.header)}\n style={getTableCellWidthStyle(firstColumnWidth)}\n >\n {measure.label}\n </th>\n {columnValues.map((cv, index) => (\n <th\n key={`col-${cv}-${index}`}\n className={clsx(styles.heatMapCell, styles.header)}\n style={getTableCellWidthStyle(columnWidth)}\n >\n {columnDimension.format ? columnDimension.format(cv) : cv}\n </th>\n ))}\n </tr>\n </thead>\n\n <tbody>\n {rowValues.map((rv) => (\n <tr key={`row-${rv}`}>\n <th\n className={clsx(styles.heatMapCell, styles.header)}\n scope=\"row\"\n style={getTableCellWidthStyle(firstColumnWidth)}\n >\n {rowDimension.format ? rowDimension.format(rv) : rv}\n </th>\n\n {columnValues.map((cv) => {\n const obj = cellMap.get(rv)?.get(cv);\n const value = getCellValue(obj?.[measure.key], displayNullAs);\n const background = getCellBackground(value, colorForValue);\n const color = getCellColor(background);\n\n return (\n <td\n key={`cell-${rv}-${cv}`}\n className={clsx(styles.heatMapCell)}\n style={{\n background,\n color,\n ...getTableCellWidthStyle(columnWidth),\n }}\n >\n {getCellDisplayValue(value, showValues, measure)}\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n );\n};\n"],"names":["clamp01","x","easeOutQuad","lerp","a","b","t","OUTSIDE_DARKEN_MAX","LERP_DARKEST_COLOR","LERP_LIGHTEST_COLOR","idOf","v","CSS_RGB_REGEX","COLOR_CACHE","normalizeHex","hex","resolveCssColorToHex","input","cached","el","computed","m","r","g","toHex","n","hexToRgb","color","i","rgbToHex","to","lerpColor","A","B","getBrightness","getCellColor","backgroundColor","makeDiverging","minC","midC","maxC","midpoint","parsePercentString","s","thresholdToRaw","rawMin","rawMax","fallback","asPct","maybe","toFiniteOrSelf","getCellValue","value","displayNullAs","getCellBackground","colorForValue","getCellDisplayValue","showValues","measure","getMidPoint","domainMin","domainMax","range","createColorForValue","minColor","midColor","maxColor","midPoint","scale","leftTailLen","rightTailLen","domRange","mid","_v","dist","strength","HeatMap","data","className","columnDimension","rowDimension","minThreshold","maxThreshold","columnWidth","firstColumnWidth","useMemo","min","max","domMin","domMax","columnValues","d","rowValues","cellMap","map","c","useCallback","clsx","styles","jsx","getTableCellWidthStyle","cv","index","rv","obj","_a","background"],"mappings":";;;;;;;;;;GAMMA,IAAU,CAACC,MAAeA,IAAI,IAAI,IAAIA,IAAI,IAAI,IAAIA,GAClDC,IAAc,CAACD,MAAc,KAAK,IAAIA,MAAM,IAAIA,IAChDE,IAAO,CAACC,GAAWC,GAAWC,MAAcF,KAAKC,IAAID,KAAKE,GAG1DC,IAAqB,MAErBC,IAAqB,WACrBC,IAAsB,WAEfC,IAAO,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AA,YAAA;AAAA,UAAA;AAAA,UAGlDb,EAAa,IAAI,CAACW,MAAO;;AACxB,kBAAMG,KAAMC,IAAAZ,EAAQ,IAAIU,CAAE,MAAd,gBAAAE,EAAiB,IAAIJ,IAC3BjD,IAAQD,EAAaqD,KAAA,gBAAAA,EAAM9C,EAAQ,MAAML,CAAa,GACtDqD,IAAapD,GAAkBF,GAAOG,CAAa,GACnD5B,IAAQQ,GAAauE,CAAU;AAErC,mBACEP,gBAAAA,EAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBAEC,WAAWF,EAAKC,EAAO,WAAW;AAAA,gBAClC,OAAO;AAAA,kBACL,YAAAQ;AAAA,kBACA,OAAA/E;AAAA,kBACA,GAAGyE,EAAuBjB,CAAW;AAAA,gBAAA;AAAA,gBAGtC,UAAA3B,GAAoBJ,GAAOK,GAAYC,CAAO;AAAA,cAAA;AAAA,cAR1C,QAAQ6C,CAAE,IAAIF,CAAE;AAAA,YAAA;AAAA,UAW3B,CAAC;AAAA,QAAA,EAAA,GA5BM,OAAOE,CAAE,EA6BlB,CACD,EAAA,CACH;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { i as F, r as R, j as u, d as A, w as S, b as d, t as j, c as N, a4 as i, a5 as l, Y as P, Z as c, A as q, o as E } from "./component.constants-D0ea4CW4.js";
|
|
2
|
+
import { useTheme as k, defineComponent as B } from "@embeddable.com/react";
|
|
3
|
+
import { C as G } from "./ChartCard-k190CXR0.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { H as O } from "./HeatMap-ylrlKLQI.js";
|
|
6
|
+
import { g as C } from "./formatter.utils-DBUd3PfE.js";
|
|
7
|
+
import { u as h } from "./charts.fillGaps.hooks-5WclK2CD.js";
|
|
8
|
+
const I = (e, a) => {
|
|
9
|
+
const n = C(a);
|
|
10
|
+
return {
|
|
11
|
+
key: e.measure.name,
|
|
12
|
+
label: n.dimensionOrMeasureTitle(e.measure),
|
|
13
|
+
format: (o) => n.data(e.measure, o)
|
|
14
|
+
};
|
|
15
|
+
}, p = (e, a) => {
|
|
16
|
+
const n = C(a);
|
|
17
|
+
return {
|
|
18
|
+
key: e.dimension.name,
|
|
19
|
+
label: n.dimensionOrMeasureTitle(e.dimension),
|
|
20
|
+
format: (o) => n.data(e.dimension, o)
|
|
21
|
+
};
|
|
22
|
+
}, Y = (e) => {
|
|
23
|
+
const a = k();
|
|
24
|
+
F(a);
|
|
25
|
+
const { description: n, title: o } = R(e), {
|
|
26
|
+
measure: m,
|
|
27
|
+
rowDimension: r,
|
|
28
|
+
columnDimension: s,
|
|
29
|
+
maxColor: b,
|
|
30
|
+
midColor: g,
|
|
31
|
+
minColor: f,
|
|
32
|
+
displayNullAs: D,
|
|
33
|
+
columnWidth: M,
|
|
34
|
+
firstColumnWidth: w,
|
|
35
|
+
showValues: x,
|
|
36
|
+
minThreshold: T,
|
|
37
|
+
maxThreshold: H
|
|
38
|
+
} = e, y = h({
|
|
39
|
+
results: e.results,
|
|
40
|
+
dimension: s
|
|
41
|
+
}), t = h({
|
|
42
|
+
results: y,
|
|
43
|
+
dimension: r
|
|
44
|
+
}), V = I({ measure: m }, a), W = p({ dimension: r }, a), v = p({ dimension: s }, a);
|
|
45
|
+
return /* @__PURE__ */ u.jsx(
|
|
46
|
+
G,
|
|
47
|
+
{
|
|
48
|
+
title: o,
|
|
49
|
+
subtitle: n,
|
|
50
|
+
data: e.results,
|
|
51
|
+
dimensionsAndMeasures: [r, s, m],
|
|
52
|
+
errorMessage: t == null ? void 0 : t.error,
|
|
53
|
+
children: /* @__PURE__ */ u.jsx(
|
|
54
|
+
O,
|
|
55
|
+
{
|
|
56
|
+
data: t.data ?? [],
|
|
57
|
+
measure: V,
|
|
58
|
+
rowDimension: W,
|
|
59
|
+
columnDimension: v,
|
|
60
|
+
maxColor: b,
|
|
61
|
+
midColor: g,
|
|
62
|
+
minColor: f,
|
|
63
|
+
showValues: x,
|
|
64
|
+
minThreshold: T,
|
|
65
|
+
maxThreshold: H,
|
|
66
|
+
columnWidth: M,
|
|
67
|
+
firstColumnWidth: w,
|
|
68
|
+
displayNullAs: D
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}, Z = {
|
|
74
|
+
name: "HeatMapPro",
|
|
75
|
+
label: "Heat Map",
|
|
76
|
+
category: "Table Charts",
|
|
77
|
+
inputs: [
|
|
78
|
+
A,
|
|
79
|
+
S,
|
|
80
|
+
{
|
|
81
|
+
...d,
|
|
82
|
+
label: "Row Dimension",
|
|
83
|
+
name: "rowDimension"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
...d,
|
|
87
|
+
label: "Column Dimension",
|
|
88
|
+
name: "columnDimension"
|
|
89
|
+
},
|
|
90
|
+
j,
|
|
91
|
+
N,
|
|
92
|
+
{ ...i, name: "displayNullAs", label: "Display Null As" },
|
|
93
|
+
{ ...l, name: "maxColor", label: "Max Color", defaultValue: "green", required: !0 },
|
|
94
|
+
{ ...l, name: "midColor", label: "Mid Color", defaultValue: "yellow", required: !0 },
|
|
95
|
+
{ ...l, name: "minColor", label: "Min Color", defaultValue: "red", required: !0 },
|
|
96
|
+
{
|
|
97
|
+
...i,
|
|
98
|
+
name: "minThreshold",
|
|
99
|
+
label: "Max range lower limit",
|
|
100
|
+
description: "Enter a value as either a number (e.g. 20) or a percentage (e.g. 20%)"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
...i,
|
|
104
|
+
name: "maxThreshold",
|
|
105
|
+
label: "Min range upper limit",
|
|
106
|
+
description: "Enter a value as either a number (e.g. 20) or a percentage (e.g. 20%)"
|
|
107
|
+
},
|
|
108
|
+
{ ...P, name: "showValues", label: "Show Values", defaultValue: !0 },
|
|
109
|
+
{
|
|
110
|
+
...c,
|
|
111
|
+
name: "firstColumnWidth",
|
|
112
|
+
label: "First Column Width",
|
|
113
|
+
description: "Set the width in px (e.g. 200)"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
...c,
|
|
117
|
+
name: "columnWidth",
|
|
118
|
+
label: "Column Width",
|
|
119
|
+
description: "Set the width in px (e.g. 200)"
|
|
120
|
+
},
|
|
121
|
+
q
|
|
122
|
+
]
|
|
123
|
+
}, X = B(Y, Z, {
|
|
124
|
+
props: (e) => ({
|
|
125
|
+
...e,
|
|
126
|
+
results: E({
|
|
127
|
+
from: e.dataset,
|
|
128
|
+
select: [e.rowDimension, e.columnDimension, e.measure],
|
|
129
|
+
limit: e.maxResults,
|
|
130
|
+
countRows: !0
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
export {
|
|
135
|
+
X as default,
|
|
136
|
+
Z as meta
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=HeatMapPro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeatMapPro.js","sources":["../src/remarkable-pro/components/charts/tables/HeatMapPro/index.tsx","../src/remarkable-pro/components/charts/tables/HeatMapPro/HeatMapPro.emb.ts"],"sourcesContent":["import { useTheme } from '@embeddable.com/react';\nimport { Theme } from '../../../../theme/theme.types';\nimport { i18nSetup } from '../../../../theme/i18n/i18n';\nimport { ChartCard } from '../../shared/ChartCard/ChartCard';\nimport { resolveI18nProps } from '../../../component.utils';\nimport { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { HeatMap, HeatMapPropsDimension, HeatMapPropsMeasure } from '../../../../../remarkable-ui';\nimport { getThemeFormatter } from '../../../../theme/formatter/formatter.utils';\nimport { useFillGaps } from '../../charts.fillGaps.hooks';\n\ntype HeatMapProProps = {\n columnDimension: Dimension;\n columnWidth?: number;\n description: string;\n displayNullAs?: string;\n firstColumnWidth?: number;\n maxColor: string;\n maxThreshold?: string;\n measure: Measure;\n midColor: string;\n minColor: string;\n minThreshold?: string;\n results: DataResponse;\n rowDimension: Dimension;\n showValues?: boolean;\n title: string;\n};\n\nexport const getHeatMeasure = (\n props: { measure: Measure },\n theme: Theme,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): HeatMapPropsMeasure<any> => {\n const themeFormatter = getThemeFormatter(theme);\n\n return {\n key: props.measure.name,\n label: themeFormatter.dimensionOrMeasureTitle(props.measure),\n format: (value) => {\n return themeFormatter.data(props.measure, value);\n },\n };\n};\n\nexport const getHeatDimension = (\n props: { dimension: Dimension },\n theme: Theme,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): HeatMapPropsDimension<any> => {\n const themeFormatter = getThemeFormatter(theme);\n\n return {\n key: props.dimension.name,\n label: themeFormatter.dimensionOrMeasureTitle(props.dimension),\n format: (value: string) => themeFormatter.data(props.dimension, value),\n };\n};\n\nconst HeatMapPro = (props: HeatMapProProps) => {\n const theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const { description, title } = resolveI18nProps(props);\n const {\n measure,\n rowDimension,\n columnDimension,\n maxColor,\n midColor,\n minColor,\n displayNullAs,\n columnWidth,\n firstColumnWidth,\n showValues,\n minThreshold,\n maxThreshold,\n } = props;\n\n // Fill gaps for the column dimension\n const resultsColumnDimensionFillGaps = useFillGaps({\n results: props.results,\n dimension: columnDimension,\n });\n\n // Fill gaps for the row dimension\n const results = useFillGaps({\n results: resultsColumnDimensionFillGaps,\n dimension: rowDimension,\n });\n\n const pivotMeasures = getHeatMeasure({ measure }, theme);\n const pivotRowDimension = getHeatDimension({ dimension: rowDimension }, theme);\n const pivotColumnDimension = getHeatDimension({ dimension: columnDimension }, theme);\n\n return (\n <ChartCard\n title={title}\n subtitle={description}\n data={props.results}\n dimensionsAndMeasures={[rowDimension, columnDimension, measure]}\n errorMessage={results?.error}\n >\n <HeatMap\n data={results.data ?? []}\n measure={pivotMeasures}\n rowDimension={pivotRowDimension}\n columnDimension={pivotColumnDimension}\n maxColor={maxColor}\n midColor={midColor}\n minColor={minColor}\n showValues={showValues}\n minThreshold={minThreshold}\n maxThreshold={maxThreshold}\n columnWidth={columnWidth}\n firstColumnWidth={firstColumnWidth}\n displayNullAs={displayNullAs}\n />\n </ChartCard>\n );\n};\n\nexport default HeatMapPro;\n","import { loadData } from '@embeddable.com/core';\nimport { defineComponent, EmbeddedComponentMeta, Inputs } from '@embeddable.com/react';\nimport HeatMapPro from './index';\nimport {\n dataset,\n description,\n title,\n maxResults,\n genericString,\n dimensionWithDateBounds,\n genericNumber,\n measure,\n inputColor,\n genericBoolean,\n} from '../../../component.constants';\n\nexport const meta = {\n name: 'HeatMapPro',\n label: 'Heat Map',\n category: 'Table Charts',\n inputs: [\n dataset,\n measure,\n {\n ...dimensionWithDateBounds,\n label: 'Row Dimension',\n name: 'rowDimension',\n },\n {\n ...dimensionWithDateBounds,\n label: 'Column Dimension',\n name: 'columnDimension',\n },\n title,\n description,\n { ...genericString, name: 'displayNullAs', label: 'Display Null As' },\n { ...inputColor, name: 'maxColor', label: 'Max Color', defaultValue: 'green', required: true },\n { ...inputColor, name: 'midColor', label: 'Mid Color', defaultValue: 'yellow', required: true },\n { ...inputColor, name: 'minColor', label: 'Min Color', defaultValue: 'red', required: true },\n {\n ...genericString,\n name: 'minThreshold',\n label: 'Max range lower limit',\n description: 'Enter a value as either a number (e.g. 20) or a percentage (e.g. 20%)',\n },\n {\n ...genericString,\n name: 'maxThreshold',\n label: 'Min range upper limit',\n description: 'Enter a value as either a number (e.g. 20) or a percentage (e.g. 20%)',\n },\n { ...genericBoolean, name: 'showValues', label: 'Show Values', defaultValue: true },\n {\n ...genericNumber,\n name: 'firstColumnWidth',\n label: 'First Column Width',\n description: 'Set the width in px (e.g. 200)',\n },\n {\n ...genericNumber,\n name: 'columnWidth',\n label: 'Column Width',\n description: 'Set the width in px (e.g. 200)',\n },\n maxResults,\n ],\n} as const satisfies EmbeddedComponentMeta;\n\nexport default defineComponent(HeatMapPro, meta, {\n props: (inputs: Inputs<typeof meta>) => {\n return {\n ...inputs,\n results: loadData({\n from: inputs.dataset,\n select: [inputs.rowDimension, inputs.columnDimension, inputs.measure],\n limit: inputs.maxResults,\n countRows: true,\n }),\n };\n },\n});\n"],"names":["getHeatMeasure","props","theme","themeFormatter","getThemeFormatter","value","getHeatDimension","HeatMapPro","useTheme","i18nSetup","description","title","resolveI18nProps","measure","rowDimension","columnDimension","maxColor","midColor","minColor","displayNullAs","columnWidth","firstColumnWidth","showValues","minThreshold","maxThreshold","resultsColumnDimensionFillGaps","useFillGaps","results","pivotMeasures","pivotRowDimension","pivotColumnDimension","jsx","ChartCard","HeatMap","meta","dataset","dimensionWithDateBounds","genericString","inputColor","genericBoolean","genericNumber","maxResults","HeatMapPro_emb","defineComponent","inputs","loadData"],"mappings":";;;;;;;AA4BO,MAAMA,IAAiB,CAC5BC,GACAC,MAE6B;AAC7B,QAAMC,IAAiBC,EAAkBF,CAAK;AAE9C,SAAO;AAAA,IACL,KAAKD,EAAM,QAAQ;AAAA,IACnB,OAAOE,EAAe,wBAAwBF,EAAM,OAAO;AAAA,IAC3D,QAAQ,CAACI,MACAF,EAAe,KAAKF,EAAM,SAASI,CAAK;AAAA,EACjD;AAEJ,GAEaC,IAAmB,CAC9BL,GACAC,MAE+B;AAC/B,QAAMC,IAAiBC,EAAkBF,CAAK;AAE9C,SAAO;AAAA,IACL,KAAKD,EAAM,UAAU;AAAA,IACrB,OAAOE,EAAe,wBAAwBF,EAAM,SAAS;AAAA,IAC7D,QAAQ,CAACI,MAAkBF,EAAe,KAAKF,EAAM,WAAWI,CAAK;AAAA,EAAA;AAEzE,GAEME,IAAa,CAACN,MAA2B;AAC7C,QAAMC,IAAQM,EAAA;AACd,EAAAC,EAAUP,CAAK;AAEf,QAAM,EAAE,aAAAQ,GAAa,OAAAC,MAAUC,EAAiBX,CAAK,GAC/C;AAAA,IACJ,SAAAY;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,aAAAC;AAAA,IACA,kBAAAC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@license @tabler/icons-react v3.35.0 - MIT
|
|
4
4
|
*
|
|
@@ -27,20 +27,20 @@ const m = [["path", { d: "M3 17l6 -6l4 4l8 -8", key: "svg-0" }], ["path", { d: "
|
|
|
27
27
|
showChangeAsPercentage: r,
|
|
28
28
|
invertChangeColors: C = !1,
|
|
29
29
|
comparisonLabel: c,
|
|
30
|
-
valueFormatter:
|
|
31
|
-
percentageDecimalPlaces:
|
|
32
|
-
className:
|
|
30
|
+
valueFormatter: p,
|
|
31
|
+
percentageDecimalPlaces: h = 1,
|
|
32
|
+
className: g
|
|
33
33
|
}) => {
|
|
34
34
|
const s = e - i, t = s > 0;
|
|
35
35
|
let a;
|
|
36
|
-
r ? a = `${(i === 0 ? 0 : s / i * 100).toFixed(
|
|
36
|
+
r ? a = `${(i === 0 ? 0 : s / i * 100).toFixed(h)}%` : a = p ? p(s) : s.toString();
|
|
37
37
|
const l = `${t ? "+" : ""}${a}`, _ = t ? f : y;
|
|
38
|
-
return /* @__PURE__ */ n.jsxs("div", { className: x(
|
|
38
|
+
return /* @__PURE__ */ n.jsxs("div", { className: x(g, o.kpiChartChangeContainer), children: [
|
|
39
39
|
/* @__PURE__ */ n.jsxs("div", { className: x(o.kpiChangeBadge, I(t, C)), children: [
|
|
40
40
|
/* @__PURE__ */ n.jsx(_, {}),
|
|
41
|
-
/* @__PURE__ */ n.jsx(
|
|
41
|
+
/* @__PURE__ */ n.jsx(d, { children: l })
|
|
42
42
|
] }),
|
|
43
|
-
c && /* @__PURE__ */ n.jsx(
|
|
43
|
+
c && /* @__PURE__ */ n.jsx(d, { children: c })
|
|
44
44
|
] });
|
|
45
45
|
}, S = ({
|
|
46
46
|
value: e,
|
|
@@ -48,16 +48,16 @@ const m = [["path", { d: "M3 17l6 -6l4 4l8 -8", key: "svg-0" }], ["path", { d: "
|
|
|
48
48
|
comparisonValue: r,
|
|
49
49
|
comparisonLabel: C,
|
|
50
50
|
invertChangeColors: c,
|
|
51
|
-
showChangeAsPercentage:
|
|
52
|
-
percentageDecimalPlaces:
|
|
53
|
-
equalComparisonLabel:
|
|
51
|
+
showChangeAsPercentage: p,
|
|
52
|
+
percentageDecimalPlaces: h = 1,
|
|
53
|
+
equalComparisonLabel: g = "No change",
|
|
54
54
|
valueFontSize: s,
|
|
55
55
|
valueFormatter: t
|
|
56
56
|
}) => {
|
|
57
57
|
const a = r !== void 0, l = a && r === e, _ = e === void 0 ? "" : t ? t(e) : e;
|
|
58
58
|
return /* @__PURE__ */ n.jsxs("div", { className: k.kpiChartContainer, children: [
|
|
59
|
-
/* @__PURE__ */ n.jsx(
|
|
60
|
-
/* @__PURE__ */ n.jsx("div", { className: k.kpiComparisonContainer, style: { fontSize: i }, children: l ? /* @__PURE__ */ n.jsx(
|
|
59
|
+
/* @__PURE__ */ n.jsx(d, { style: { fontSize: s }, children: _ }),
|
|
60
|
+
/* @__PURE__ */ n.jsx("div", { className: k.kpiComparisonContainer, style: { fontSize: i }, children: l ? /* @__PURE__ */ n.jsx(d, { children: g }) : /* @__PURE__ */ n.jsx(
|
|
61
61
|
K,
|
|
62
62
|
{
|
|
63
63
|
changeFontSize: i,
|
|
@@ -65,8 +65,8 @@ const m = [["path", { d: "M3 17l6 -6l4 4l8 -8", key: "svg-0" }], ["path", { d: "
|
|
|
65
65
|
comparisonLabel: C,
|
|
66
66
|
comparisonValue: r,
|
|
67
67
|
invertChangeColors: c,
|
|
68
|
-
percentageDecimalPlaces:
|
|
69
|
-
showChangeAsPercentage:
|
|
68
|
+
percentageDecimalPlaces: h,
|
|
69
|
+
showChangeAsPercentage: p,
|
|
70
70
|
value: e,
|
|
71
71
|
valueFormatter: t
|
|
72
72
|
}
|
|
@@ -76,4 +76,4 @@ const m = [["path", { d: "M3 17l6 -6l4 4l8 -8", key: "svg-0" }], ["path", { d: "
|
|
|
76
76
|
export {
|
|
77
77
|
S as K
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=KpiChart-
|
|
79
|
+
//# sourceMappingURL=KpiChart-DJ5el66E.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KpiChart-
|
|
1
|
+
{"version":3,"file":"KpiChart-DJ5el66E.js","sources":["../node_modules/@tabler/icons-react/dist/esm/icons/IconTrendingDown.mjs","../node_modules/@tabler/icons-react/dist/esm/icons/IconTrendingUp.mjs","../src/remarkable-ui/charts/kpis/components/KpiChartChange.tsx","../src/remarkable-ui/charts/kpis/KpiChart.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.35.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 7l6 6l4 -4l8 8\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M21 10l0 7l-7 0\", \"key\": \"svg-1\" }]];\nconst IconTrendingDown = createReactComponent(\"outline\", \"trending-down\", \"TrendingDown\", __iconNode);\n\nexport { __iconNode, IconTrendingDown as default };\n//# sourceMappingURL=IconTrendingDown.mjs.map\n","/**\n * @license @tabler/icons-react v3.35.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 17l6 -6l4 4l8 -8\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M14 7l7 0l0 7\", \"key\": \"svg-1\" }]];\nconst IconTrendingUp = createReactComponent(\"outline\", \"trending-up\", \"TrendingUp\", __iconNode);\n\nexport { __iconNode, IconTrendingUp as default };\n//# sourceMappingURL=IconTrendingUp.mjs.map\n","import { FC } from 'react';\nimport styles from './KpiChartChange.module.css';\nimport clsx from 'clsx';\nimport { Typography } from '../../../shared/Typography/Typography';\nimport { IconTrendingDown, IconTrendingUp } from '@tabler/icons-react';\nimport { KpiChartProps } from '../KpiChart.types';\n\nconst getChangeClass = (isPositive: boolean, invertChangeColors: boolean) => {\n if (isPositive) return invertChangeColors ? styles.negative : styles.positive;\n return invertChangeColors ? styles.positive : styles.negative;\n};\n\ntype KpiChartChangeProps = KpiChartProps & { className?: string };\n\nexport const KpiChartChange: FC<KpiChartChangeProps> = ({\n value,\n comparisonValue = 0,\n showChangeAsPercentage,\n invertChangeColors = false,\n comparisonLabel,\n valueFormatter,\n percentageDecimalPlaces = 1,\n className,\n}) => {\n const difference = value - comparisonValue;\n const isPositive = difference > 0;\n\n let differenceLabel: string;\n\n if (showChangeAsPercentage) {\n const percentage = comparisonValue === 0 ? 0 : (difference / comparisonValue) * 100;\n differenceLabel = `${percentage.toFixed(percentageDecimalPlaces)}%`;\n } else {\n differenceLabel = valueFormatter ? valueFormatter(difference) : difference.toString();\n }\n\n const displayValue = `${isPositive ? '+' : ''}${differenceLabel}`;\n\n const Icon = isPositive ? IconTrendingUp : IconTrendingDown;\n\n return (\n <div className={clsx(className, styles.kpiChartChangeContainer)}>\n <div className={clsx(styles.kpiChangeBadge, getChangeClass(isPositive, invertChangeColors))}>\n <Icon />\n <Typography>{displayValue}</Typography>\n </div>\n {comparisonLabel && <Typography>{comparisonLabel}</Typography>}\n </div>\n );\n};\n","import { FC } from 'react';\nimport { Typography } from '../../shared/Typography/Typography';\nimport styles from './KpiChart.module.css';\nimport { KpiChartChange } from './components/KpiChartChange';\nimport { KpiChartProps } from './KpiChart.types';\nimport clsx from 'clsx';\n\nexport const KpiChart: FC<KpiChartProps> = ({\n value,\n changeFontSize,\n comparisonValue,\n comparisonLabel,\n invertChangeColors,\n showChangeAsPercentage,\n percentageDecimalPlaces = 1,\n equalComparisonLabel = 'No change',\n valueFontSize,\n valueFormatter,\n}) => {\n const hasComparisonValue = comparisonValue !== undefined;\n const equalComparison = hasComparisonValue && comparisonValue === value;\n\n const displayValue = value === undefined ? '' : valueFormatter ? valueFormatter(value) : value;\n\n return (\n <div className={styles.kpiChartContainer}>\n <Typography style={{ fontSize: valueFontSize }}>{displayValue}</Typography>\n <div className={styles.kpiComparisonContainer} style={{ fontSize: changeFontSize }}>\n {equalComparison ? (\n <Typography>{equalComparisonLabel}</Typography>\n ) : (\n <KpiChartChange\n changeFontSize={changeFontSize}\n className={clsx(!hasComparisonValue && styles.kpiChangeHidden)}\n comparisonLabel={comparisonLabel}\n comparisonValue={comparisonValue}\n invertChangeColors={invertChangeColors}\n percentageDecimalPlaces={percentageDecimalPlaces}\n showChangeAsPercentage={showChangeAsPercentage}\n value={value}\n valueFormatter={valueFormatter}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":["__iconNode","IconTrendingDown","createReactComponent","IconTrendingUp","getChangeClass","isPositive","invertChangeColors","styles","KpiChartChange","value","comparisonValue","showChangeAsPercentage","comparisonLabel","valueFormatter","percentageDecimalPlaces","className","difference","differenceLabel","displayValue","Icon","clsx","jsxs","jsx","Typography","KpiChart","changeFontSize","equalComparisonLabel","valueFontSize","hasComparisonValue","equalComparison"],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa,CAAC,CAAC,QAAQ,EAAE,GAAK,qBAAqB,KAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,GAAK,mBAAmB,KAAO,QAAO,CAAE,CAAC,GAC1HC,IAAmBC,EAAqB,WAAW,iBAAiB,gBAAgBF,CAAU;ACVpG;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa,CAAC,CAAC,QAAQ,EAAE,GAAK,uBAAuB,KAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,GAAK,iBAAiB,KAAO,QAAO,CAAE,CAAC,GAC1HG,IAAiBD,EAAqB,WAAW,eAAe,cAAcF,CAAU;;;;;;;;;GCHxFI,IAAiB,CAACC,GAAqBC,MACvCD,IAAmBC,IAAqBC,EAAO,WAAWA,EAAO,WAC9DD,IAAqBC,EAAO,WAAWA,EAAO,UAK1CC,IAA0C,CAAC;AAAA,EACtD,OAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,wBAAAC;A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EY,gBAAAA,EAAAA,KAAC,OAAA,EAAI,WAAWd,EAAO,mBACrB,UAAA;AAAA,IAAAe,gBAAAA,MAACC,KAAW,OAAO,EAAE,UAAUI,EAAA,GAAkB,UAAAT,GAAa;AAAA,IAC9DI,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAWf,EAAO,wBAAwB,OAAO,EAAE,UAAUkB,EAAA,GAC/D,UAAAI,IACCP,gBAAAA,MAACC,GAAA,EAAY,aAAqB,IAElCD,gBAAAA,EAAAA;AAAAA,MAACd;AAAA,MAAA;AAAA,QACC,gBAAAiB;AAAA,QACA,WAAWL,EAAK,CAACQ,KAAsBrB,EAAO,eAAe;AAAA,QAC7D,iBAAAK;AAAA,QACA,iBAAAF;AAAA,QACA,oBAAAJ;AAAA,QACA,yBAAAQ;AAAA,QACA,wBAAAH;AAAA,QACA,OAAAF;AAAA,QACA,gBAAAI;AAAA,MAAA;AAAA,IAAA,EACF,CAEJ;AAAA,EAAA,GACF;AAEJ;","x_google_ignoreList":[0,1]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useTheme as j, defineComponent as w } from "@embeddable.com/react";
|
|
2
|
-
import { i as A, r as Y, U as l, j as y, d as q, w as B, W as E, X as M, t as I, c as J, Y as b, Z as c, o as v } from "./component.constants-
|
|
3
|
-
import { C as O } from "./ChartCard-
|
|
2
|
+
import { i as A, r as Y, U as l, j as y, d as q, w as B, W as E, X as M, t as I, c as J, Y as b, Z as c, o as v } from "./component.constants-D0ea4CW4.js";
|
|
3
|
+
import { C as O } from "./ChartCard-k190CXR0.js";
|
|
4
4
|
import { useEffect as U } from "react";
|
|
5
|
-
import { K as W } from "./KpiChart-
|
|
6
|
-
import { g as X } from "./formatter.utils-
|
|
7
|
-
import { g as Z, a as $ } from "./timeRange.utils-
|
|
8
|
-
import { C as k } from "./ComparisonPeriod.type.emb-
|
|
5
|
+
import { K as W } from "./KpiChart-DJ5el66E.js";
|
|
6
|
+
import { g as X } from "./formatter.utils-DBUd3PfE.js";
|
|
7
|
+
import { g as Z, a as $ } from "./timeRange.utils-B9kyLPq_.js";
|
|
8
|
+
import { C as k } from "./ComparisonPeriod.type.emb-Dgl2VM4_.js";
|
|
9
9
|
const G = (e) => {
|
|
10
10
|
var d, C, P, h, u, f;
|
|
11
11
|
const a = j();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useTheme as h, defineComponent as f } from "@embeddable.com/react";
|
|
2
|
-
import { i as C, r as b, j as m, d as K, w as g, t as x, c as F, Z as N, o as S } from "./component.constants-
|
|
3
|
-
import { C as j } from "./ChartCard-
|
|
2
|
+
import { i as C, r as b, j as m, d as K, w as g, t as x, c as F, Z as N, o as S } from "./component.constants-D0ea4CW4.js";
|
|
3
|
+
import { C as j } from "./ChartCard-k190CXR0.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { K as v } from "./KpiChart-
|
|
6
|
-
import { g as z } from "./formatter.utils-
|
|
5
|
+
import { K as v } from "./KpiChart-DJ5el66E.js";
|
|
6
|
+
import { g as z } from "./formatter.utils-DBUd3PfE.js";
|
|
7
7
|
const P = (e) => {
|
|
8
8
|
var s, o;
|
|
9
9
|
const a = h();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useTheme as Y, defineComponent as _ } from "@embeddable.com/react";
|
|
2
|
-
import { m as E, E as G, C as w, U, _ as I, $ as O, i as q, r as z, j as V, a0 as K, d as J, a as B, Y as A, a1 as S, z as W, X as H, W as Q, t as Z, c as ee, s as ae, e as se, f as ne, g as te, x as ie, y as oe, p as re, q as le, u as me, A as de, V as ce, o as F } from "./component.constants-
|
|
3
|
-
import { C as pe } from "./ChartCard-
|
|
2
|
+
import { m as E, E as G, C as w, U, _ as I, $ as O, i as q, r as z, j as V, a0 as K, d as J, a as B, Y as A, a1 as S, z as W, X as H, W as Q, t as Z, c as ee, s as ae, e as se, f as ne, g as te, x as ie, y as oe, p as re, q as le, u as me, A as de, V as ce, o as F } from "./component.constants-D0ea4CW4.js";
|
|
3
|
+
import { C as pe } from "./ChartCard-k190CXR0.js";
|
|
4
4
|
import { useEffect as ue } from "react";
|
|
5
|
-
import { g as ge } from "./timeRange.utils-
|
|
6
|
-
import { g as M } from "./formatter.utils-
|
|
5
|
+
import { g as ge } from "./timeRange.utils-B9kyLPq_.js";
|
|
6
|
+
import { g as M } from "./formatter.utils-DBUd3PfE.js";
|
|
7
7
|
import { g as xe, a as he } from "./object.utils-D_Zzon-H.js";
|
|
8
8
|
import { i as be, s as Ce } from "./color.utils-CVyp-fGP.js";
|
|
9
9
|
import { g as fe } from "./lines.utils-CFEUUo4k.js";
|
|
10
10
|
import { u as N } from "./charts.fillGaps.hooks-5WclK2CD.js";
|
|
11
|
-
import { C as ye } from "./ComparisonPeriod.type.emb-
|
|
11
|
+
import { C as ye } from "./ComparisonPeriod.type.emb-Dgl2VM4_.js";
|
|
12
12
|
const L = "mainAxis", v = "comparisonAxis", $ = (a, t) => {
|
|
13
13
|
var P, k, h, u;
|
|
14
14
|
const { data: n, measure: i, dimension: s, index: c, isPreviousPeriod: r, hasMinMaxYAxisRange: b, labels: e } = a, p = n == null ? void 0 : n.map((C) => C[s.name]), l = !!((P = i.inputs) != null && P.connectGaps), g = e ? e.map((C) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTheme as v, defineComponent as w } from "@embeddable.com/react";
|
|
2
|
-
import { E as f, C as g, m as R, i as F, r as P, j as A, a0 as B, d as j, a as k, Y as p, a1 as O, b as S, t as T, c as I, s as $, e as G, f as X, g as Y, x as E, y as K, p as N, q as U, u as _, A as q, V as z, o as W } from "./component.constants-
|
|
3
|
-
import { C as H } from "./ChartCard-
|
|
4
|
-
import { g as V } from "./formatter.utils-
|
|
2
|
+
import { E as f, C as g, m as R, i as F, r as P, j as A, a0 as B, d as j, a as k, Y as p, a1 as O, b as S, t as T, c as I, s as $, e as G, f as X, g as Y, x as E, y as K, p as N, q as U, u as _, A as q, V as z, o as W } from "./component.constants-D0ea4CW4.js";
|
|
3
|
+
import { C as H } from "./ChartCard-k190CXR0.js";
|
|
4
|
+
import { g as V } from "./formatter.utils-DBUd3PfE.js";
|
|
5
5
|
import { g as J, a as y } from "./object.utils-D_Zzon-H.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { i as D, s as Q } from "./color.utils-CVyp-fGP.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTheme as R, defineComponent as P } from "@embeddable.com/react";
|
|
2
|
-
import { E as k, C as $, m as F, i as S, r as v, j as y, a0 as B, d as j, w, Y as V, b as O, z as T, t as X, c as Y, A as E, s as K, e as N, f as U, g as q, x as z, y as W, p as _, q as H, u as J, V as D, o as Q } from "./component.constants-
|
|
3
|
-
import { C as Z } from "./ChartCard-
|
|
4
|
-
import { g as M } from "./formatter.utils-
|
|
2
|
+
import { E as k, C as $, m as F, i as S, r as v, j as y, a0 as B, d as j, w, Y as V, b as O, z as T, t as X, c as Y, A as E, s as K, e as N, f as U, g as q, x as z, y as W, p as _, q as H, u as J, V as D, o as Q } from "./component.constants-D0ea4CW4.js";
|
|
3
|
+
import { C as Z } from "./ChartCard-k190CXR0.js";
|
|
4
|
+
import { g as M } from "./formatter.utils-DBUd3PfE.js";
|
|
5
5
|
import { g as I, a as G } from "./object.utils-D_Zzon-H.js";
|
|
6
6
|
import { s as ee } from "./color.utils-CVyp-fGP.js";
|
|
7
7
|
import "react";
|