@carto/ps-react-ui 4.4.2 → 4.5.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/dist/download-config-DemuQ3Jm.js +56 -0
- package/dist/download-config-DemuQ3Jm.js.map +1 -0
- package/dist/error-Cj8eUMrl.js +40 -0
- package/dist/error-Cj8eUMrl.js.map +1 -0
- package/dist/formatter-B9Bxn1k7.js +6 -0
- package/dist/formatter-B9Bxn1k7.js.map +1 -0
- package/dist/no-data-DkIt7Qt1.js +61 -0
- package/dist/no-data-DkIt7Qt1.js.map +1 -0
- package/dist/row-D4VOhcNI.js +34 -0
- package/dist/row-D4VOhcNI.js.map +1 -0
- package/dist/series-Bola3CmD.js +90 -0
- package/dist/series-Bola3CmD.js.map +1 -0
- package/dist/styles-Y8q7Jff3.js +118 -0
- package/dist/styles-Y8q7Jff3.js.map +1 -0
- package/dist/types/widgets/actions/brush-toggle/types.d.ts +8 -2
- package/dist/types/widgets/category/components/category-row-multi.d.ts +2 -1
- package/dist/types/widgets/category/components/category-row-single.d.ts +2 -1
- package/dist/types/widgets/category/types.d.ts +1 -0
- package/dist/types/widgets/echart/shared-resize-observer.d.ts +12 -0
- package/dist/types/widgets/echart/types.d.ts +2 -0
- package/dist/types/widgets/histogram/config.d.ts +15 -3
- package/dist/types/widgets/histogram/index.d.ts +2 -1
- package/dist/types/widgets/histogram/types.d.ts +6 -3
- package/dist/types/widgets/stores/index.d.ts +2 -1
- package/dist/types/widgets/stores/types.d.ts +2 -0
- package/dist/types/widgets/stores/use-widget-selector.d.ts +35 -0
- package/dist/types/widgets/stores/widget-store-performance.test.d.ts +1 -0
- package/dist/types/widgets/stores/widget-store.d.ts +49 -27
- package/dist/types/widgets/table/types.d.ts +1 -1
- package/dist/types/widgets/utils/chart-config/index.d.ts +1 -1
- package/dist/types/widgets/utils/chart-config/option-builders.d.ts +13 -8
- package/dist/types/widgets/utils/formatter.d.ts +1 -0
- package/dist/types/widgets/utils/index.d.ts +1 -1
- package/dist/use-widget-ref-BFazQvJK.js +22 -0
- package/dist/use-widget-ref-BFazQvJK.js.map +1 -0
- package/dist/use-widget-selector-DqRmWQ1K.js +12 -0
- package/dist/use-widget-selector-DqRmWQ1K.js.map +1 -0
- package/dist/widget-store-CIrb9RKP.js +263 -0
- package/dist/widget-store-CIrb9RKP.js.map +1 -0
- package/dist/widgets/actions.js +799 -817
- package/dist/widgets/actions.js.map +1 -1
- package/dist/widgets/bar.js +53 -47
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/category.js +261 -255
- package/dist/widgets/category.js.map +1 -1
- package/dist/widgets/echart.js +109 -99
- package/dist/widgets/echart.js.map +1 -1
- package/dist/widgets/error.js +1 -1
- package/dist/widgets/formula.js +71 -63
- package/dist/widgets/formula.js.map +1 -1
- package/dist/widgets/histogram.js +119 -80
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/loader.js +53 -60
- package/dist/widgets/loader.js.map +1 -1
- package/dist/widgets/markdown.js +51 -50
- package/dist/widgets/markdown.js.map +1 -1
- package/dist/widgets/no-data.js +1 -1
- package/dist/widgets/pie.js +111 -99
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/range.js +146 -144
- package/dist/widgets/range.js.map +1 -1
- package/dist/widgets/scatterplot.js +50 -44
- package/dist/widgets/scatterplot.js.map +1 -1
- package/dist/widgets/skeleton-loader.js +18 -17
- package/dist/widgets/skeleton-loader.js.map +1 -1
- package/dist/widgets/spread.js +110 -94
- package/dist/widgets/spread.js.map +1 -1
- package/dist/widgets/stores.js +5 -2
- package/dist/widgets/stores.js.map +1 -1
- package/dist/widgets/table.js +422 -436
- package/dist/widgets/table.js.map +1 -1
- package/dist/widgets/timeseries.js +52 -46
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets/toolbar-actions.js +101 -6693
- package/dist/widgets/toolbar-actions.js.map +1 -1
- package/dist/widgets/utils.js +16 -14
- package/dist/widgets/utils.js.map +1 -1
- package/dist/widgets/wrapper.js +156 -158
- package/dist/widgets/wrapper.js.map +1 -1
- package/dist/widgets.js +4 -4
- package/package.json +5 -4
- package/src/hooks/use-widget-ref.ts +3 -4
- package/src/widgets/README.md +3 -3
- package/src/widgets/actions/brush-toggle/brush-toggle.tsx +60 -79
- package/src/widgets/actions/brush-toggle/types.ts +8 -2
- package/src/widgets/actions/change-column/change-column.tsx +15 -15
- package/src/widgets/actions/change-column/sortable-column-item.tsx +3 -1
- package/src/widgets/actions/download/download.tsx +4 -3
- package/src/widgets/actions/fullscreen/fullscreen.tsx +7 -11
- package/src/widgets/actions/lock-selection/lock-selection.tsx +12 -15
- package/src/widgets/actions/relative-data/relative-data.tsx +22 -26
- package/src/widgets/actions/searcher/searcher-toggle.tsx +11 -12
- package/src/widgets/actions/searcher/searcher.tsx +20 -21
- package/src/widgets/actions/stack-toggle/stack-toggle.tsx +15 -21
- package/src/widgets/actions/zoom-toggle/zoom-toggle.tsx +27 -43
- package/src/widgets/bar/config.ts +22 -14
- package/src/widgets/category/category-ui.tsx +31 -27
- package/src/widgets/category/components/category-row-multi.tsx +6 -2
- package/src/widgets/category/components/category-row-single.tsx +5 -1
- package/src/widgets/category/types.ts +1 -0
- package/src/widgets/echart/echart-ui.test.tsx +20 -16
- package/src/widgets/echart/echart-ui.tsx +6 -12
- package/src/widgets/echart/echart.tsx +13 -27
- package/src/widgets/echart/shared-resize-observer.ts +45 -0
- package/src/widgets/echart/types.ts +2 -0
- package/src/widgets/error/error.tsx +7 -9
- package/src/widgets/formula/components/prefix.tsx +4 -6
- package/src/widgets/formula/components/row.tsx +4 -4
- package/src/widgets/formula/components/series.tsx +4 -6
- package/src/widgets/formula/components/suffix.tsx +4 -6
- package/src/widgets/formula/components/value.tsx +9 -16
- package/src/widgets/histogram/config.ts +101 -20
- package/src/widgets/histogram/index.ts +6 -1
- package/src/widgets/histogram/types.ts +9 -3
- package/src/widgets/loader/loader.tsx +31 -44
- package/src/widgets/markdown/markdown.tsx +4 -7
- package/src/widgets/no-data/no-data.tsx +7 -10
- package/src/widgets/pie/config.ts +17 -5
- package/src/widgets/range/components/range-item.tsx +20 -18
- package/src/widgets/scatterplot/config.ts +8 -3
- package/src/widgets/skeleton-loader/skeleton-loader.tsx +2 -5
- package/src/widgets/spread/components/max-value.tsx +14 -16
- package/src/widgets/spread/components/min-value.tsx +14 -16
- package/src/widgets/stores/index.ts +2 -1
- package/src/widgets/stores/types.ts +2 -0
- package/src/widgets/stores/use-widget-selector.ts +47 -0
- package/src/widgets/stores/widget-store-performance.test.ts +750 -0
- package/src/widgets/stores/widget-store.test.ts +81 -0
- package/src/widgets/stores/widget-store.ts +225 -44
- package/src/widgets/table/config.ts +0 -1
- package/src/widgets/table/hooks/use-pagination.ts +28 -52
- package/src/widgets/table/hooks/use-selection.ts +20 -24
- package/src/widgets/table/hooks/use-sort.ts +22 -39
- package/src/widgets/table/types.ts +1 -1
- package/src/widgets/timeseries/config.ts +21 -13
- package/src/widgets/utils/chart-config/index.ts +1 -1
- package/src/widgets/utils/chart-config/option-builders.ts +22 -12
- package/src/widgets/utils/formatter.ts +2 -1
- package/src/widgets/utils/index.ts +1 -1
- package/src/widgets/wrapper/wrapper-ui.tsx +12 -13
- package/src/widgets/wrapper/wrapper.tsx +4 -6
- package/dist/error-CEkRPccv.js +0 -39
- package/dist/error-CEkRPccv.js.map +0 -1
- package/dist/formatter-B1Xh8XDH.js +0 -5
- package/dist/formatter-B1Xh8XDH.js.map +0 -1
- package/dist/no-data-hR3KcJ-_.js +0 -60
- package/dist/no-data-hR3KcJ-_.js.map +0 -1
- package/dist/row-DTCV0Ocm.js +0 -35
- package/dist/row-DTCV0Ocm.js.map +0 -1
- package/dist/series-CYNOu2Ju.js +0 -91
- package/dist/series-CYNOu2Ju.js.map +0 -1
- package/dist/styles-C_8vOEep.js +0 -167
- package/dist/styles-C_8vOEep.js.map +0 -1
- package/dist/use-widget-ref-wtFLDFCD.js +0 -25
- package/dist/use-widget-ref-wtFLDFCD.js.map +0 -1
- package/dist/widget-store-CzDt8oSK.js +0 -163
- package/dist/widget-store-CzDt8oSK.js.map +0 -1
package/dist/widgets/formula.js
CHANGED
|
@@ -1,90 +1,98 @@
|
|
|
1
|
-
import { I, S as
|
|
2
|
-
import { jsx as f, jsxs as
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
1
|
+
import { I as y, S as F, P as I, a as D } from "../series-Bola3CmD.js";
|
|
2
|
+
import { jsx as f, jsxs as P, Fragment as k } from "react/jsx-runtime";
|
|
3
|
+
import { c as g } from "react/compiler-runtime";
|
|
4
|
+
import { d as C } from "../formatter-B9Bxn1k7.js";
|
|
5
|
+
import { u as R } from "../use-widget-selector-DqRmWQ1K.js";
|
|
6
|
+
import { R as T, s as $ } from "../row-D4VOhcNI.js";
|
|
7
|
+
import { Box as v, Skeleton as b } from "@mui/material";
|
|
8
|
+
import "../widget-store-CIrb9RKP.js";
|
|
9
|
+
import "zustand/shallow";
|
|
9
10
|
import "@mui/icons-material";
|
|
10
11
|
import "react";
|
|
11
|
-
import "
|
|
12
|
-
import { d as y, a as v } from "../exports-Cr43OCul.js";
|
|
12
|
+
import { d as h, a as S } from "../exports-Cr43OCul.js";
|
|
13
13
|
import "../lasso-tool-BYbxrJ-7.js";
|
|
14
14
|
import "../cjs-D4KH3azB.js";
|
|
15
15
|
import "@dnd-kit/core";
|
|
16
16
|
import "@dnd-kit/sortable";
|
|
17
17
|
import "@dnd-kit/utilities";
|
|
18
|
-
import { u as j } from "../use-widget-ref-
|
|
18
|
+
import { u as j } from "../use-widget-ref-BFazQvJK.js";
|
|
19
19
|
function z(t) {
|
|
20
|
-
const e =
|
|
21
|
-
let i, o
|
|
20
|
+
const e = g(15);
|
|
21
|
+
let r, i, o;
|
|
22
22
|
e[0] !== t ? ({
|
|
23
|
-
id:
|
|
24
|
-
index:
|
|
25
|
-
...
|
|
26
|
-
} = t, e[0] = t, e[1] =
|
|
27
|
-
const n =
|
|
23
|
+
id: r,
|
|
24
|
+
index: o,
|
|
25
|
+
...i
|
|
26
|
+
} = t, e[0] = t, e[1] = r, e[2] = i, e[3] = o) : (r = e[1], i = e[2], o = e[3]);
|
|
27
|
+
const n = o === void 0 ? 0 : o;
|
|
28
28
|
let a;
|
|
29
|
-
e[4] !==
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
e[4] !== n ? (a = (w) => {
|
|
30
|
+
const p = w;
|
|
31
|
+
return {
|
|
32
|
+
value: p?.data?.[n]?.value,
|
|
33
|
+
color: p?.data?.[n]?.color,
|
|
34
|
+
formatter: p?.formatter ?? C
|
|
35
|
+
};
|
|
36
|
+
}, e[4] = n, e[5] = a) : a = e[5];
|
|
37
|
+
const {
|
|
38
|
+
value: l,
|
|
39
|
+
color: u,
|
|
40
|
+
formatter: c
|
|
41
|
+
} = R(r, a);
|
|
42
|
+
let m;
|
|
43
|
+
e[6] !== u ? (m = {
|
|
44
|
+
color: u
|
|
45
|
+
}, e[6] = u, e[7] = m) : m = e[7];
|
|
46
|
+
const x = l ?? 0;
|
|
34
47
|
let s;
|
|
35
|
-
e[
|
|
36
|
-
color: x
|
|
37
|
-
}, e[10] = x, e[11] = s) : s = e[11];
|
|
38
|
-
const p = l ?? 0;
|
|
48
|
+
e[8] !== c || e[9] !== x ? (s = c(x), e[8] = c, e[9] = x, e[10] = s) : s = e[10];
|
|
39
49
|
let d;
|
|
40
|
-
e[12] !==
|
|
41
|
-
let c;
|
|
42
|
-
return e[15] !== o || e[16] !== s || e[17] !== d ? (c = /* @__PURE__ */ f(I, { TypographyProps: s, ...o, children: d }), e[15] = o, e[16] = s, e[17] = d, e[18] = c) : c = e[18], c;
|
|
50
|
+
return e[11] !== i || e[12] !== m || e[13] !== s ? (d = /* @__PURE__ */ f(y, { TypographyProps: m, ...i, children: s }), e[11] = i, e[12] = m, e[13] = s, e[14] = d) : d = e[14], d;
|
|
43
51
|
}
|
|
44
|
-
function
|
|
52
|
+
function Z({
|
|
45
53
|
refUI: t
|
|
46
54
|
}) {
|
|
47
55
|
return [{
|
|
48
|
-
...
|
|
49
|
-
modifier: () =>
|
|
56
|
+
...h,
|
|
57
|
+
modifier: () => h.modifier(t)
|
|
50
58
|
}, {
|
|
51
|
-
...
|
|
59
|
+
...S,
|
|
52
60
|
modifier: async (e) => {
|
|
53
|
-
const
|
|
54
|
-
return
|
|
61
|
+
const r = [e?.map((i) => i.value) ?? []];
|
|
62
|
+
return S.modifier(r);
|
|
55
63
|
}
|
|
56
64
|
}];
|
|
57
65
|
}
|
|
58
|
-
function
|
|
66
|
+
function ee() {
|
|
59
67
|
return {
|
|
60
68
|
series: []
|
|
61
69
|
};
|
|
62
70
|
}
|
|
63
|
-
function
|
|
64
|
-
const e =
|
|
65
|
-
ref:
|
|
71
|
+
function te(t) {
|
|
72
|
+
const e = g(8), {
|
|
73
|
+
ref: r
|
|
66
74
|
} = j(t.id);
|
|
67
|
-
let
|
|
68
|
-
e[0] !== t.id ? (
|
|
75
|
+
let i;
|
|
76
|
+
e[0] !== t.id ? (i = (a) => {
|
|
69
77
|
const {
|
|
70
78
|
index: l
|
|
71
79
|
} = a;
|
|
72
|
-
return /* @__PURE__ */ k
|
|
73
|
-
/* @__PURE__ */ f(
|
|
74
|
-
/* @__PURE__ */ f(
|
|
80
|
+
return /* @__PURE__ */ P(k, { children: [
|
|
81
|
+
/* @__PURE__ */ f(F, { id: t.id, index: l }),
|
|
82
|
+
/* @__PURE__ */ f(I, { id: t.id, index: l }),
|
|
75
83
|
/* @__PURE__ */ f(z, { id: t.id, index: l }),
|
|
76
|
-
/* @__PURE__ */ f(
|
|
84
|
+
/* @__PURE__ */ f(D, { id: t.id, index: l })
|
|
77
85
|
] });
|
|
78
|
-
}, e[0] = t.id, e[1] =
|
|
79
|
-
let
|
|
80
|
-
e[2] !== t.id || e[3] !==
|
|
86
|
+
}, e[0] = t.id, e[1] = i) : i = e[1];
|
|
87
|
+
let o;
|
|
88
|
+
e[2] !== t.id || e[3] !== i ? (o = /* @__PURE__ */ f(T, { id: t.id, children: i }), e[2] = t.id, e[3] = i, e[4] = o) : o = e[4];
|
|
81
89
|
let n;
|
|
82
|
-
return e[5] !==
|
|
90
|
+
return e[5] !== r || e[6] !== o ? (n = /* @__PURE__ */ f(v, { ref: r, children: o }), e[5] = r, e[6] = o, e[7] = n) : n = e[7], n;
|
|
83
91
|
}
|
|
84
|
-
function
|
|
85
|
-
const t =
|
|
92
|
+
function ie() {
|
|
93
|
+
const t = g(1);
|
|
86
94
|
let e;
|
|
87
|
-
return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ f(
|
|
95
|
+
return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ f(v, { sx: $.row, "aria-label": "Formula skeleton", children: /* @__PURE__ */ f(b, { width: 120, height: 32 }) }), t[0] = e) : e = t[0], e;
|
|
88
96
|
}
|
|
89
97
|
function V(t) {
|
|
90
98
|
return {
|
|
@@ -93,21 +101,21 @@ function V(t) {
|
|
|
93
101
|
suffix: typeof t.suffix == "string" ? t.suffix : void 0
|
|
94
102
|
};
|
|
95
103
|
}
|
|
96
|
-
function
|
|
104
|
+
function oe(t) {
|
|
97
105
|
return t?.map(V);
|
|
98
106
|
}
|
|
99
107
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
ie as FormulaSkeleton,
|
|
109
|
+
te as FormulaUI,
|
|
110
|
+
y as Item,
|
|
111
|
+
I as Prefix,
|
|
104
112
|
T as Row,
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
F as Series,
|
|
114
|
+
D as Suffix,
|
|
107
115
|
z as Value,
|
|
108
|
-
|
|
109
|
-
|
|
116
|
+
ee as formulaConfig,
|
|
117
|
+
Z as formulaDownloadConfig,
|
|
110
118
|
V as sanitizeDataItem,
|
|
111
|
-
|
|
119
|
+
oe as sanitizeDataItems
|
|
112
120
|
};
|
|
113
121
|
//# sourceMappingURL=formula.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formula.js","sources":["../../src/widgets/formula/components/value.tsx","../../src/widgets/formula/config.ts","../../src/widgets/formula/formula-ui.tsx","../../src/widgets/formula/skeleton.tsx","../../src/widgets/formula/serializer.ts"],"sourcesContent":["import { type FormulaWidgetState, type ValueProps } from '../types'\nimport {
|
|
1
|
+
{"version":3,"file":"formula.js","sources":["../../src/widgets/formula/components/value.tsx","../../src/widgets/formula/config.ts","../../src/widgets/formula/formula-ui.tsx","../../src/widgets/formula/skeleton.tsx","../../src/widgets/formula/serializer.ts"],"sourcesContent":["import { type FormulaWidgetState, type ValueProps } from '../types'\nimport { Item } from './item'\nimport { defaultFormatter } from '../../utils/formatter'\nimport { useWidgetSelector } from '../../stores/use-widget-selector'\n\n/**\n * Displays the formatted numeric value for a formula widget data item, applying the widget's formatter and color.\n */\nexport function Value({ id, index = 0, ...props }: ValueProps) {\n const { value, color, formatter } = useWidgetSelector(id, (w) => {\n const widget = w as FormulaWidgetState | undefined\n return {\n value: widget?.data?.[index]?.value,\n color: widget?.data?.[index]?.color,\n formatter: widget?.formatter ?? defaultFormatter,\n }\n })\n\n return (\n <Item TypographyProps={{ color }} {...props}>\n {formatter(value ?? 0)}\n </Item>\n )\n}\n","import { downloadToCSV, downloadToPNG } from '../actions'\nimport type { ConfigProps } from '../loader/types'\nimport type { FormulaDownloadConfig, FormulaWidgetConfig } from './types'\n\n/**\n * Creates download configuration for formula widgets, supporting PNG (screenshot) and CSV (data) exports.\n *\n * @param props - Configuration with `refUI` reference for PNG export.\n * @returns Array of download items for use with the Download action.\n */\nexport function formulaDownloadConfig({\n refUI,\n}: ConfigProps): FormulaDownloadConfig {\n return [\n {\n ...downloadToPNG,\n modifier: () => downloadToPNG.modifier(refUI),\n },\n {\n ...downloadToCSV,\n modifier: async (data) => {\n const formulaData = [data?.map((item) => item.value) ?? []]\n return downloadToCSV.modifier(formulaData)\n },\n },\n ]\n}\n\n/**\n * Returns the default configuration for formula (single or multiple numeric value) widgets.\n *\n * @returns Default formula widget config with empty series.\n */\nexport function formulaConfig(): FormulaWidgetConfig {\n return {\n series: [],\n }\n}\n","import type { FormulaUIProps } from './types'\nimport { Row } from './components/row'\nimport { Value } from './components/value'\nimport { Prefix } from './components/prefix'\nimport { Suffix } from './components/suffix'\nimport { Series } from './components/series'\nimport { useWidgetRef } from '../../hooks'\nimport { Box } from '@mui/material'\n\n/**\n * Renders a formula widget displaying one or more KPI values with optional prefixes, suffixes, and series indicators.\n */\nexport function FormulaUI(props: FormulaUIProps) {\n const { ref } = useWidgetRef(props.id)\n\n return (\n <Box ref={ref}>\n <Row id={props.id}>\n {({ index }) => (\n <>\n <Series id={props.id} index={index} />\n <Prefix id={props.id} index={index} />\n <Value id={props.id} index={index} />\n <Suffix id={props.id} index={index} />\n </>\n )}\n </Row>\n </Box>\n )\n}\n","import { Box, Skeleton } from '@mui/material'\nimport { styles } from './style'\n\nexport function FormulaSkeleton() {\n return (\n <Box sx={styles.row} aria-label='Formula skeleton'>\n <Skeleton width={120} height={32} />\n </Box>\n )\n}\n","import type { DataItem } from './types'\n\n/**\n * Sanitizes DataItem by converting ReactNode prefix/suffix values to undefined.\n * This ensures only string values are stored in the widget state.\n *\n * @param item - The DataItem to sanitize\n * @returns A new DataItem with ReactNode prefix/suffix values converted to undefined\n */\nexport function sanitizeDataItem(item: DataItem): DataItem {\n return {\n ...item,\n prefix: typeof item.prefix === 'string' ? item.prefix : undefined,\n suffix: typeof item.suffix === 'string' ? item.suffix : undefined,\n }\n}\n\n/**\n * Sanitizes an array of DataItems by converting ReactNode prefix/suffix values to undefined.\n *\n * @param items - Array of DataItems to sanitize\n * @returns A new array with sanitized DataItems\n */\nexport function sanitizeDataItems(\n items: DataItem[] | undefined,\n): DataItem[] | undefined {\n return items?.map(sanitizeDataItem)\n}\n"],"names":["Value","t0","$","_c","id","props","t1","index","undefined","t2","w","widget","value","data","color","formatter","defaultFormatter","useWidgetSelector","t3","t4","t5","t6","Item","formulaDownloadConfig","refUI","downloadToPNG","modifier","downloadToCSV","formulaData","map","item","formulaConfig","series","FormulaUI","ref","useWidgetRef","jsxs","Fragment","jsx","Series","Prefix","Suffix","Row","Box","FormulaSkeleton","Symbol","for","styles","row","Skeleton","sanitizeDataItem","prefix","suffix","sanitizeDataItems","items"],"mappings":";;;;;;;;;;;;;;;;;;AAQO,SAAAA,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAA,EAAA;AAAA,MAAAC,GAAAC,GAAAC;AAAA,EAAAJ,SAAAD,KAAe;AAAA,IAAAG,IAAAA;AAAAA,IAAAG,OAAAD;AAAAA,IAAA,GAAAD;AAAAA,EAAAA,IAAAJ,GAAuCC,OAAAD,GAAAC,OAAAE,GAAAF,OAAAG,GAAAH,OAAAI,MAAAF,IAAAF,EAAA,CAAA,GAAAG,IAAAH,EAAA,CAAA,GAAAI,IAAAJ,EAAA,CAAA;AAAjC,QAAAK,IAAAD,MAAAE,SAAA,IAAAF;AAAS,MAAAG;AAAA,EAAAP,SAAAK,KACuBE,IAAAC,CAAAA,MAAA;AACxD,UAAAC,IAAeD;AAAmC,WAC3C;AAAA,MAAAE,OACED,GAAME,OAASN,CAAK,GAAQK;AAAAA,MAAAE,OAC5BH,GAAME,OAASN,CAAK,GAAQO;AAAAA,MAAAC,WACxBJ,GAAMI,aAANC;AAAAA,IAAAA;AAAAA,EACZ,GACFd,OAAAK,GAAAL,OAAAO,KAAAA,IAAAP,EAAA,CAAA;AAPD,QAAA;AAAA,IAAAU,OAAAA;AAAAA,IAAAE,OAAAA;AAAAA,IAAAC,WAAAA;AAAAA,EAAAA,IAAoCE,EAAkBb,GAAIK,CAOzD;AAAC,MAAAS;AAAA,EAAAhB,SAAAY,KAGuBI,IAAA;AAAA,IAAAJ,OAAAA;AAAAA,EAAAA,GAASZ,OAAAY,GAAAZ,OAAAgB,KAAAA,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W,WAAWrB,EAAKqB,SAAS3C;AAAAA,IACxD4C,QAAQ,OAAOtB,EAAKsB,UAAW,WAAWtB,EAAKsB,SAAS5C;AAAAA,EAAAA;AAE5D;AAQO,SAAS6C,GACdC,GACwB;AACxB,SAAOA,GAAOzB,IAAIqB,CAAgB;AACpC;"}
|
|
@@ -1,45 +1,85 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as m, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
import { c as L } from "react/compiler-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "echarts";
|
|
5
|
-
import "../widget-store-
|
|
5
|
+
import "../widget-store-CIrb9RKP.js";
|
|
6
6
|
import "zustand/shallow";
|
|
7
|
-
import { g as
|
|
8
|
-
import { m as
|
|
9
|
-
import { g as
|
|
10
|
-
import { Box as
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import { g as k } from "../options-D9wflre6.js";
|
|
8
|
+
import { m as C } from "../utils-BOhInag6.js";
|
|
9
|
+
import { g as $, h as A, n as u, d as M, e as v, c as T } from "../styles-Y8q7Jff3.js";
|
|
10
|
+
import { Box as f, Skeleton as d } from "@mui/material";
|
|
11
|
+
import "@mui/icons-material";
|
|
12
|
+
import { d as h, a as y } from "../exports-Cr43OCul.js";
|
|
13
|
+
import "../lasso-tool-BYbxrJ-7.js";
|
|
14
|
+
import "../cjs-D4KH3azB.js";
|
|
15
|
+
import "@dnd-kit/core";
|
|
16
|
+
import "@dnd-kit/sortable";
|
|
17
|
+
import "@dnd-kit/utilities";
|
|
18
|
+
function D(e, n, t) {
|
|
19
|
+
if (!e?.length || e[0]?.length === 0) return [];
|
|
20
|
+
const r = e[0]?.length ?? 0, a = x(r, n, t), o = e.length;
|
|
21
|
+
return [o > 1 ? ["Bin", ...Array.from({
|
|
22
|
+
length: o
|
|
23
|
+
}, (c, s) => `Series ${s + 1}`)] : ["Bin", "Value"], ...a.map((c, s) => [c, ...e.map((i) => String(i[s] ?? 0))])];
|
|
24
|
+
}
|
|
25
|
+
function ie({
|
|
26
|
+
refUI: e,
|
|
27
|
+
ticks: n,
|
|
28
|
+
labelFormatter: t
|
|
29
|
+
}) {
|
|
30
|
+
return [{
|
|
31
|
+
...h,
|
|
32
|
+
modifier: () => h.modifier(e)
|
|
33
|
+
}, {
|
|
34
|
+
...y,
|
|
35
|
+
modifier: async (r) => y.modifier(D(r, n, t))
|
|
36
|
+
}];
|
|
37
|
+
}
|
|
38
|
+
function x(e, n, t) {
|
|
39
|
+
const r = (a) => String(t ? t(a) : a);
|
|
40
|
+
return Array.from({
|
|
41
|
+
length: e
|
|
42
|
+
}, (a, o) => {
|
|
43
|
+
const p = n[o] ?? o, l = n[o + 1];
|
|
44
|
+
return l !== void 0 && isFinite(l) ? `${r(p)}-${r(l)}` : `${r(p)}+`;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function re(e) {
|
|
13
48
|
return {
|
|
14
49
|
type: "histogram",
|
|
15
|
-
option:
|
|
16
|
-
formatter:
|
|
50
|
+
option: C(k(e), I(e)),
|
|
51
|
+
formatter: e.formatter
|
|
17
52
|
};
|
|
18
53
|
}
|
|
19
|
-
function
|
|
20
|
-
data:
|
|
21
|
-
|
|
22
|
-
|
|
54
|
+
function I({
|
|
55
|
+
data: e = [],
|
|
56
|
+
ticks: n,
|
|
57
|
+
theme: t,
|
|
58
|
+
formatter: r,
|
|
59
|
+
labelFormatter: a
|
|
23
60
|
}) {
|
|
24
|
-
const
|
|
25
|
-
let
|
|
61
|
+
const o = (e?.length ?? 0) > 1, p = e[0]?.length ?? 0, l = x(p, n, a);
|
|
62
|
+
let c = 0, s = 1;
|
|
26
63
|
return {
|
|
27
|
-
legend:
|
|
28
|
-
|
|
64
|
+
legend: v({
|
|
65
|
+
hasLegend: o
|
|
66
|
+
}),
|
|
67
|
+
grid: M(o, t),
|
|
29
68
|
xAxis: {
|
|
30
69
|
type: "category",
|
|
70
|
+
data: l,
|
|
31
71
|
axisLine: {
|
|
32
72
|
show: !1
|
|
33
73
|
},
|
|
34
74
|
axisLabel: {
|
|
35
|
-
fontSize:
|
|
36
|
-
fontFamily:
|
|
75
|
+
fontSize: t.typography.overlineDelicate.fontSize,
|
|
76
|
+
fontFamily: t.typography.overlineDelicate.fontFamily,
|
|
37
77
|
showMinLabel: !0,
|
|
38
78
|
showMaxLabel: !0,
|
|
39
79
|
hideOverlap: !0,
|
|
40
80
|
margin: 0,
|
|
41
|
-
padding: [parseInt(
|
|
42
|
-
color:
|
|
81
|
+
padding: [parseInt(t.spacing(0.5)), parseInt(t.spacing(0.5)), 0, parseInt(t.spacing(0.5))],
|
|
82
|
+
color: t.palette.black[60]
|
|
43
83
|
},
|
|
44
84
|
axisTick: {
|
|
45
85
|
show: !1
|
|
@@ -47,24 +87,24 @@ function j({
|
|
|
47
87
|
splitLine: {
|
|
48
88
|
show: !0,
|
|
49
89
|
lineStyle: {
|
|
50
|
-
color:
|
|
90
|
+
color: t.palette.black[4]
|
|
51
91
|
}
|
|
52
92
|
}
|
|
53
93
|
},
|
|
54
94
|
yAxis: {
|
|
55
95
|
type: "value",
|
|
56
|
-
min: (
|
|
57
|
-
max: (
|
|
96
|
+
min: (i) => (c = i.min < 0 ? u(i.min) : 0, c),
|
|
97
|
+
max: (i) => (s = i.max <= 0 ? 1 : u(i.max), s),
|
|
58
98
|
splitNumber: 1,
|
|
59
99
|
axisLabel: {
|
|
60
|
-
fontSize:
|
|
61
|
-
fontFamily:
|
|
62
|
-
margin: parseInt(
|
|
100
|
+
fontSize: t.typography.overlineDelicate.fontSize,
|
|
101
|
+
fontFamily: t.typography.overlineDelicate.fontFamily,
|
|
102
|
+
margin: parseInt(t.spacing(1)),
|
|
63
103
|
show: !0,
|
|
64
104
|
showMaxLabel: !0,
|
|
65
105
|
showMinLabel: !0,
|
|
66
106
|
verticalAlign: "bottom",
|
|
67
|
-
formatter: (
|
|
107
|
+
formatter: (i) => i !== s && i !== c || i === 0 ? "" : r ? r(i) : String(i)
|
|
68
108
|
},
|
|
69
109
|
axisLine: {
|
|
70
110
|
show: !1
|
|
@@ -75,94 +115,93 @@ function j({
|
|
|
75
115
|
splitLine: {
|
|
76
116
|
show: !0,
|
|
77
117
|
lineStyle: {
|
|
78
|
-
color:
|
|
118
|
+
color: t.palette.black[4]
|
|
79
119
|
}
|
|
80
120
|
}
|
|
81
121
|
},
|
|
82
122
|
tooltip: {
|
|
83
|
-
position:
|
|
84
|
-
formatter:
|
|
85
|
-
const
|
|
123
|
+
position: A(t),
|
|
124
|
+
formatter: $((i) => {
|
|
125
|
+
const g = i.value, b = typeof g == "number" && r ? r(g) : String(g ?? ""), w = typeof i.marker == "string" ? i.marker : "", S = i.seriesName ? `${i.seriesName}: ` : "";
|
|
86
126
|
return {
|
|
87
|
-
name:
|
|
88
|
-
seriesName:
|
|
89
|
-
marker:
|
|
90
|
-
value:
|
|
127
|
+
name: i.name ?? "",
|
|
128
|
+
seriesName: S,
|
|
129
|
+
marker: w,
|
|
130
|
+
value: b
|
|
91
131
|
};
|
|
92
132
|
})
|
|
93
133
|
},
|
|
94
|
-
series:
|
|
95
|
-
datasetIndex: l,
|
|
134
|
+
series: e.map((i) => ({
|
|
96
135
|
type: "bar",
|
|
136
|
+
data: i,
|
|
97
137
|
barGap: "1%",
|
|
98
|
-
// No gap between bars in histogram
|
|
99
138
|
barCategoryGap: "1%",
|
|
100
|
-
// No gap between categories in histogram
|
|
101
139
|
emphasis: {
|
|
102
140
|
focus: "series"
|
|
103
141
|
}
|
|
104
142
|
}))
|
|
105
143
|
};
|
|
106
144
|
}
|
|
107
|
-
const
|
|
145
|
+
const N = {
|
|
108
146
|
skeleton: {
|
|
109
|
-
graph:
|
|
147
|
+
graph: T.graph
|
|
110
148
|
}
|
|
111
149
|
};
|
|
112
|
-
function
|
|
113
|
-
const
|
|
114
|
-
let
|
|
115
|
-
|
|
150
|
+
function oe() {
|
|
151
|
+
const e = L(2);
|
|
152
|
+
let n;
|
|
153
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ m(f, { sx: {
|
|
116
154
|
display: "flex",
|
|
117
155
|
alignItems: "flex-end",
|
|
118
156
|
justifyContent: "space-between",
|
|
119
|
-
gap:
|
|
120
|
-
height:
|
|
157
|
+
gap: V,
|
|
158
|
+
height: G,
|
|
121
159
|
width: "100%"
|
|
122
|
-
}, children: Array(8).fill(0).map(
|
|
123
|
-
let
|
|
124
|
-
return
|
|
125
|
-
|
|
126
|
-
/* @__PURE__ */
|
|
160
|
+
}, children: Array(8).fill(0).map(z) }), e[0] = n) : n = e[0];
|
|
161
|
+
let t;
|
|
162
|
+
return e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ _(f, { sx: N.skeleton.graph.container, children: [
|
|
163
|
+
n,
|
|
164
|
+
/* @__PURE__ */ m(f, { sx: {
|
|
127
165
|
display: "flex",
|
|
128
166
|
alignItems: "center",
|
|
129
167
|
justifyContent: "space-between",
|
|
130
168
|
width: "100%",
|
|
131
|
-
mt:
|
|
132
|
-
}, children: Array(4).fill(0).map(
|
|
133
|
-
] }),
|
|
169
|
+
mt: j
|
|
170
|
+
}, children: Array(4).fill(0).map(F) })
|
|
171
|
+
] }), e[1] = t) : t = e[1], t;
|
|
134
172
|
}
|
|
135
|
-
function
|
|
136
|
-
return /* @__PURE__ */
|
|
173
|
+
function F(e, n) {
|
|
174
|
+
return /* @__PURE__ */ m(d, { width: 32, height: 8 }, `skeleton-label-${n}`);
|
|
137
175
|
}
|
|
138
|
-
function
|
|
176
|
+
function j(e) {
|
|
139
177
|
const {
|
|
140
|
-
spacing:
|
|
141
|
-
} =
|
|
142
|
-
return
|
|
178
|
+
spacing: n
|
|
179
|
+
} = e;
|
|
180
|
+
return n(1);
|
|
143
181
|
}
|
|
144
|
-
function
|
|
145
|
-
const
|
|
146
|
-
return /* @__PURE__ */
|
|
182
|
+
function z(e, n) {
|
|
183
|
+
const r = `${[60, 80, 95, 85, 70, 55, 40, 30][n]}%`;
|
|
184
|
+
return /* @__PURE__ */ m(d, { variant: "rectangular", sx: {
|
|
147
185
|
flex: 1,
|
|
148
|
-
height:
|
|
149
|
-
} }, `skeleton-bar-${
|
|
186
|
+
height: r
|
|
187
|
+
} }, `skeleton-bar-${n}`);
|
|
150
188
|
}
|
|
151
|
-
function
|
|
189
|
+
function G(e) {
|
|
152
190
|
const {
|
|
153
|
-
spacing:
|
|
154
|
-
} =
|
|
155
|
-
return
|
|
191
|
+
spacing: n
|
|
192
|
+
} = e;
|
|
193
|
+
return n(30);
|
|
156
194
|
}
|
|
157
|
-
function
|
|
195
|
+
function V(e) {
|
|
158
196
|
const {
|
|
159
|
-
spacing:
|
|
160
|
-
} =
|
|
161
|
-
return
|
|
197
|
+
spacing: n
|
|
198
|
+
} = e;
|
|
199
|
+
return n(0.5);
|
|
162
200
|
}
|
|
163
201
|
export {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
202
|
+
oe as HistogramSkeleton,
|
|
203
|
+
re as histogramConfig,
|
|
204
|
+
D as histogramDataToCSV,
|
|
205
|
+
ie as histogramDownloadConfig
|
|
167
206
|
};
|
|
168
207
|
//# sourceMappingURL=histogram.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"histogram.js","sources":["../../src/widgets/histogram/config.ts","../../src/widgets/histogram/style.ts","../../src/widgets/histogram/skeleton.tsx"],"sourcesContent":["import {\n getCommonOptions,\n mergeEchartWidgetConfig,\n type EchartOptionsProps,\n} from '../echart'\nimport type {\n HistogramConfig,\n HistogramWidgetConfig,\n HistogramWidgetData,\n} from './types'\nimport {\n flattenObjectArrayToCSV,\n buildLegendConfig,\n buildGridConfig,\n createTooltipPositioner,\n createTooltipFormatter,\n createChartDownloadConfig,\n niceNum,\n} from '../utils/chart-config'\n\nexport const histogramDownloadConfig =\n createChartDownloadConfig<HistogramWidgetData>(flattenObjectArrayToCSV)\n/**\n * Generates ECharts configuration for distribution histogram widgets with adjacent bars (minimal gap) and axis formatting styled with the CARTO theme.\n *\n * @param props - Histogram configuration including bin data and theme.\n * @returns Widget config with ECharts option object.\n */\nexport function histogramConfig(props: HistogramConfig): HistogramWidgetConfig {\n return {\n type: 'histogram',\n option: mergeEchartWidgetConfig(getCommonOptions(props), getOption(props)),\n formatter: props.formatter,\n }\n}\nfunction getOption({\n data = [],\n theme,\n formatter,\n}: HistogramConfig): EchartOptionsProps {\n const hasLegend = (data?.length ?? 0) > 1\n\n let niceMin = 0\n let niceMax = 1\n\n return {\n legend: buildLegendConfig(hasLegend),\n grid: buildGridConfig(hasLegend, theme),\n xAxis: {\n type: 'category',\n axisLine: {\n show: false,\n },\n axisLabel: {\n fontSize: theme.typography.overlineDelicate.fontSize,\n fontFamily: theme.typography.overlineDelicate.fontFamily,\n showMinLabel: true,\n showMaxLabel: true,\n hideOverlap: true,\n margin: 0,\n padding: [\n parseInt(theme.spacing(0.5)),\n parseInt(theme.spacing(0.5)),\n 0,\n parseInt(theme.spacing(0.5)),\n ],\n color: theme.palette.black[60],\n },\n axisTick: {\n show: false,\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: theme.palette.black[4],\n },\n },\n },\n yAxis: {\n type: 'value' as const,\n min: (extent: { min: number }) => {\n niceMin = extent.min < 0 ? niceNum(extent.min) : 0\n return niceMin\n },\n max: (extent: { min: number; max: number }) => {\n niceMax = extent.max <= 0 ? 1 : niceNum(extent.max)\n return niceMax\n },\n splitNumber: 1,\n axisLabel: {\n fontSize: theme.typography.overlineDelicate.fontSize,\n fontFamily: theme.typography.overlineDelicate.fontFamily,\n margin: parseInt(theme.spacing(1)),\n show: true,\n showMaxLabel: true,\n showMinLabel: true,\n verticalAlign: 'bottom' as const,\n formatter: (value: number) => {\n if (value !== niceMax && value !== niceMin) return ''\n if (value === 0) return ''\n return formatter ? formatter(value) : String(value)\n },\n },\n axisLine: {\n show: false,\n },\n axisTick: {\n show: false,\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: theme.palette.black[4],\n },\n },\n },\n tooltip: {\n position: createTooltipPositioner(theme),\n formatter: createTooltipFormatter((item) => {\n const value = item.value as Record<string, string | number>\n const index = item.dimensionNames?.[item.encode?.y?.at(0) ?? 1]\n const _value = value[index ?? '']\n\n const formattedValue =\n typeof _value === 'number' && formatter\n ? formatter(_value)\n : (_value ?? '')\n\n const marker = typeof item.marker === 'string' ? item.marker : ''\n const seriesName = item.seriesName ? `${item.seriesName}: ` : ''\n const name = item.name ?? ''\n\n return { name, seriesName, marker, value: formattedValue }\n }),\n },\n series: data.map((_: unknown, index: number) => ({\n datasetIndex: index,\n type: 'bar',\n barGap: '1%', // No gap between bars in histogram\n barCategoryGap: '1%', // No gap between categories in histogram\n emphasis: {\n focus: 'series',\n },\n })),\n } as EchartOptionsProps\n}\n","import type { SxProps, Theme } from '@mui/material'\nimport { baseSkeletonStyles } from '../utils/skeleton'\n\nexport const styles = {\n skeleton: {\n graph: baseSkeletonStyles.graph,\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { Box, Skeleton } from '@mui/material'\nimport { styles } from './style'\n\nexport function HistogramSkeleton() {\n return (\n <Box sx={styles.skeleton.graph.container}>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'flex-end',\n justifyContent: 'space-between',\n gap: ({ spacing }) => spacing(0.5),\n height: ({ spacing }) => spacing(30),\n width: '100%',\n }}\n >\n {Array(8)\n .fill(0)\n .map((_, i) => {\n // Create varying heights for histogram bars\n const heights = [60, 80, 95, 85, 70, 55, 40, 30]\n const height = `${heights[i]}%`\n return (\n <Skeleton\n key={`skeleton-bar-${i}`}\n variant='rectangular'\n sx={{\n flex: 1,\n height,\n }}\n />\n )\n })}\n </Box>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: '100%',\n mt: ({ spacing }) => spacing(1),\n }}\n >\n {Array(4)\n .fill(0)\n .map((_, i) => (\n <Skeleton key={`skeleton-label-${i}`} width={32} height={8} />\n ))}\n </Box>\n </Box>\n )\n}\n"],"names":["histogramDownloadConfig","createChartDownloadConfig","flattenObjectArrayToCSV","histogramConfig","props","type","option","mergeEchartWidgetConfig","getCommonOptions","getOption","formatter","data","theme","hasLegend","length","niceMin","niceMax","legend","buildLegendConfig","grid","buildGridConfig","xAxis","axisLine","show","axisLabel","fontSize","typography","overlineDelicate","fontFamily","showMinLabel","showMaxLabel","hideOverlap","margin","padding","parseInt","spacing","color","palette","black","axisTick","splitLine","lineStyle","yAxis","min","extent","niceNum","max","splitNumber","verticalAlign","value","String","tooltip","position","createTooltipPositioner","createTooltipFormatter","item","index","dimensionNames","encode","y","at","_value","formattedValue","marker","seriesName","name","series","map","_","datasetIndex","barGap","barCategoryGap","emphasis","focus","styles","skeleton","graph","baseSkeletonStyles","HistogramSkeleton","$","_c","t0","Symbol","for","jsx","Box","display","alignItems","justifyContent","gap","_temp","height","_temp2","width","Array","fill","_temp3","t1","container","mt","_temp4","_temp5","__0","i_0","Skeleton","i","spacing_1","flex","spacing_0"],"mappings":";;;;;;;;;;AAoBO,MAAMA,IACXC,EAA+CC,CAAuB;AAOjE,SAASC,EAAgBC,GAA+C;AAC7E,SAAO;AAAA,IACLC,MAAM;AAAA,IACNC,QAAQC,EAAwBC,EAAiBJ,CAAK,GAAGK,EAAUL,CAAK,CAAC;AAAA,IACzEM,WAAWN,EAAMM;AAAAA,EAAAA;AAErB;AACA,SAASD,EAAU;AAAA,EACjBE,MAAAA,IAAO,CAAA;AAAA,EACPC,OAAAA;AAAAA,EACAF,WAAAA;AACe,GAAuB;AACtC,QAAMG,KAAaF,GAAMG,UAAU,KAAK;AAExC,MAAIC,IAAU,GACVC,IAAU;AAEd,SAAO;AAAA,IACLC,QAAQC,EAAkBL,CAAS;AAAA,IACnCM,MAAMC,EAAgBP,GAAWD,CAAK;AAAA,IACtCS,OAAO;AAAA,MACLhB,MAAM;AAAA,MACNiB,UAAU;AAAA,QACRC,MAAM;AAAA,MAAA;AAAA,MAERC,WAAW;AAAA,Q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AA;AAAAA,EAAAA,EAET,GALK,gBAAgBc,CAAC,EAKrB;AACD;AA3BT,SAAAb,EAAAX,GAAA;AASY,QAAA;AAAA,IAAA9C,SAAAyE;AAAAA,EAAAA,IAAA3B;AAAW,SAAK9C,EAAQ,EAAE;AAAC;AATvC,SAAAuD,EAAAT,GAAA;AAQS,QAAA;AAAA,IAAA9C,SAAAA;AAAAA,EAAAA,IAAA8C;AAAW,SAAK9C,EAAQ,GAAG;AAAC;"}
|
|
1
|
+
{"version":3,"file":"histogram.js","sources":["../../src/widgets/histogram/config.ts","../../src/widgets/histogram/style.ts","../../src/widgets/histogram/skeleton.tsx"],"sourcesContent":["import {\n getCommonOptions,\n mergeEchartWidgetConfig,\n type EchartOptionsProps,\n} from '../echart'\nimport type { HistogramConfig, HistogramWidgetConfig } from './types'\nimport {\n buildLegendConfig,\n buildGridConfig,\n createTooltipPositioner,\n createTooltipFormatter,\n niceNum,\n} from '../utils/chart-config'\nimport { downloadToCSV, downloadToPNG, type DownloadItem } from '../actions'\nimport type { ConfigProps } from '../loader/types'\n\nexport interface HistogramDownloadConfigProps extends ConfigProps {\n ticks: number[]\n labelFormatter?: (value: string | number) => string | number\n}\n\nexport function histogramDataToCSV(\n data: number[][],\n ticks: number[],\n labelFormatter?: (value: string | number) => string | number,\n): string[][] {\n if (!data?.length || data[0]?.length === 0) return []\n\n const dataLength = data[0]?.length ?? 0\n const labels = createAxisLabels(dataLength, ticks, labelFormatter)\n const seriesCount = data.length\n const isMulti = seriesCount > 1\n\n const headers = isMulti\n ? [\n 'Bin',\n ...Array.from({ length: seriesCount }, (_, i) => `Series ${i + 1}`),\n ]\n : ['Bin', 'Value']\n\n return [\n headers,\n ...labels.map((label, i) => [\n label,\n ...data.map((series) => String(series[i] ?? 0)),\n ]),\n ]\n}\n\nexport function histogramDownloadConfig({\n refUI,\n ticks,\n labelFormatter,\n}: HistogramDownloadConfigProps): DownloadItem<number[][]>[] {\n return [\n {\n ...downloadToPNG,\n modifier: () => downloadToPNG.modifier(refUI),\n },\n {\n ...downloadToCSV,\n modifier: async (data) =>\n downloadToCSV.modifier(histogramDataToCSV(data, ticks, labelFormatter)),\n },\n ]\n}\n\n/**\n * Creates formatted axis labels from tick boundaries.\n *\n * @param dataLength - Number of data points (determines number of labels).\n * @param ticks - Bin boundaries. If `ticks.length === dataLength + 1`, all\n * bins are ranges. If `ticks.length === dataLength`, the last bin is\n * open-ended (`+`). A last tick of `Infinity` also produces `+`.\n * @param labelFormatter - Optional formatter applied to each individual tick\n * value when building the bin range label.\n */\nfunction createAxisLabels(\n dataLength: number,\n ticks: number[],\n labelFormatter?: (value: string | number) => string | number,\n): string[] {\n const fmt = (v: number) =>\n labelFormatter ? String(labelFormatter(v)) : String(v)\n\n return Array.from({ length: dataLength }, (_, i) => {\n const low = ticks[i] ?? i\n const high = ticks[i + 1]\n return high !== undefined && isFinite(high)\n ? `${fmt(low)}-${fmt(high)}`\n : `${fmt(low)}+`\n })\n}\n\n/**\n * Generates ECharts configuration for distribution histogram widgets with\n * adjacent bars (minimal gap) and axis formatting styled with the CARTO theme.\n *\n * Accepts raw `number[][]` data and `ticks` boundaries. The ticks and\n * `labelFormatter` are used to create the x-axis category labels; the raw\n * numeric data is embedded directly in each series.\n *\n * @param props - Histogram configuration including raw data, ticks, and theme.\n * @returns Widget config with ECharts option object.\n */\nexport function histogramConfig(props: HistogramConfig): HistogramWidgetConfig {\n return {\n type: 'histogram',\n option: mergeEchartWidgetConfig(getCommonOptions(props), getOption(props)),\n formatter: props.formatter,\n }\n}\n\nfunction getOption({\n data = [],\n ticks,\n theme,\n formatter,\n labelFormatter,\n}: HistogramConfig): EchartOptionsProps {\n const hasLegend = (data?.length ?? 0) > 1\n const dataLength = data[0]?.length ?? 0\n const axisLabels = createAxisLabels(dataLength, ticks, labelFormatter)\n\n let niceMin = 0\n let niceMax = 1\n\n return {\n legend: buildLegendConfig({ hasLegend }),\n grid: buildGridConfig(hasLegend, theme),\n xAxis: {\n type: 'category',\n data: axisLabels,\n axisLine: {\n show: false,\n },\n axisLabel: {\n fontSize: theme.typography.overlineDelicate.fontSize,\n fontFamily: theme.typography.overlineDelicate.fontFamily,\n showMinLabel: true,\n showMaxLabel: true,\n hideOverlap: true,\n margin: 0,\n padding: [\n parseInt(theme.spacing(0.5)),\n parseInt(theme.spacing(0.5)),\n 0,\n parseInt(theme.spacing(0.5)),\n ],\n color: theme.palette.black[60],\n },\n axisTick: {\n show: false,\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: theme.palette.black[4],\n },\n },\n },\n yAxis: {\n type: 'value' as const,\n min: (extent: { min: number }) => {\n niceMin = extent.min < 0 ? niceNum(extent.min) : 0\n return niceMin\n },\n max: (extent: { min: number; max: number }) => {\n niceMax = extent.max <= 0 ? 1 : niceNum(extent.max)\n return niceMax\n },\n splitNumber: 1,\n axisLabel: {\n fontSize: theme.typography.overlineDelicate.fontSize,\n fontFamily: theme.typography.overlineDelicate.fontFamily,\n margin: parseInt(theme.spacing(1)),\n show: true,\n showMaxLabel: true,\n showMinLabel: true,\n verticalAlign: 'bottom' as const,\n formatter: (value: number) => {\n if (value !== niceMax && value !== niceMin) return ''\n if (value === 0) return ''\n return formatter ? formatter(value) : String(value)\n },\n },\n axisLine: {\n show: false,\n },\n axisTick: {\n show: false,\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: theme.palette.black[4],\n },\n },\n },\n tooltip: {\n position: createTooltipPositioner(theme),\n formatter: createTooltipFormatter((item) => {\n const _value = item.value as number\n\n const formattedValue =\n typeof _value === 'number' && formatter\n ? formatter(_value)\n : String(_value ?? '')\n\n const marker = typeof item.marker === 'string' ? item.marker : ''\n const seriesName = item.seriesName ? `${item.seriesName}: ` : ''\n const name = item.name ?? ''\n\n return { name, seriesName, marker, value: formattedValue }\n }),\n },\n series: data.map((seriesData: number[]) => ({\n type: 'bar',\n data: seriesData,\n barGap: '1%',\n barCategoryGap: '1%',\n emphasis: {\n focus: 'series',\n },\n })),\n } as EchartOptionsProps\n}\n","import type { SxProps, Theme } from '@mui/material'\nimport { baseSkeletonStyles } from '../utils/skeleton'\n\nexport const styles = {\n skeleton: {\n graph: baseSkeletonStyles.graph,\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { Box, Skeleton } from '@mui/material'\nimport { styles } from './style'\n\nexport function HistogramSkeleton() {\n return (\n <Box sx={styles.skeleton.graph.container}>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'flex-end',\n justifyContent: 'space-between',\n gap: ({ spacing }) => spacing(0.5),\n height: ({ spacing }) => spacing(30),\n width: '100%',\n }}\n >\n {Array(8)\n .fill(0)\n .map((_, i) => {\n // Create varying heights for histogram bars\n const heights = [60, 80, 95, 85, 70, 55, 40, 30]\n const height = `${heights[i]}%`\n return (\n <Skeleton\n key={`skeleton-bar-${i}`}\n variant='rectangular'\n sx={{\n flex: 1,\n height,\n }}\n />\n )\n })}\n </Box>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: '100%',\n mt: ({ spacing }) => spacing(1),\n }}\n >\n {Array(4)\n .fill(0)\n .map((_, i) => (\n <Skeleton key={`skeleton-label-${i}`} width={32} height={8} />\n ))}\n </Box>\n </Box>\n )\n}\n"],"names":["histogramDataToCSV","data","ticks","labelFormatter","length","dataLength","labels","createAxisLabels","seriesCount","Array","from","_","i","map","label","series","String","histogramDownloadConfig","refUI","downloadToPNG","modifier","downloadToCSV","fmt","v","low","high","undefined","isFinite","histogramConfig","props","type","option","mergeEchartWidgetConfig","getCommonOptions","getOption","formatter","theme","hasLegend","axisLabels","niceMin","niceMax","legend","buildLegendConfig","grid","buildGridConfig","xAxis","axisLine","show","axisLabel","fontSize","typography","overlineDelicate","fontFamily","showMinLabel","showMaxLabel","hideOverlap","margin","padding","parseInt","spacing","color","palette","black","axisTick","splitLine","lineStyle","yAxis","min","extent","niceNum","max","splitNumber","verticalAlign","value","tooltip","position","createTooltipPositioner","createTooltipFormatter","item","_value","formattedValue","marker","seriesName","name","seriesData","barGap","barCategoryGap","emphasis","focus","styles","skeleton","graph","baseSkeletonStyles","HistogramSkeleton","$","_c","t0","Symbol","for","jsx","Box","display","alignItems","justifyContent","gap","_temp","height","_temp2","width","fill","_temp3","t1","container","mt","_temp4","_temp5","__0","i_0","Skeleton","spacing_1","flex","spacing_0"],"mappings":";;;;;;;;;;;;;;;;;AAqBO,SAASA,EACdC,GACAC,GACAC,GACY;AACZ,MAAI,CAACF,GAAMG,UAAUH,EAAK,CAAC,GAAGG,WAAW,EAAG,QAAO,CAAA;AAEnD,QAAMC,IAAaJ,EAAK,CAAC,GAAGG,UAAU,GAChCE,IAASC,EAAiBF,GAAYH,GAAOC,CAAc,GAC3DK,IAAcP,EAAKG;AAUzB,SAAO,CATSI,IAAc,IAG1B,CACE,OACA,GAAGC,MAAMC,KAAK;AAAA,IAAEN,QAAQI;AAAAA,EAAAA,GAAe,CAACG,GAAGC,MAAM,UAAUA,IAAI,CAAC,EAAE,CAAC,IAErE,CAAC,OAAO,OAAO,GAIjB,GAAGN,EAAOO,IAAI,CAACC,GAAOF,MAAM,CAC1BE,GACA,GAAGb,EAAKY,IAAKE,CAAAA,MAAWC,OAAOD,EAAOH,CAAC,KAAK,CAAC,CAAC,CAAC,CAChD,CAAC;AAEN;AAEO,SAASK,GAAwB;AAAA,EACtCC,OAAAA;AAAAA,EACAhB,OAAAA;AAAAA,EACAC,gBAAAA;AAC4B,GAA+B;AAC3D,SAAO,CACL;AAAA,IACE,GAAGgB;AAAAA,IACHC,UAAUA,MAAMD,EAAcC,SAASF,CAAK;AAAA,EAAA,GAE9C;AAAA,IACE,GAAGG;AAAAA,IACHD,UAAU,OAAOnB,MACfoB,EAAcD,SAASpB,EAAmBC,GAAMC,GAAOC,CAAc,CAAC;AAAA,EAAA,CACzE;AAEL;AAYA,SAASI,EACPF,GACAH,GACAC,GACU;AACV,QAAMmB,IAAMA,CAACC,MACMP,OAAjBb,IAAwBA,EAAeoB,CAAC,IAAYA,CAAX;AAE3C,SAAOd,MA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