@lightdash/common 0.2129.1 → 0.2131.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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/index.d.ts +10 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +10 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/visualizations/CartesianChartDataModel.d.ts +1 -1
- package/dist/cjs/visualizations/CartesianChartDataModel.d.ts.map +1 -1
- package/dist/cjs/visualizations/CartesianChartDataModel.js +147 -46
- package/dist/cjs/visualizations/CartesianChartDataModel.js.map +1 -1
- package/dist/cjs/visualizations/PieChartDataModel.d.ts.map +1 -1
- package/dist/cjs/visualizations/PieChartDataModel.js +26 -0
- package/dist/cjs/visualizations/PieChartDataModel.js.map +1 -1
- package/dist/cjs/visualizations/helpers/styles/axisStyles.d.ts +50 -0
- package/dist/cjs/visualizations/helpers/styles/axisStyles.d.ts.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/axisStyles.js +59 -0
- package/dist/cjs/visualizations/helpers/styles/axisStyles.js.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/barChartStyles.d.ts +81 -0
- package/dist/cjs/visualizations/helpers/styles/barChartStyles.d.ts.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/barChartStyles.js +336 -0
- package/dist/cjs/visualizations/helpers/styles/barChartStyles.js.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/gridStyles.d.ts +21 -0
- package/dist/cjs/visualizations/helpers/styles/gridStyles.d.ts.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/gridStyles.js +27 -0
- package/dist/cjs/visualizations/helpers/styles/gridStyles.js.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/legendStyles.d.ts +49 -0
- package/dist/cjs/visualizations/helpers/styles/legendStyles.d.ts.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/legendStyles.js +38 -0
- package/dist/cjs/visualizations/helpers/styles/legendStyles.js.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/pieChartStyles.d.ts +49 -0
- package/dist/cjs/visualizations/helpers/styles/pieChartStyles.d.ts.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/pieChartStyles.js +58 -0
- package/dist/cjs/visualizations/helpers/styles/pieChartStyles.js.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/referenceLineStyles.d.ts +31 -0
- package/dist/cjs/visualizations/helpers/styles/referenceLineStyles.d.ts.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/referenceLineStyles.js +43 -0
- package/dist/cjs/visualizations/helpers/styles/referenceLineStyles.js.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/themeColors.d.ts +18 -0
- package/dist/cjs/visualizations/helpers/styles/themeColors.d.ts.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/themeColors.js +23 -0
- package/dist/cjs/visualizations/helpers/styles/themeColors.js.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/tooltipStyles.d.ts +53 -0
- package/dist/cjs/visualizations/helpers/styles/tooltipStyles.d.ts.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/tooltipStyles.js +147 -0
- package/dist/cjs/visualizations/helpers/styles/tooltipStyles.js.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/valueLabelStyles.d.ts +20 -0
- package/dist/cjs/visualizations/helpers/styles/valueLabelStyles.d.ts.map +1 -0
- package/dist/cjs/visualizations/helpers/styles/valueLabelStyles.js +34 -0
- package/dist/cjs/visualizations/helpers/styles/valueLabelStyles.js.map +1 -0
- package/dist/cjs/visualizations/{chartTransformations.d.ts → helpers/tooltipFormatter.d.ts} +53 -20
- package/dist/cjs/visualizations/helpers/tooltipFormatter.d.ts.map +1 -0
- package/dist/cjs/visualizations/helpers/tooltipFormatter.js +510 -0
- package/dist/cjs/visualizations/helpers/tooltipFormatter.js.map +1 -0
- package/dist/cjs/visualizations/helpers/valueFormatter.d.ts +7 -0
- package/dist/cjs/visualizations/helpers/valueFormatter.d.ts.map +1 -0
- package/dist/cjs/visualizations/helpers/valueFormatter.js +13 -0
- package/dist/cjs/visualizations/helpers/valueFormatter.js.map +1 -0
- package/dist/cjs/visualizations/types/index.d.ts +84 -1
- package/dist/cjs/visualizations/types/index.d.ts.map +1 -1
- package/dist/cjs/visualizations/types/index.js.map +1 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/index.d.ts +10 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +10 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/visualizations/CartesianChartDataModel.d.ts +1 -1
- package/dist/esm/visualizations/CartesianChartDataModel.d.ts.map +1 -1
- package/dist/esm/visualizations/CartesianChartDataModel.js +146 -45
- package/dist/esm/visualizations/CartesianChartDataModel.js.map +1 -1
- package/dist/esm/visualizations/PieChartDataModel.d.ts.map +1 -1
- package/dist/esm/visualizations/PieChartDataModel.js +26 -0
- package/dist/esm/visualizations/PieChartDataModel.js.map +1 -1
- package/dist/esm/visualizations/helpers/styles/axisStyles.d.ts +50 -0
- package/dist/esm/visualizations/helpers/styles/axisStyles.d.ts.map +1 -0
- package/dist/esm/visualizations/helpers/styles/axisStyles.js +51 -0
- package/dist/esm/visualizations/helpers/styles/axisStyles.js.map +1 -0
- package/dist/esm/visualizations/helpers/styles/barChartStyles.d.ts +81 -0
- package/dist/esm/visualizations/helpers/styles/barChartStyles.d.ts.map +1 -0
- package/dist/esm/visualizations/helpers/styles/barChartStyles.js +326 -0
- package/dist/esm/visualizations/helpers/styles/barChartStyles.js.map +1 -0
- package/dist/esm/visualizations/helpers/styles/gridStyles.d.ts +21 -0
- package/dist/esm/visualizations/helpers/styles/gridStyles.d.ts.map +1 -0
- package/dist/esm/visualizations/helpers/styles/gridStyles.js +22 -0
- package/dist/esm/visualizations/helpers/styles/gridStyles.js.map +1 -0
- package/dist/esm/visualizations/helpers/styles/legendStyles.d.ts +49 -0
- package/dist/esm/visualizations/helpers/styles/legendStyles.d.ts.map +1 -0
- package/dist/esm/visualizations/helpers/styles/legendStyles.js +34 -0
- package/dist/esm/visualizations/helpers/styles/legendStyles.js.map +1 -0
- package/dist/esm/visualizations/helpers/styles/pieChartStyles.d.ts +49 -0
- package/dist/esm/visualizations/helpers/styles/pieChartStyles.d.ts.map +1 -0
- package/dist/esm/visualizations/helpers/styles/pieChartStyles.js +51 -0
- package/dist/esm/visualizations/helpers/styles/pieChartStyles.js.map +1 -0
- package/dist/esm/visualizations/helpers/styles/referenceLineStyles.d.ts +31 -0
- package/dist/esm/visualizations/helpers/styles/referenceLineStyles.d.ts.map +1 -0
- package/dist/esm/visualizations/helpers/styles/referenceLineStyles.js +39 -0
- package/dist/esm/visualizations/helpers/styles/referenceLineStyles.js.map +1 -0
- package/dist/esm/visualizations/helpers/styles/themeColors.d.ts +18 -0
- package/dist/esm/visualizations/helpers/styles/themeColors.d.ts.map +1 -0
- package/dist/esm/visualizations/helpers/styles/themeColors.js +20 -0
- package/dist/esm/visualizations/helpers/styles/themeColors.js.map +1 -0
- package/dist/esm/visualizations/helpers/styles/tooltipStyles.d.ts +53 -0
- package/dist/esm/visualizations/helpers/styles/tooltipStyles.d.ts.map +1 -0
- package/dist/esm/visualizations/helpers/styles/tooltipStyles.js +136 -0
- package/dist/esm/visualizations/helpers/styles/tooltipStyles.js.map +1 -0
- package/dist/esm/visualizations/helpers/styles/valueLabelStyles.d.ts +20 -0
- package/dist/esm/visualizations/helpers/styles/valueLabelStyles.d.ts.map +1 -0
- package/dist/esm/visualizations/helpers/styles/valueLabelStyles.js +30 -0
- package/dist/esm/visualizations/helpers/styles/valueLabelStyles.js.map +1 -0
- package/dist/esm/visualizations/{chartTransformations.d.ts → helpers/tooltipFormatter.d.ts} +53 -20
- package/dist/esm/visualizations/helpers/tooltipFormatter.d.ts.map +1 -0
- package/dist/esm/visualizations/helpers/tooltipFormatter.js +502 -0
- package/dist/esm/visualizations/helpers/tooltipFormatter.js.map +1 -0
- package/dist/esm/visualizations/helpers/valueFormatter.d.ts +7 -0
- package/dist/esm/visualizations/helpers/valueFormatter.d.ts.map +1 -0
- package/dist/esm/visualizations/helpers/valueFormatter.js +8 -0
- package/dist/esm/visualizations/helpers/valueFormatter.js.map +1 -0
- package/dist/esm/visualizations/types/index.d.ts +84 -1
- package/dist/esm/visualizations/types/index.d.ts.map +1 -1
- package/dist/esm/visualizations/types/index.js +1 -1
- package/dist/esm/visualizations/types/index.js.map +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +10 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +10 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/visualizations/CartesianChartDataModel.d.ts +1 -1
- package/dist/types/visualizations/CartesianChartDataModel.d.ts.map +1 -1
- package/dist/types/visualizations/CartesianChartDataModel.js +146 -45
- package/dist/types/visualizations/CartesianChartDataModel.js.map +1 -1
- package/dist/types/visualizations/PieChartDataModel.d.ts.map +1 -1
- package/dist/types/visualizations/PieChartDataModel.js +26 -0
- package/dist/types/visualizations/PieChartDataModel.js.map +1 -1
- package/dist/types/visualizations/helpers/styles/axisStyles.d.ts +50 -0
- package/dist/types/visualizations/helpers/styles/axisStyles.d.ts.map +1 -0
- package/dist/types/visualizations/helpers/styles/axisStyles.js +51 -0
- package/dist/types/visualizations/helpers/styles/axisStyles.js.map +1 -0
- package/dist/types/visualizations/helpers/styles/barChartStyles.d.ts +81 -0
- package/dist/types/visualizations/helpers/styles/barChartStyles.d.ts.map +1 -0
- package/dist/types/visualizations/helpers/styles/barChartStyles.js +326 -0
- package/dist/types/visualizations/helpers/styles/barChartStyles.js.map +1 -0
- package/dist/types/visualizations/helpers/styles/gridStyles.d.ts +21 -0
- package/dist/types/visualizations/helpers/styles/gridStyles.d.ts.map +1 -0
- package/dist/types/visualizations/helpers/styles/gridStyles.js +22 -0
- package/dist/types/visualizations/helpers/styles/gridStyles.js.map +1 -0
- package/dist/types/visualizations/helpers/styles/legendStyles.d.ts +49 -0
- package/dist/types/visualizations/helpers/styles/legendStyles.d.ts.map +1 -0
- package/dist/types/visualizations/helpers/styles/legendStyles.js +34 -0
- package/dist/types/visualizations/helpers/styles/legendStyles.js.map +1 -0
- package/dist/types/visualizations/helpers/styles/pieChartStyles.d.ts +49 -0
- package/dist/types/visualizations/helpers/styles/pieChartStyles.d.ts.map +1 -0
- package/dist/types/visualizations/helpers/styles/pieChartStyles.js +51 -0
- package/dist/types/visualizations/helpers/styles/pieChartStyles.js.map +1 -0
- package/dist/types/visualizations/helpers/styles/referenceLineStyles.d.ts +31 -0
- package/dist/types/visualizations/helpers/styles/referenceLineStyles.d.ts.map +1 -0
- package/dist/types/visualizations/helpers/styles/referenceLineStyles.js +39 -0
- package/dist/types/visualizations/helpers/styles/referenceLineStyles.js.map +1 -0
- package/dist/types/visualizations/helpers/styles/themeColors.d.ts +18 -0
- package/dist/types/visualizations/helpers/styles/themeColors.d.ts.map +1 -0
- package/dist/types/visualizations/helpers/styles/themeColors.js +20 -0
- package/dist/types/visualizations/helpers/styles/themeColors.js.map +1 -0
- package/dist/types/visualizations/helpers/styles/tooltipStyles.d.ts +53 -0
- package/dist/types/visualizations/helpers/styles/tooltipStyles.d.ts.map +1 -0
- package/dist/types/visualizations/helpers/styles/tooltipStyles.js +136 -0
- package/dist/types/visualizations/helpers/styles/tooltipStyles.js.map +1 -0
- package/dist/types/visualizations/helpers/styles/valueLabelStyles.d.ts +20 -0
- package/dist/types/visualizations/helpers/styles/valueLabelStyles.d.ts.map +1 -0
- package/dist/types/visualizations/helpers/styles/valueLabelStyles.js +30 -0
- package/dist/types/visualizations/helpers/styles/valueLabelStyles.js.map +1 -0
- package/dist/types/visualizations/{chartTransformations.d.ts → helpers/tooltipFormatter.d.ts} +53 -20
- package/dist/types/visualizations/helpers/tooltipFormatter.d.ts.map +1 -0
- package/dist/types/visualizations/helpers/tooltipFormatter.js +502 -0
- package/dist/types/visualizations/helpers/tooltipFormatter.js.map +1 -0
- package/dist/types/visualizations/helpers/valueFormatter.d.ts +7 -0
- package/dist/types/visualizations/helpers/valueFormatter.d.ts.map +1 -0
- package/dist/types/visualizations/helpers/valueFormatter.js +8 -0
- package/dist/types/visualizations/helpers/valueFormatter.js.map +1 -0
- package/dist/types/visualizations/types/index.d.ts +84 -1
- package/dist/types/visualizations/types/index.d.ts.map +1 -1
- package/dist/types/visualizations/types/index.js +1 -1
- package/dist/types/visualizations/types/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/visualizations/chartTransformations.d.ts.map +0 -1
- package/dist/cjs/visualizations/chartTransformations.js +0 -112
- package/dist/cjs/visualizations/chartTransformations.js.map +0 -1
- package/dist/esm/visualizations/chartTransformations.d.ts.map +0 -1
- package/dist/esm/visualizations/chartTransformations.js +0 -107
- package/dist/esm/visualizations/chartTransformations.js.map +0 -1
- package/dist/types/visualizations/chartTransformations.d.ts.map +0 -1
- package/dist/types/visualizations/chartTransformations.js +0 -107
- package/dist/types/visualizations/chartTransformations.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gridStyles.d.ts","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/gridStyles.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;CAMhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;CAM/B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { GRAY_1, GRAY_2 } from './themeColors';
|
|
2
|
+
/**
|
|
3
|
+
* Get grid line styling for line charts
|
|
4
|
+
*/
|
|
5
|
+
export const getLineChartGridStyle = () => ({
|
|
6
|
+
show: true,
|
|
7
|
+
lineStyle: {
|
|
8
|
+
color: GRAY_1,
|
|
9
|
+
type: 'solid',
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Get grid line styling for bar charts
|
|
14
|
+
*/
|
|
15
|
+
export const getBarChartGridStyle = () => ({
|
|
16
|
+
show: true,
|
|
17
|
+
lineStyle: {
|
|
18
|
+
color: GRAY_2,
|
|
19
|
+
type: [3, 3], // [dash length, gap length]
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=gridStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gridStyles.js","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/gridStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE,CAAC,CAAC;IACxC,IAAI,EAAE,IAAI;IACV,SAAS,EAAE;QACP,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,OAAgB;KACzB;CACJ,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,CAAC;IACvC,IAAI,EAAE,IAAI;IACV,SAAS,EAAE;QACP,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAU,EAAE,4BAA4B;KACtD;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
type LegendIconType = 'line' | 'square';
|
|
2
|
+
export declare const getLegendStyle: (iconType?: LegendIconType) => {
|
|
3
|
+
textStyle: {
|
|
4
|
+
color: string;
|
|
5
|
+
fontSize: number;
|
|
6
|
+
fontWeight: number;
|
|
7
|
+
padding: number[];
|
|
8
|
+
};
|
|
9
|
+
pageButtonItemGap: number;
|
|
10
|
+
pageButtonGap: number;
|
|
11
|
+
pageTextStyle: {
|
|
12
|
+
color: string;
|
|
13
|
+
fontSize: number;
|
|
14
|
+
fontWeight: number;
|
|
15
|
+
};
|
|
16
|
+
pageIconColor: string;
|
|
17
|
+
pageIconInactiveColor: string;
|
|
18
|
+
pageIconSize: number;
|
|
19
|
+
icon: string;
|
|
20
|
+
itemWidth: number;
|
|
21
|
+
itemHeight: number;
|
|
22
|
+
itemGap: number;
|
|
23
|
+
} | {
|
|
24
|
+
textStyle: {
|
|
25
|
+
color: string;
|
|
26
|
+
fontSize: number;
|
|
27
|
+
fontWeight: number;
|
|
28
|
+
padding: number[];
|
|
29
|
+
};
|
|
30
|
+
pageButtonItemGap: number;
|
|
31
|
+
pageButtonGap: number;
|
|
32
|
+
pageTextStyle: {
|
|
33
|
+
color: string;
|
|
34
|
+
fontSize: number;
|
|
35
|
+
fontWeight: number;
|
|
36
|
+
};
|
|
37
|
+
pageIconColor: string;
|
|
38
|
+
pageIconInactiveColor: string;
|
|
39
|
+
pageIconSize: number;
|
|
40
|
+
icon: string;
|
|
41
|
+
itemStyle: {
|
|
42
|
+
borderRadius: number;
|
|
43
|
+
};
|
|
44
|
+
itemWidth: number;
|
|
45
|
+
itemHeight: number;
|
|
46
|
+
itemGap: number;
|
|
47
|
+
};
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=legendStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legendStyles.d.ts","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/legendStyles.ts"],"names":[],"mappings":"AAEA,KAAK,cAAc,GAAG,MAAM,GAAG,QAAQ,CAAC;AAMxC,eAAO,MAAM,cAAc,cAAc,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BrD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { GRAY_3, GRAY_7 } from './themeColors';
|
|
2
|
+
// looks like -o-
|
|
3
|
+
const lineSeriesLegendIcon = 'path://M0,5 L5,5 L5,7 L0,7 Z M13,5 L18,5 L18,7 L13,7 Z M9,2 A4,4 0 1,1 9,10 A4,4 0 1,1 9,2 Z';
|
|
4
|
+
export const getLegendStyle = (iconType = 'square') => ({
|
|
5
|
+
itemWidth: iconType === 'line' ? 18 : 12,
|
|
6
|
+
itemHeight: 12,
|
|
7
|
+
itemGap: 16,
|
|
8
|
+
...(iconType === 'line'
|
|
9
|
+
? {
|
|
10
|
+
icon: lineSeriesLegendIcon,
|
|
11
|
+
}
|
|
12
|
+
: {
|
|
13
|
+
icon: 'roundRect',
|
|
14
|
+
itemStyle: { borderRadius: 3 },
|
|
15
|
+
}),
|
|
16
|
+
textStyle: {
|
|
17
|
+
color: GRAY_7,
|
|
18
|
+
fontSize: 12,
|
|
19
|
+
fontWeight: 500,
|
|
20
|
+
padding: [0, 0, 0, 2],
|
|
21
|
+
},
|
|
22
|
+
// Navigation controls (for scrollable legends)
|
|
23
|
+
pageButtonItemGap: 16, // Space between left arrow, page text, and right arrow
|
|
24
|
+
pageButtonGap: 8, // Space between legend items and navigation controls
|
|
25
|
+
pageTextStyle: {
|
|
26
|
+
color: GRAY_7,
|
|
27
|
+
fontSize: 12,
|
|
28
|
+
fontWeight: 500,
|
|
29
|
+
},
|
|
30
|
+
pageIconColor: GRAY_7, // Active chevron color
|
|
31
|
+
pageIconInactiveColor: GRAY_3, // Inactive chevron color
|
|
32
|
+
pageIconSize: 12,
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=legendStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legendStyles.js","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/legendStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAI/C,iBAAiB;AACjB,MAAM,oBAAoB,GACtB,8FAA8F,CAAC;AAEnG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,WAA2B,QAAQ,EAAE,EAAE,CAAC,CAAC;IACpE,SAAS,EAAE,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;IACxC,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,EAAE;IACX,GAAG,CAAC,QAAQ,KAAK,MAAM;QACnB,CAAC,CAAC;YACI,IAAI,EAAE,oBAAoB;SAC7B;QACH,CAAC,CAAC;YACI,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE;SACjC,CAAC;IACR,SAAS,EAAE;QACP,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,GAAG;QACf,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;KACxB;IACD,+CAA+C;IAC/C,iBAAiB,EAAE,EAAE,EAAE,uDAAuD;IAC9E,aAAa,EAAE,CAAC,EAAE,qDAAqD;IACvE,aAAa,EAAE;QACX,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,GAAG;KAClB;IACD,aAAa,EAAE,MAAM,EAAE,uBAAuB;IAC9C,qBAAqB,EAAE,MAAM,EAAE,yBAAyB;IACxD,YAAY,EAAE,EAAE;CACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get pie slice styling
|
|
3
|
+
*/
|
|
4
|
+
export declare const getPieSliceStyle: (isDonut: boolean) => {
|
|
5
|
+
itemStyle: {
|
|
6
|
+
borderRadius: number;
|
|
7
|
+
borderColor: string;
|
|
8
|
+
borderWidth: number;
|
|
9
|
+
};
|
|
10
|
+
} | {
|
|
11
|
+
itemStyle?: undefined;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Get external label styling for pie charts
|
|
15
|
+
*/
|
|
16
|
+
export declare const getPieExternalLabelStyle: () => {
|
|
17
|
+
fontSize: number;
|
|
18
|
+
lineHeight: number;
|
|
19
|
+
rich: {
|
|
20
|
+
name: {
|
|
21
|
+
color: string;
|
|
22
|
+
fontWeight: number;
|
|
23
|
+
fontSize: number;
|
|
24
|
+
lineHeight: number;
|
|
25
|
+
};
|
|
26
|
+
value: {
|
|
27
|
+
color: string;
|
|
28
|
+
fontWeight: number;
|
|
29
|
+
fontSize: number;
|
|
30
|
+
lineHeight: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Get label line (connector) styling for pie chart external labels
|
|
36
|
+
*/
|
|
37
|
+
export declare const getPieLabelLineStyle: () => {
|
|
38
|
+
lineStyle: {
|
|
39
|
+
color: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Get internal label styling for pie charts (labels inside slices)
|
|
44
|
+
*/
|
|
45
|
+
export declare const getPieInternalLabelStyle: () => {
|
|
46
|
+
fontWeight: number;
|
|
47
|
+
fontSize: number;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=pieChartStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pieChartStyles.d.ts","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/pieChartStyles.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,gBAAgB,YAAa,OAAO;;;;;;;;CASrC,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;CAkBnC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;CAI/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;CAGnC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { GRAY_3, GRAY_6, GRAY_7, WHITE } from './themeColors';
|
|
2
|
+
/**
|
|
3
|
+
* Get pie slice styling
|
|
4
|
+
*/
|
|
5
|
+
export const getPieSliceStyle = (isDonut) => isDonut
|
|
6
|
+
? {
|
|
7
|
+
itemStyle: {
|
|
8
|
+
borderRadius: 4,
|
|
9
|
+
borderColor: WHITE,
|
|
10
|
+
borderWidth: 2,
|
|
11
|
+
},
|
|
12
|
+
}
|
|
13
|
+
: {};
|
|
14
|
+
/**
|
|
15
|
+
* Get external label styling for pie charts
|
|
16
|
+
*/
|
|
17
|
+
export const getPieExternalLabelStyle = () => ({
|
|
18
|
+
fontSize: 12,
|
|
19
|
+
lineHeight: 18,
|
|
20
|
+
// Rich text styles for different parts of the label
|
|
21
|
+
rich: {
|
|
22
|
+
name: {
|
|
23
|
+
color: GRAY_6,
|
|
24
|
+
fontWeight: 500,
|
|
25
|
+
fontSize: 12,
|
|
26
|
+
lineHeight: 18,
|
|
27
|
+
},
|
|
28
|
+
value: {
|
|
29
|
+
color: GRAY_7,
|
|
30
|
+
fontWeight: 600,
|
|
31
|
+
fontSize: 12,
|
|
32
|
+
lineHeight: 18,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Get label line (connector) styling for pie chart external labels
|
|
38
|
+
*/
|
|
39
|
+
export const getPieLabelLineStyle = () => ({
|
|
40
|
+
lineStyle: {
|
|
41
|
+
color: GRAY_3,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Get internal label styling for pie charts (labels inside slices)
|
|
46
|
+
*/
|
|
47
|
+
export const getPieInternalLabelStyle = () => ({
|
|
48
|
+
fontWeight: 500,
|
|
49
|
+
fontSize: 12,
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=pieChartStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pieChartStyles.js","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/pieChartStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAgB,EAAE,EAAE,CACjD,OAAO;IACH,CAAC,CAAC;QACI,SAAS,EAAE;YACP,YAAY,EAAE,CAAC;YACf,WAAW,EAAE,KAAK;YAClB,WAAW,EAAE,CAAC;SACjB;KACJ;IACH,CAAC,CAAC,EAAE,CAAC;AAEb;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE,CAAC,CAAC;IAC3C,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,EAAE;IACd,oDAAoD;IACpD,IAAI,EAAE;QACF,IAAI,EAAE;YACF,KAAK,EAAE,MAAM;YACb,UAAU,EAAE,GAAG;YACf,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,EAAE;SACjB;QACD,KAAK,EAAE;YACH,KAAK,EAAE,MAAM;YACb,UAAU,EAAE,GAAG;YACf,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,EAAE;SACjB;KACJ;CACJ,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,CAAC;IACvC,SAAS,EAAE;QACP,KAAK,EAAE,MAAM;KAChB;CACJ,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE,CAAC,CAAC;IAC3C,UAAU,EAAE,GAAG;IACf,QAAQ,EAAE,EAAE;CACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get reference line styling
|
|
3
|
+
*/
|
|
4
|
+
export declare const getReferenceLineStyle: (lineColor?: string) => {
|
|
5
|
+
emphasis: {
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
};
|
|
8
|
+
lineStyle: {
|
|
9
|
+
color: string;
|
|
10
|
+
type: readonly [2, 3];
|
|
11
|
+
width: number;
|
|
12
|
+
};
|
|
13
|
+
label: {
|
|
14
|
+
show: boolean;
|
|
15
|
+
position: "start";
|
|
16
|
+
distance: number;
|
|
17
|
+
formatter: (params: {
|
|
18
|
+
name?: string;
|
|
19
|
+
value?: number | string;
|
|
20
|
+
}) => string;
|
|
21
|
+
backgroundColor: string;
|
|
22
|
+
color: string;
|
|
23
|
+
borderWidth: number;
|
|
24
|
+
borderColor: string;
|
|
25
|
+
padding: number[];
|
|
26
|
+
borderRadius: number;
|
|
27
|
+
fontSize: number;
|
|
28
|
+
fontWeight: number;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=referenceLineStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referenceLineStyles.d.ts","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/referenceLineStyles.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,qBAAqB,eAAgB,MAAM;;;;;;;;;;;;;4BAgBxB;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE;;;;;;;;;;CAkBzE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { GRAY_7, GRAY_8, GRAY_9, WHITE } from './themeColors';
|
|
2
|
+
/**
|
|
3
|
+
* Get reference line styling
|
|
4
|
+
*/
|
|
5
|
+
export const getReferenceLineStyle = (lineColor) => {
|
|
6
|
+
const defaultLineColor = lineColor || GRAY_9;
|
|
7
|
+
return {
|
|
8
|
+
emphasis: {
|
|
9
|
+
disabled: true,
|
|
10
|
+
},
|
|
11
|
+
lineStyle: {
|
|
12
|
+
color: defaultLineColor,
|
|
13
|
+
type: [2, 3], // Dotted: 2px dash, 3px gap
|
|
14
|
+
width: 2,
|
|
15
|
+
},
|
|
16
|
+
label: {
|
|
17
|
+
show: true,
|
|
18
|
+
position: 'start', // Start position (left side) to avoid right-edge clipping
|
|
19
|
+
distance: -4, // Negative distance moves label into chart area
|
|
20
|
+
formatter: (params) => {
|
|
21
|
+
const text = params.name || String(params.value || '');
|
|
22
|
+
// Simple truncation - ECharts doesn't handle wrapping well for mark line labels
|
|
23
|
+
const maxChars = 15;
|
|
24
|
+
return text.length > maxChars
|
|
25
|
+
? `${text.substring(0, maxChars)}...`
|
|
26
|
+
: text;
|
|
27
|
+
},
|
|
28
|
+
backgroundColor: GRAY_7,
|
|
29
|
+
color: WHITE,
|
|
30
|
+
borderWidth: 1,
|
|
31
|
+
borderColor: GRAY_8,
|
|
32
|
+
padding: [2, 4],
|
|
33
|
+
borderRadius: 4,
|
|
34
|
+
fontSize: 11,
|
|
35
|
+
fontWeight: 500,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=referenceLineStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referenceLineStyles.js","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/referenceLineStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAkB,EAAE,EAAE;IACxD,MAAM,gBAAgB,GAAG,SAAS,IAAI,MAAM,CAAC;IAE7C,OAAO;QACH,QAAQ,EAAE;YACN,QAAQ,EAAE,IAAI;SACjB;QACD,SAAS,EAAE;YACP,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAU,EAAE,4BAA4B;YACnD,KAAK,EAAE,CAAC;SACX;QACD,KAAK,EAAE;YACH,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,OAAgB,EAAE,0DAA0D;YACtF,QAAQ,EAAE,CAAC,CAAC,EAAE,gDAAgD;YAC9D,SAAS,EAAE,CAAC,MAAkD,EAAE,EAAE;gBAC9D,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;gBACvD,gFAAgF;gBAChF,MAAM,QAAQ,GAAG,EAAE,CAAC;gBACpB,OAAO,IAAI,CAAC,MAAM,GAAG,QAAQ;oBACzB,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK;oBACrC,CAAC,CAAC,IAAI,CAAC;YACf,CAAC;YACD,eAAe,EAAE,MAAM;YACvB,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,MAAM;YACnB,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YACf,YAAY,EAAE,CAAC;YACf,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,GAAG;SAClB;KACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme color constants for ECharts styling
|
|
3
|
+
* Centralizes color usage across all chart style utilities
|
|
4
|
+
* Using Mantine default color palette
|
|
5
|
+
*/
|
|
6
|
+
export declare const GRAY_0 = "#f8f9fa";
|
|
7
|
+
export declare const GRAY_1 = "#f1f3f5";
|
|
8
|
+
export declare const GRAY_2 = "#e9ecef";
|
|
9
|
+
export declare const GRAY_3 = "#dee2e6";
|
|
10
|
+
export declare const GRAY_4 = "#ced4da";
|
|
11
|
+
export declare const GRAY_5 = "#adb5bd";
|
|
12
|
+
export declare const GRAY_6 = "#868e96";
|
|
13
|
+
export declare const GRAY_7 = "#495057";
|
|
14
|
+
export declare const GRAY_8 = "#343a40";
|
|
15
|
+
export declare const GRAY_9 = "#212529";
|
|
16
|
+
export declare const WHITE = "#FFFFFF";
|
|
17
|
+
export declare const AXIS_TITLE_COLOR = "#747B83";
|
|
18
|
+
//# sourceMappingURL=themeColors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeColors.d.ts","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/themeColors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,MAAM,YAAY,CAAC;AAGhC,eAAO,MAAM,KAAK,YAAY,CAAC;AAG/B,eAAO,MAAM,gBAAgB,YAAY,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme color constants for ECharts styling
|
|
3
|
+
* Centralizes color usage across all chart style utilities
|
|
4
|
+
* Using Mantine default color palette
|
|
5
|
+
*/
|
|
6
|
+
export const GRAY_0 = '#f8f9fa'; // theme.colors.gray[0]
|
|
7
|
+
export const GRAY_1 = '#f1f3f5'; // theme.colors.gray[1]
|
|
8
|
+
export const GRAY_2 = '#e9ecef'; // theme.colors.gray[2]
|
|
9
|
+
export const GRAY_3 = '#dee2e6'; // theme.colors.gray[3]
|
|
10
|
+
export const GRAY_4 = '#ced4da'; // theme.colors.gray[4]
|
|
11
|
+
export const GRAY_5 = '#adb5bd'; // theme.colors.gray[5]
|
|
12
|
+
export const GRAY_6 = '#868e96'; // theme.colors.gray[6]
|
|
13
|
+
export const GRAY_7 = '#495057'; // theme.colors.gray[7]
|
|
14
|
+
export const GRAY_8 = '#343a40'; // theme.colors.gray[8]
|
|
15
|
+
export const GRAY_9 = '#212529'; // theme.colors.gray[9]
|
|
16
|
+
// White
|
|
17
|
+
export const WHITE = '#FFFFFF';
|
|
18
|
+
// Axis title (legacy hardcoded color - between gray 5 and gray 6)
|
|
19
|
+
export const AXIS_TITLE_COLOR = '#747B83';
|
|
20
|
+
//# sourceMappingURL=themeColors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeColors.js","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/themeColors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,uBAAuB;AACxD,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,uBAAuB;AACxD,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,uBAAuB;AACxD,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,uBAAuB;AACxD,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,uBAAuB;AACxD,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,uBAAuB;AACxD,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,uBAAuB;AACxD,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,uBAAuB;AACxD,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,uBAAuB;AACxD,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,uBAAuB;AAExD,QAAQ;AACR,MAAM,CAAC,MAAM,KAAK,GAAG,SAAS,CAAC;AAE/B,kEAAkE;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get base tooltip styling
|
|
3
|
+
*/
|
|
4
|
+
export declare const getTooltipStyle: () => {
|
|
5
|
+
padding: number;
|
|
6
|
+
borderColor: string;
|
|
7
|
+
borderWidth: number;
|
|
8
|
+
borderRadius: number;
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
textStyle: {
|
|
11
|
+
color: string;
|
|
12
|
+
fontSize: number;
|
|
13
|
+
};
|
|
14
|
+
extraCssText: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Format a tooltip value with pill styling (e.g. "100% - $100")
|
|
18
|
+
*/
|
|
19
|
+
export declare const formatTooltipValue: (value: string) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Format tooltip header (e.g. "Total Sales")
|
|
22
|
+
*/
|
|
23
|
+
export declare const formatTooltipHeader: (header: string) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Get tooltip divider
|
|
26
|
+
*/
|
|
27
|
+
export declare const getTooltipDivider: () => string;
|
|
28
|
+
/**
|
|
29
|
+
* Format a color indicator (square) for tooltip (e.g. a color block)
|
|
30
|
+
*/
|
|
31
|
+
export declare const formatColorIndicator: (color: string) => string;
|
|
32
|
+
/**
|
|
33
|
+
* Format a simple text label for tooltip (e.g. series name or category)
|
|
34
|
+
* Color: gray.7, Font size: 11px
|
|
35
|
+
*/
|
|
36
|
+
export declare const formatTooltipLabel: (text: string) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Format a tooltip row with color indicator, label, and value (stacked layout)
|
|
39
|
+
* Used for pie charts and other single-row tooltip formats
|
|
40
|
+
* @param colorIndicator - HTML string for color indicator (from formatColorIndicator)
|
|
41
|
+
* @param label - HTML string for label (from formatTooltipLabel)
|
|
42
|
+
* @param value - HTML string for value (from formatTooltipValue)
|
|
43
|
+
*/
|
|
44
|
+
export declare const formatTooltipRow: (colorIndicator: string, label: string, value: string) => string;
|
|
45
|
+
/**
|
|
46
|
+
* Format a cartesian chart tooltip row with color indicator, series name, and value (inline layout)
|
|
47
|
+
* Used for bar/line/area charts where all elements are in a single horizontal row
|
|
48
|
+
* @param colorIndicator - HTML string for color indicator (from formatColorIndicator)
|
|
49
|
+
* @param seriesName - Series name text
|
|
50
|
+
* @param valuePill - HTML string for formatted value pill (from formatTooltipValue)
|
|
51
|
+
*/
|
|
52
|
+
export declare const formatCartesianTooltipRow: (colorIndicator: string, seriesName: string, valuePill: string) => string;
|
|
53
|
+
//# sourceMappingURL=tooltipStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltipStyles.d.ts","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/tooltipStyles.ts"],"names":[],"mappings":"AAeA;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;CAY1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB,UAAW,MAAM,KAAG,MAYlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,WAAY,MAAM,KAAG,MAQpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAO,MAOpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,UAAW,MAAM,KAAG,MAUpD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,SAAU,MAAM,KAAG,MAMjD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,mBACT,MAAM,SACf,MAAM,SACN,MAAM,KACd,MAWF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,mBAClB,MAAM,cACV,MAAM,aACP,MAAM,KAClB,MAiBF,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { GRAY_0, GRAY_1, GRAY_3, GRAY_7, WHITE } from './themeColors';
|
|
2
|
+
/**
|
|
3
|
+
* Helper to convert style object to CSS string
|
|
4
|
+
* We need this because ECharts doesn't support style objects directly
|
|
5
|
+
*/
|
|
6
|
+
const stylesToString = (styles) => Object.entries(styles)
|
|
7
|
+
.map(([key, value]) => {
|
|
8
|
+
// Convert camelCase to kebab-case
|
|
9
|
+
const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();
|
|
10
|
+
return `${kebabKey}: ${value}`;
|
|
11
|
+
})
|
|
12
|
+
.join('; ');
|
|
13
|
+
/**
|
|
14
|
+
* Get base tooltip styling
|
|
15
|
+
*/
|
|
16
|
+
export const getTooltipStyle = () => ({
|
|
17
|
+
padding: 8,
|
|
18
|
+
borderColor: GRAY_3,
|
|
19
|
+
borderWidth: 1,
|
|
20
|
+
borderRadius: 8,
|
|
21
|
+
backgroundColor: WHITE,
|
|
22
|
+
textStyle: {
|
|
23
|
+
color: GRAY_7,
|
|
24
|
+
fontSize: 12,
|
|
25
|
+
},
|
|
26
|
+
extraCssText: 'box-shadow: 0px 8px 8px 0px rgba(0, 0, 0, 0.08), 0px 0px 1px 0px rgba(0, 0, 0, 0.25);',
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Format a tooltip value with pill styling (e.g. "100% - $100")
|
|
30
|
+
*/
|
|
31
|
+
export const formatTooltipValue = (value) => {
|
|
32
|
+
const styles = stylesToString({
|
|
33
|
+
display: 'inline-block',
|
|
34
|
+
backgroundColor: GRAY_0,
|
|
35
|
+
border: `1px solid ${GRAY_1}`,
|
|
36
|
+
color: GRAY_7,
|
|
37
|
+
padding: '2px 8px',
|
|
38
|
+
borderRadius: '6px',
|
|
39
|
+
fontWeight: 600,
|
|
40
|
+
fontSize: '12px',
|
|
41
|
+
});
|
|
42
|
+
return `<span style="${styles}">${value}</span>`;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Format tooltip header (e.g. "Total Sales")
|
|
46
|
+
*/
|
|
47
|
+
export const formatTooltipHeader = (header) => {
|
|
48
|
+
const styles = stylesToString({
|
|
49
|
+
color: GRAY_7,
|
|
50
|
+
fontWeight: 500,
|
|
51
|
+
fontSize: '13px',
|
|
52
|
+
paddingBottom: '8px',
|
|
53
|
+
});
|
|
54
|
+
return `<div style="${styles}">${header}</div>`;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Get tooltip divider
|
|
58
|
+
*/
|
|
59
|
+
export const getTooltipDivider = () => {
|
|
60
|
+
const styles = stylesToString({
|
|
61
|
+
height: '1px',
|
|
62
|
+
backgroundColor: GRAY_1,
|
|
63
|
+
marginBottom: '4px',
|
|
64
|
+
});
|
|
65
|
+
return `<div style="${styles}"></div>`;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Format a color indicator (square) for tooltip (e.g. a color block)
|
|
69
|
+
*/
|
|
70
|
+
export const formatColorIndicator = (color) => {
|
|
71
|
+
const styles = stylesToString({
|
|
72
|
+
display: 'inline-block',
|
|
73
|
+
width: '10px',
|
|
74
|
+
height: '10px',
|
|
75
|
+
backgroundColor: color,
|
|
76
|
+
borderRadius: '2px',
|
|
77
|
+
verticalAlign: 'middle',
|
|
78
|
+
});
|
|
79
|
+
return `<span style="${styles}"></span>`;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Format a simple text label for tooltip (e.g. series name or category)
|
|
83
|
+
* Color: gray.7, Font size: 11px
|
|
84
|
+
*/
|
|
85
|
+
export const formatTooltipLabel = (text) => {
|
|
86
|
+
const styles = stylesToString({
|
|
87
|
+
color: GRAY_7,
|
|
88
|
+
fontSize: '11px',
|
|
89
|
+
});
|
|
90
|
+
return `<span style="${styles}">${text}</span>`;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Format a tooltip row with color indicator, label, and value (stacked layout)
|
|
94
|
+
* Used for pie charts and other single-row tooltip formats
|
|
95
|
+
* @param colorIndicator - HTML string for color indicator (from formatColorIndicator)
|
|
96
|
+
* @param label - HTML string for label (from formatTooltipLabel)
|
|
97
|
+
* @param value - HTML string for value (from formatTooltipValue)
|
|
98
|
+
*/
|
|
99
|
+
export const formatTooltipRow = (colorIndicator, label, value) => {
|
|
100
|
+
const rowStyles = stylesToString({
|
|
101
|
+
display: 'flex',
|
|
102
|
+
alignItems: 'center',
|
|
103
|
+
gap: '8px',
|
|
104
|
+
});
|
|
105
|
+
const valueContainerStyles = stylesToString({
|
|
106
|
+
marginTop: '2px',
|
|
107
|
+
marginLeft: '16px',
|
|
108
|
+
});
|
|
109
|
+
return `<div style="${rowStyles}">${colorIndicator}${label}</div><div style="${valueContainerStyles}">${value}</div>`;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Format a cartesian chart tooltip row with color indicator, series name, and value (inline layout)
|
|
113
|
+
* Used for bar/line/area charts where all elements are in a single horizontal row
|
|
114
|
+
* @param colorIndicator - HTML string for color indicator (from formatColorIndicator)
|
|
115
|
+
* @param seriesName - Series name text
|
|
116
|
+
* @param valuePill - HTML string for formatted value pill (from formatTooltipValue)
|
|
117
|
+
*/
|
|
118
|
+
export const formatCartesianTooltipRow = (colorIndicator, seriesName, valuePill) => {
|
|
119
|
+
const rowStyles = stylesToString({
|
|
120
|
+
display: 'flex',
|
|
121
|
+
alignItems: 'center',
|
|
122
|
+
gap: '8px',
|
|
123
|
+
marginBottom: '2px',
|
|
124
|
+
});
|
|
125
|
+
const seriesNameStyles = stylesToString({
|
|
126
|
+
color: GRAY_7,
|
|
127
|
+
flex: '1',
|
|
128
|
+
fontSize: '12px',
|
|
129
|
+
});
|
|
130
|
+
return `<div style="${rowStyles}">
|
|
131
|
+
${colorIndicator}
|
|
132
|
+
<span style="${seriesNameStyles}">${seriesName}</span>
|
|
133
|
+
${valuePill}
|
|
134
|
+
</div>`;
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=tooltipStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltipStyles.js","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/tooltipStyles.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Series } from '../../../types/savedCharts';
|
|
2
|
+
/**
|
|
3
|
+
* Get value label styling for any chart series (line, bar, area, scatter, etc.)
|
|
4
|
+
* Inside: White on dark backgrounds, gray.9 on light backgrounds, weight 400
|
|
5
|
+
* Outside: gray.9 text with colored border matching series, weight 500
|
|
6
|
+
* Size: 11px
|
|
7
|
+
* @param position - Label position relative to data point
|
|
8
|
+
* @param type - Series type
|
|
9
|
+
*/
|
|
10
|
+
export declare const getValueLabelStyle: (position: "left" | "right" | "top" | "bottom" | "inside" | undefined, type: Series["type"]) => {
|
|
11
|
+
readonly fontSize: 11;
|
|
12
|
+
readonly fontWeight: "500";
|
|
13
|
+
} | {
|
|
14
|
+
textBorderColor: string;
|
|
15
|
+
textBorderWidth: number;
|
|
16
|
+
textBorderType: string;
|
|
17
|
+
fontSize: 11;
|
|
18
|
+
fontWeight: "500";
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=valueLabelStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueLabelStyles.d.ts","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/valueLabelStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAG9E;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,aACjB,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,QAC9D,MAAM,CAAC,MAAM,CAAC;;;;;;;;;CAuBvB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CartesianSeriesType } from '../../../types/savedCharts';
|
|
2
|
+
import { WHITE } from './themeColors';
|
|
3
|
+
/**
|
|
4
|
+
* Get value label styling for any chart series (line, bar, area, scatter, etc.)
|
|
5
|
+
* Inside: White on dark backgrounds, gray.9 on light backgrounds, weight 400
|
|
6
|
+
* Outside: gray.9 text with colored border matching series, weight 500
|
|
7
|
+
* Size: 11px
|
|
8
|
+
* @param position - Label position relative to data point
|
|
9
|
+
* @param type - Series type
|
|
10
|
+
*/
|
|
11
|
+
export const getValueLabelStyle = (position, type) => {
|
|
12
|
+
const isInside = position === 'inside';
|
|
13
|
+
const base = {
|
|
14
|
+
fontSize: 11,
|
|
15
|
+
fontWeight: '500',
|
|
16
|
+
};
|
|
17
|
+
if (
|
|
18
|
+
// inside labels for line and area series should have a white border - similar way to bar series for legibility
|
|
19
|
+
isInside &&
|
|
20
|
+
(type === CartesianSeriesType.LINE || type === CartesianSeriesType.AREA)) {
|
|
21
|
+
return {
|
|
22
|
+
...base,
|
|
23
|
+
textBorderColor: WHITE,
|
|
24
|
+
textBorderWidth: 2,
|
|
25
|
+
textBorderType: 'solid',
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return base;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=valueLabelStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueLabelStyles.js","sourceRoot":"","sources":["../../../../../src/visualizations/helpers/styles/valueLabelStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAe,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAC9B,QAAoE,EACpE,IAAoB,EACtB,EAAE;IACA,MAAM,QAAQ,GAAG,QAAQ,KAAK,QAAQ,CAAC;IAEvC,MAAM,IAAI,GAAG;QACT,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;KACX,CAAC;IAEX;IACI,+GAA+G;IAC/G,QAAQ;QACR,CAAC,IAAI,KAAK,mBAAmB,CAAC,IAAI,IAAI,IAAI,KAAK,mBAAmB,CAAC,IAAI,CAAC,EAC1E,CAAC;QACC,OAAO;YACH,GAAG,IAAI;YACP,eAAe,EAAE,KAAK;YACtB,eAAe,EAAE,CAAC;YAClB,cAAc,EAAE,OAAO;SAC1B,CAAC;IACN,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC"}
|