minerva-design 1.7.1 → 1.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.
- package/CHANGELOG.md +12 -0
- package/README.md +2 -0
- package/custom-elements.json +10 -2
- package/dist/angular/fesm2022/minerva-angular.mjs +40 -5
- package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
- package/dist/angular/types/minerva-angular.d.ts +14 -1
- package/dist/charts/react/charts.cjs +1 -1
- package/dist/charts/react/charts.cjs.map +1 -1
- package/dist/charts/react/charts.js +120 -97
- package/dist/charts/react/charts.js.map +1 -1
- package/dist/charts/react/types.d.cts +8 -0
- package/dist/charts/react/types.d.ts +8 -0
- package/dist/core/contracts.cjs +1 -1
- package/dist/core/contracts.cjs.map +1 -1
- package/dist/core/contracts.js +1 -1
- package/dist/core/contracts.js.map +1 -1
- package/dist/icons/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/icons/_virtual/_rolldown/runtime.js +11 -0
- package/dist/icons/core.cjs +1 -0
- package/dist/icons/core.d.cts +12 -0
- package/dist/icons/core.d.ts +12 -0
- package/dist/icons/core.js +21 -0
- package/dist/icons/engine/canvas2d.cjs +2 -0
- package/dist/icons/engine/canvas2d.cjs.map +1 -0
- package/dist/icons/engine/canvas2d.d.cts +10 -0
- package/dist/icons/engine/canvas2d.d.ts +10 -0
- package/dist/icons/engine/canvas2d.js +47 -0
- package/dist/icons/engine/canvas2d.js.map +1 -0
- package/dist/icons/engine/color.cjs +2 -0
- package/dist/icons/engine/color.cjs.map +1 -0
- package/dist/icons/engine/color.d.cts +9 -0
- package/dist/icons/engine/color.d.ts +9 -0
- package/dist/icons/engine/color.js +115 -0
- package/dist/icons/engine/color.js.map +1 -0
- package/dist/icons/engine/defaults.cjs +2 -0
- package/dist/icons/engine/defaults.cjs.map +1 -0
- package/dist/icons/engine/defaults.d.cts +17 -0
- package/dist/icons/engine/defaults.d.ts +17 -0
- package/dist/icons/engine/defaults.js +39 -0
- package/dist/icons/engine/defaults.js.map +1 -0
- package/dist/icons/engine/define.cjs +2 -0
- package/dist/icons/engine/define.cjs.map +1 -0
- package/dist/icons/engine/define.d.cts +8 -0
- package/dist/icons/engine/define.d.ts +8 -0
- package/dist/icons/engine/define.js +19 -0
- package/dist/icons/engine/define.js.map +1 -0
- package/dist/icons/engine/icon-canvas.cjs +2 -0
- package/dist/icons/engine/icon-canvas.cjs.map +1 -0
- package/dist/icons/engine/icon-canvas.d.cts +13 -0
- package/dist/icons/engine/icon-canvas.d.ts +13 -0
- package/dist/icons/engine/icon-canvas.js +117 -0
- package/dist/icons/engine/icon-canvas.js.map +1 -0
- package/dist/icons/engine/icons/actions.cjs +2 -0
- package/dist/icons/engine/icons/actions.cjs.map +1 -0
- package/dist/icons/engine/icons/actions.d.cts +67 -0
- package/dist/icons/engine/icons/actions.d.ts +67 -0
- package/dist/icons/engine/icons/actions.js +447 -0
- package/dist/icons/engine/icons/actions.js.map +1 -0
- package/dist/icons/engine/icons/arrows.cjs +2 -0
- package/dist/icons/engine/icons/arrows.cjs.map +1 -0
- package/dist/icons/engine/icons/arrows.d.cts +69 -0
- package/dist/icons/engine/icons/arrows.d.ts +69 -0
- package/dist/icons/engine/icons/arrows.js +417 -0
- package/dist/icons/engine/icons/arrows.js.map +1 -0
- package/dist/icons/engine/icons/communication.cjs +2 -0
- package/dist/icons/engine/icons/communication.cjs.map +1 -0
- package/dist/icons/engine/icons/communication.d.cts +21 -0
- package/dist/icons/engine/icons/communication.d.ts +21 -0
- package/dist/icons/engine/icons/communication.js +142 -0
- package/dist/icons/engine/icons/communication.js.map +1 -0
- package/dist/icons/engine/icons/data.cjs +2 -0
- package/dist/icons/engine/icons/data.cjs.map +1 -0
- package/dist/icons/engine/icons/data.d.cts +29 -0
- package/dist/icons/engine/icons/data.d.ts +29 -0
- package/dist/icons/engine/icons/data.js +203 -0
- package/dist/icons/engine/icons/data.js.map +1 -0
- package/dist/icons/engine/icons/devices.cjs +2 -0
- package/dist/icons/engine/icons/devices.cjs.map +1 -0
- package/dist/icons/engine/icons/devices.d.cts +25 -0
- package/dist/icons/engine/icons/devices.d.ts +25 -0
- package/dist/icons/engine/icons/devices.js +188 -0
- package/dist/icons/engine/icons/devices.js.map +1 -0
- package/dist/icons/engine/icons/files.cjs +2 -0
- package/dist/icons/engine/icons/files.cjs.map +1 -0
- package/dist/icons/engine/icons/files.d.cts +33 -0
- package/dist/icons/engine/icons/files.d.ts +33 -0
- package/dist/icons/engine/icons/files.js +218 -0
- package/dist/icons/engine/icons/files.js.map +1 -0
- package/dist/icons/engine/icons/finance.cjs +2 -0
- package/dist/icons/engine/icons/finance.cjs.map +1 -0
- package/dist/icons/engine/icons/finance.d.cts +29 -0
- package/dist/icons/engine/icons/finance.d.ts +29 -0
- package/dist/icons/engine/icons/finance.js +229 -0
- package/dist/icons/engine/icons/finance.js.map +1 -0
- package/dist/icons/engine/icons/index.d.cts +10 -0
- package/dist/icons/engine/icons/index.d.ts +10 -0
- package/dist/icons/engine/icons/interface.cjs +2 -0
- package/dist/icons/engine/icons/interface.cjs.map +1 -0
- package/dist/icons/engine/icons/interface.d.cts +69 -0
- package/dist/icons/engine/icons/interface.d.ts +69 -0
- package/dist/icons/engine/icons/interface.js +471 -0
- package/dist/icons/engine/icons/interface.js.map +1 -0
- package/dist/icons/engine/icons/media.cjs +2 -0
- package/dist/icons/engine/icons/media.cjs.map +1 -0
- package/dist/icons/engine/icons/media.d.cts +41 -0
- package/dist/icons/engine/icons/media.d.ts +41 -0
- package/dist/icons/engine/icons/media.js +266 -0
- package/dist/icons/engine/icons/media.js.map +1 -0
- package/dist/icons/engine/icons/status.cjs +2 -0
- package/dist/icons/engine/icons/status.cjs.map +1 -0
- package/dist/icons/engine/icons/status.d.cts +31 -0
- package/dist/icons/engine/icons/status.d.ts +31 -0
- package/dist/icons/engine/icons/status.js +197 -0
- package/dist/icons/engine/icons/status.js.map +1 -0
- package/dist/icons/engine/path.cjs +3 -0
- package/dist/icons/engine/path.cjs.map +1 -0
- package/dist/icons/engine/path.d.cts +45 -0
- package/dist/icons/engine/path.d.ts +45 -0
- package/dist/icons/engine/path.js +215 -0
- package/dist/icons/engine/path.js.map +1 -0
- package/dist/icons/engine/registry.cjs +2 -0
- package/dist/icons/engine/registry.cjs.map +1 -0
- package/dist/icons/engine/registry.d.cts +13 -0
- package/dist/icons/engine/registry.d.ts +13 -0
- package/dist/icons/engine/registry.js +37 -0
- package/dist/icons/engine/registry.js.map +1 -0
- package/dist/icons/engine/renderers/batch.cjs +2 -0
- package/dist/icons/engine/renderers/batch.cjs.map +1 -0
- package/dist/icons/engine/renderers/batch.d.cts +32 -0
- package/dist/icons/engine/renderers/batch.d.ts +32 -0
- package/dist/icons/engine/renderers/batch.js +51 -0
- package/dist/icons/engine/renderers/batch.js.map +1 -0
- package/dist/icons/engine/renderers/canvas2d.cjs +2 -0
- package/dist/icons/engine/renderers/canvas2d.cjs.map +1 -0
- package/dist/icons/engine/renderers/canvas2d.d.cts +4 -0
- package/dist/icons/engine/renderers/canvas2d.d.ts +4 -0
- package/dist/icons/engine/renderers/canvas2d.js +30 -0
- package/dist/icons/engine/renderers/canvas2d.js.map +1 -0
- package/dist/icons/engine/renderers/detect.cjs +2 -0
- package/dist/icons/engine/renderers/detect.cjs.map +1 -0
- package/dist/icons/engine/renderers/detect.d.cts +13 -0
- package/dist/icons/engine/renderers/detect.d.ts +13 -0
- package/dist/icons/engine/renderers/detect.js +38 -0
- package/dist/icons/engine/renderers/detect.js.map +1 -0
- package/dist/icons/engine/renderers/gl.cjs +2 -0
- package/dist/icons/engine/renderers/gl.cjs.map +1 -0
- package/dist/icons/engine/renderers/gl.d.cts +9 -0
- package/dist/icons/engine/renderers/gl.d.ts +9 -0
- package/dist/icons/engine/renderers/gl.js +79 -0
- package/dist/icons/engine/renderers/gl.js.map +1 -0
- package/dist/icons/engine/renderers/shaders.cjs +58 -0
- package/dist/icons/engine/renderers/shaders.cjs.map +1 -0
- package/dist/icons/engine/renderers/shaders.d.cts +5 -0
- package/dist/icons/engine/renderers/shaders.d.ts +5 -0
- package/dist/icons/engine/renderers/shaders.js +6 -0
- package/dist/icons/engine/renderers/shaders.js.map +1 -0
- package/dist/icons/engine/renderers/types.d.cts +35 -0
- package/dist/icons/engine/renderers/types.d.ts +35 -0
- package/dist/icons/engine/renderers/webgpu.cjs +2 -0
- package/dist/icons/engine/renderers/webgpu.cjs.map +1 -0
- package/dist/icons/engine/renderers/webgpu.d.cts +4 -0
- package/dist/icons/engine/renderers/webgpu.d.ts +4 -0
- package/dist/icons/engine/renderers/webgpu.js +172 -0
- package/dist/icons/engine/renderers/webgpu.js.map +1 -0
- package/dist/icons/engine/surface.cjs +2 -0
- package/dist/icons/engine/surface.cjs.map +1 -0
- package/dist/icons/engine/surface.d.cts +7 -0
- package/dist/icons/engine/surface.d.ts +7 -0
- package/dist/icons/engine/surface.js +150 -0
- package/dist/icons/engine/surface.js.map +1 -0
- package/dist/icons/engine/svg.cjs +2 -0
- package/dist/icons/engine/svg.cjs.map +1 -0
- package/dist/icons/engine/svg.d.cts +13 -0
- package/dist/icons/engine/svg.d.ts +13 -0
- package/dist/icons/engine/svg.js +29 -0
- package/dist/icons/engine/svg.js.map +1 -0
- package/dist/icons/engine/tessellate.cjs +2 -0
- package/dist/icons/engine/tessellate.cjs.map +1 -0
- package/dist/icons/engine/tessellate.d.cts +20 -0
- package/dist/icons/engine/tessellate.d.ts +20 -0
- package/dist/icons/engine/tessellate.js +73 -0
- package/dist/icons/engine/tessellate.js.map +1 -0
- package/dist/icons/engine/theme.cjs +2 -0
- package/dist/icons/engine/theme.cjs.map +1 -0
- package/dist/icons/engine/theme.d.cts +2 -0
- package/dist/icons/engine/theme.d.ts +2 -0
- package/dist/icons/engine/theme.js +22 -0
- package/dist/icons/engine/theme.js.map +1 -0
- package/dist/icons/engine/types.d.cts +120 -0
- package/dist/icons/engine/types.d.ts +120 -0
- package/dist/icons/index.cjs +1 -0
- package/dist/icons/index.d.cts +7 -0
- package/dist/icons/index.d.ts +7 -0
- package/dist/icons/index.js +27 -0
- package/dist/icons/react/DynamicIcon.cjs +2 -0
- package/dist/icons/react/DynamicIcon.cjs.map +1 -0
- package/dist/icons/react/DynamicIcon.d.cts +7 -0
- package/dist/icons/react/DynamicIcon.d.ts +7 -0
- package/dist/icons/react/DynamicIcon.js +16 -0
- package/dist/icons/react/DynamicIcon.js.map +1 -0
- package/dist/icons/react/Icon.cjs +2 -0
- package/dist/icons/react/Icon.cjs.map +1 -0
- package/dist/icons/react/Icon.d.cts +7 -0
- package/dist/icons/react/Icon.d.ts +7 -0
- package/dist/icons/react/Icon.js +101 -0
- package/dist/icons/react/Icon.js.map +1 -0
- package/dist/icons/react/IconCanvas.cjs +2 -0
- package/dist/icons/react/IconCanvas.cjs.map +1 -0
- package/dist/icons/react/IconCanvas.d.cts +9 -0
- package/dist/icons/react/IconCanvas.d.ts +9 -0
- package/dist/icons/react/IconCanvas.js +64 -0
- package/dist/icons/react/IconCanvas.js.map +1 -0
- package/dist/icons/react/createIcon.cjs +2 -0
- package/dist/icons/react/createIcon.cjs.map +1 -0
- package/dist/icons/react/createIcon.d.cts +10 -0
- package/dist/icons/react/createIcon.d.ts +10 -0
- package/dist/icons/react/createIcon.js +18 -0
- package/dist/icons/react/createIcon.js.map +1 -0
- package/dist/icons/react/icons.cjs +2 -0
- package/dist/icons/react/icons.cjs.map +1 -0
- package/dist/icons/react/icons.d.cts +808 -0
- package/dist/icons/react/icons.d.ts +808 -0
- package/dist/icons/react/icons.js +18 -0
- package/dist/icons/react/icons.js.map +1 -0
- package/dist/icons/react/types.d.cts +62 -0
- package/dist/icons/react/types.d.ts +62 -0
- package/dist/vue/components/Chart/QuadrantChart.vue.d.ts +4 -0
- package/dist/vue/components/Chart/QuadrantChart.vue.js.map +1 -1
- package/dist/vue/components/Chart/QuadrantChart.vue_vue_type_script_setup_true_lang.js +48 -37
- package/dist/vue/components/Chart/QuadrantChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/vue/components/Chart/cartesian.d.ts +1 -0
- package/dist/vue/components/Chart/cartesian.js +1 -0
- package/dist/vue/components/Chart/cartesian.js.map +1 -1
- package/dist/web-components/components/chart/chart.d.ts +1 -0
- package/dist/web-components/components/chart/chart.js +1 -0
- package/dist/web-components/components/chart/chart.js.map +1 -1
- package/dist/web-components/components/chart/charts.d.ts +6 -1
- package/dist/web-components/components/chart/charts.js +31 -15
- package/dist/web-components/components/chart/charts.js.map +1 -1
- package/dist/web-components/html-custom-data.json +2 -2
- package/dist/web-components/types/react.d.ts +2 -0
- package/dist/web-components/types/solid.d.ts +2 -0
- package/dist/web-components/types/svelte.d.ts +2 -0
- package/dist/web-components/types/vue.d.ts +2 -0
- package/package.json +28 -2
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { resolveLocale as e } from "../engine/locale.js";
|
|
3
3
|
import { Chart as t, ChartBase as n, engineOptions as r } from "./Chart.js";
|
|
4
4
|
import { areaSeries as i, barSeries as a, boxplotData as o, boxplotSeries as s, bubbleSeries as c, candlestickSeries as l, ganttSeries as u, heatmapChartOptions as d, histogramSeries as f, lineSeries as p, presetLabels as m, quadrantChartOptions as h, quadrantOf as g, rangeAreaSeries as _, scatterSeries as v, sparklineOptions as y, waterfallSeries as b } from "../engine/presets.js";
|
|
5
|
-
import {
|
|
6
|
-
import { jsx as
|
|
5
|
+
import { useEffect as x, useMemo as S, useRef as C, useState as w } from "react";
|
|
6
|
+
import { jsx as T } from "react/jsx-runtime";
|
|
7
7
|
//#region src/react/charts.tsx
|
|
8
|
-
var
|
|
8
|
+
var E = (e) => ({
|
|
9
9
|
height: e.height,
|
|
10
10
|
width: e.width,
|
|
11
11
|
className: e.className,
|
|
@@ -18,8 +18,8 @@ var w = (e) => ({
|
|
|
18
18
|
onRendererChange: e.onRendererChange,
|
|
19
19
|
renderTooltip: e.renderTooltip
|
|
20
20
|
});
|
|
21
|
-
function
|
|
22
|
-
let { series: t, area: i = !1, curve: a, stacked: o = !1, percent: s = !1 } = e, c =
|
|
21
|
+
function D(e) {
|
|
22
|
+
let { series: t, area: i = !1, curve: a, stacked: o = !1, percent: s = !1 } = e, c = S(() => p(t, i, {
|
|
23
23
|
curve: a,
|
|
24
24
|
stacked: o || s
|
|
25
25
|
}), [
|
|
@@ -29,17 +29,17 @@ function T(e) {
|
|
|
29
29
|
o,
|
|
30
30
|
s
|
|
31
31
|
]);
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ T(n, {
|
|
33
33
|
options: r({
|
|
34
34
|
...e,
|
|
35
35
|
series: c,
|
|
36
36
|
stackMode: s ? "percent" : void 0
|
|
37
37
|
}),
|
|
38
|
-
...
|
|
38
|
+
...E(e)
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
let { series: t, curve: a = "smooth", stacked: o = !1, percent: s = !1 } = e, c =
|
|
41
|
+
function O(e) {
|
|
42
|
+
let { series: t, curve: a = "smooth", stacked: o = !1, percent: s = !1 } = e, c = S(() => i(t, {
|
|
43
43
|
curve: a,
|
|
44
44
|
stacked: o || s
|
|
45
45
|
}), [
|
|
@@ -48,44 +48,44 @@ function E(e) {
|
|
|
48
48
|
o,
|
|
49
49
|
s
|
|
50
50
|
]);
|
|
51
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ T(n, {
|
|
52
52
|
options: r({
|
|
53
53
|
...e,
|
|
54
54
|
series: c,
|
|
55
55
|
stackMode: s ? "percent" : void 0
|
|
56
56
|
}),
|
|
57
|
-
...
|
|
57
|
+
...E(e)
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
let { series: t, stacked: i = !1, percent: o = !1, labels: s = !1 } = e, c =
|
|
60
|
+
function k(e) {
|
|
61
|
+
let { series: t, stacked: i = !1, percent: o = !1, labels: s = !1 } = e, c = S(() => a(t, i || o, s), [
|
|
62
62
|
t,
|
|
63
63
|
i,
|
|
64
64
|
o,
|
|
65
65
|
s
|
|
66
66
|
]);
|
|
67
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ T(n, {
|
|
68
68
|
options: r({
|
|
69
69
|
...e,
|
|
70
70
|
labels: void 0,
|
|
71
71
|
series: c,
|
|
72
72
|
stackMode: o ? "percent" : void 0
|
|
73
73
|
}),
|
|
74
|
-
...
|
|
74
|
+
...E(e)
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
let { series: t } = e, i =
|
|
79
|
-
return /* @__PURE__ */
|
|
77
|
+
function A(e) {
|
|
78
|
+
let { series: t } = e, i = S(() => l(t), [t]);
|
|
79
|
+
return /* @__PURE__ */ T(n, {
|
|
80
80
|
options: r({
|
|
81
81
|
...e,
|
|
82
82
|
series: i
|
|
83
83
|
}),
|
|
84
|
-
...
|
|
84
|
+
...E(e)
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
let { data: t, xCategories: i, yCategories: a, colorScale: o, valueRange: s, colorMidpoint: c, name: l, radius: u, format: f } = e, p =
|
|
87
|
+
function j(e) {
|
|
88
|
+
let { data: t, xCategories: i, yCategories: a, colorScale: o, valueRange: s, colorMidpoint: c, name: l, radius: u, format: f } = e, p = S(() => d({
|
|
89
89
|
data: t,
|
|
90
90
|
xCategories: i,
|
|
91
91
|
yCategories: a,
|
|
@@ -109,7 +109,7 @@ function k(e) {
|
|
|
109
109
|
...e,
|
|
110
110
|
series: p
|
|
111
111
|
});
|
|
112
|
-
return /* @__PURE__ */
|
|
112
|
+
return /* @__PURE__ */ T(n, {
|
|
113
113
|
options: {
|
|
114
114
|
...d({
|
|
115
115
|
data: t,
|
|
@@ -123,11 +123,11 @@ function k(e) {
|
|
|
123
123
|
}),
|
|
124
124
|
series: p
|
|
125
125
|
},
|
|
126
|
-
...
|
|
126
|
+
...E(e)
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
let { data: t, type: r, color: i, curve: a, name: o, reference: s, format: c, height: l = 48, width: u, renderer: d, tooltip: f, palette: p, ariaLabel: m, locale: h, labels: g, className: _, style: v, ref: b, onHover:
|
|
129
|
+
function M(e) {
|
|
130
|
+
let { data: t, type: r, color: i, curve: a, name: o, reference: s, format: c, height: l = 48, width: u, renderer: d, tooltip: f, palette: p, ariaLabel: m, locale: h, labels: g, className: _, style: v, ref: b, onHover: x, renderTooltip: C } = e, w = S(() => y({
|
|
131
131
|
data: t,
|
|
132
132
|
type: r,
|
|
133
133
|
color: i,
|
|
@@ -157,33 +157,33 @@ function A(e) {
|
|
|
157
157
|
h,
|
|
158
158
|
g
|
|
159
159
|
]);
|
|
160
|
-
return /* @__PURE__ */
|
|
161
|
-
options:
|
|
160
|
+
return /* @__PURE__ */ T(n, {
|
|
161
|
+
options: w,
|
|
162
162
|
height: l,
|
|
163
163
|
width: u,
|
|
164
164
|
className: _,
|
|
165
165
|
style: v,
|
|
166
166
|
handleRef: b,
|
|
167
|
-
onHover:
|
|
168
|
-
renderTooltip:
|
|
167
|
+
onHover: x,
|
|
168
|
+
renderTooltip: C
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
let { series: t } = e, i =
|
|
173
|
-
return /* @__PURE__ */
|
|
171
|
+
function N(e) {
|
|
172
|
+
let { series: t } = e, i = S(() => v(t), [t]);
|
|
173
|
+
return /* @__PURE__ */ T(n, {
|
|
174
174
|
options: r({
|
|
175
175
|
...e,
|
|
176
176
|
series: i
|
|
177
177
|
}),
|
|
178
|
-
...
|
|
178
|
+
...E(e)
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
var
|
|
181
|
+
var P = [
|
|
182
182
|
"topLeft",
|
|
183
183
|
"topRight",
|
|
184
184
|
"bottomLeft",
|
|
185
185
|
"bottomRight"
|
|
186
|
-
],
|
|
186
|
+
], F = 400, I = (e, t, n) => {
|
|
187
187
|
let r = e.endsWith("Left"), i = e.startsWith("top");
|
|
188
188
|
return {
|
|
189
189
|
position: "absolute",
|
|
@@ -194,14 +194,24 @@ var M = [
|
|
|
194
194
|
pointerEvents: "none"
|
|
195
195
|
};
|
|
196
196
|
};
|
|
197
|
-
function
|
|
198
|
-
let { points: t, xDomain: i, yDomain: a, xSplit: o, ySplit: s, quadrants: c, xLabel: l, yLabel: u, axisLabels: d, showTicks: f, reverseX: p, showLabels: m, pointSize: _, name: v, draggable: y, onPointClick: b, onPointDrop:
|
|
197
|
+
function L(e) {
|
|
198
|
+
let { points: t, xDomain: i, yDomain: a, xSplit: o, ySplit: s, quadrants: c, xLabel: l, yLabel: u, axisLabels: d, showTicks: f, reverseX: p, showLabels: m, pointSize: _, name: v, draggable: y, onPointClick: b, onPointDoubleClick: S, onPointDrag: D, onPointDrop: O, onQuadrantClick: k, renderTooltip: A, quadrantContent: j } = e, M = {
|
|
199
199
|
xDomain: i,
|
|
200
200
|
yDomain: a,
|
|
201
201
|
xSplit: o,
|
|
202
202
|
ySplit: s,
|
|
203
203
|
reverseX: p
|
|
204
|
-
},
|
|
204
|
+
}, [N, L] = w(null), R = C(null);
|
|
205
|
+
x(() => {
|
|
206
|
+
if (!N) return;
|
|
207
|
+
let e = () => L(null);
|
|
208
|
+
return window.addEventListener("pointerup", e), () => window.removeEventListener("pointerup", e);
|
|
209
|
+
}, [N]);
|
|
210
|
+
let z = (e) => ({
|
|
211
|
+
x: e.x,
|
|
212
|
+
y: e.y,
|
|
213
|
+
quadrant: g(M, e.x, e.y)
|
|
214
|
+
}), B = h({
|
|
205
215
|
points: t,
|
|
206
216
|
xDomain: i,
|
|
207
217
|
yDomain: a,
|
|
@@ -216,69 +226,82 @@ function P(e) {
|
|
|
216
226
|
showLabels: m,
|
|
217
227
|
pointSize: _,
|
|
218
228
|
name: v,
|
|
219
|
-
draggable: y ?? !!
|
|
229
|
+
draggable: y ?? !!(O || D)
|
|
220
230
|
}, r({
|
|
221
231
|
...e,
|
|
222
232
|
series: []
|
|
223
|
-
})),
|
|
224
|
-
let [t, n] = i ?? [0, 10], [r,
|
|
225
|
-
x: e.x + e.width * (p ? 1 -
|
|
226
|
-
y: e.y + e.height * (1 -
|
|
227
|
-
};
|
|
228
|
-
return
|
|
233
|
+
})), V = j || N ? (e) => {
|
|
234
|
+
let [t, n] = i ?? [0, 10], [r, l] = a ?? [0, 10], u = o ?? (t + n) / 2, d = s ?? (r + l) / 2, f = (u - t) / (n - t || 1), m = (d - r) / (l - r || 1), h = {
|
|
235
|
+
x: e.x + e.width * (p ? 1 - f : f),
|
|
236
|
+
y: e.y + e.height * (1 - m)
|
|
237
|
+
}, g = N ? c?.[N]?.color ?? "currentColor" : "";
|
|
238
|
+
return [...P.map((t) => j?.[t] ? /* @__PURE__ */ T("div", {
|
|
229
239
|
className: `minerva-chart-quadrant minerva-chart-quadrant-${t}`,
|
|
230
|
-
style:
|
|
231
|
-
children:
|
|
232
|
-
}, t) : null)
|
|
240
|
+
style: I(t, e, h),
|
|
241
|
+
children: j[t]
|
|
242
|
+
}, t) : null), N ? /* @__PURE__ */ T("div", {
|
|
243
|
+
className: "minerva-chart-quadrant-target",
|
|
244
|
+
style: {
|
|
245
|
+
...I(N, e, h),
|
|
246
|
+
background: `color-mix(in srgb, ${g} 14%, transparent)`,
|
|
247
|
+
boxShadow: `inset 0 0 0 2px ${g}`
|
|
248
|
+
}
|
|
249
|
+
}, "drop-target") : null];
|
|
233
250
|
} : void 0;
|
|
234
|
-
return /* @__PURE__ */
|
|
235
|
-
options:
|
|
236
|
-
...
|
|
251
|
+
return /* @__PURE__ */ T(n, {
|
|
252
|
+
options: B,
|
|
253
|
+
...E({
|
|
237
254
|
...e,
|
|
238
255
|
onPointClick: void 0,
|
|
239
256
|
renderTooltip: void 0
|
|
240
257
|
}),
|
|
241
|
-
overlay:
|
|
242
|
-
onPointClick:
|
|
258
|
+
overlay: V,
|
|
259
|
+
onPointClick: (e) => {
|
|
243
260
|
let n = e.items[0]?.index;
|
|
244
|
-
n
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
261
|
+
if (n === void 0 || !t[n]) return;
|
|
262
|
+
let r = Date.now(), i = R.current, a = i?.index === n && r - i.time < F;
|
|
263
|
+
R.current = a ? null : {
|
|
264
|
+
index: n,
|
|
265
|
+
time: r
|
|
266
|
+
}, b?.(t[n], n), a && S?.(t[n], n);
|
|
267
|
+
},
|
|
268
|
+
onPlotClick: k ? (e) => k(g(M, e.x, e.y), e) : void 0,
|
|
269
|
+
onDrag: (e) => {
|
|
270
|
+
let n = e.item.index, r = z(e);
|
|
271
|
+
L(r.quadrant), t[n] && D?.(t[n], n, r);
|
|
272
|
+
},
|
|
273
|
+
onDrop: (e) => {
|
|
274
|
+
L(null);
|
|
248
275
|
let n = e.item.index;
|
|
249
|
-
t[n] &&
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
quadrant: g(D, e.x, e.y)
|
|
253
|
-
});
|
|
254
|
-
} : void 0,
|
|
255
|
-
renderTooltip: T ? (e) => {
|
|
276
|
+
t[n] && O && O(t[n], n, z(e));
|
|
277
|
+
},
|
|
278
|
+
renderTooltip: A ? (e) => {
|
|
256
279
|
let n = e.items[0]?.index;
|
|
257
|
-
return n !== void 0 && t[n] ?
|
|
280
|
+
return n !== void 0 && t[n] ? A(t[n], n) : null;
|
|
258
281
|
} : void 0
|
|
259
282
|
});
|
|
260
283
|
}
|
|
261
|
-
function
|
|
262
|
-
return /* @__PURE__ */
|
|
284
|
+
function R(e) {
|
|
285
|
+
return /* @__PURE__ */ T(k, {
|
|
263
286
|
...e,
|
|
264
287
|
orientation: "horizontal"
|
|
265
288
|
});
|
|
266
289
|
}
|
|
267
|
-
function
|
|
268
|
-
let { series: t, curve: i = "smooth" } = e, a =
|
|
269
|
-
return /* @__PURE__ */
|
|
290
|
+
function z(e) {
|
|
291
|
+
let { series: t, curve: i = "smooth" } = e, a = S(() => _(t, i), [t, i]);
|
|
292
|
+
return /* @__PURE__ */ T(n, {
|
|
270
293
|
options: r({
|
|
271
294
|
...e,
|
|
272
295
|
series: a
|
|
273
296
|
}),
|
|
274
|
-
...
|
|
297
|
+
...E(e)
|
|
275
298
|
});
|
|
276
299
|
}
|
|
277
|
-
function
|
|
278
|
-
return /* @__PURE__ */
|
|
300
|
+
function B(e) {
|
|
301
|
+
return /* @__PURE__ */ T(t, { ...e });
|
|
279
302
|
}
|
|
280
|
-
function
|
|
281
|
-
let { series: t, minSize: i, maxSize: a, maxValue: o } = e, s =
|
|
303
|
+
function V(e) {
|
|
304
|
+
let { series: t, minSize: i, maxSize: a, maxValue: o } = e, s = S(() => c(t, {
|
|
282
305
|
minSize: i,
|
|
283
306
|
maxSize: a,
|
|
284
307
|
maxValue: o
|
|
@@ -288,16 +311,16 @@ function R(e) {
|
|
|
288
311
|
a,
|
|
289
312
|
o
|
|
290
313
|
]);
|
|
291
|
-
return /* @__PURE__ */
|
|
314
|
+
return /* @__PURE__ */ T(n, {
|
|
292
315
|
options: r({
|
|
293
316
|
...e,
|
|
294
317
|
series: s
|
|
295
318
|
}),
|
|
296
|
-
...
|
|
319
|
+
...E(e)
|
|
297
320
|
});
|
|
298
321
|
}
|
|
299
|
-
function
|
|
300
|
-
let { values: i, bins: a, domain: o, nice: s, name: c, color: l, formatBin: u, series: d, locale: p } = t, m = e(p), h =
|
|
322
|
+
function H(t) {
|
|
323
|
+
let { values: i, bins: a, domain: o, nice: s, name: c, color: l, formatBin: u, series: d, locale: p } = t, m = e(p), h = S(() => [f(i, {
|
|
301
324
|
bins: a,
|
|
302
325
|
domain: o,
|
|
303
326
|
nice: s,
|
|
@@ -316,16 +339,16 @@ function z(t) {
|
|
|
316
339
|
d,
|
|
317
340
|
m
|
|
318
341
|
]);
|
|
319
|
-
return /* @__PURE__ */
|
|
342
|
+
return /* @__PURE__ */ T(n, {
|
|
320
343
|
options: r({
|
|
321
344
|
...t,
|
|
322
345
|
series: h
|
|
323
346
|
}),
|
|
324
|
-
...
|
|
347
|
+
...E(t)
|
|
325
348
|
});
|
|
326
349
|
}
|
|
327
|
-
function
|
|
328
|
-
let { series: i, groups: a, name: c, whisker: l, orientation: u, locale: d, outlierShape: f, outlierSize: p } = t, h = c ?? m(e(d)).values, g =
|
|
350
|
+
function U(t) {
|
|
351
|
+
let { series: i, groups: a, name: c, whisker: l, orientation: u, locale: d, outlierShape: f, outlierSize: p } = t, h = c ?? m(e(d)).values, g = S(() => s([...a?.length ? [{
|
|
329
352
|
id: "boxplot",
|
|
330
353
|
name: h,
|
|
331
354
|
data: o(a, { whisker: l })
|
|
@@ -341,17 +364,17 @@ function B(t) {
|
|
|
341
364
|
f,
|
|
342
365
|
p
|
|
343
366
|
]);
|
|
344
|
-
return /* @__PURE__ */
|
|
367
|
+
return /* @__PURE__ */ T(n, {
|
|
345
368
|
options: r({
|
|
346
369
|
...t,
|
|
347
370
|
series: g,
|
|
348
371
|
orientation: u
|
|
349
372
|
}),
|
|
350
|
-
...
|
|
373
|
+
...E(t)
|
|
351
374
|
});
|
|
352
375
|
}
|
|
353
|
-
function
|
|
354
|
-
let { steps: i, name: a, upColor: o, downColor: s, totalColor: c, start: l, labels: u = !0, format: d, connector: f, orientation: p, locale: m } = t, h = e(m), g =
|
|
376
|
+
function W(t) {
|
|
377
|
+
let { steps: i, name: a, upColor: o, downColor: s, totalColor: c, start: l, labels: u = !0, format: d, connector: f, orientation: p, locale: m } = t, h = e(m), g = S(() => [b(i, {
|
|
355
378
|
name: a,
|
|
356
379
|
upColor: o,
|
|
357
380
|
downColor: s,
|
|
@@ -373,18 +396,18 @@ function V(t) {
|
|
|
373
396
|
f,
|
|
374
397
|
h
|
|
375
398
|
]);
|
|
376
|
-
return /* @__PURE__ */
|
|
399
|
+
return /* @__PURE__ */ T(n, {
|
|
377
400
|
options: r({
|
|
378
401
|
...t,
|
|
379
402
|
labels: void 0,
|
|
380
403
|
series: g,
|
|
381
404
|
orientation: p
|
|
382
405
|
}),
|
|
383
|
-
...
|
|
406
|
+
...E(t)
|
|
384
407
|
});
|
|
385
408
|
}
|
|
386
|
-
function
|
|
387
|
-
let { tasks: i, colors: a, taskName: o, progressName: s, milestoneName: c, formatProgress: l, dependenciesName: d, dependencyArrows: f, dependencyColor: p, today: m = !1, todayLabel: h, xAxis: g, yAxis: _, annotations: v, interaction: y, legend: b, locale:
|
|
409
|
+
function G(t) {
|
|
410
|
+
let { tasks: i, colors: a, taskName: o, progressName: s, milestoneName: c, formatProgress: l, dependenciesName: d, dependencyArrows: f, dependencyColor: p, today: m = !1, todayLabel: h, xAxis: g, yAxis: _, annotations: v, interaction: y, legend: b, locale: x } = t, C = e(x), D = S(() => u(i, {
|
|
388
411
|
colors: a,
|
|
389
412
|
taskName: o,
|
|
390
413
|
progressName: s,
|
|
@@ -393,7 +416,7 @@ function H(t) {
|
|
|
393
416
|
dependenciesName: d,
|
|
394
417
|
dependencyArrows: f,
|
|
395
418
|
dependencyColor: p,
|
|
396
|
-
locale:
|
|
419
|
+
locale: C
|
|
397
420
|
}), [
|
|
398
421
|
i,
|
|
399
422
|
a,
|
|
@@ -404,8 +427,8 @@ function H(t) {
|
|
|
404
427
|
d,
|
|
405
428
|
f,
|
|
406
429
|
p,
|
|
407
|
-
|
|
408
|
-
]), [O] =
|
|
430
|
+
C
|
|
431
|
+
]), [O] = w(() => Date.now()), k = m === !1 ? null : m === !0 ? O : m instanceof Date ? m.getTime() : m, A = k === null ? [] : [{
|
|
409
432
|
type: "line",
|
|
410
433
|
axis: "y",
|
|
411
434
|
value: k,
|
|
@@ -413,7 +436,7 @@ function H(t) {
|
|
|
413
436
|
dash: [4, 3],
|
|
414
437
|
label: h
|
|
415
438
|
}];
|
|
416
|
-
return /* @__PURE__ */
|
|
439
|
+
return /* @__PURE__ */ T(n, {
|
|
417
440
|
options: {
|
|
418
441
|
...r({
|
|
419
442
|
...t,
|
|
@@ -436,10 +459,10 @@ function H(t) {
|
|
|
436
459
|
interaction: y ?? { zoom: "y" },
|
|
437
460
|
legend: b ?? D.series.length > 1
|
|
438
461
|
},
|
|
439
|
-
...
|
|
462
|
+
...E(t)
|
|
440
463
|
});
|
|
441
464
|
}
|
|
442
465
|
//#endregion
|
|
443
|
-
export {
|
|
466
|
+
export { O as AreaChart, k as BarChart, U as BoxPlotChart, V as BubbleChart, A as CandlestickChart, G as GanttChart, j as HeatmapChart, H as HistogramChart, R as HorizontalBarChart, D as LineChart, B as MixedChart, L as QuadrantChart, z as RangeAreaChart, N as ScatterChart, M as Sparkline, W as WaterfallChart };
|
|
444
467
|
|
|
445
468
|
//# sourceMappingURL=charts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charts.js","names":["frameProps","props","LineChart","input","series","useMemo","lineSeries","area","stacked","percent","curve","ChartBase","engineOptions","AreaChart","areaSeries","BarChart","barSeries","labels","CandlestickChart","candlestickSeries","HeatmapChart","heatmapChartOptions","data","xCategories","yCategories","colorScale","valueRange","colorMidpoint","name","radius","format","base","Sparkline","options","sparklineOptions","type","color","reference","renderer","tooltip","palette","ariaLabel","locale","ref","ScatterChart","scatterSeries","CORNERS","cornerStyle","left","corner","top","split","plot","QuadrantChart","geometry","quadrantChartOptions","draggable","onPointDrop","overlay","quadrantContent","x0","x1","xDomain","y0","y1","yDomain","xs","xSplit","ys","ySplit","fx","fy","reverseX","onPointClick","index","event","points","onQuadrantClick","quadrantOf","at","renderTooltip","HorizontalBarChart","RangeAreaChart","rangeAreaSeries","MixedChart","Chart","BubbleChart","bubbleSeries","minSize","maxSize","maxValue","HistogramChart","extra","lang","resolveLocale","histogramSeries","values","formatBin","bins","domain","nice","BoxPlotChart","groupName","presetLabels","boxplotSeries","groups","boxplotData","s","outlierShape","outlierSize","whisker","WaterfallChart","waterfallSeries","steps","upColor","downColor","totalColor","start","connector","GanttChart","gantt","ganttSeries","tasks","colors","taskName","progressName","milestoneName","formatProgress","dependenciesName","dependencyArrows","dependencyColor","mountedAt","useState","now","today","lines","todayLabel","xAxis","yAxis","annotations","interaction","legend"],"sources":["../../../../charts/src/react/charts.tsx"],"sourcesContent":["import { useMemo, useState, type CSSProperties } from \"react\";\nimport {\n areaSeries,\n barSeries,\n boxplotData,\n boxplotSeries,\n bubbleSeries,\n candlestickSeries,\n ganttSeries,\n heatmapChartOptions,\n histogramSeries,\n lineSeries,\n presetLabels,\n quadrantChartOptions,\n quadrantOf,\n rangeAreaSeries,\n scatterSeries,\n sparklineOptions,\n waterfallSeries,\n type QuadrantCorner,\n} from \"../engine/presets\";\nimport { resolveLocale } from \"../engine/locale\";\nimport type { ChartAnnotation, ChartRect } from \"../engine/types\";\nimport { Chart, ChartBase, engineOptions } from \"./Chart\";\nimport type {\n AreaChartProps,\n BarChartProps,\n BoxPlotChartProps,\n BubbleChartProps,\n CandlestickChartProps,\n ChartCommonProps,\n GanttChartProps,\n HeatmapChartProps,\n HistogramChartProps,\n HorizontalBarChartProps,\n LineChartProps,\n MixedChartProps,\n QuadrantChartProps,\n RangeAreaChartProps,\n ScatterChartProps,\n SparklineProps,\n WaterfallChartProps,\n} from \"./types\";\n\nconst frameProps = (props: Omit<ChartCommonProps, \"labels\">) => ({\n height: props.height,\n width: props.width,\n className: props.className,\n style: props.style,\n handleRef: props.ref,\n onHover: props.onHover,\n onPointClick: props.onPointClick,\n onPlotClick: props.onPlotClick,\n onZoom: props.onZoom,\n onRendererChange: props.onRendererChange,\n renderTooltip: props.renderTooltip,\n});\n\n/** Line (or area) chart; handles millions of points on the GPU */\nexport function LineChart(props: LineChartProps) {\n const {\n series: input,\n area = false,\n curve,\n stacked = false,\n percent = false,\n } = props;\n const series = useMemo(\n () => lineSeries(input, area, { curve, stacked: stacked || percent }),\n [input, area, curve, stacked, percent],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Area chart: smooth by default, stacked or 100% stacked */\nexport function AreaChart(props: AreaChartProps) {\n const {\n series: input,\n curve = \"smooth\",\n stacked = false,\n percent = false,\n } = props;\n const series = useMemo(\n () => areaSeries(input, { curve, stacked: stacked || percent }),\n [input, curve, stacked, percent],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Bar chart: grouped side by side, stacked or 100% stacked, with optional value labels */\nexport function BarChart(props: BarChartProps) {\n const {\n series: input,\n stacked = false,\n percent = false,\n labels = false,\n } = props;\n const series = useMemo(\n () => barSeries(input, stacked || percent, labels),\n [input, stacked, percent, labels],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n labels: undefined,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Candlestick (OHLC) chart: rising and falling candles, zoomable on the GPU */\nexport function CandlestickChart(props: CandlestickChartProps) {\n const { series: input } = props;\n const series = useMemo(() => candlestickSeries(input), [input]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Heatmap: a grid of cells colored by value (categories or numbers on both axes) */\nexport function HeatmapChart(props: HeatmapChartProps) {\n const {\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n } = props;\n const series = useMemo(\n () =>\n heatmapChartOptions({\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n }).series,\n [\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n ],\n );\n const base = engineOptions({ ...props, series });\n return (\n <ChartBase\n options={{\n ...heatmapChartOptions(\n { data, xCategories, yCategories },\n {\n ...base,\n legend: props.legend,\n interaction: props.interaction,\n tooltip: props.tooltip,\n },\n ),\n series,\n }}\n {...frameProps(props)}\n />\n );\n}\n\n/** Word-sized chart without axes: a trend in a table cell, a KPI card, ... */\nexport function Sparkline(props: SparklineProps) {\n const {\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n height = 48,\n width,\n renderer,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n className,\n style,\n ref,\n onHover,\n renderTooltip,\n } = props;\n const options = useMemo(\n () =>\n sparklineOptions(\n { data, type, color, curve, name, reference, format },\n { renderer, tooltip, palette, ariaLabel, locale, labels },\n ),\n [\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n renderer,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n ],\n );\n return (\n <ChartBase\n options={options}\n height={height}\n width={width}\n className={className}\n style={style}\n handleRef={ref}\n onHover={onHover}\n renderTooltip={renderTooltip}\n />\n );\n}\n\n/** Scatter chart: zooms on both axes, hit testing through a spatial index */\nexport function ScatterChart(props: ScatterChartProps) {\n const { series: input } = props;\n const series = useMemo(() => scatterSeries(input), [input]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\nconst CORNERS: QuadrantCorner[] = [\n \"topLeft\",\n \"topRight\",\n \"bottomLeft\",\n \"bottomRight\",\n];\n\nconst cornerStyle = (\n corner: QuadrantCorner,\n plot: ChartRect,\n split: { x: number; y: number },\n): CSSProperties => {\n const left = corner.endsWith(\"Left\");\n const top = corner.startsWith(\"top\");\n return {\n position: \"absolute\",\n left: left ? 0 : split.x - plot.x,\n top: top ? 0 : split.y - plot.y,\n width: left ? split.x - plot.x : plot.x + plot.width - split.x,\n height: top ? split.y - plot.y : plot.y + plot.height - split.y,\n pointerEvents: \"none\",\n };\n};\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG, ...): tinted\n * quadrants with titles, dividers, and labelled dots placed without\n * overlapping labels. Dots can be dragged to another quadrant.\n */\nexport function QuadrantChart(props: QuadrantChartProps) {\n const {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable,\n onPointClick,\n onPointDrop,\n onQuadrantClick,\n renderTooltip,\n quadrantContent,\n } = props;\n const geometry = { xDomain, yDomain, xSplit, ySplit, reverseX };\n\n const options = quadrantChartOptions(\n {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable: draggable ?? !!onPointDrop,\n },\n engineOptions({ ...props, series: [] }),\n );\n\n const overlay = quadrantContent\n ? (plot: ChartRect) => {\n const [x0, x1] = xDomain ?? [0, 10];\n const [y0, y1] = yDomain ?? [0, 10];\n const xs = xSplit ?? (x0 + x1) / 2;\n const ys = ySplit ?? (y0 + y1) / 2;\n const fx = (xs - x0) / (x1 - x0 || 1);\n const fy = (ys - y0) / (y1 - y0 || 1);\n const split = {\n x: plot.x + plot.width * (reverseX ? 1 - fx : fx),\n y: plot.y + plot.height * (1 - fy),\n };\n return CORNERS.map((corner) =>\n quadrantContent[corner] ? (\n <div\n key={corner}\n className={`minerva-chart-quadrant minerva-chart-quadrant-${corner}`}\n style={cornerStyle(corner, plot, split)}\n >\n {quadrantContent[corner]}\n </div>\n ) : null,\n );\n }\n : undefined;\n\n return (\n <ChartBase\n options={options}\n {...frameProps({\n ...props,\n onPointClick: undefined,\n renderTooltip: undefined,\n })}\n overlay={overlay}\n onPointClick={\n onPointClick\n ? (event) => {\n const index = event.items[0]?.index;\n if (index !== undefined && points[index])\n onPointClick(points[index], index);\n }\n : undefined\n }\n onPlotClick={\n onQuadrantClick\n ? (at) => onQuadrantClick(quadrantOf(geometry, at.x, at.y), at)\n : undefined\n }\n onDrop={\n onPointDrop\n ? (event) => {\n const index = event.item.index;\n if (!points[index]) return;\n onPointDrop(points[index], index, {\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry, event.x, event.y),\n });\n }\n : undefined\n }\n renderTooltip={\n renderTooltip\n ? (event) => {\n const index = event.items[0]?.index;\n return index !== undefined && points[index]\n ? renderTooltip(points[index], index)\n : null;\n }\n : undefined\n }\n />\n );\n}\n\n/**\n * Horizontal bar chart: categories down the left side, values from the\n * left (rankings, long names, diverging surveys, stacked progress)\n */\nexport function HorizontalBarChart(props: HorizontalBarChartProps) {\n return <BarChart {...props} orientation=\"horizontal\" />;\n}\n\n/**\n * Range area chart: bands between a lower (`y0`) and an upper edge\n * (confidence intervals, min-max ranges), mixable with lines\n */\nexport function RangeAreaChart(props: RangeAreaChartProps) {\n const { series: input, curve = \"smooth\" } = props;\n const series = useMemo(() => rangeAreaSeries(input, curve), [input, curve]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Combination chart: bars, lines and areas on one or two value axes\n * (`yAxis: \"right\"` series use `yAxis2`, aligned on the left grid)\n */\nexport function MixedChart(props: MixedChartProps) {\n return <Chart {...props} />;\n}\n\n/** Bubble chart: x, y and a value sized by area (√value diameters) */\nexport function BubbleChart(props: BubbleChartProps) {\n const { series: input, minSize, maxSize, maxValue } = props;\n const series = useMemo(\n () => bubbleSeries(input, { minSize, maxSize, maxValue }),\n [input, minSize, maxSize, maxValue],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Histogram: the distribution of raw samples in bins of equal width\n * (Freedman-Diaconis, Sturges or a count); millions of samples are binned\n * in milliseconds\n */\nexport function HistogramChart(props: HistogramChartProps) {\n const {\n values,\n bins,\n domain,\n nice,\n name,\n color,\n formatBin,\n series: extra,\n locale,\n } = props;\n // page language read at every render: a language switch renames the series\n const lang = resolveLocale(locale);\n const series = useMemo(\n () => [\n histogramSeries(values, {\n bins,\n domain,\n nice,\n name,\n color,\n format: formatBin,\n locale: lang,\n }),\n ...(extra ?? []),\n ],\n [values, bins, domain, nice, name, color, formatBin, extra, lang],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Box plot: medians, quartiles, whiskers and outliers of samples, from raw\n * values (`groups`) or computed statistics (`series`)\n */\nexport function BoxPlotChart(props: BoxPlotChartProps) {\n const {\n series: input,\n groups,\n name,\n whisker,\n orientation,\n locale,\n outlierShape,\n outlierSize,\n } = props;\n const groupName = name ?? presetLabels(resolveLocale(locale)).values;\n const series = useMemo(\n () =>\n boxplotSeries([\n ...(groups?.length\n ? [\n {\n id: \"boxplot\",\n name: groupName,\n data: boxplotData(groups, { whisker }),\n },\n ]\n : []),\n ...(input ?? []),\n ]).map((s) =>\n s.type === \"boxplot\"\n ? {\n ...s,\n outlierShape: s.outlierShape ?? outlierShape,\n outlierSize: s.outlierSize ?? outlierSize,\n }\n : s,\n ),\n [input, groups, groupName, whisker, outlierShape, outlierSize],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series, orientation })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Waterfall (bridge) chart: how changes take a value from a start to an\n * end, with subtotals and totals (P&L bridges, budget variances)\n */\nexport function WaterfallChart(props: WaterfallChartProps) {\n const {\n steps,\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels = true,\n format,\n connector,\n orientation,\n locale,\n } = props;\n const lang = resolveLocale(locale);\n const series = useMemo(\n () => [\n waterfallSeries(steps, {\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n connector,\n locale: lang,\n }),\n ],\n [\n steps,\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n connector,\n lang,\n ],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n labels: undefined,\n series,\n orientation,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Gantt chart: tasks as bars on a time axis with their progress, groups,\n * milestones and a today line; zooms and pans along the time\n */\nexport function GanttChart(props: GanttChartProps) {\n const {\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n dependencyArrows,\n dependencyColor,\n today = false,\n todayLabel,\n xAxis,\n yAxis,\n annotations,\n interaction,\n legend,\n locale,\n } = props;\n const lang = resolveLocale(locale);\n const gantt = useMemo(\n () =>\n ganttSeries(tasks, {\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n dependencyArrows,\n dependencyColor,\n locale: lang,\n }),\n [\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n dependencyArrows,\n dependencyColor,\n lang,\n ],\n );\n const [mountedAt] = useState(() => Date.now());\n const now =\n today === false\n ? null\n : today === true\n ? mountedAt\n : today instanceof Date\n ? today.getTime()\n : today;\n const lines: ChartAnnotation[] =\n now === null\n ? []\n : [\n {\n type: \"line\",\n axis: \"y\",\n value: now,\n color: \"var(--danger-color, #dc2626)\",\n dash: [4, 3],\n label: todayLabel,\n },\n ];\n return (\n <ChartBase\n options={{\n ...engineOptions({\n ...props,\n series: gantt.series,\n orientation: \"horizontal\",\n }),\n xAxis: {\n type: \"category\",\n categories: gantt.categories,\n ...xAxis,\n },\n yAxis: {\n type: \"time\",\n min: gantt.domain[0],\n max: gantt.domain[1],\n ...yAxis,\n },\n annotations: [...(annotations ?? []), ...lines],\n dependencies: gantt.dependencies,\n interaction: interaction ?? { zoom: \"y\" },\n legend: legend ?? gantt.series.length > 1,\n }}\n {...frameProps(props)}\n />\n );\n}\n"],"mappings":";;;;;;;AA4CA,IAAMA,KAAc,OAA6C;CAC/D,QAAQC,EAAM;CACd,OAAOA,EAAM;CACb,WAAWA,EAAM;CACjB,OAAOA,EAAM;CACb,WAAWA,EAAM;CACjB,SAASA,EAAM;CACf,cAAcA,EAAM;CACpB,aAAaA,EAAM;CACnB,QAAQA,EAAM;CACd,kBAAkBA,EAAM;CACxB,eAAeA,EAAM;AACvB;AAGA,SAAgBC,EAAU,GAAuB;CAC/C,IAAM,EACJ,QAAQC,GACR,UAAO,IACP,UACA,aAAU,IACV,aAAU,OACRF,GACEG,IAASC,QACPC,EAAWH,GAAOI,GAAM;EAAE;EAAO,SAASC,KAAWC;CAAQ,CAAC,GACpE;EAACN;EAAOI;EAAMG;EAAOF;EAASC;CAAO,CACvC;CACA,OACE,kBAACE,GAAD;EACE,SAASC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SAAS,YACP;EACE,GAAGA;EACH,cAAcA,EAAE,gBAAgBC;EAChC,aAAaD,EAAE,eAAeE;CAChC,IACAF,CACN,GACF;EAACxG;EAAOsG;EAAQH;EAAWQ;EAASF;EAAcC;CAAW,CAC/D;CACA,OACE,kBAAClG,GAAD;EACE,SAASC,EAAc;GAAE,GAAGX;GAAO;GAAQ;EAAY,CAAC;EACxD,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAMA,SAAgB8G,EAAe,GAA4B;CACzD,IAAM,EACJ,UACA,SACA,YACA,cACA,eACA,UACA,YAAS,IACT,WACA,cACA,gBACA,cACE9G,GACE4F,IAAOC,EAAcpD,CAAM,GAC3BtC,IAASC,QACP,CACJ2G,EAAgBC,GAAO;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQpB;CACV,CAAC,CACH,GACA;EACEoB;EACArF;EACAsF;EACAC;EACAC;EACAC;EACApG;EACAa;EACAwF;EACAzB;CACF,CACF;CACA,OACE,kBAAClF,GAAD;EACE,SAASC,EAAc;GACrB,GAAGX;GACH,QAAQ,KAAA;GACR;GACA;EACF,CAAC;EACD,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAMA,SAAgBsH,EAAW,GAAwB;CACjD,IAAM,EACJ,UACA,WACA,aACA,iBACA,kBACA,mBACA,qBACA,qBACA,oBACA,WAAQ,IACR,eACA,UACA,UACA,gBACA,gBACA,WACA,cACEtH,GACE4F,IAAOC,EAAcpD,CAAM,GAC3B8E,IAAQnH,QAEVoH,EAAYC,GAAO;EACjB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ7B;CACV,CAAC,GACH;EACE6B;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACArC;CACF,CACF,GACM,CAACsC,KAAaC,QAAe,KAAK,IAAI,CAAC,GACvCC,IACJC,MAAU,KACN,OACAA,MAAU,KACRH,IACAG,aAAiB,OACfA,EAAM,QAAQ,IACdA,GACJC,IACJF,MAAQ,OACJ,CAAC,IACD,CACE;EACE,MAAM;EACN,MAAM;EACN,OAAOA;EACP,OAAO;EACP,MAAM,CAAC,GAAG,CAAC;EACX,OAAOG;CACT,CACF;CACN,OACE,kBAAC7H,GAAD;EACE,SAAS;GACP,GAAGC,EAAc;IACf,GAAGX;IACH,QAAQuH,EAAM;IACd,aAAa;GACf,CAAC;GACD,OAAO;IACL,MAAM;IACN,YAAYA,EAAM;IAClB,GAAGiB;GACL;GACA,OAAO;IACL,MAAM;IACN,KAAKjB,EAAM,OAAO;IAClB,KAAKA,EAAM,OAAO;IAClB,GAAGkB;GACL;GACA,aAAa,CAAC,GAAIC,KAAe,CAAC,GAAI,GAAGJ,CAAK;GAC9C,cAAcf,EAAM;GACpB,aAAaoB,KAAe,EAAE,MAAM,IAAI;GACxC,QAAQC,KAAUrB,EAAM,OAAO,SAAS;EAC1C;EACA,GAAIxH,EAAWC,CAAK;CACrB,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"charts.js","names":["frameProps","props","LineChart","input","series","useMemo","lineSeries","area","stacked","percent","curve","ChartBase","engineOptions","AreaChart","areaSeries","BarChart","barSeries","labels","CandlestickChart","candlestickSeries","HeatmapChart","heatmapChartOptions","data","xCategories","yCategories","colorScale","valueRange","colorMidpoint","name","radius","format","base","Sparkline","options","sparklineOptions","type","color","reference","renderer","tooltip","palette","ariaLabel","locale","ref","ScatterChart","scatterSeries","CORNERS","DOUBLE_CLICK_MS","cornerStyle","left","corner","top","split","plot","QuadrantChart","geometry","dropCorner","setDropCorner","useState","lastClick","useRef","release","dropAt","event","quadrantOf","quadrantChartOptions","draggable","onPointDrop","onPointDrag","overlay","quadrantContent","x0","x1","xDomain","y0","y1","yDomain","xs","xSplit","ys","ySplit","fx","fy","reverseX","tint","quadrants","index","points","now","last","double","onPointClick","onPointDoubleClick","onQuadrantClick","at","target","renderTooltip","HorizontalBarChart","RangeAreaChart","rangeAreaSeries","MixedChart","Chart","BubbleChart","bubbleSeries","minSize","maxSize","maxValue","HistogramChart","extra","lang","resolveLocale","histogramSeries","values","formatBin","bins","domain","nice","BoxPlotChart","groupName","presetLabels","boxplotSeries","groups","boxplotData","s","outlierShape","outlierSize","whisker","WaterfallChart","waterfallSeries","steps","upColor","downColor","totalColor","start","connector","GanttChart","gantt","ganttSeries","tasks","colors","taskName","progressName","milestoneName","formatProgress","dependenciesName","dependencyArrows","dependencyColor","mountedAt","today","lines","todayLabel","xAxis","yAxis","annotations","interaction","legend"],"sources":["../../../../charts/src/react/charts.tsx"],"sourcesContent":["import {\n useEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n} from \"react\";\nimport {\n areaSeries,\n barSeries,\n boxplotData,\n boxplotSeries,\n bubbleSeries,\n candlestickSeries,\n ganttSeries,\n heatmapChartOptions,\n histogramSeries,\n lineSeries,\n presetLabels,\n quadrantChartOptions,\n quadrantOf,\n rangeAreaSeries,\n scatterSeries,\n sparklineOptions,\n waterfallSeries,\n type QuadrantCorner,\n} from \"../engine/presets\";\nimport { resolveLocale } from \"../engine/locale\";\nimport type {\n ChartAnnotation,\n ChartDragEvent,\n ChartRect,\n} from \"../engine/types\";\nimport { Chart, ChartBase, engineOptions } from \"./Chart\";\nimport type {\n AreaChartProps,\n BarChartProps,\n BoxPlotChartProps,\n BubbleChartProps,\n CandlestickChartProps,\n ChartCommonProps,\n GanttChartProps,\n HeatmapChartProps,\n HistogramChartProps,\n HorizontalBarChartProps,\n LineChartProps,\n MixedChartProps,\n QuadrantChartProps,\n QuadrantDropTarget,\n RangeAreaChartProps,\n ScatterChartProps,\n SparklineProps,\n WaterfallChartProps,\n} from \"./types\";\n\nconst frameProps = (props: Omit<ChartCommonProps, \"labels\">) => ({\n height: props.height,\n width: props.width,\n className: props.className,\n style: props.style,\n handleRef: props.ref,\n onHover: props.onHover,\n onPointClick: props.onPointClick,\n onPlotClick: props.onPlotClick,\n onZoom: props.onZoom,\n onRendererChange: props.onRendererChange,\n renderTooltip: props.renderTooltip,\n});\n\n/** Line (or area) chart; handles millions of points on the GPU */\nexport function LineChart(props: LineChartProps) {\n const {\n series: input,\n area = false,\n curve,\n stacked = false,\n percent = false,\n } = props;\n const series = useMemo(\n () => lineSeries(input, area, { curve, stacked: stacked || percent }),\n [input, area, curve, stacked, percent],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Area chart: smooth by default, stacked or 100% stacked */\nexport function AreaChart(props: AreaChartProps) {\n const {\n series: input,\n curve = \"smooth\",\n stacked = false,\n percent = false,\n } = props;\n const series = useMemo(\n () => areaSeries(input, { curve, stacked: stacked || percent }),\n [input, curve, stacked, percent],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Bar chart: grouped side by side, stacked or 100% stacked, with optional value labels */\nexport function BarChart(props: BarChartProps) {\n const {\n series: input,\n stacked = false,\n percent = false,\n labels = false,\n } = props;\n const series = useMemo(\n () => barSeries(input, stacked || percent, labels),\n [input, stacked, percent, labels],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n labels: undefined,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Candlestick (OHLC) chart: rising and falling candles, zoomable on the GPU */\nexport function CandlestickChart(props: CandlestickChartProps) {\n const { series: input } = props;\n const series = useMemo(() => candlestickSeries(input), [input]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Heatmap: a grid of cells colored by value (categories or numbers on both axes) */\nexport function HeatmapChart(props: HeatmapChartProps) {\n const {\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n } = props;\n const series = useMemo(\n () =>\n heatmapChartOptions({\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n }).series,\n [\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n ],\n );\n const base = engineOptions({ ...props, series });\n return (\n <ChartBase\n options={{\n ...heatmapChartOptions(\n { data, xCategories, yCategories },\n {\n ...base,\n legend: props.legend,\n interaction: props.interaction,\n tooltip: props.tooltip,\n },\n ),\n series,\n }}\n {...frameProps(props)}\n />\n );\n}\n\n/** Word-sized chart without axes: a trend in a table cell, a KPI card, ... */\nexport function Sparkline(props: SparklineProps) {\n const {\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n height = 48,\n width,\n renderer,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n className,\n style,\n ref,\n onHover,\n renderTooltip,\n } = props;\n const options = useMemo(\n () =>\n sparklineOptions(\n { data, type, color, curve, name, reference, format },\n { renderer, tooltip, palette, ariaLabel, locale, labels },\n ),\n [\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n renderer,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n ],\n );\n return (\n <ChartBase\n options={options}\n height={height}\n width={width}\n className={className}\n style={style}\n handleRef={ref}\n onHover={onHover}\n renderTooltip={renderTooltip}\n />\n );\n}\n\n/** Scatter chart: zooms on both axes, hit testing through a spatial index */\nexport function ScatterChart(props: ScatterChartProps) {\n const { series: input } = props;\n const series = useMemo(() => scatterSeries(input), [input]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\nconst CORNERS: QuadrantCorner[] = [\n \"topLeft\",\n \"topRight\",\n \"bottomLeft\",\n \"bottomRight\",\n];\n\n/** Two clicks on the same point within this delay count as a double click */\nconst DOUBLE_CLICK_MS = 400;\n\nconst cornerStyle = (\n corner: QuadrantCorner,\n plot: ChartRect,\n split: { x: number; y: number },\n): CSSProperties => {\n const left = corner.endsWith(\"Left\");\n const top = corner.startsWith(\"top\");\n return {\n position: \"absolute\",\n left: left ? 0 : split.x - plot.x,\n top: top ? 0 : split.y - plot.y,\n width: left ? split.x - plot.x : plot.x + plot.width - split.x,\n height: top ? split.y - plot.y : plot.y + plot.height - split.y,\n pointerEvents: \"none\",\n };\n};\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG, ...): tinted\n * quadrants with titles, dividers, and labelled dots placed without\n * overlapping labels. Dots can be dragged to another quadrant.\n */\nexport function QuadrantChart(props: QuadrantChartProps) {\n const {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable,\n onPointClick,\n onPointDoubleClick,\n onPointDrag,\n onPointDrop,\n onQuadrantClick,\n renderTooltip,\n quadrantContent,\n } = props;\n const geometry = { xDomain, yDomain, xSplit, ySplit, reverseX };\n const [dropCorner, setDropCorner] = useState<QuadrantCorner | null>(null);\n const lastClick = useRef<{ index: number; time: number } | null>(null);\n\n // a release outside the plot ends the drag without a drop event\n useEffect(() => {\n if (!dropCorner) return;\n const release = () => setDropCorner(null);\n window.addEventListener(\"pointerup\", release);\n return () => window.removeEventListener(\"pointerup\", release);\n }, [dropCorner]);\n\n const dropAt = (event: ChartDragEvent): QuadrantDropTarget => ({\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry, event.x, event.y),\n });\n\n const options = quadrantChartOptions(\n {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable: draggable ?? !!(onPointDrop || onPointDrag),\n },\n engineOptions({ ...props, series: [] }),\n );\n\n const overlay =\n quadrantContent || dropCorner\n ? (plot: ChartRect) => {\n const [x0, x1] = xDomain ?? [0, 10];\n const [y0, y1] = yDomain ?? [0, 10];\n const xs = xSplit ?? (x0 + x1) / 2;\n const ys = ySplit ?? (y0 + y1) / 2;\n const fx = (xs - x0) / (x1 - x0 || 1);\n const fy = (ys - y0) / (y1 - y0 || 1);\n const split = {\n x: plot.x + plot.width * (reverseX ? 1 - fx : fx),\n y: plot.y + plot.height * (1 - fy),\n };\n const tint = dropCorner\n ? (quadrants?.[dropCorner]?.color ?? \"currentColor\")\n : \"\";\n return [\n ...CORNERS.map((corner) =>\n quadrantContent?.[corner] ? (\n <div\n key={corner}\n className={`minerva-chart-quadrant minerva-chart-quadrant-${corner}`}\n style={cornerStyle(corner, plot, split)}\n >\n {quadrantContent[corner]}\n </div>\n ) : null,\n ),\n dropCorner ? (\n <div\n key=\"drop-target\"\n className=\"minerva-chart-quadrant-target\"\n style={{\n ...cornerStyle(dropCorner, plot, split),\n background: `color-mix(in srgb, ${tint} 14%, transparent)`,\n boxShadow: `inset 0 0 0 2px ${tint}`,\n }}\n />\n ) : null,\n ];\n }\n : undefined;\n\n return (\n <ChartBase\n options={options}\n {...frameProps({\n ...props,\n onPointClick: undefined,\n renderTooltip: undefined,\n })}\n overlay={overlay}\n onPointClick={(event) => {\n const index = event.items[0]?.index;\n if (index === undefined || !points[index]) return;\n const now = Date.now();\n const last = lastClick.current;\n const double =\n last?.index === index && now - last.time < DOUBLE_CLICK_MS;\n lastClick.current = double ? null : { index, time: now };\n onPointClick?.(points[index], index);\n if (double) onPointDoubleClick?.(points[index], index);\n }}\n onPlotClick={\n onQuadrantClick\n ? (at) => onQuadrantClick(quadrantOf(geometry, at.x, at.y), at)\n : undefined\n }\n onDrag={(event) => {\n const index = event.item.index;\n const target = dropAt(event);\n setDropCorner(target.quadrant);\n if (points[index]) onPointDrag?.(points[index], index, target);\n }}\n onDrop={(event) => {\n setDropCorner(null);\n const index = event.item.index;\n if (points[index] && onPointDrop)\n onPointDrop(points[index], index, dropAt(event));\n }}\n renderTooltip={\n renderTooltip\n ? (event) => {\n const index = event.items[0]?.index;\n return index !== undefined && points[index]\n ? renderTooltip(points[index], index)\n : null;\n }\n : undefined\n }\n />\n );\n}\n\n/**\n * Horizontal bar chart: categories down the left side, values from the\n * left (rankings, long names, diverging surveys, stacked progress)\n */\nexport function HorizontalBarChart(props: HorizontalBarChartProps) {\n return <BarChart {...props} orientation=\"horizontal\" />;\n}\n\n/**\n * Range area chart: bands between a lower (`y0`) and an upper edge\n * (confidence intervals, min-max ranges), mixable with lines\n */\nexport function RangeAreaChart(props: RangeAreaChartProps) {\n const { series: input, curve = \"smooth\" } = props;\n const series = useMemo(() => rangeAreaSeries(input, curve), [input, curve]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Combination chart: bars, lines and areas on one or two value axes\n * (`yAxis: \"right\"` series use `yAxis2`, aligned on the left grid)\n */\nexport function MixedChart(props: MixedChartProps) {\n return <Chart {...props} />;\n}\n\n/** Bubble chart: x, y and a value sized by area (√value diameters) */\nexport function BubbleChart(props: BubbleChartProps) {\n const { series: input, minSize, maxSize, maxValue } = props;\n const series = useMemo(\n () => bubbleSeries(input, { minSize, maxSize, maxValue }),\n [input, minSize, maxSize, maxValue],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Histogram: the distribution of raw samples in bins of equal width\n * (Freedman-Diaconis, Sturges or a count); millions of samples are binned\n * in milliseconds\n */\nexport function HistogramChart(props: HistogramChartProps) {\n const {\n values,\n bins,\n domain,\n nice,\n name,\n color,\n formatBin,\n series: extra,\n locale,\n } = props;\n // page language read at every render: a language switch renames the series\n const lang = resolveLocale(locale);\n const series = useMemo(\n () => [\n histogramSeries(values, {\n bins,\n domain,\n nice,\n name,\n color,\n format: formatBin,\n locale: lang,\n }),\n ...(extra ?? []),\n ],\n [values, bins, domain, nice, name, color, formatBin, extra, lang],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Box plot: medians, quartiles, whiskers and outliers of samples, from raw\n * values (`groups`) or computed statistics (`series`)\n */\nexport function BoxPlotChart(props: BoxPlotChartProps) {\n const {\n series: input,\n groups,\n name,\n whisker,\n orientation,\n locale,\n outlierShape,\n outlierSize,\n } = props;\n const groupName = name ?? presetLabels(resolveLocale(locale)).values;\n const series = useMemo(\n () =>\n boxplotSeries([\n ...(groups?.length\n ? [\n {\n id: \"boxplot\",\n name: groupName,\n data: boxplotData(groups, { whisker }),\n },\n ]\n : []),\n ...(input ?? []),\n ]).map((s) =>\n s.type === \"boxplot\"\n ? {\n ...s,\n outlierShape: s.outlierShape ?? outlierShape,\n outlierSize: s.outlierSize ?? outlierSize,\n }\n : s,\n ),\n [input, groups, groupName, whisker, outlierShape, outlierSize],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series, orientation })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Waterfall (bridge) chart: how changes take a value from a start to an\n * end, with subtotals and totals (P&L bridges, budget variances)\n */\nexport function WaterfallChart(props: WaterfallChartProps) {\n const {\n steps,\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels = true,\n format,\n connector,\n orientation,\n locale,\n } = props;\n const lang = resolveLocale(locale);\n const series = useMemo(\n () => [\n waterfallSeries(steps, {\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n connector,\n locale: lang,\n }),\n ],\n [\n steps,\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n connector,\n lang,\n ],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n labels: undefined,\n series,\n orientation,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Gantt chart: tasks as bars on a time axis with their progress, groups,\n * milestones and a today line; zooms and pans along the time\n */\nexport function GanttChart(props: GanttChartProps) {\n const {\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n dependencyArrows,\n dependencyColor,\n today = false,\n todayLabel,\n xAxis,\n yAxis,\n annotations,\n interaction,\n legend,\n locale,\n } = props;\n const lang = resolveLocale(locale);\n const gantt = useMemo(\n () =>\n ganttSeries(tasks, {\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n dependencyArrows,\n dependencyColor,\n locale: lang,\n }),\n [\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n dependencyArrows,\n dependencyColor,\n lang,\n ],\n );\n const [mountedAt] = useState(() => Date.now());\n const now =\n today === false\n ? null\n : today === true\n ? mountedAt\n : today instanceof Date\n ? today.getTime()\n : today;\n const lines: ChartAnnotation[] =\n now === null\n ? []\n : [\n {\n type: \"line\",\n axis: \"y\",\n value: now,\n color: \"var(--danger-color, #dc2626)\",\n dash: [4, 3],\n label: todayLabel,\n },\n ];\n return (\n <ChartBase\n options={{\n ...engineOptions({\n ...props,\n series: gantt.series,\n orientation: \"horizontal\",\n }),\n xAxis: {\n type: \"category\",\n categories: gantt.categories,\n ...xAxis,\n },\n yAxis: {\n type: \"time\",\n min: gantt.domain[0],\n max: gantt.domain[1],\n ...yAxis,\n },\n annotations: [...(annotations ?? []), ...lines],\n dependencies: gantt.dependencies,\n interaction: interaction ?? { zoom: \"y\" },\n legend: legend ?? gantt.series.length > 1,\n }}\n {...frameProps(props)}\n />\n );\n}\n"],"mappings":";;;;;;;AAuDA,IAAMA,KAAc,OAA6C;CAC/D,QAAQC,EAAM;CACd,OAAOA,EAAM;CACb,WAAWA,EAAM;CACjB,OAAOA,EAAM;CACb,WAAWA,EAAM;CACjB,SAASA,EAAM;CACf,cAAcA,EAAM;CACpB,aAAaA,EAAM;CACnB,QAAQA,EAAM;CACd,kBAAkBA,EAAM;CACxB,eAAeA,EAAM;AACvB;AAGA,SAAgBC,EAAU,GAAuB;CAC/C,IAAM,EACJ,QAAQC,GACR,UAAO,IACP,UACA,aAAU,IACV,aAAU,OACRF,GACEG,IAASC,QACPC,EAAWH,GAAOI,GAAM;EAAE;EAAO,SAASC,KAAWC;CAAQ,CAAC,GACpE;EAACN;EAAOI;EAAMG;EAAOF;EAASC;CAAO,CACv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EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,CAAC,QACL;EACEC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;CACF,CACF,GACMC,IAAOnB,EAAc;EAAE,GAAGX;EAAO;CAAO,CAAC;CAC/C,OACE,kBAACU,GAAD;EACE,SAAS;GACP,GAAGU,EACD;IAAE;IAAM;IAAa;GAAY,GACjC;IACE,GAAGU;IACH,QAAQ9B,EAAM;IACd,aAAaA,EAAM;IACnB,SAASA,EAAM;GACjB,CACF;GACA;EACF;EACA,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAGA,SAAgB+B,EAAU,GAAuB;CAC/C,IAAM,EACJ,SACA,SACA,UACA,UACA,SACA,cACA,WACA,YAAS,IACT,UACA,aACA,YACA,YACA,cACA,WACA,WACA,cACA,UACA,QACA,YACA,qBACE/B,GACEgC,IAAU5B,QAEZ6B,EACE;EAAE;EAAM;EAAM;EAAO;EAAO;EAAM;EAAW;CAAO,GACpD;EAAE;EAAU;EAAS;EAAS;EAAW;EAAQ;CAAO,CAC1D,GACF;EACEZ;EACAa;EACAC;EACA1B;EACAkB;EACAS;EACAP;EACAQ;EACAC;EACAC;EACAC;EACAC;EACAzB;CACF,CACF;CACA,OACE,kBAACN,GAAD;EACW;EACD;EACD;EACI;EACJ;EACP,WAAWgC;EACF;EACM;CAChB,CAAA;AAEL;AAGA,SAAgBC,EAAa,GAA0B;CACrD,IAAM,EAAE,QAAQzC,MAAUF,GACpBG,IAASC,QAAcwC,EAAc1C,CAAK,GAAG,CAACA,CAAK,CAAC;CAC1D,OACE,kBAACQ,GAAD;EACE,SAASC,EAAc;GAAE,GAAGX;GAAO;EAAO,CAAC;EAC3C,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAEA,IAAM6C,IAA4B;CAChC;CACA;CACA;CACA;AACF,GAGMC,IAAkB,KAElBC,KACJ,GACA,GACA,MACkB;CAClB,IAAMC,IAAOC,EAAO,SAAS,M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O;GAAQ;EAAY,CAAC;EACxD,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAMA,SAAgB8H,EAAe,GAA4B;CACzD,IAAM,EACJ,UACA,SACA,YACA,cACA,eACA,UACA,YAAS,IACT,WACA,cACA,gBACA,cACE9H,GACE4G,IAAOC,EAAcpE,CAAM,GAC3BtC,IAASC,QACP,CACJ2H,EAAgBC,GAAO;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQpB;CACV,CAAC,CACH,GACA;EACEoB;EACArG;EACAsG;EACAC;EACAC;EACAC;EACApH;EACAa;EACAwG;EACAzB;CACF,CACF;CACA,OACE,kBAAClG,GAAD;EACE,SAASC,EAAc;GACrB,GAAGX;GACH,QAAQ,KAAA;GACR;GACA;EACF,CAAC;EACD,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAMA,SAAgBsI,EAAW,GAAwB;CACjD,IAAM,EACJ,UACA,WACA,aACA,iBACA,kBACA,mBACA,qBACA,qBACA,oBACA,WAAQ,IACR,eACA,UACA,UACA,gBACA,gBACA,WACA,cACEtI,GACE4G,IAAOC,EAAcpE,CAAM,GAC3B8F,IAAQnI,QAEVoI,EAAYC,GAAO;EACjB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ7B;CACV,CAAC,GACH;EACE6B;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACArC;CACF,CACF,GACM,CAACsC,KAAazF,QAAe,KAAK,IAAI,CAAC,GACvC8B,IACJ4D,MAAU,KACN,OACAA,MAAU,KACRD,IACAC,aAAiB,OACfA,EAAM,QAAQ,IACdA,GACJC,IACJ7D,MAAQ,OACJ,CAAC,IACD,CACE;EACE,MAAM;EACN,MAAM;EACN,OAAOA;EACP,OAAO;EACP,MAAM,CAAC,GAAG,CAAC;EACX,OAAO8D;CACT,CACF;CACN,OACE,kBAAC3I,GAAD;EACE,SAAS;GACP,GAAGC,EAAc;IACf,GAAGX;IACH,QAAQuI,EAAM;IACd,aAAa;GACf,CAAC;GACD,OAAO;IACL,MAAM;IACN,YAAYA,EAAM;IAClB,GAAGe;GACL;GACA,OAAO;IACL,MAAM;IACN,KAAKf,EAAM,OAAO;IAClB,KAAKA,EAAM,OAAO;IAClB,GAAGgB;GACL;GACA,aAAa,CAAC,GAAIC,KAAe,CAAC,GAAI,GAAGJ,CAAK;GAC9C,cAAcb,EAAM;GACpB,aAAakB,KAAe,EAAE,MAAM,IAAI;GACxC,QAAQC,KAAUnB,EAAM,OAAO,SAAS;EAC1C;EACA,GAAIxI,EAAWC,CAAK;CACrB,CAAA;AAEL"}
|
|
@@ -320,6 +320,14 @@ export interface QuadrantDropTarget {
|
|
|
320
320
|
export interface QuadrantChartProps extends Omit<ChartCommonProps, "onPointClick" | "onPlotClick" | "renderTooltip" | "xAxis" | "yAxis">, QuadrantConfig {
|
|
321
321
|
/** Called with the clicked point and its index */
|
|
322
322
|
onPointClick?: (point: QuadrantPoint, index: number) => void;
|
|
323
|
+
/** Called when the same point is clicked twice in quick succession */
|
|
324
|
+
onPointDoubleClick?: (point: QuadrantPoint, index: number) => void;
|
|
325
|
+
/**
|
|
326
|
+
* Called on every move of a dragged point, with the quadrant under the
|
|
327
|
+
* pointer; the dots stay in place until the drop (update `points` in
|
|
328
|
+
* `onPointDrop`)
|
|
329
|
+
*/
|
|
330
|
+
onPointDrag?: (point: QuadrantPoint, index: number, target: QuadrantDropTarget) => void;
|
|
323
331
|
/** Called when the empty area of a quadrant is clicked */
|
|
324
332
|
onQuadrantClick?: (quadrant: QuadrantCorner, position: {
|
|
325
333
|
x: number;
|
|
@@ -320,6 +320,14 @@ export interface QuadrantDropTarget {
|
|
|
320
320
|
export interface QuadrantChartProps extends Omit<ChartCommonProps, "onPointClick" | "onPlotClick" | "renderTooltip" | "xAxis" | "yAxis">, QuadrantConfig {
|
|
321
321
|
/** Called with the clicked point and its index */
|
|
322
322
|
onPointClick?: (point: QuadrantPoint, index: number) => void;
|
|
323
|
+
/** Called when the same point is clicked twice in quick succession */
|
|
324
|
+
onPointDoubleClick?: (point: QuadrantPoint, index: number) => void;
|
|
325
|
+
/**
|
|
326
|
+
* Called on every move of a dragged point, with the quadrant under the
|
|
327
|
+
* pointer; the dots stay in place until the drop (update `points` in
|
|
328
|
+
* `onPointDrop`)
|
|
329
|
+
*/
|
|
330
|
+
onPointDrag?: (point: QuadrantPoint, index: number, target: QuadrantDropTarget) => void;
|
|
323
331
|
/** Called when the empty area of a quadrant is clicked */
|
|
324
332
|
onQuadrantClick?: (quadrant: QuadrantCorner, position: {
|
|
325
333
|
x: number;
|