@sequenceholdings/atlas-ui 0.1.2 → 0.1.5
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/charts.d.ts +160 -0
- package/dist/charts.mjs +97 -51
- package/dist/index.d.ts +4064 -0
- package/dist/index.mjs +36932 -10520
- package/dist/tokens.css +0 -36
- package/dist/{utils-Dhlckutd.js → utils-D-IFNYlh.js} +566 -516
- package/package.json +28 -8
- package/theme.v2.css +225 -0
- package/tokens.v2.css +537 -0
- package/dist/charts.mjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/utils-Dhlckutd.js.map +0 -1
- package/src/charts.ts +0 -17
- package/src/index.ts +0 -216
- package/src/process-env.d.ts +0 -8
- package/src/tokens.css +0 -220
package/dist/charts.d.ts
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
export declare interface BarDataset {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
data: number[];
|
|
8
|
+
color: string;
|
|
9
|
+
borderColor?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare const CHART_GRID: {
|
|
13
|
+
readonly horizontal: true;
|
|
14
|
+
readonly vertical: false;
|
|
15
|
+
readonly strokeDasharray: "3 3";
|
|
16
|
+
readonly stroke: "#E2E8F0";
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** Chart.js scale ticks — font size 10, ui-monospace, slate-400 */
|
|
20
|
+
export declare const CHART_JS_SCALE_TICKS: {
|
|
21
|
+
readonly font: {
|
|
22
|
+
readonly size: 10;
|
|
23
|
+
readonly family: "ui-monospace, monospace";
|
|
24
|
+
};
|
|
25
|
+
readonly color: "#94A3B8";
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** Chart.js Tooltip plugin options — aligned with StackedBarChart / TimeseriesLineChart.
|
|
29
|
+
* `footerColor` / `footerFont` / `footerMarginTop` are required for the tooltip's
|
|
30
|
+
* footer slot ("Total: $X" callbacks on SpendTimeseriesChart, CreditsTab,
|
|
31
|
+
* StackedBarChart) to render visibly — without them the footer string is emitted
|
|
32
|
+
* but rendered with default body styling and visually blends into the line above. */
|
|
33
|
+
export declare const CHART_JS_TOOLTIP_STYLE: {
|
|
34
|
+
readonly backgroundColor: "#fff";
|
|
35
|
+
readonly titleColor: "#0F172A";
|
|
36
|
+
readonly bodyColor: "#334155";
|
|
37
|
+
readonly footerColor: "#0F172A";
|
|
38
|
+
readonly footerFont: {
|
|
39
|
+
readonly weight: "bold";
|
|
40
|
+
readonly size: 12;
|
|
41
|
+
readonly family: "ui-monospace, monospace";
|
|
42
|
+
};
|
|
43
|
+
readonly footerMarginTop: 8;
|
|
44
|
+
readonly borderColor: "#E2E8F0";
|
|
45
|
+
readonly borderWidth: 1;
|
|
46
|
+
readonly titleFont: {
|
|
47
|
+
readonly weight: "bold";
|
|
48
|
+
readonly size: 12;
|
|
49
|
+
readonly family: "ui-monospace, monospace";
|
|
50
|
+
};
|
|
51
|
+
readonly bodyFont: {
|
|
52
|
+
readonly size: 12;
|
|
53
|
+
readonly family: "ui-monospace, monospace";
|
|
54
|
+
};
|
|
55
|
+
readonly padding: 10;
|
|
56
|
+
readonly cornerRadius: 8;
|
|
57
|
+
readonly boxPadding: 4;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** DES-334: computed — Chart.js / Recharts tick APIs take numeric px, not CSS vars */
|
|
61
|
+
export declare const CHART_TICK: {
|
|
62
|
+
readonly fontSize: 10;
|
|
63
|
+
readonly fill: "#94A3B8";
|
|
64
|
+
readonly fontFamily: "ui-monospace, monospace";
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export declare const CHART_TOOLTIP: {
|
|
68
|
+
readonly borderRadius: "var(--corner-surface-nested)";
|
|
69
|
+
readonly border: "1px solid #E2E8F0";
|
|
70
|
+
readonly boxShadow: "var(--elevation-popover)";
|
|
71
|
+
readonly fontSize: "var(--type-caption)";
|
|
72
|
+
readonly fontFamily: "ui-monospace, monospace";
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export declare function ChartCard({ title, toolbar, legend, children, className }: ChartCardProps): JSX.Element;
|
|
76
|
+
|
|
77
|
+
declare interface ChartCardProps {
|
|
78
|
+
title: string;
|
|
79
|
+
toolbar?: ReactNode;
|
|
80
|
+
legend?: ReactNode;
|
|
81
|
+
children: ReactNode;
|
|
82
|
+
className?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export declare function ChartLegend({ items, className }: ChartLegendProps): JSX.Element;
|
|
86
|
+
|
|
87
|
+
declare interface ChartLegendProps {
|
|
88
|
+
items: LegendItem[];
|
|
89
|
+
className?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export declare function DonutChart({ segments, centerLabel, centerValue, size, className, }: DonutChartProps): JSX.Element | null;
|
|
93
|
+
|
|
94
|
+
declare interface DonutChartProps {
|
|
95
|
+
segments: DonutSegment[];
|
|
96
|
+
centerLabel?: string;
|
|
97
|
+
centerValue?: string;
|
|
98
|
+
size?: number;
|
|
99
|
+
className?: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export declare interface DonutSegment {
|
|
103
|
+
key: string;
|
|
104
|
+
label: string;
|
|
105
|
+
value: number;
|
|
106
|
+
color: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export declare function formatChartCurrencyTick(v: number | string): string;
|
|
110
|
+
|
|
111
|
+
declare interface LegendItem {
|
|
112
|
+
key: string;
|
|
113
|
+
label: string;
|
|
114
|
+
color: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export declare interface LineDataset {
|
|
118
|
+
key: string;
|
|
119
|
+
label: string;
|
|
120
|
+
data: number[];
|
|
121
|
+
color: string;
|
|
122
|
+
fill?: boolean;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export declare function StackedBarChart({ labels, datasets, stacked, yFormat, onClick, barTotals, maxTicksLimit, height, className, }: StackedBarChartProps): JSX.Element | null;
|
|
126
|
+
|
|
127
|
+
declare interface StackedBarChartProps {
|
|
128
|
+
labels: string[];
|
|
129
|
+
datasets: BarDataset[];
|
|
130
|
+
stacked?: boolean;
|
|
131
|
+
yFormat?: 'currency' | 'count' | 'percent';
|
|
132
|
+
onClick?: (index: number) => void;
|
|
133
|
+
barTotals?: boolean;
|
|
134
|
+
maxTicksLimit?: number;
|
|
135
|
+
height?: number;
|
|
136
|
+
className?: string;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export declare function TimeseriesLineChart({ labels, datasets, yFormat, tension, maxTicksLimit, showPoints, showValueLabels, height, className, }: TimeseriesLineChartProps): JSX.Element | null;
|
|
140
|
+
|
|
141
|
+
declare interface TimeseriesLineChartProps {
|
|
142
|
+
labels: string[];
|
|
143
|
+
datasets: LineDataset[];
|
|
144
|
+
yFormat?: 'currency' | 'percent' | 'number';
|
|
145
|
+
tension?: number;
|
|
146
|
+
maxTicksLimit?: number;
|
|
147
|
+
showPoints?: boolean;
|
|
148
|
+
showValueLabels?: boolean;
|
|
149
|
+
height?: number;
|
|
150
|
+
className?: string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export { }
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
declare module 'chart.js' {
|
|
157
|
+
interface TooltipPositionerMap {
|
|
158
|
+
cursor: TooltipPositionerFunction<ChartType>;
|
|
159
|
+
}
|
|
160
|
+
}
|
package/dist/charts.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./utils-
|
|
1
|
+
import { t as e } from "./utils-D-IFNYlh.js";
|
|
2
2
|
import { forwardRef as t, useEffect as n, useMemo as r, useRef as i } from "react";
|
|
3
3
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
4
|
//#region ../../../atlas/src/shared/components/ui/chart-card.tsx
|
|
@@ -840,12 +840,10 @@ var Et = (e) => e === 0 || e === 1, Dt = (e, t, n) => -(2 ** (10 * --e) * Math.s
|
|
|
840
840
|
return Et(e) ? e : e < .5 ? .5 * Dt(e * 2, t, n) : .5 + .5 * Ot(e * 2 - 1, t, n);
|
|
841
841
|
},
|
|
842
842
|
easeInBack(e) {
|
|
843
|
-
|
|
844
|
-
return e * e * ((t + 1) * e - t);
|
|
843
|
+
return e * e * (2.70158 * e - 1.70158);
|
|
845
844
|
},
|
|
846
845
|
easeOutBack(e) {
|
|
847
|
-
|
|
848
|
-
return --e * e * ((t + 1) * e + t) + 1;
|
|
846
|
+
return --e * e * (2.70158 * e + 1.70158) + 1;
|
|
849
847
|
},
|
|
850
848
|
easeInOutBack(e) {
|
|
851
849
|
let t = 1.70158;
|
|
@@ -1056,7 +1054,7 @@ function Kt(e, t) {
|
|
|
1056
1054
|
function qt(e, t, n) {
|
|
1057
1055
|
return typeof t == "string" ? Me(Kt(e, t), n) : Me(Kt(e, ""), t);
|
|
1058
1056
|
}
|
|
1059
|
-
var G = /*
|
|
1057
|
+
var G = /* #__PURE__ */ new class {
|
|
1060
1058
|
constructor(e, t) {
|
|
1061
1059
|
this.animation = void 0, this.backgroundColor = "rgba(0,0,0,0.1)", this.borderColor = "rgba(0,0,0,0.1)", this.color = "#666", this.datasets = {}, this.devicePixelRatio = (e) => e.chart.platform.getDevicePixelRatio(), this.elements = {}, this.events = [
|
|
1062
1060
|
"mousemove",
|
|
@@ -1879,7 +1877,7 @@ function Pr(e, t) {
|
|
|
1879
1877
|
bottom: n.bottom === !1 ? e.height : r.bottom + (n.bottom === !0 ? 0 : n.bottom)
|
|
1880
1878
|
};
|
|
1881
1879
|
}
|
|
1882
|
-
var Y = /*
|
|
1880
|
+
var Y = /* #__PURE__ */ new class {
|
|
1883
1881
|
constructor() {
|
|
1884
1882
|
this._request = null, this._charts = /* @__PURE__ */ new Map(), this._running = !1, this._lastDate = void 0;
|
|
1885
1883
|
}
|
|
@@ -4315,7 +4313,7 @@ function Ka(e, t) {
|
|
|
4315
4313
|
function qa(e) {
|
|
4316
4314
|
return "id" in e && "defaults" in e;
|
|
4317
4315
|
}
|
|
4318
|
-
var X = /*
|
|
4316
|
+
var X = /* #__PURE__ */ new class {
|
|
4319
4317
|
constructor() {
|
|
4320
4318
|
this.controllers = new Wa(oi, "datasets", !0), this.elements = new Wa(Ca, "elements"), this.plugins = new Wa(Object, "plugins"), this.scales = new Wa(Ua, "scales"), this._typedRegistries = [
|
|
4321
4319
|
this.controllers,
|
|
@@ -7034,7 +7032,7 @@ var zc = {
|
|
|
7034
7032
|
common: !0,
|
|
7035
7033
|
size: 3154e7
|
|
7036
7034
|
}
|
|
7037
|
-
}, $ = /*
|
|
7035
|
+
}, $ = /* #__PURE__ */ Object.keys(zc);
|
|
7038
7036
|
function Bc(e, t) {
|
|
7039
7037
|
return e - t;
|
|
7040
7038
|
}
|
|
@@ -7332,7 +7330,7 @@ function nl(e, t) {
|
|
|
7332
7330
|
m
|
|
7333
7331
|
]), n(() => {
|
|
7334
7332
|
_.current && (y(), setTimeout(v));
|
|
7335
|
-
}, [l]), n(() => (v(), () => y()), []),
|
|
7333
|
+
}, [l]), n(() => (v(), () => y()), []), /*#__PURE__*/ a("canvas", {
|
|
7336
7334
|
ref: g,
|
|
7337
7335
|
role: "img",
|
|
7338
7336
|
height: r,
|
|
@@ -7341,18 +7339,16 @@ function nl(e, t) {
|
|
|
7341
7339
|
children: p
|
|
7342
7340
|
});
|
|
7343
7341
|
}
|
|
7344
|
-
var rl =
|
|
7342
|
+
var rl = /*#__PURE__*/ t(nl);
|
|
7345
7343
|
function il(e, n) {
|
|
7346
|
-
return jo.register(n),
|
|
7344
|
+
return jo.register(n), /*#__PURE__*/ t((t, n) => /*#__PURE__*/ a(rl, {
|
|
7347
7345
|
...t,
|
|
7348
7346
|
ref: n,
|
|
7349
7347
|
type: e
|
|
7350
7348
|
}));
|
|
7351
7349
|
}
|
|
7352
|
-
var al = /*
|
|
7353
|
-
|
|
7354
|
-
//#region ../../../atlas/src/shared/components/ui/donut-chart.tsx
|
|
7355
|
-
jo.register(Vo, sc);
|
|
7350
|
+
var al = /* #__PURE__ */ il("line", Ti), ol = /* #__PURE__ */ il("bar", Si), sl = /* #__PURE__ */ il("doughnut", wi);
|
|
7351
|
+
jo.register(Vo, sc), sc.positioners.cursor = (e, t) => t;
|
|
7356
7352
|
var cl = {
|
|
7357
7353
|
backgroundColor: "#fff",
|
|
7358
7354
|
titleColor: "#0F172A",
|
|
@@ -7390,9 +7386,10 @@ function ll({ segments: e, centerLabel: t, centerValue: n, size: s = 220, classN
|
|
|
7390
7386
|
plugins: {
|
|
7391
7387
|
tooltip: {
|
|
7392
7388
|
...cl,
|
|
7389
|
+
position: "cursor",
|
|
7393
7390
|
callbacks: { label: (t) => {
|
|
7394
|
-
let n = e.reduce((e, t) => e + t.value, 0)
|
|
7395
|
-
return ` ${t.
|
|
7391
|
+
let n = e.reduce((e, t) => e + t.value, 0);
|
|
7392
|
+
return ` ${n > 0 ? (t.raw / n * 100).toFixed(1) : "0"}%`;
|
|
7396
7393
|
} }
|
|
7397
7394
|
},
|
|
7398
7395
|
legend: { display: !1 }
|
|
@@ -7415,7 +7412,7 @@ function ll({ segments: e, centerLabel: t, centerValue: n, size: s = 220, classN
|
|
|
7415
7412
|
className: "text-lg font-semibold text-foreground",
|
|
7416
7413
|
children: n
|
|
7417
7414
|
}), t && /* @__PURE__ */ a("span", {
|
|
7418
|
-
className: "text-xs font-medium uppercase tracking-wider text-
|
|
7415
|
+
className: "text-xs font-medium uppercase tracking-wider text-muted-foreground",
|
|
7419
7416
|
children: t
|
|
7420
7417
|
})]
|
|
7421
7418
|
})]
|
|
@@ -7428,6 +7425,13 @@ var ul = {
|
|
|
7428
7425
|
backgroundColor: "#fff",
|
|
7429
7426
|
titleColor: "#0F172A",
|
|
7430
7427
|
bodyColor: "#334155",
|
|
7428
|
+
footerColor: "#0F172A",
|
|
7429
|
+
footerFont: {
|
|
7430
|
+
weight: "bold",
|
|
7431
|
+
size: 12,
|
|
7432
|
+
family: "ui-monospace, monospace"
|
|
7433
|
+
},
|
|
7434
|
+
footerMarginTop: 8,
|
|
7431
7435
|
borderColor: "#E2E8F0",
|
|
7432
7436
|
borderWidth: 1,
|
|
7433
7437
|
titleFont: {
|
|
@@ -7487,13 +7491,19 @@ function ml({ labels: e, datasets: t, stacked: n = !0, yFormat: o = "currency",
|
|
|
7487
7491
|
backgroundColor: e.color,
|
|
7488
7492
|
borderColor: e.borderColor ?? e.color,
|
|
7489
7493
|
borderWidth: +!!e.borderColor,
|
|
7490
|
-
borderRadius: 3,
|
|
7491
|
-
borderSkipped: !1
|
|
7494
|
+
borderRadius: o === "percent" ? 1 : 3,
|
|
7495
|
+
borderSkipped: !1,
|
|
7496
|
+
barPercentage: o === "percent" ? .72 : .9,
|
|
7497
|
+
categoryPercentage: o === "percent" ? .82 : .9
|
|
7492
7498
|
}))
|
|
7493
|
-
}), [
|
|
7499
|
+
}), [
|
|
7500
|
+
e,
|
|
7501
|
+
t,
|
|
7502
|
+
o
|
|
7503
|
+
]), m = r(() => ({
|
|
7494
7504
|
responsive: !0,
|
|
7495
7505
|
maintainAspectRatio: !1,
|
|
7496
|
-
layout: c ? { padding: { top: 24 } } : void 0,
|
|
7506
|
+
layout: c ? { padding: { top: 24 } } : o === "percent" ? { padding: { top: 10 } } : void 0,
|
|
7497
7507
|
interaction: {
|
|
7498
7508
|
mode: "index",
|
|
7499
7509
|
intersect: !1
|
|
@@ -7512,7 +7522,7 @@ function ml({ labels: e, datasets: t, stacked: n = !0, yFormat: o = "currency",
|
|
|
7512
7522
|
callbacks: o === "currency" ? {
|
|
7513
7523
|
label: (e) => ` ${e.dataset.label}: ${fl(e.raw)}`,
|
|
7514
7524
|
footer: (e) => `Total: ${fl(e.reduce((e, t) => e + t.raw, 0))}`
|
|
7515
|
-
} : void 0
|
|
7525
|
+
} : o === "percent" ? { label: (e) => ` ${e.dataset.label}: ${e.raw.toFixed(1)}%` } : void 0
|
|
7516
7526
|
},
|
|
7517
7527
|
legend: { display: !1 }
|
|
7518
7528
|
},
|
|
@@ -7539,11 +7549,12 @@ function ml({ labels: e, datasets: t, stacked: n = !0, yFormat: o = "currency",
|
|
|
7539
7549
|
family: "ui-monospace, monospace"
|
|
7540
7550
|
},
|
|
7541
7551
|
color: "#94A3B8",
|
|
7542
|
-
callback: o === "currency" ? dl : void 0,
|
|
7552
|
+
callback: o === "currency" ? dl : o === "percent" ? (e) => Number(e) > 100 ? "" : `${e}%` : void 0,
|
|
7543
7553
|
...o === "count" ? { stepSize: 1 } : {}
|
|
7544
7554
|
},
|
|
7545
7555
|
border: { display: !1 },
|
|
7546
|
-
beginAtZero: !0
|
|
7556
|
+
beginAtZero: !0,
|
|
7557
|
+
...o === "percent" ? { max: 102 } : {}
|
|
7547
7558
|
}
|
|
7548
7559
|
}
|
|
7549
7560
|
}), [
|
|
@@ -7597,8 +7608,11 @@ function _l(e) {
|
|
|
7597
7608
|
maximumFractionDigits: 2
|
|
7598
7609
|
}).format(e);
|
|
7599
7610
|
}
|
|
7600
|
-
function vl(
|
|
7601
|
-
|
|
7611
|
+
function vl(e, t) {
|
|
7612
|
+
return t === "currency" ? gl(e) : t === "percent" ? `${e.toFixed(0)}%` : e.toLocaleString();
|
|
7613
|
+
}
|
|
7614
|
+
function yl({ labels: e, datasets: t, yFormat: n = "currency", tension: i = .3, maxTicksLimit: o, showPoints: s = !1, showValueLabels: c = !1, height: l = 220, className: u }) {
|
|
7615
|
+
let d = r(() => ({
|
|
7602
7616
|
labels: e,
|
|
7603
7617
|
datasets: t.map((e) => ({
|
|
7604
7618
|
label: e.label,
|
|
@@ -7607,17 +7621,36 @@ function vl({ labels: e, datasets: t, yFormat: n = "currency", tension: i = .3,
|
|
|
7607
7621
|
backgroundColor: e.fill ? `${e.color}33` : "transparent",
|
|
7608
7622
|
fill: e.fill ?? !1,
|
|
7609
7623
|
tension: i,
|
|
7610
|
-
pointRadius: 0,
|
|
7611
|
-
pointHoverRadius: 4,
|
|
7624
|
+
pointRadius: s ? 3 : 0,
|
|
7625
|
+
pointHoverRadius: s ? 5 : 4,
|
|
7626
|
+
pointBackgroundColor: e.color,
|
|
7627
|
+
pointBorderColor: "#FFFFFF",
|
|
7628
|
+
pointBorderWidth: s ? 1.5 : 0,
|
|
7612
7629
|
borderWidth: 2
|
|
7613
7630
|
}))
|
|
7614
7631
|
}), [
|
|
7615
7632
|
e,
|
|
7616
7633
|
t,
|
|
7617
|
-
i
|
|
7618
|
-
|
|
7634
|
+
i,
|
|
7635
|
+
s
|
|
7636
|
+
]), f = r(() => ({
|
|
7637
|
+
id: "lineValueLabels",
|
|
7638
|
+
afterDatasetsDraw(e) {
|
|
7639
|
+
if (!c) return;
|
|
7640
|
+
let { ctx: t } = e;
|
|
7641
|
+
t.save(), t.font = "600 10px ui-monospace, monospace", t.fillStyle = "#64748B", t.textAlign = "center", t.textBaseline = "bottom", e.data.datasets.forEach((r, i) => {
|
|
7642
|
+
e.getDatasetMeta(i).data.forEach((i, a) => {
|
|
7643
|
+
let o = r.data[a];
|
|
7644
|
+
if (typeof o != "number") return;
|
|
7645
|
+
let s = vl(o, n), c = t.measureText(s).width / 2, l = Math.min(Math.max(i.x, e.chartArea.left + c + 4), e.chartArea.right - c - 4);
|
|
7646
|
+
t.fillText(s, l, i.y - 8);
|
|
7647
|
+
});
|
|
7648
|
+
}), t.restore();
|
|
7649
|
+
}
|
|
7650
|
+
}), [c, n]), p = r(() => ({
|
|
7619
7651
|
responsive: !0,
|
|
7620
7652
|
maintainAspectRatio: !1,
|
|
7653
|
+
layout: c ? { padding: { top: 20 } } : void 0,
|
|
7621
7654
|
interaction: {
|
|
7622
7655
|
mode: "index",
|
|
7623
7656
|
intersect: !1
|
|
@@ -7629,7 +7662,10 @@ function vl({ labels: e, datasets: t, yFormat: n = "currency", tension: i = .3,
|
|
|
7629
7662
|
callbacks: n === "currency" ? {
|
|
7630
7663
|
label: (e) => ` ${e.dataset.label}: ${_l(e.raw)}`,
|
|
7631
7664
|
footer: (e) => `Total: ${_l(e.reduce((e, t) => e + t.raw, 0))}`
|
|
7632
|
-
} : n === "percent" ? { label: (e) => ` ${e.dataset.label}: ${e.raw.toFixed(1)}%` } :
|
|
7665
|
+
} : n === "percent" ? { label: (e) => ` ${e.dataset.label}: ${e.raw.toFixed(1)}%` } : n === "number" ? {
|
|
7666
|
+
label: (e) => ` ${e.dataset.label}: ${e.raw.toLocaleString()}`,
|
|
7667
|
+
footer: (e) => `Total: ${e.reduce((e, t) => e + t.raw, 0).toLocaleString()}`
|
|
7668
|
+
} : void 0
|
|
7633
7669
|
},
|
|
7634
7670
|
legend: { display: !1 }
|
|
7635
7671
|
},
|
|
@@ -7654,33 +7690,45 @@ function vl({ labels: e, datasets: t, yFormat: n = "currency", tension: i = .3,
|
|
|
7654
7690
|
family: "ui-monospace, monospace"
|
|
7655
7691
|
},
|
|
7656
7692
|
color: "#94A3B8",
|
|
7657
|
-
callback: n === "currency" ? gl : n === "percent" ? (e) => `${e}%` : void 0
|
|
7693
|
+
callback: n === "currency" ? gl : n === "percent" ? (e) => `${e}%` : n === "number" ? (e) => Number(e).toLocaleString() : void 0
|
|
7658
7694
|
},
|
|
7659
7695
|
border: { display: !1 },
|
|
7660
7696
|
beginAtZero: !0,
|
|
7661
7697
|
...n === "percent" ? { max: 100 } : {}
|
|
7662
7698
|
}
|
|
7663
7699
|
}
|
|
7664
|
-
}), [
|
|
7700
|
+
}), [
|
|
7701
|
+
n,
|
|
7702
|
+
o,
|
|
7703
|
+
c
|
|
7704
|
+
]);
|
|
7665
7705
|
return !e.length || !t.length ? null : /* @__PURE__ */ a("div", {
|
|
7666
|
-
className:
|
|
7667
|
-
style: { height:
|
|
7706
|
+
className: u,
|
|
7707
|
+
style: { height: l },
|
|
7668
7708
|
children: /* @__PURE__ */ a(al, {
|
|
7669
|
-
data:
|
|
7670
|
-
options:
|
|
7709
|
+
data: d,
|
|
7710
|
+
options: p,
|
|
7711
|
+
plugins: c ? [f] : []
|
|
7671
7712
|
})
|
|
7672
7713
|
});
|
|
7673
7714
|
}
|
|
7674
7715
|
//#endregion
|
|
7675
7716
|
//#region ../../../atlas/src/shared/lib/chart-styles.ts
|
|
7676
|
-
var
|
|
7717
|
+
var bl = {
|
|
7677
7718
|
fontSize: 10,
|
|
7678
7719
|
fill: "#94A3B8",
|
|
7679
7720
|
fontFamily: "ui-monospace, monospace"
|
|
7680
|
-
},
|
|
7721
|
+
}, xl = {
|
|
7681
7722
|
backgroundColor: "#fff",
|
|
7682
7723
|
titleColor: "#0F172A",
|
|
7683
7724
|
bodyColor: "#334155",
|
|
7725
|
+
footerColor: "#0F172A",
|
|
7726
|
+
footerFont: {
|
|
7727
|
+
weight: "bold",
|
|
7728
|
+
size: 12,
|
|
7729
|
+
family: "ui-monospace, monospace"
|
|
7730
|
+
},
|
|
7731
|
+
footerMarginTop: 8,
|
|
7684
7732
|
borderColor: "#E2E8F0",
|
|
7685
7733
|
borderWidth: 1,
|
|
7686
7734
|
titleFont: {
|
|
@@ -7695,30 +7743,28 @@ var yl = {
|
|
|
7695
7743
|
padding: 10,
|
|
7696
7744
|
cornerRadius: 8,
|
|
7697
7745
|
boxPadding: 4
|
|
7698
|
-
},
|
|
7746
|
+
}, Sl = {
|
|
7699
7747
|
font: {
|
|
7700
7748
|
size: 10,
|
|
7701
7749
|
family: "ui-monospace, monospace"
|
|
7702
7750
|
},
|
|
7703
7751
|
color: "#94A3B8"
|
|
7704
7752
|
};
|
|
7705
|
-
function
|
|
7753
|
+
function Cl(e) {
|
|
7706
7754
|
let t = Number(e);
|
|
7707
7755
|
return t >= 1e9 ? `$${(t / 1e9).toFixed(t >= 1e10 ? 0 : 1)}B` : t >= 1e6 ? `$${(t / 1e6).toFixed(t >= 1e7 ? 0 : 1)}M` : t >= 1e3 ? `$${(t / 1e3).toFixed(t >= 1e4 ? 0 : 1)}k` : `$${t}`;
|
|
7708
7756
|
}
|
|
7709
|
-
var
|
|
7710
|
-
borderRadius:
|
|
7757
|
+
var wl = {
|
|
7758
|
+
borderRadius: "var(--corner-surface-nested)",
|
|
7711
7759
|
border: "1px solid #E2E8F0",
|
|
7712
|
-
boxShadow: "
|
|
7713
|
-
fontSize:
|
|
7760
|
+
boxShadow: "var(--elevation-popover)",
|
|
7761
|
+
fontSize: "var(--type-caption)",
|
|
7714
7762
|
fontFamily: "ui-monospace, monospace"
|
|
7715
|
-
},
|
|
7763
|
+
}, Tl = {
|
|
7716
7764
|
horizontal: !0,
|
|
7717
7765
|
vertical: !1,
|
|
7718
7766
|
strokeDasharray: "3 3",
|
|
7719
7767
|
stroke: "#E2E8F0"
|
|
7720
7768
|
};
|
|
7721
7769
|
//#endregion
|
|
7722
|
-
export {
|
|
7723
|
-
|
|
7724
|
-
//# sourceMappingURL=charts.mjs.map
|
|
7770
|
+
export { Tl as CHART_GRID, Sl as CHART_JS_SCALE_TICKS, xl as CHART_JS_TOOLTIP_STYLE, bl as CHART_TICK, wl as CHART_TOOLTIP, s as ChartCard, c as ChartLegend, ll as DonutChart, ml as StackedBarChart, yl as TimeseriesLineChart, Cl as formatChartCurrencyTick };
|