@hitachivantara/uikit-react-viz 4.1.9 → 5.1.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/README.md +1 -1
- package/dist/cjs/components/LineChart/LineChart.cjs +398 -0
- package/dist/cjs/components/LineChart/LineChart.cjs.map +1 -0
- package/dist/cjs/components/LineChart/LineChart.styles.cjs +85 -0
- package/dist/cjs/components/LineChart/LineChart.styles.cjs.map +1 -0
- package/dist/cjs/hooks/useVizTheme.cjs +9 -0
- package/dist/cjs/hooks/useVizTheme.cjs.map +1 -0
- package/dist/cjs/index.cjs +8 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/providers/Provider.cjs +137 -0
- package/dist/cjs/providers/Provider.cjs.map +1 -0
- package/dist/cjs/utils/getAgFunc.cjs +5 -0
- package/dist/cjs/utils/getAgFunc.cjs.map +1 -0
- package/dist/cjs/utils/getAxisType.cjs +16 -0
- package/dist/cjs/utils/getAxisType.cjs.map +1 -0
- package/dist/cjs/utils/getLegendIcon.cjs +10 -0
- package/dist/cjs/utils/getLegendIcon.cjs.map +1 -0
- package/dist/esm/components/LineChart/LineChart.js +377 -0
- package/dist/esm/components/LineChart/LineChart.js.map +1 -0
- package/dist/esm/components/LineChart/LineChart.styles.js +85 -0
- package/dist/esm/components/LineChart/LineChart.styles.js.map +1 -0
- package/dist/esm/hooks/useVizTheme.js +9 -0
- package/dist/esm/hooks/useVizTheme.js.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/providers/Provider.js +118 -0
- package/dist/esm/providers/Provider.js.map +1 -0
- package/dist/esm/utils/getAgFunc.js +5 -0
- package/dist/esm/utils/getAgFunc.js.map +1 -0
- package/dist/esm/utils/getAxisType.js +16 -0
- package/dist/esm/utils/getAxisType.js.map +1 -0
- package/dist/esm/utils/getLegendIcon.js +10 -0
- package/dist/esm/utils/getLegendIcon.js.map +1 -0
- package/dist/types/index.d.ts +229 -0
- package/package.json +36 -48
- package/LICENSE.txt +0 -201
- package/dist/Barchart/Barchart.d.ts +0 -14
- package/dist/Barchart/Barchart.js +0 -214
- package/dist/Barchart/Barchart.js.map +0 -1
- package/dist/Barchart/barchartPlotlyOverrides.js +0 -47
- package/dist/Barchart/barchartPlotlyOverrides.js.map +0 -1
- package/dist/Barchart/index.d.ts +0 -2
- package/dist/Barchart/index.js +0 -14
- package/dist/Barchart/index.js.map +0 -1
- package/dist/Barchart/styles.js +0 -10
- package/dist/Barchart/styles.js.map +0 -1
- package/dist/Chart/Chart.d.ts +0 -44
- package/dist/Chart/Chart.js +0 -194
- package/dist/Chart/Chart.js.map +0 -1
- package/dist/Chart/Plot/Plot.d.ts +0 -43
- package/dist/Chart/Plot/Plot.js +0 -110
- package/dist/Chart/Plot/Plot.js.map +0 -1
- package/dist/Chart/Plot/index.d.ts +0 -2
- package/dist/Chart/Plot/index.js +0 -14
- package/dist/Chart/Plot/index.js.map +0 -1
- package/dist/Chart/Plot/styles.js +0 -10
- package/dist/Chart/Plot/styles.js.map +0 -1
- package/dist/Chart/Tooltip/MultiTooltip/MultiTooltip.js +0 -143
- package/dist/Chart/Tooltip/MultiTooltip/MultiTooltip.js.map +0 -1
- package/dist/Chart/Tooltip/MultiTooltip/index.js +0 -14
- package/dist/Chart/Tooltip/MultiTooltip/index.js.map +0 -1
- package/dist/Chart/Tooltip/MultiTooltip/styles.js +0 -49
- package/dist/Chart/Tooltip/MultiTooltip/styles.js.map +0 -1
- package/dist/Chart/Tooltip/SingleTooltip/SingleTooltip.js +0 -73
- package/dist/Chart/Tooltip/SingleTooltip/SingleTooltip.js.map +0 -1
- package/dist/Chart/Tooltip/SingleTooltip/index.js +0 -14
- package/dist/Chart/Tooltip/SingleTooltip/index.js.map +0 -1
- package/dist/Chart/Tooltip/SingleTooltip/styles.js +0 -24
- package/dist/Chart/Tooltip/SingleTooltip/styles.js.map +0 -1
- package/dist/Chart/Tooltip/Tooltip.js +0 -146
- package/dist/Chart/Tooltip/Tooltip.js.map +0 -1
- package/dist/Chart/Tooltip/index.js +0 -14
- package/dist/Chart/Tooltip/index.js.map +0 -1
- package/dist/Chart/Tooltip/styles.js +0 -16
- package/dist/Chart/Tooltip/styles.js.map +0 -1
- package/dist/Chart/chartPlotlyOverrides.js +0 -145
- package/dist/Chart/chartPlotlyOverrides.js.map +0 -1
- package/dist/Chart/index.d.ts +0 -5
- package/dist/Chart/index.js +0 -14
- package/dist/Chart/index.js.map +0 -1
- package/dist/Chart/styles.js +0 -36
- package/dist/Chart/styles.js.map +0 -1
- package/dist/ConfusionMatrix/ConfusionMatrix.d.ts +0 -10
- package/dist/ConfusionMatrix/ConfusionMatrix.js +0 -102
- package/dist/ConfusionMatrix/ConfusionMatrix.js.map +0 -1
- package/dist/ConfusionMatrix/CustomTooltip/CustomTooltip.js +0 -47
- package/dist/ConfusionMatrix/CustomTooltip/CustomTooltip.js.map +0 -1
- package/dist/ConfusionMatrix/CustomTooltip/index.js +0 -14
- package/dist/ConfusionMatrix/CustomTooltip/index.js.map +0 -1
- package/dist/ConfusionMatrix/CustomTooltip/styles.js +0 -26
- package/dist/ConfusionMatrix/CustomTooltip/styles.js.map +0 -1
- package/dist/ConfusionMatrix/confusionMatrixPlotlyOverrides.js +0 -189
- package/dist/ConfusionMatrix/confusionMatrixPlotlyOverrides.js.map +0 -1
- package/dist/ConfusionMatrix/index.d.ts +0 -2
- package/dist/ConfusionMatrix/index.js +0 -14
- package/dist/ConfusionMatrix/index.js.map +0 -1
- package/dist/ConfusionMatrix/styles.js +0 -10
- package/dist/ConfusionMatrix/styles.js.map +0 -1
- package/dist/Donutchart/Donutchart.d.ts +0 -10
- package/dist/Donutchart/Donutchart.js +0 -103
- package/dist/Donutchart/Donutchart.js.map +0 -1
- package/dist/Donutchart/donutchartPlotlyOverrides.js +0 -44
- package/dist/Donutchart/donutchartPlotlyOverrides.js.map +0 -1
- package/dist/Donutchart/index.d.ts +0 -2
- package/dist/Donutchart/index.js +0 -14
- package/dist/Donutchart/index.js.map +0 -1
- package/dist/Donutchart/styles.js +0 -10
- package/dist/Donutchart/styles.js.map +0 -1
- package/dist/Linechart/Linechart.d.ts +0 -14
- package/dist/Linechart/Linechart.js +0 -108
- package/dist/Linechart/Linechart.js.map +0 -1
- package/dist/Linechart/index.d.ts +0 -2
- package/dist/Linechart/index.js +0 -14
- package/dist/Linechart/index.js.map +0 -1
- package/dist/Linechart/lineChartPlotlyOverrides.js +0 -63
- package/dist/Linechart/lineChartPlotlyOverrides.js.map +0 -1
- package/dist/Linechart/styles.js +0 -10
- package/dist/Linechart/styles.js.map +0 -1
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -35
- package/dist/index.js.map +0 -1
- package/dist/legacy/Barchart/Barchart.d.ts +0 -14
- package/dist/legacy/Barchart/Barchart.js +0 -199
- package/dist/legacy/Barchart/Barchart.js.map +0 -1
- package/dist/legacy/Barchart/barchartPlotlyOverrides.js +0 -38
- package/dist/legacy/Barchart/barchartPlotlyOverrides.js.map +0 -1
- package/dist/legacy/Barchart/index.d.ts +0 -2
- package/dist/legacy/Barchart/index.js +0 -2
- package/dist/legacy/Barchart/index.js.map +0 -1
- package/dist/legacy/Barchart/styles.js +0 -3
- package/dist/legacy/Barchart/styles.js.map +0 -1
- package/dist/legacy/Chart/Chart.d.ts +0 -44
- package/dist/legacy/Chart/Chart.js +0 -181
- package/dist/legacy/Chart/Chart.js.map +0 -1
- package/dist/legacy/Chart/Plot/Plot.d.ts +0 -43
- package/dist/legacy/Chart/Plot/Plot.js +0 -95
- package/dist/legacy/Chart/Plot/Plot.js.map +0 -1
- package/dist/legacy/Chart/Plot/index.d.ts +0 -2
- package/dist/legacy/Chart/Plot/index.js +0 -2
- package/dist/legacy/Chart/Plot/index.js.map +0 -1
- package/dist/legacy/Chart/Plot/styles.js +0 -3
- package/dist/legacy/Chart/Plot/styles.js.map +0 -1
- package/dist/legacy/Chart/Tooltip/MultiTooltip/MultiTooltip.js +0 -130
- package/dist/legacy/Chart/Tooltip/MultiTooltip/MultiTooltip.js.map +0 -1
- package/dist/legacy/Chart/Tooltip/MultiTooltip/index.js +0 -2
- package/dist/legacy/Chart/Tooltip/MultiTooltip/index.js.map +0 -1
- package/dist/legacy/Chart/Tooltip/MultiTooltip/styles.js +0 -42
- package/dist/legacy/Chart/Tooltip/MultiTooltip/styles.js.map +0 -1
- package/dist/legacy/Chart/Tooltip/SingleTooltip/SingleTooltip.js +0 -57
- package/dist/legacy/Chart/Tooltip/SingleTooltip/SingleTooltip.js.map +0 -1
- package/dist/legacy/Chart/Tooltip/SingleTooltip/index.js +0 -2
- package/dist/legacy/Chart/Tooltip/SingleTooltip/index.js.map +0 -1
- package/dist/legacy/Chart/Tooltip/SingleTooltip/styles.js +0 -17
- package/dist/legacy/Chart/Tooltip/SingleTooltip/styles.js.map +0 -1
- package/dist/legacy/Chart/Tooltip/Tooltip.js +0 -129
- package/dist/legacy/Chart/Tooltip/Tooltip.js.map +0 -1
- package/dist/legacy/Chart/Tooltip/index.js +0 -2
- package/dist/legacy/Chart/Tooltip/index.js.map +0 -1
- package/dist/legacy/Chart/Tooltip/styles.js +0 -9
- package/dist/legacy/Chart/Tooltip/styles.js.map +0 -1
- package/dist/legacy/Chart/chartPlotlyOverrides.js +0 -136
- package/dist/legacy/Chart/chartPlotlyOverrides.js.map +0 -1
- package/dist/legacy/Chart/index.d.ts +0 -5
- package/dist/legacy/Chart/index.js +0 -2
- package/dist/legacy/Chart/index.js.map +0 -1
- package/dist/legacy/Chart/styles.js +0 -28
- package/dist/legacy/Chart/styles.js.map +0 -1
- package/dist/legacy/ConfusionMatrix/ConfusionMatrix.d.ts +0 -10
- package/dist/legacy/ConfusionMatrix/ConfusionMatrix.js +0 -87
- package/dist/legacy/ConfusionMatrix/ConfusionMatrix.js.map +0 -1
- package/dist/legacy/ConfusionMatrix/CustomTooltip/CustomTooltip.js +0 -39
- package/dist/legacy/ConfusionMatrix/CustomTooltip/CustomTooltip.js.map +0 -1
- package/dist/legacy/ConfusionMatrix/CustomTooltip/index.js +0 -2
- package/dist/legacy/ConfusionMatrix/CustomTooltip/index.js.map +0 -1
- package/dist/legacy/ConfusionMatrix/CustomTooltip/styles.js +0 -19
- package/dist/legacy/ConfusionMatrix/CustomTooltip/styles.js.map +0 -1
- package/dist/legacy/ConfusionMatrix/confusionMatrixPlotlyOverrides.js +0 -181
- package/dist/legacy/ConfusionMatrix/confusionMatrixPlotlyOverrides.js.map +0 -1
- package/dist/legacy/ConfusionMatrix/index.d.ts +0 -2
- package/dist/legacy/ConfusionMatrix/index.js +0 -2
- package/dist/legacy/ConfusionMatrix/index.js.map +0 -1
- package/dist/legacy/ConfusionMatrix/styles.js +0 -3
- package/dist/legacy/ConfusionMatrix/styles.js.map +0 -1
- package/dist/legacy/Donutchart/Donutchart.d.ts +0 -10
- package/dist/legacy/Donutchart/Donutchart.js +0 -89
- package/dist/legacy/Donutchart/Donutchart.js.map +0 -1
- package/dist/legacy/Donutchart/donutchartPlotlyOverrides.js +0 -35
- package/dist/legacy/Donutchart/donutchartPlotlyOverrides.js.map +0 -1
- package/dist/legacy/Donutchart/index.d.ts +0 -2
- package/dist/legacy/Donutchart/index.js +0 -2
- package/dist/legacy/Donutchart/index.js.map +0 -1
- package/dist/legacy/Donutchart/styles.js +0 -3
- package/dist/legacy/Donutchart/styles.js.map +0 -1
- package/dist/legacy/Linechart/Linechart.d.ts +0 -14
- package/dist/legacy/Linechart/Linechart.js +0 -94
- package/dist/legacy/Linechart/Linechart.js.map +0 -1
- package/dist/legacy/Linechart/index.d.ts +0 -2
- package/dist/legacy/Linechart/index.js +0 -2
- package/dist/legacy/Linechart/index.js.map +0 -1
- package/dist/legacy/Linechart/lineChartPlotlyOverrides.js +0 -54
- package/dist/legacy/Linechart/lineChartPlotlyOverrides.js.map +0 -1
- package/dist/legacy/Linechart/styles.js +0 -3
- package/dist/legacy/Linechart/styles.js.map +0 -1
- package/dist/legacy/index.d.ts +0 -11
- package/dist/legacy/index.js +0 -6
- package/dist/legacy/index.js.map +0 -1
- package/dist/modern/Barchart/Barchart.d.ts +0 -14
- package/dist/modern/Barchart/Barchart.js +0 -185
- package/dist/modern/Barchart/Barchart.js.map +0 -1
- package/dist/modern/Barchart/barchartPlotlyOverrides.js +0 -36
- package/dist/modern/Barchart/barchartPlotlyOverrides.js.map +0 -1
- package/dist/modern/Barchart/index.d.ts +0 -2
- package/dist/modern/Barchart/index.js +0 -2
- package/dist/modern/Barchart/index.js.map +0 -1
- package/dist/modern/Barchart/styles.js +0 -3
- package/dist/modern/Barchart/styles.js.map +0 -1
- package/dist/modern/Chart/Chart.d.ts +0 -44
- package/dist/modern/Chart/Chart.js +0 -162
- package/dist/modern/Chart/Chart.js.map +0 -1
- package/dist/modern/Chart/Plot/Plot.d.ts +0 -43
- package/dist/modern/Chart/Plot/Plot.js +0 -89
- package/dist/modern/Chart/Plot/Plot.js.map +0 -1
- package/dist/modern/Chart/Plot/index.d.ts +0 -2
- package/dist/modern/Chart/Plot/index.js +0 -2
- package/dist/modern/Chart/Plot/index.js.map +0 -1
- package/dist/modern/Chart/Plot/styles.js +0 -3
- package/dist/modern/Chart/Plot/styles.js.map +0 -1
- package/dist/modern/Chart/Tooltip/MultiTooltip/MultiTooltip.js +0 -122
- package/dist/modern/Chart/Tooltip/MultiTooltip/MultiTooltip.js.map +0 -1
- package/dist/modern/Chart/Tooltip/MultiTooltip/index.js +0 -2
- package/dist/modern/Chart/Tooltip/MultiTooltip/index.js.map +0 -1
- package/dist/modern/Chart/Tooltip/MultiTooltip/styles.js +0 -40
- package/dist/modern/Chart/Tooltip/MultiTooltip/styles.js.map +0 -1
- package/dist/modern/Chart/Tooltip/SingleTooltip/SingleTooltip.js +0 -54
- package/dist/modern/Chart/Tooltip/SingleTooltip/SingleTooltip.js.map +0 -1
- package/dist/modern/Chart/Tooltip/SingleTooltip/index.js +0 -2
- package/dist/modern/Chart/Tooltip/SingleTooltip/index.js.map +0 -1
- package/dist/modern/Chart/Tooltip/SingleTooltip/styles.js +0 -15
- package/dist/modern/Chart/Tooltip/SingleTooltip/styles.js.map +0 -1
- package/dist/modern/Chart/Tooltip/Tooltip.js +0 -129
- package/dist/modern/Chart/Tooltip/Tooltip.js.map +0 -1
- package/dist/modern/Chart/Tooltip/index.js +0 -2
- package/dist/modern/Chart/Tooltip/index.js.map +0 -1
- package/dist/modern/Chart/Tooltip/styles.js +0 -9
- package/dist/modern/Chart/Tooltip/styles.js.map +0 -1
- package/dist/modern/Chart/chartPlotlyOverrides.js +0 -126
- package/dist/modern/Chart/chartPlotlyOverrides.js.map +0 -1
- package/dist/modern/Chart/index.d.ts +0 -5
- package/dist/modern/Chart/index.js +0 -2
- package/dist/modern/Chart/index.js.map +0 -1
- package/dist/modern/Chart/styles.js +0 -19
- package/dist/modern/Chart/styles.js.map +0 -1
- package/dist/modern/ConfusionMatrix/ConfusionMatrix.d.ts +0 -10
- package/dist/modern/ConfusionMatrix/ConfusionMatrix.js +0 -76
- package/dist/modern/ConfusionMatrix/ConfusionMatrix.js.map +0 -1
- package/dist/modern/ConfusionMatrix/CustomTooltip/CustomTooltip.js +0 -37
- package/dist/modern/ConfusionMatrix/CustomTooltip/CustomTooltip.js.map +0 -1
- package/dist/modern/ConfusionMatrix/CustomTooltip/index.js +0 -2
- package/dist/modern/ConfusionMatrix/CustomTooltip/index.js.map +0 -1
- package/dist/modern/ConfusionMatrix/CustomTooltip/styles.js +0 -17
- package/dist/modern/ConfusionMatrix/CustomTooltip/styles.js.map +0 -1
- package/dist/modern/ConfusionMatrix/confusionMatrixPlotlyOverrides.js +0 -154
- package/dist/modern/ConfusionMatrix/confusionMatrixPlotlyOverrides.js.map +0 -1
- package/dist/modern/ConfusionMatrix/index.d.ts +0 -2
- package/dist/modern/ConfusionMatrix/index.js +0 -2
- package/dist/modern/ConfusionMatrix/index.js.map +0 -1
- package/dist/modern/ConfusionMatrix/styles.js +0 -3
- package/dist/modern/ConfusionMatrix/styles.js.map +0 -1
- package/dist/modern/Donutchart/Donutchart.d.ts +0 -10
- package/dist/modern/Donutchart/Donutchart.js +0 -78
- package/dist/modern/Donutchart/Donutchart.js.map +0 -1
- package/dist/modern/Donutchart/donutchartPlotlyOverrides.js +0 -33
- package/dist/modern/Donutchart/donutchartPlotlyOverrides.js.map +0 -1
- package/dist/modern/Donutchart/index.d.ts +0 -2
- package/dist/modern/Donutchart/index.js +0 -2
- package/dist/modern/Donutchart/index.js.map +0 -1
- package/dist/modern/Donutchart/styles.js +0 -3
- package/dist/modern/Donutchart/styles.js.map +0 -1
- package/dist/modern/Linechart/Linechart.d.ts +0 -14
- package/dist/modern/Linechart/Linechart.js +0 -82
- package/dist/modern/Linechart/Linechart.js.map +0 -1
- package/dist/modern/Linechart/index.d.ts +0 -2
- package/dist/modern/Linechart/index.js +0 -2
- package/dist/modern/Linechart/index.js.map +0 -1
- package/dist/modern/Linechart/lineChartPlotlyOverrides.js +0 -50
- package/dist/modern/Linechart/lineChartPlotlyOverrides.js.map +0 -1
- package/dist/modern/Linechart/styles.js +0 -3
- package/dist/modern/Linechart/styles.js.map +0 -1
- package/dist/modern/index.d.ts +0 -11
- package/dist/modern/index.js +0 -6
- package/dist/modern/index.js.map +0 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { createClasses, theme } from "@hitachivantara/uikit-react-core";
|
|
2
|
+
const {
|
|
3
|
+
useClasses,
|
|
4
|
+
staticClasses
|
|
5
|
+
} = createClasses("HvLineChart", {
|
|
6
|
+
/** Single tooltip styles */
|
|
7
|
+
singleTooltipRoot: {
|
|
8
|
+
width: "fit-content",
|
|
9
|
+
boxShadow: theme.colors.shadow,
|
|
10
|
+
backgroundColor: theme.colors.atmo1,
|
|
11
|
+
padding: theme.space.sm,
|
|
12
|
+
display: "flex"
|
|
13
|
+
},
|
|
14
|
+
singleTooltipTitle: {
|
|
15
|
+
fontFamily: theme.fontFamily.body,
|
|
16
|
+
fontWeight: theme.fontWeights.semibold,
|
|
17
|
+
fontSize: theme.fontSizes.sm,
|
|
18
|
+
color: theme.colors.secondary
|
|
19
|
+
},
|
|
20
|
+
singleTooltipValue: {
|
|
21
|
+
fontFamily: theme.fontFamily.body,
|
|
22
|
+
fontWeight: theme.fontWeights.normal,
|
|
23
|
+
fontSize: theme.fontSizes.sm,
|
|
24
|
+
color: theme.colors.secondary,
|
|
25
|
+
marginLeft: theme.space.xs
|
|
26
|
+
},
|
|
27
|
+
/** Multiple tooltip styles */
|
|
28
|
+
multipleTooltipRoot: {
|
|
29
|
+
width: "fit-content",
|
|
30
|
+
boxShadow: theme.colors.shadow,
|
|
31
|
+
backgroundColor: theme.colors.atmo1
|
|
32
|
+
},
|
|
33
|
+
multipleTooltipTitleContainer: {
|
|
34
|
+
padding: `15px ${theme.space.sm}`,
|
|
35
|
+
borderBottom: `3px solid ${theme.colors.atmo2}`
|
|
36
|
+
},
|
|
37
|
+
multipleTooltipTitle: {
|
|
38
|
+
fontFamily: theme.fontFamily.body,
|
|
39
|
+
fontWeight: theme.fontWeights.semibold,
|
|
40
|
+
fontSize: theme.fontSizes.sm,
|
|
41
|
+
color: theme.colors.secondary
|
|
42
|
+
},
|
|
43
|
+
multipleTooltipValuesContainer: {
|
|
44
|
+
display: "flex",
|
|
45
|
+
flexDirection: "column",
|
|
46
|
+
padding: theme.space.sm,
|
|
47
|
+
"& > *:not(:last-child)": {
|
|
48
|
+
paddingBottom: theme.space.sm
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
multipleTooltipSeriesContainer: {
|
|
52
|
+
display: "flex",
|
|
53
|
+
flexDirection: "row",
|
|
54
|
+
justifyContent: "space-between",
|
|
55
|
+
alignItems: "center"
|
|
56
|
+
},
|
|
57
|
+
multipleTooltipSeriesNameContainer: {
|
|
58
|
+
display: "flex",
|
|
59
|
+
flexDirection: "row",
|
|
60
|
+
alignItems: "center",
|
|
61
|
+
marginRight: theme.space.sm
|
|
62
|
+
},
|
|
63
|
+
multipleTooltipSeriesColor: {
|
|
64
|
+
width: "10px",
|
|
65
|
+
height: "10px",
|
|
66
|
+
marginRight: "5px"
|
|
67
|
+
},
|
|
68
|
+
multipleTooltipSeriesName: {
|
|
69
|
+
fontFamily: theme.fontFamily.body,
|
|
70
|
+
fontWeight: theme.fontWeights.semibold,
|
|
71
|
+
fontSize: theme.fontSizes.sm,
|
|
72
|
+
color: theme.colors.secondary
|
|
73
|
+
},
|
|
74
|
+
multipleTooltipSeriesValue: {
|
|
75
|
+
fontFamily: theme.fontFamily.body,
|
|
76
|
+
fontWeight: theme.fontWeights.normal,
|
|
77
|
+
fontSize: theme.fontSizes.sm,
|
|
78
|
+
color: theme.colors.secondary
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
export {
|
|
82
|
+
staticClasses,
|
|
83
|
+
useClasses
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=LineChart.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.styles.js","sources":["../../../../src/components/LineChart/LineChart.styles.tsx"],"sourcesContent":["import { theme, createClasses } from \"@hitachivantara/uikit-react-core\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvLineChart\", {\n /** Single tooltip styles */\n singleTooltipRoot: {\n width: \"fit-content\",\n boxShadow: theme.colors.shadow,\n backgroundColor: theme.colors.atmo1,\n padding: theme.space.sm,\n display: \"flex\",\n },\n singleTooltipTitle: {\n fontFamily: theme.fontFamily.body,\n fontWeight: theme.fontWeights.semibold,\n fontSize: theme.fontSizes.sm,\n color: theme.colors.secondary,\n },\n singleTooltipValue: {\n fontFamily: theme.fontFamily.body,\n fontWeight: theme.fontWeights.normal,\n fontSize: theme.fontSizes.sm,\n color: theme.colors.secondary,\n marginLeft: theme.space.xs,\n },\n /** Multiple tooltip styles */\n multipleTooltipRoot: {\n width: \"fit-content\",\n boxShadow: theme.colors.shadow,\n backgroundColor: theme.colors.atmo1,\n },\n multipleTooltipTitleContainer: {\n padding: `15px ${theme.space.sm}`,\n borderBottom: `3px solid ${theme.colors.atmo2}`,\n },\n multipleTooltipTitle: {\n fontFamily: theme.fontFamily.body,\n fontWeight: theme.fontWeights.semibold,\n fontSize: theme.fontSizes.sm,\n color: theme.colors.secondary,\n },\n multipleTooltipValuesContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n padding: theme.space.sm,\n\n \"& > *:not(:last-child)\": { paddingBottom: theme.space.sm },\n },\n multipleTooltipSeriesContainer: {\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n },\n multipleTooltipSeriesNameContainer: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n marginRight: theme.space.sm,\n },\n multipleTooltipSeriesColor: {\n width: \"10px\",\n height: \"10px\",\n marginRight: \"5px\",\n },\n multipleTooltipSeriesName: {\n fontFamily: theme.fontFamily.body,\n fontWeight: theme.fontWeights.semibold,\n fontSize: theme.fontSizes.sm,\n color: theme.colors.secondary,\n },\n multipleTooltipSeriesValue: {\n fontFamily: theme.fontFamily.body,\n fontWeight: theme.fontWeights.normal,\n fontSize: theme.fontSizes.sm,\n color: theme.colors.secondary,\n },\n});\n"],"names":["useClasses","staticClasses","createClasses","singleTooltipRoot","width","boxShadow","theme","colors","shadow","backgroundColor","atmo1","padding","space","sm","display","singleTooltipTitle","fontFamily","body","fontWeight","fontWeights","semibold","fontSize","fontSizes","color","secondary","singleTooltipValue","normal","marginLeft","xs","multipleTooltipRoot","multipleTooltipTitleContainer","borderBottom","atmo2","multipleTooltipTitle","multipleTooltipValuesContainer","flexDirection","paddingBottom","multipleTooltipSeriesContainer","justifyContent","alignItems","multipleTooltipSeriesNameContainer","marginRight","multipleTooltipSeriesColor","height","multipleTooltipSeriesName","multipleTooltipSeriesValue"],"mappings":";AAEa,MAAA;AAAA,EAAEA;AAAAA,EAAYC;AAAc,IAAIC,cAAc,eAAe;AAAA;AAAA,EAExEC,mBAAmB;AAAA,IACjBC,OAAO;AAAA,IACPC,WAAWC,MAAMC,OAAOC;AAAAA,IACxBC,iBAAiBH,MAAMC,OAAOG;AAAAA,IAC9BC,SAASL,MAAMM,MAAMC;AAAAA,IACrBC,SAAS;AAAA,EACX;AAAA,EACAC,oBAAoB;AAAA,IAClBC,YAAYV,MAAMU,WAAWC;AAAAA,IAC7BC,YAAYZ,MAAMa,YAAYC;AAAAA,IAC9BC,UAAUf,MAAMgB,UAAUT;AAAAA,IAC1BU,OAAOjB,MAAMC,OAAOiB;AAAAA,EACtB;AAAA,EACAC,oBAAoB;AAAA,IAClBT,YAAYV,MAAMU,WAAWC;AAAAA,IAC7BC,YAAYZ,MAAMa,YAAYO;AAAAA,IAC9BL,UAAUf,MAAMgB,UAAUT;AAAAA,IAC1BU,OAAOjB,MAAMC,OAAOiB;AAAAA,IACpBG,YAAYrB,MAAMM,MAAMgB;AAAAA,EAC1B;AAAA;AAAA,EAEAC,qBAAqB;AAAA,IACnBzB,OAAO;AAAA,IACPC,WAAWC,MAAMC,OAAOC;AAAAA,IACxBC,iBAAiBH,MAAMC,OAAOG;AAAAA,EAChC;AAAA,EACAoB,+BAA+B;AAAA,IAC7BnB,SAAU,QAAOL,MAAMM,MAAMC;AAAAA,IAC7BkB,cAAe,aAAYzB,MAAMC,OAAOyB;AAAAA,EAC1C;AAAA,EACAC,sBAAsB;AAAA,IACpBjB,YAAYV,MAAMU,WAAWC;AAAAA,IAC7BC,YAAYZ,MAAMa,YAAYC;AAAAA,IAC9BC,UAAUf,MAAMgB,UAAUT;AAAAA,IAC1BU,OAAOjB,MAAMC,OAAOiB;AAAAA,EACtB;AAAA,EACAU,gCAAgC;AAAA,IAC9BpB,SAAS;AAAA,IACTqB,eAAe;AAAA,IACfxB,SAASL,MAAMM,MAAMC;AAAAA,IAErB,0BAA0B;AAAA,MAAEuB,eAAe9B,MAAMM,MAAMC;AAAAA,IAAG;AAAA,EAC5D;AAAA,EACAwB,gCAAgC;AAAA,IAC9BvB,SAAS;AAAA,IACTqB,eAAe;AAAA,IACfG,gBAAgB;AAAA,IAChBC,YAAY;AAAA,EACd;AAAA,EACAC,oCAAoC;AAAA,IAClC1B,SAAS;AAAA,IACTqB,eAAe;AAAA,IACfI,YAAY;AAAA,IACZE,aAAanC,MAAMM,MAAMC;AAAAA,EAC3B;AAAA,EACA6B,4BAA4B;AAAA,IAC1BtC,OAAO;AAAA,IACPuC,QAAQ;AAAA,IACRF,aAAa;AAAA,EACf;AAAA,EACAG,2BAA2B;AAAA,IACzB5B,YAAYV,MAAMU,WAAWC;AAAAA,IAC7BC,YAAYZ,MAAMa,YAAYC;AAAAA,IAC9BC,UAAUf,MAAMgB,UAAUT;AAAAA,IAC1BU,OAAOjB,MAAMC,OAAOiB;AAAAA,EACtB;AAAA,EACAqB,4BAA4B;AAAA,IAC1B7B,YAAYV,MAAMU,WAAWC;AAAAA,IAC7BC,YAAYZ,MAAMa,YAAYO;AAAAA,IAC9BL,UAAUf,MAAMgB,UAAUT;AAAAA,IAC1BU,OAAOjB,MAAMC,OAAOiB;AAAAA,EACtB;AACF,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVizTheme.js","sources":["../../../src/hooks/useVizTheme.ts"],"sourcesContent":["import { HvVizContext, HvVizContextValue } from \"@viz/providers\";\nimport { useContext } from \"react\";\n\nexport const useVizTheme = (): HvVizContextValue => {\n return useContext(HvVizContext);\n};\n"],"names":["useVizTheme","useContext","HvVizContext"],"mappings":";;AAGO,MAAMA,cAAcA,MAAyB;AAClD,SAAOC,WAAWC,YAAY;AAChC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { useTheme } from "@hitachivantara/uikit-react-core";
|
|
2
|
+
import * as echarts from "echarts/core";
|
|
3
|
+
import { createContext, useState, useEffect, useMemo } from "react";
|
|
4
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
5
|
+
const HvVizContext = createContext({
|
|
6
|
+
theme: void 0
|
|
7
|
+
});
|
|
8
|
+
const HvVizProvider = ({
|
|
9
|
+
children
|
|
10
|
+
}) => {
|
|
11
|
+
const {
|
|
12
|
+
activeTheme,
|
|
13
|
+
colorModes,
|
|
14
|
+
selectedMode,
|
|
15
|
+
selectedTheme
|
|
16
|
+
} = useTheme();
|
|
17
|
+
const [theme, setTheme] = useState();
|
|
18
|
+
const registerThemes = (themeName, modes, themeStructure) => {
|
|
19
|
+
modes.forEach((mode) => {
|
|
20
|
+
const baseText = {
|
|
21
|
+
color: themeStructure == null ? void 0 : themeStructure.colors.modes[mode].secondary,
|
|
22
|
+
fontWeight: themeStructure == null ? void 0 : themeStructure.fontWeights.normal,
|
|
23
|
+
fontSize: themeStructure == null ? void 0 : themeStructure.fontSizes.sm,
|
|
24
|
+
fontFamily: themeStructure == null ? void 0 : themeStructure.fontFamily.body
|
|
25
|
+
};
|
|
26
|
+
const customAxis = {
|
|
27
|
+
nameTextStyle: {
|
|
28
|
+
...baseText
|
|
29
|
+
},
|
|
30
|
+
axisLine: {
|
|
31
|
+
show: true,
|
|
32
|
+
lineStyle: {
|
|
33
|
+
color: themeStructure == null ? void 0 : themeStructure.colors.modes[mode].atmo3
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
axisTick: {
|
|
37
|
+
show: true,
|
|
38
|
+
lineStyle: {
|
|
39
|
+
color: themeStructure == null ? void 0 : themeStructure.colors.modes[mode].atmo3
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
axisLabel: {
|
|
43
|
+
color: themeStructure == null ? void 0 : themeStructure.colors.modes[mode].secondary_80,
|
|
44
|
+
fontWeight: themeStructure == null ? void 0 : themeStructure.fontWeights.normal,
|
|
45
|
+
fontSize: themeStructure == null ? void 0 : themeStructure.fontSizes.sm,
|
|
46
|
+
fontFamily: themeStructure == null ? void 0 : themeStructure.fontFamily.body
|
|
47
|
+
},
|
|
48
|
+
splitLine: {
|
|
49
|
+
show: true,
|
|
50
|
+
lineStyle: {
|
|
51
|
+
color: themeStructure == null ? void 0 : themeStructure.colors.modes[mode].atmo3
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
echarts.registerTheme(`${themeName}-${mode}`, {
|
|
56
|
+
color: [themeStructure == null ? void 0 : themeStructure.colors.modes[mode].cat1, themeStructure == null ? void 0 : themeStructure.colors.modes[mode].cat2, themeStructure == null ? void 0 : themeStructure.colors.modes[mode].cat3, themeStructure == null ? void 0 : themeStructure.colors.modes[mode].cat4, themeStructure == null ? void 0 : themeStructure.colors.modes[mode].cat5, themeStructure == null ? void 0 : themeStructure.colors.modes[mode].cat6],
|
|
57
|
+
legend: {
|
|
58
|
+
textStyle: {
|
|
59
|
+
...baseText
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
tooltip: {
|
|
63
|
+
borderWidth: 0,
|
|
64
|
+
padding: 0,
|
|
65
|
+
textStyle: {
|
|
66
|
+
...baseText
|
|
67
|
+
},
|
|
68
|
+
axisPointer: {
|
|
69
|
+
lineStyle: {
|
|
70
|
+
color: themeStructure == null ? void 0 : themeStructure.colors.modes[mode].secondary,
|
|
71
|
+
width: 1
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
dataZoom: {
|
|
76
|
+
textStyle: {
|
|
77
|
+
...baseText
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
categoryAxis: {
|
|
81
|
+
...customAxis
|
|
82
|
+
},
|
|
83
|
+
valueAxis: {
|
|
84
|
+
...customAxis
|
|
85
|
+
},
|
|
86
|
+
logAxis: {
|
|
87
|
+
...customAxis
|
|
88
|
+
},
|
|
89
|
+
timeAxis: {
|
|
90
|
+
...customAxis
|
|
91
|
+
},
|
|
92
|
+
line: {
|
|
93
|
+
lineStyle: {
|
|
94
|
+
width: 2
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
registerThemes(selectedTheme, colorModes, activeTheme);
|
|
102
|
+
}, [selectedTheme, colorModes, activeTheme]);
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
setTheme(`${selectedTheme}-${selectedMode}`);
|
|
105
|
+
}, [selectedMode, selectedTheme]);
|
|
106
|
+
const value = useMemo(() => ({
|
|
107
|
+
theme
|
|
108
|
+
}), [theme]);
|
|
109
|
+
return /* @__PURE__ */ jsx(HvVizContext.Provider, {
|
|
110
|
+
value,
|
|
111
|
+
children
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
export {
|
|
115
|
+
HvVizContext,
|
|
116
|
+
HvVizProvider
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=Provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Provider.js","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import { HvTheme, useTheme } from \"@hitachivantara/uikit-react-core\";\nimport * as echarts from \"echarts/core\";\nimport { createContext, useEffect, useMemo, useState } from \"react\";\n\nexport interface HvVizContextValue {\n /**\n * Current theme\n */\n theme?: string;\n}\n\nexport const HvVizContext = createContext<HvVizContextValue>({\n theme: undefined,\n});\n\nexport interface HvVizProviderProps {\n /**\n * Component tree.\n */\n children?: React.ReactNode;\n}\n\n/**\n * Enables theming capabilities for visualizations.\n *\n * Without this provider the visualizations will not comply to the UI Kit themes.\n *\n * This provider should always be used in combination with the `HvProvider` from\n * the core package since the former uses the themes provided by the latter.\n *\n * `HvVizProvider` should always be used after `HvProvider` like so to work properly:\n *\n * ```\n * <HvProvider>\n * <HvVizProvider>\n * (...)\n * </HvVizProvider>\n * </HvProvider>\n * ```\n */\nexport const HvVizProvider = ({ children }: HvVizProviderProps) => {\n const { activeTheme, colorModes, selectedMode, selectedTheme } = useTheme();\n\n const [theme, setTheme] = useState<string | undefined>();\n\n const registerThemes = (\n themeName: string,\n modes: string[],\n themeStructure?: HvTheme\n ) => {\n modes.forEach((mode) => {\n const baseText = {\n color: themeStructure?.colors.modes[mode].secondary,\n fontWeight: themeStructure?.fontWeights.normal,\n fontSize: themeStructure?.fontSizes.sm,\n fontFamily: themeStructure?.fontFamily.body,\n };\n\n const customAxis = {\n nameTextStyle: {\n ...baseText,\n },\n axisLine: {\n show: true,\n lineStyle: {\n color: themeStructure?.colors.modes[mode].atmo3,\n },\n },\n axisTick: {\n show: true,\n lineStyle: {\n color: themeStructure?.colors.modes[mode].atmo3,\n },\n },\n axisLabel: {\n color: themeStructure?.colors.modes[mode].secondary_80,\n fontWeight: themeStructure?.fontWeights.normal,\n fontSize: themeStructure?.fontSizes.sm,\n fontFamily: themeStructure?.fontFamily.body,\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: themeStructure?.colors.modes[mode].atmo3,\n },\n },\n };\n\n echarts.registerTheme(`${themeName}-${mode}`, {\n color: [\n themeStructure?.colors.modes[mode].cat1,\n themeStructure?.colors.modes[mode].cat2,\n themeStructure?.colors.modes[mode].cat3,\n themeStructure?.colors.modes[mode].cat4,\n themeStructure?.colors.modes[mode].cat5,\n themeStructure?.colors.modes[mode].cat6,\n ],\n legend: {\n textStyle: {\n ...baseText,\n },\n },\n tooltip: {\n borderWidth: 0,\n padding: 0,\n textStyle: {\n ...baseText,\n },\n axisPointer: {\n lineStyle: {\n color: themeStructure?.colors.modes[mode].secondary,\n width: 1,\n },\n },\n },\n dataZoom: {\n textStyle: { ...baseText },\n },\n categoryAxis: {\n ...customAxis,\n },\n valueAxis: {\n ...customAxis,\n },\n logAxis: {\n ...customAxis,\n },\n timeAxis: {\n ...customAxis,\n },\n line: {\n lineStyle: {\n width: 2,\n },\n },\n });\n });\n };\n\n useEffect(() => {\n registerThemes(selectedTheme, colorModes, activeTheme);\n }, [selectedTheme, colorModes, activeTheme]);\n\n useEffect(() => {\n setTheme(`${selectedTheme}-${selectedMode}`);\n }, [selectedMode, selectedTheme]);\n\n const value = useMemo<HvVizContextValue>(\n () => ({\n theme,\n }),\n [theme]\n );\n\n return (\n <HvVizContext.Provider value={value}>{children}</HvVizContext.Provider>\n );\n};\n"],"names":["HvVizContext","createContext","theme","undefined","HvVizProvider","children","activeTheme","colorModes","selectedMode","selectedTheme","useTheme","setTheme","useState","registerThemes","themeName","modes","themeStructure","forEach","mode","baseText","color","colors","secondary","fontWeight","fontWeights","normal","fontSize","fontSizes","sm","fontFamily","body","customAxis","nameTextStyle","axisLine","show","lineStyle","atmo3","axisTick","axisLabel","secondary_80","splitLine","registerTheme","cat1","cat2","cat3","cat4","cat5","cat6","legend","textStyle","tooltip","borderWidth","padding","axisPointer","width","dataZoom","categoryAxis","valueAxis","logAxis","timeAxis","line","useEffect","value","useMemo","_jsx","Provider"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAgFunc.js","sources":["../../../src/utils/getAgFunc.ts"],"sourcesContent":["import { HvChartAggregation } from \"@viz/types\";\n\nexport const getAgFunc = (func: HvChartAggregation, field: string) =>\n func === \"count\" ? \"count()\" : `${func}(d[\"${field}\"])`;\n"],"names":["getAgFunc","func","field"],"mappings":"AAEaA,MAAAA,YAAYA,CAACC,MAA0BC,UAClDD,SAAS,UAAU,YAAa,GAAEA,WAAWC;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const getAxisType = (type) => {
|
|
2
|
+
switch (type) {
|
|
3
|
+
case "categorical":
|
|
4
|
+
return "category";
|
|
5
|
+
case "time":
|
|
6
|
+
return "time";
|
|
7
|
+
case "continuous":
|
|
8
|
+
return "value";
|
|
9
|
+
default:
|
|
10
|
+
return void 0;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
getAxisType
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=getAxisType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAxisType.js","sources":["../../../src/utils/getAxisType.ts"],"sourcesContent":["import { HvChartAxisType } from \"@viz/types\";\n\nexport const getAxisType = (type?: HvChartAxisType) => {\n switch (type) {\n case \"categorical\":\n return \"category\";\n case \"time\":\n return \"time\";\n case \"continuous\":\n return \"value\";\n default:\n return undefined;\n }\n};\n"],"names":["getAxisType","type","undefined"],"mappings":"AAEaA,MAAAA,cAAcA,CAACC,SAA2B;AACrD,UAAQA,MAAI;AAAA,IACV,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT;AACSC,aAAAA;AAAAA,EACX;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLegendIcon.js","sources":["../../../src/utils/getLegendIcon.ts"],"sourcesContent":["export const getLegendIcon = (square: boolean) => {\n if (square) {\n return \"path://M0,0L16,0L16,16L0,16L0,0Z\";\n }\n\n return \"path://M0,0L16,0L16,2L0,2Z\";\n};\n"],"names":["getLegendIcon","square"],"mappings":"AAAaA,MAAAA,gBAAgBA,CAACC,WAAoB;AAChD,MAAIA,QAAQ;AACH,WAAA;AAAA,EACT;AAEO,SAAA;AACT;"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import type ColumnTable from 'arquero/dist/types/table/column-table';
|
|
2
|
+
import type { Context } from 'react';
|
|
3
|
+
import { ExtractNames } from '@hitachivantara/uikit-react-core';
|
|
4
|
+
import type { JSX as JSX_2 } from '@emotion/react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
/** Empty cell mode */
|
|
7
|
+
declare const emptyCellMode: readonly ["connect", "void"];
|
|
8
|
+
|
|
9
|
+
declare type FullMeasuresField = {
|
|
10
|
+
/** Column name. */
|
|
11
|
+
field: string;
|
|
12
|
+
/** Sampling function to use. */
|
|
13
|
+
sampling?: HvChartSampling;
|
|
14
|
+
/** Id of the yAxis. */
|
|
15
|
+
yAxis?: string;
|
|
16
|
+
/** Whether to hide the symbol for data points. Defaults to `false`. */
|
|
17
|
+
hideSymbol?: boolean;
|
|
18
|
+
/** Aggregation function to use. If no `agg` is defined, it will default to `sum`. */
|
|
19
|
+
agg?: HvChartAggregation;
|
|
20
|
+
/** Whether the area under the lines should be filled. If not specified, it defaults to the global `area` prop. */
|
|
21
|
+
area?: boolean;
|
|
22
|
+
/** Sets opacity of the filled area if `area` is true. If not specified, it defaults to the global `areaOpacity` prop. */
|
|
23
|
+
areaOpacity?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Stack name to use when the measure should be stacked.
|
|
26
|
+
*
|
|
27
|
+
* Measures stacked together have the same name.
|
|
28
|
+
*
|
|
29
|
+
* If not specified, it defaults to the global `stacked` prop.
|
|
30
|
+
*/
|
|
31
|
+
stack?: string;
|
|
32
|
+
/** Strategy to use when there are empty cells. If not specified, it defaults to the global `emptyCellMode` prop. */
|
|
33
|
+
emptyCellMode?: HvChartEmptyCellMode;
|
|
34
|
+
/** Formatter for the value in the tooltip. If not specified, it defaults to the one defined in the global `tooltip` prop. */
|
|
35
|
+
valueFormatter?: (value?: string | number) => string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
declare type FullSortByField = {
|
|
39
|
+
/** Column name. */
|
|
40
|
+
field: string;
|
|
41
|
+
/** Order function to use. If no `order` is defined, it will default to `asc`. */
|
|
42
|
+
order?: HvChartOrder;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
declare type GroupByField = string;
|
|
46
|
+
|
|
47
|
+
/** Aggregation functions */
|
|
48
|
+
export declare type HvChartAggregation = "sum" | "average" | "min" | "max" | "count";
|
|
49
|
+
|
|
50
|
+
/** Axis definition */
|
|
51
|
+
export declare interface HvChartAxis {
|
|
52
|
+
id?: string;
|
|
53
|
+
/** Type: continuous, categorical, or time data. Defaults varies per visualization type and axis orientation. */
|
|
54
|
+
type?: HvChartAxisType;
|
|
55
|
+
/** Formatter for the labels on the axis. */
|
|
56
|
+
labelFormatter?: ((value?: string | number, index?: number) => string) | string;
|
|
57
|
+
/** Rotation of the labels on the axis. Defaults to `0`. */
|
|
58
|
+
labelRotation?: number;
|
|
59
|
+
/** Name used for the axis. */
|
|
60
|
+
name?: string;
|
|
61
|
+
/** Maximum value on the axis. Set this property to `max` to use the maximum data value. */
|
|
62
|
+
maxValue?: string | number | "max" | ((obj: {
|
|
63
|
+
max: string | number;
|
|
64
|
+
min: string | number;
|
|
65
|
+
}) => string | number);
|
|
66
|
+
/** Minimum value on the axis. Set this property to `min` to use the maximum data value. */
|
|
67
|
+
minValue?: string | number | "min" | ((obj: {
|
|
68
|
+
max: string | number;
|
|
69
|
+
min: string | number;
|
|
70
|
+
}) => string | number);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Axis types:
|
|
75
|
+
* continuous: continuous data
|
|
76
|
+
* categorical: discrete/categorical data
|
|
77
|
+
* time: continuous time data
|
|
78
|
+
*/
|
|
79
|
+
export declare type HvChartAxisType = "continuous" | "categorical" | "time";
|
|
80
|
+
|
|
81
|
+
export declare type HvChartEmptyCellMode = (typeof emptyCellMode)[number];
|
|
82
|
+
|
|
83
|
+
/** Order functions */
|
|
84
|
+
export declare type HvChartOrder = "asc" | "desc";
|
|
85
|
+
|
|
86
|
+
/** Sampling functions */
|
|
87
|
+
export declare type HvChartSampling = "none" | "average" | "min" | "max" | "sum" | "lttb";
|
|
88
|
+
|
|
89
|
+
export declare type HvChartTooltipType = (typeof tooltipType)[number];
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* A line chart or line plot or line graph is a type of chart which displays information as a series of data points
|
|
93
|
+
* connected by straight line segments. It is a basic type of chart common in many fields.
|
|
94
|
+
*/
|
|
95
|
+
export declare const HvLineChart: ({ data, groupBy, splitBy, measures, sortBy, xAxis, yAxis, legend, tooltip, seriesNameFormatter, area, stack, emptyCellMode, horizontalRangeSlider, areaOpacity, classes: classesProp, grid, }: HvLineChartProps) => JSX_2.Element;
|
|
96
|
+
|
|
97
|
+
export declare type HvLineChartClasses = ExtractNames<typeof useClasses>;
|
|
98
|
+
|
|
99
|
+
export declare interface HvLineChartProps {
|
|
100
|
+
/** Chart data. */
|
|
101
|
+
data: Map<string | number, (string | number)[]> | Record<string | number, (string | number)[]> | Record<string | number, string | number>[] | ColumnTable;
|
|
102
|
+
/** Columns to use to group the data. */
|
|
103
|
+
groupBy: GroupByField | GroupByField[];
|
|
104
|
+
/** Columns to measure on the chart. */
|
|
105
|
+
measures: MeasuresField | MeasuresField[];
|
|
106
|
+
/** Columns to use to split the measures. */
|
|
107
|
+
splitBy?: SplitByField | SplitByField[];
|
|
108
|
+
/** Columns to use to sort the data points. */
|
|
109
|
+
sortBy?: SortByField | SortByField[];
|
|
110
|
+
/**
|
|
111
|
+
* Options for the xAxis, i.e. the horizontal axis.
|
|
112
|
+
*
|
|
113
|
+
* The default `type` for this axis is `categorical`.
|
|
114
|
+
* */
|
|
115
|
+
xAxis?: HvChartAxis;
|
|
116
|
+
/**
|
|
117
|
+
* Options for the yAxis, i.e. the vertical axis.
|
|
118
|
+
*
|
|
119
|
+
* The default `type` for this axis is `continuous`.
|
|
120
|
+
* */
|
|
121
|
+
yAxis?: HvChartAxis | [HvChartAxis, HvChartAxis];
|
|
122
|
+
/** Tooltip options. */
|
|
123
|
+
tooltip?: {
|
|
124
|
+
/** Whether to show the tooltip or not. Defaults to `true`. */
|
|
125
|
+
show?: boolean;
|
|
126
|
+
/** Formatter for the value in the tooltip. */
|
|
127
|
+
valueFormatter?: (value?: string | number) => string;
|
|
128
|
+
/** Tooltip type: single line or multiple lines modes. The single line mode should only be used when there's one series. Defaults to `multiple`. */
|
|
129
|
+
type?: HvChartTooltipType;
|
|
130
|
+
};
|
|
131
|
+
/** Legend options. */
|
|
132
|
+
legend?: {
|
|
133
|
+
/** Whether to show the legend or not. The legend will appear by default for multiple series. Otherwise, the legend will not be shown. */
|
|
134
|
+
show?: boolean;
|
|
135
|
+
};
|
|
136
|
+
/** Formatter for the series names used on the tooltips and legend. */
|
|
137
|
+
seriesNameFormatter?: (value?: string) => string;
|
|
138
|
+
/** Strategy to use when there are empty cells. Defaults to `void`. */
|
|
139
|
+
emptyCellMode?: HvChartEmptyCellMode;
|
|
140
|
+
/** Whether the area under the lines should be filled. Defaults to `false`. */
|
|
141
|
+
area?: boolean;
|
|
142
|
+
/** Sets opacity of the filled area if `area` is true. Defaults to `0.5`. */
|
|
143
|
+
areaOpacity?: number;
|
|
144
|
+
/** Stack name to use when all the series should be stacked together. If not provided, the series are not stacked. */
|
|
145
|
+
stack?: string;
|
|
146
|
+
/** Ranger slider options for the horizontal axis. */
|
|
147
|
+
horizontalRangeSlider?: {
|
|
148
|
+
/** Whether to show the ranger slider or not. Defaults to `false`. */
|
|
149
|
+
show?: boolean;
|
|
150
|
+
};
|
|
151
|
+
/** A Jss Object used to override or extend the styles applied to the component. */
|
|
152
|
+
classes?: Partial<HvLineChartClasses>;
|
|
153
|
+
/** Grid options. */
|
|
154
|
+
grid?: {
|
|
155
|
+
/** Distance between the grid and the top of the container. */
|
|
156
|
+
top?: string | number;
|
|
157
|
+
/** Distance between the grid and the right side of the container. */
|
|
158
|
+
right?: string | number;
|
|
159
|
+
/** Distance between the grid and the left side of the container. */
|
|
160
|
+
left?: string | number;
|
|
161
|
+
/** Distance between the grid and the bottom of the container. */
|
|
162
|
+
bottom?: string | number;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export declare const HvVizContext: Context<HvVizContextValue>;
|
|
167
|
+
|
|
168
|
+
export declare interface HvVizContextValue {
|
|
169
|
+
/**
|
|
170
|
+
* Current theme
|
|
171
|
+
*/
|
|
172
|
+
theme?: string;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Enables theming capabilities for visualizations.
|
|
177
|
+
*
|
|
178
|
+
* Without this provider the visualizations will not comply to the UI Kit themes.
|
|
179
|
+
*
|
|
180
|
+
* This provider should always be used in combination with the `HvProvider` from
|
|
181
|
+
* the core package since the former uses the themes provided by the latter.
|
|
182
|
+
*
|
|
183
|
+
* `HvVizProvider` should always be used after `HvProvider` like so to work properly:
|
|
184
|
+
*
|
|
185
|
+
* ```
|
|
186
|
+
* <HvProvider>
|
|
187
|
+
* <HvVizProvider>
|
|
188
|
+
* (...)
|
|
189
|
+
* </HvVizProvider>
|
|
190
|
+
* </HvProvider>
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
export declare const HvVizProvider: ({ children }: HvVizProviderProps) => JSX_2.Element;
|
|
194
|
+
|
|
195
|
+
export declare interface HvVizProviderProps {
|
|
196
|
+
/**
|
|
197
|
+
* Component tree.
|
|
198
|
+
*/
|
|
199
|
+
children?: React.ReactNode;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
declare type MeasuresField = string | FullMeasuresField;
|
|
203
|
+
|
|
204
|
+
declare type SortByField = string | FullSortByField;
|
|
205
|
+
|
|
206
|
+
declare type SplitByField = string;
|
|
207
|
+
|
|
208
|
+
/** Tooltip type */
|
|
209
|
+
declare const tooltipType: readonly ["single", "multiple"];
|
|
210
|
+
|
|
211
|
+
declare const useClasses: (classesProp: Partial<Record<"singleTooltipRoot" | "singleTooltipTitle" | "singleTooltipValue" | "multipleTooltipRoot" | "multipleTooltipTitleContainer" | "multipleTooltipTitle" | "multipleTooltipValuesContainer" | "multipleTooltipSeriesContainer" | "multipleTooltipSeriesNameContainer" | "multipleTooltipSeriesColor" | "multipleTooltipSeriesName" | "multipleTooltipSeriesValue", string>>) => {
|
|
212
|
+
cx: (...args: any) => string;
|
|
213
|
+
classes: {
|
|
214
|
+
singleTooltipRoot: string;
|
|
215
|
+
singleTooltipTitle: string;
|
|
216
|
+
singleTooltipValue: string;
|
|
217
|
+
multipleTooltipRoot: string;
|
|
218
|
+
multipleTooltipTitleContainer: string;
|
|
219
|
+
multipleTooltipTitle: string;
|
|
220
|
+
multipleTooltipValuesContainer: string;
|
|
221
|
+
multipleTooltipSeriesContainer: string;
|
|
222
|
+
multipleTooltipSeriesNameContainer: string;
|
|
223
|
+
multipleTooltipSeriesColor: string;
|
|
224
|
+
multipleTooltipSeriesName: string;
|
|
225
|
+
multipleTooltipSeriesValue: string;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,67 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/uikit-react-viz",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
3
|
+
"version": "5.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"author": "Hitachi Vantara UI Kit Team",
|
|
6
|
+
"description": "Contributed React visualization components for the NEXT UI Kit.",
|
|
5
7
|
"homepage": "https://github.com/lumada-design/hv-uikit-react",
|
|
6
|
-
"license": "Apache-2.0",
|
|
7
|
-
"main": "./dist/index.js",
|
|
8
|
-
"module": "./dist/legacy/index.js",
|
|
9
|
-
"types": "dist/index.d.ts",
|
|
10
8
|
"sideEffects": false,
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
9
|
+
"keywords": [
|
|
10
|
+
"hitachi-vantara",
|
|
11
|
+
"design-system",
|
|
12
|
+
"ui-kit",
|
|
13
|
+
"react",
|
|
14
|
+
"typescript"
|
|
15
|
+
],
|
|
14
16
|
"repository": {
|
|
15
17
|
"type": "git",
|
|
16
18
|
"url": "https://github.com/lumada-design/hv-uikit-react.git"
|
|
17
19
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"build:babel:node": "cross-env BABEL_ENV=commonjs npx babel --root-mode upward src -d dist --extensions '.js,.jsx' --source-maps --ignore '**/tests','**/stories' --copy-files --no-copy-ignored",
|
|
22
|
-
"build:babel:legacy": "cross-env BABEL_ENV=legacy npx babel --root-mode upward src -d dist/legacy --extensions '.js,.jsx' --source-maps --ignore '**/tests','**/stories' --copy-files --no-copy-ignored",
|
|
23
|
-
"build:babel:modern": "cross-env BABEL_ENV=modern npx babel --root-mode upward src -d dist/modern --extensions '.js,.jsx' --source-maps --ignore '**/tests','**/stories' --copy-files --no-copy-ignored",
|
|
24
|
-
"build:post:clean-snapshots": "npx rimraf **/dist/**/tests",
|
|
25
|
-
"dev": "npx npm-run-all --npm-path npm clean dev:babel:watch",
|
|
26
|
-
"dev:babel:watch": "cross-env BABEL_ENV=commonjs npx babel --root-mode upward src -d dist --extensions '.js,.jsx' --source-maps --ignore '**/tests','**/stories' --copy-files --no-copy-ignored --watch",
|
|
27
|
-
"clean": "npx rimraf dist",
|
|
28
|
-
"test": "jest --coverage",
|
|
29
|
-
"test:watch": "jest --watch",
|
|
30
|
-
"test:update": "jest --u",
|
|
31
|
-
"prepublishOnly": "npm run build",
|
|
32
|
-
"link": "npm link",
|
|
33
|
-
"yalc-publish": "npx yalc publish --no-scripts",
|
|
34
|
-
"lint:prettier": "npx prettier --config ../../prettier.config.js --check \"src/**/*.js\"",
|
|
35
|
-
"license-check": "node ../../scripts/license-check.cjs ../../config/license-check.json",
|
|
36
|
-
"ts-check": "npx tsc -p ."
|
|
20
|
+
"license": "Apache-2.0",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/lumada-design/hv-uikit-react/issues"
|
|
37
23
|
},
|
|
38
24
|
"peerDependencies": {
|
|
39
|
-
"@emotion/react": "^11.10.
|
|
40
|
-
"@emotion/styled": "^11.10.
|
|
41
|
-
"@mui/material": "^5.
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"react": "^
|
|
45
|
-
"react
|
|
25
|
+
"@emotion/react": "^11.10.5",
|
|
26
|
+
"@emotion/styled": "^11.10.5",
|
|
27
|
+
"@mui/material": "^5.12.2",
|
|
28
|
+
"arquero": "^5.2.0",
|
|
29
|
+
"echarts": "^5.4.2",
|
|
30
|
+
"echarts-for-react": "^3.0.2",
|
|
31
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
32
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
|
46
33
|
},
|
|
47
34
|
"dependencies": {
|
|
48
|
-
"@
|
|
49
|
-
"
|
|
50
|
-
"lodash": "^4.17.21",
|
|
51
|
-
"prop-types": "^15.8.1",
|
|
52
|
-
"react-plotly.js": "^2.5.1"
|
|
53
|
-
},
|
|
54
|
-
"devDependencies": {
|
|
55
|
-
"@types/lodash": "^4.14.182",
|
|
56
|
-
"@types/plotly.js": "2.12.5",
|
|
57
|
-
"@types/react": "^17.0.47",
|
|
58
|
-
"cross-env": "^7.0.3"
|
|
35
|
+
"@emotion/css": "^11.11.0",
|
|
36
|
+
"@hitachivantara/uikit-react-core": "^5.15.0"
|
|
59
37
|
},
|
|
60
38
|
"files": [
|
|
61
39
|
"dist"
|
|
62
40
|
],
|
|
63
41
|
"publishConfig": {
|
|
64
|
-
"access": "public"
|
|
42
|
+
"access": "public",
|
|
43
|
+
"directory": "package"
|
|
44
|
+
},
|
|
45
|
+
"gitHead": "10acd676130dcf2a1b89481de2de9ba072b0b746",
|
|
46
|
+
"main": "dist/cjs/index.cjs",
|
|
47
|
+
"exports": {
|
|
48
|
+
".": {
|
|
49
|
+
"require": "./dist/cjs/index.cjs",
|
|
50
|
+
"import": "./dist/esm/index.js"
|
|
51
|
+
}
|
|
65
52
|
},
|
|
66
|
-
"
|
|
53
|
+
"types": "dist/types/index.d.ts",
|
|
54
|
+
"module": "dist/esm/index.js"
|
|
67
55
|
}
|