@hitachivantara/uikit-react-viz 5.1.1 → 5.2.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/components/BarChart/BarChart.cjs +16 -0
- package/dist/cjs/components/BarChart/BarChart.cjs.map +1 -0
- package/dist/cjs/components/BaseChart/BaseChart.cjs +423 -0
- package/dist/cjs/components/BaseChart/BaseChart.cjs.map +1 -0
- package/dist/cjs/components/{LineChart/LineChart.styles.cjs → BaseChart/BaseChart.styles.cjs} +2 -2
- package/dist/cjs/components/{LineChart/LineChart.styles.cjs.map → BaseChart/BaseChart.styles.cjs.map} +1 -1
- package/dist/cjs/components/LineChart/LineChart.cjs +8 -386
- package/dist/cjs/components/LineChart/LineChart.cjs.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/providers/Provider.cjs +2 -103
- package/dist/cjs/providers/Provider.cjs.map +1 -1
- package/dist/cjs/utils/registerThemes.cjs +106 -0
- package/dist/cjs/utils/registerThemes.cjs.map +1 -0
- package/dist/esm/components/BarChart/BarChart.js +16 -0
- package/dist/esm/components/BarChart/BarChart.js.map +1 -0
- package/dist/esm/components/BaseChart/BaseChart.js +402 -0
- package/dist/esm/components/BaseChart/BaseChart.js.map +1 -0
- package/dist/esm/components/{LineChart/LineChart.styles.js → BaseChart/BaseChart.styles.js} +2 -2
- package/dist/esm/components/{LineChart/LineChart.styles.js.map → BaseChart/BaseChart.styles.js.map} +1 -1
- package/dist/esm/components/LineChart/LineChart.js +8 -365
- package/dist/esm/components/LineChart/LineChart.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/providers/Provider.js +1 -83
- package/dist/esm/providers/Provider.js.map +1 -1
- package/dist/esm/utils/registerThemes.js +87 -0
- package/dist/esm/utils/registerThemes.js.map +1 -0
- package/dist/types/index.d.ts +126 -79
- package/package.json +3 -3
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as echarts from "echarts/core";
|
|
2
|
+
const registerThemes = (themeName, modes, themeStructure) => {
|
|
3
|
+
modes.forEach((mode) => {
|
|
4
|
+
const baseText = {
|
|
5
|
+
color: themeStructure == null ? void 0 : themeStructure.colors.modes[mode].secondary,
|
|
6
|
+
fontWeight: themeStructure == null ? void 0 : themeStructure.fontWeights.normal,
|
|
7
|
+
fontSize: themeStructure == null ? void 0 : themeStructure.fontSizes.sm,
|
|
8
|
+
fontFamily: themeStructure == null ? void 0 : themeStructure.fontFamily.body
|
|
9
|
+
};
|
|
10
|
+
const customAxis = {
|
|
11
|
+
nameTextStyle: {
|
|
12
|
+
...baseText
|
|
13
|
+
},
|
|
14
|
+
axisLine: {
|
|
15
|
+
show: true,
|
|
16
|
+
lineStyle: {
|
|
17
|
+
color: themeStructure == null ? void 0 : themeStructure.colors.modes[mode].atmo3
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
axisTick: {
|
|
21
|
+
show: true,
|
|
22
|
+
lineStyle: {
|
|
23
|
+
color: themeStructure == null ? void 0 : themeStructure.colors.modes[mode].atmo3
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
axisLabel: {
|
|
27
|
+
color: themeStructure == null ? void 0 : themeStructure.colors.modes[mode].secondary_80,
|
|
28
|
+
fontWeight: themeStructure == null ? void 0 : themeStructure.fontWeights.normal,
|
|
29
|
+
fontSize: themeStructure == null ? void 0 : themeStructure.fontSizes.sm,
|
|
30
|
+
fontFamily: themeStructure == null ? void 0 : themeStructure.fontFamily.body
|
|
31
|
+
},
|
|
32
|
+
splitLine: {
|
|
33
|
+
show: true,
|
|
34
|
+
lineStyle: {
|
|
35
|
+
color: themeStructure == null ? void 0 : themeStructure.colors.modes[mode].atmo3
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
echarts.registerTheme(`${themeName}-${mode}`, {
|
|
40
|
+
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],
|
|
41
|
+
legend: {
|
|
42
|
+
textStyle: {
|
|
43
|
+
...baseText
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
tooltip: {
|
|
47
|
+
borderWidth: 0,
|
|
48
|
+
padding: 0,
|
|
49
|
+
textStyle: {
|
|
50
|
+
...baseText
|
|
51
|
+
},
|
|
52
|
+
axisPointer: {
|
|
53
|
+
lineStyle: {
|
|
54
|
+
color: themeStructure == null ? void 0 : themeStructure.colors.modes[mode].secondary,
|
|
55
|
+
width: 1
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
dataZoom: {
|
|
60
|
+
textStyle: {
|
|
61
|
+
...baseText
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
categoryAxis: {
|
|
65
|
+
...customAxis
|
|
66
|
+
},
|
|
67
|
+
valueAxis: {
|
|
68
|
+
...customAxis
|
|
69
|
+
},
|
|
70
|
+
logAxis: {
|
|
71
|
+
...customAxis
|
|
72
|
+
},
|
|
73
|
+
timeAxis: {
|
|
74
|
+
...customAxis
|
|
75
|
+
},
|
|
76
|
+
line: {
|
|
77
|
+
lineStyle: {
|
|
78
|
+
width: 2
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
registerThemes
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=registerThemes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerThemes.js","sources":["../../../src/utils/registerThemes.ts"],"sourcesContent":["import { HvTheme } from \"@hitachivantara/uikit-react-core\";\nimport * as echarts from \"echarts/core\";\n\nexport 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"],"names":["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"],"mappings":";AAGO,MAAMA,iBAAiBA,CAC5BC,WACAC,OACAC,mBACG;AACHD,QAAME,QAASC,CAAS,SAAA;AACtB,UAAMC,WAAW;AAAA,MACfC,OAAOJ,iDAAgBK,OAAON,MAAMG,MAAMI;AAAAA,MAC1CC,YAAYP,iDAAgBQ,YAAYC;AAAAA,MACxCC,UAAUV,iDAAgBW,UAAUC;AAAAA,MACpCC,YAAYb,iDAAgBa,WAAWC;AAAAA,IAAAA;AAGzC,UAAMC,aAAa;AAAA,MACjBC,eAAe;AAAA,QACb,GAAGb;AAAAA,MACL;AAAA,MACAc,UAAU;AAAA,QACRC,MAAM;AAAA,QACNC,WAAW;AAAA,UACTf,OAAOJ,iDAAgBK,OAAON,MAAMG,MAAMkB;AAAAA,QAC5C;AAAA,MACF;AAAA,MACAC,UAAU;AAAA,QACRH,MAAM;AAAA,QACNC,WAAW;AAAA,UACTf,OAAOJ,iDAAgBK,OAAON,MAAMG,MAAMkB;AAAAA,QAC5C;AAAA,MACF;AAAA,MACAE,WAAW;AAAA,QACTlB,OAAOJ,iDAAgBK,OAAON,MAAMG,MAAMqB;AAAAA,QAC1ChB,YAAYP,iDAAgBQ,YAAYC;AAAAA,QACxCC,UAAUV,iDAAgBW,UAAUC;AAAAA,QACpCC,YAAYb,iDAAgBa,WAAWC;AAAAA,MACzC;AAAA,MACAU,WAAW;AAAA,QACTN,MAAM;AAAA,QACNC,WAAW;AAAA,UACTf,OAAOJ,iDAAgBK,OAAON,MAAMG,MAAMkB;AAAAA,QAC5C;AAAA,MACF;AAAA,IAAA;AAGMK,YAAAA,cAAe,GAAE3B,aAAaI,QAAQ;AAAA,MAC5CE,OAAO,CACLJ,iDAAgBK,OAAON,MAAMG,MAAMwB,MACnC1B,iDAAgBK,OAAON,MAAMG,MAAMyB,MACnC3B,iDAAgBK,OAAON,MAAMG,MAAM0B,MACnC5B,iDAAgBK,OAAON,MAAMG,MAAM2B,MACnC7B,iDAAgBK,OAAON,MAAMG,MAAM4B,MACnC9B,iDAAgBK,OAAON,MAAMG,MAAM6B,IAAI;AAAA,MAEzCC,QAAQ;AAAA,QACNC,WAAW;AAAA,UACT,GAAG9B;AAAAA,QACL;AAAA,MACF;AAAA,MACA+B,SAAS;AAAA,QACPC,aAAa;AAAA,QACbC,SAAS;AAAA,QACTH,WAAW;AAAA,UACT,GAAG9B;AAAAA,QACL;AAAA,QACAkC,aAAa;AAAA,UACXlB,WAAW;AAAA,YACTf,OAAOJ,iDAAgBK,OAAON,MAAMG,MAAMI;AAAAA,YAC1CgC,OAAO;AAAA,UACT;AAAA,QACF;AAAA,MACF;AAAA,MACAC,UAAU;AAAA,QACRN,WAAW;AAAA,UAAE,GAAG9B;AAAAA,QAAS;AAAA,MAC3B;AAAA,MACAqC,cAAc;AAAA,QACZ,GAAGzB;AAAAA,MACL;AAAA,MACA0B,WAAW;AAAA,QACT,GAAG1B;AAAAA,MACL;AAAA,MACA2B,SAAS;AAAA,QACP,GAAG3B;AAAAA,MACL;AAAA,MACA4B,UAAU;AAAA,QACR,GAAG5B;AAAAA,MACL;AAAA,MACA6B,MAAM;AAAA,QACJzB,WAAW;AAAA,UACTmB,OAAO;AAAA,QACT;AAAA,MACF;AAAA,IAAA,CACD;AAAA,EAAA,CACF;AACH;"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,27 +1,21 @@
|
|
|
1
|
+
import { Arrayable } from '@hitachivantara/uikit-react-core';
|
|
1
2
|
import type ColumnTable from 'arquero/dist/types/table/column-table';
|
|
2
3
|
import type { Context } from 'react';
|
|
3
4
|
import type { CSSInterpolation } from '@emotion/serialize';
|
|
4
5
|
import { ExtractNames } from '@hitachivantara/uikit-react-core';
|
|
5
6
|
import type { JSX as JSX_2 } from '@emotion/react/jsx-runtime';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
declare const emptyCellMode: readonly ["connect", "void"];
|
|
8
|
+
declare type BarMeasuresField = string | BaseFullMeasuresField;
|
|
9
9
|
|
|
10
|
-
declare
|
|
10
|
+
declare interface BaseFullMeasuresField {
|
|
11
11
|
/** Column name. */
|
|
12
12
|
field: string;
|
|
13
13
|
/** Sampling function to use. */
|
|
14
14
|
sampling?: HvChartSampling;
|
|
15
15
|
/** Id of the yAxis. */
|
|
16
16
|
yAxis?: string;
|
|
17
|
-
/** Whether to hide the symbol for data points. Defaults to `false`. */
|
|
18
|
-
hideSymbol?: boolean;
|
|
19
17
|
/** Aggregation function to use. If no `agg` is defined, it will default to `sum`. */
|
|
20
18
|
agg?: HvChartAggregation;
|
|
21
|
-
/** Whether the area under the lines should be filled. If not specified, it defaults to the global `area` prop. */
|
|
22
|
-
area?: boolean;
|
|
23
|
-
/** Sets opacity of the filled area if `area` is true. If not specified, it defaults to the global `areaOpacity` prop. */
|
|
24
|
-
areaOpacity?: number;
|
|
25
19
|
/**
|
|
26
20
|
* Stack name to use when the measure should be stacked.
|
|
27
21
|
*
|
|
@@ -31,10 +25,11 @@ declare type FullMeasuresField = {
|
|
|
31
25
|
*/
|
|
32
26
|
stack?: string;
|
|
33
27
|
/** Strategy to use when there are empty cells. If not specified, it defaults to the global `emptyCellMode` prop. */
|
|
34
|
-
emptyCellMode?: HvChartEmptyCellMode;
|
|
35
|
-
/** Formatter for the value in the tooltip. If not specified, it defaults to the one defined in the global `tooltip` prop. */
|
|
36
28
|
valueFormatter?: (value?: string | number) => string;
|
|
37
|
-
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Empty cell mode */
|
|
32
|
+
declare const emptyCellMode: readonly ["connect", "void"];
|
|
38
33
|
|
|
39
34
|
declare type FullSortByField = {
|
|
40
35
|
/** Column name. */
|
|
@@ -45,6 +40,75 @@ declare type FullSortByField = {
|
|
|
45
40
|
|
|
46
41
|
declare type GroupByField = string;
|
|
47
42
|
|
|
43
|
+
/**
|
|
44
|
+
* A bar chart is a chart or graph that presents categorical data with rectangular bars.
|
|
45
|
+
*/
|
|
46
|
+
export declare const HvBarChart: ({ horizontal, ...others }: HvBarChartProps) => JSX_2.Element;
|
|
47
|
+
|
|
48
|
+
export declare interface HvBarChartClasses extends HvBaseChartClasses {
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export declare interface HvBarChartProps extends HvBaseChartCommonProps, HvBaseChartBarProps {
|
|
52
|
+
/** A Jss Object used to override or extend the styles applied to the component. */
|
|
53
|
+
classes?: HvBarChartClasses;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Bar chart props only */
|
|
57
|
+
declare interface HvBaseChartBarProps {
|
|
58
|
+
/** Columns to measure on the chart. */
|
|
59
|
+
measures: Arrayable<BarMeasuresField>;
|
|
60
|
+
/** Whether the bar chart should be horizontal. Defaults to `false`. */
|
|
61
|
+
horizontal?: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare type HvBaseChartClasses = Partial<ExtractNames<typeof useClasses>>;
|
|
65
|
+
|
|
66
|
+
/** Line and bar chart common props */
|
|
67
|
+
declare interface HvBaseChartCommonProps {
|
|
68
|
+
/** Chart data. */
|
|
69
|
+
data: Map<string | number, (string | number)[]> | Record<string | number, (string | number)[]> | Record<string | number, string | number>[] | ColumnTable;
|
|
70
|
+
/** Columns to use to group the data. */
|
|
71
|
+
groupBy: Arrayable<GroupByField>;
|
|
72
|
+
/** Columns to use to split the measures. */
|
|
73
|
+
splitBy?: Arrayable<SplitByField>;
|
|
74
|
+
/** Columns to use to sort the data points. */
|
|
75
|
+
sortBy?: Arrayable<SortByField>;
|
|
76
|
+
/** Options for the xAxis, i.e. the horizontal axis. */
|
|
77
|
+
xAxis?: HvChartAxis;
|
|
78
|
+
/** Options for the yAxis, i.e. the vertical axis. */
|
|
79
|
+
yAxis?: HvChartAxis | [HvChartAxis, HvChartAxis];
|
|
80
|
+
/** Tooltip options. */
|
|
81
|
+
tooltip?: HvChartTooltip;
|
|
82
|
+
/** Legend options. */
|
|
83
|
+
legend?: {
|
|
84
|
+
/** Whether to show the legend or not. The legend will appear by default for multiple series. Otherwise, the legend will not be shown. */
|
|
85
|
+
show?: boolean;
|
|
86
|
+
};
|
|
87
|
+
/** Formatter for the series names used on the tooltips and legend. */
|
|
88
|
+
seriesNameFormatter?: (value?: string) => string;
|
|
89
|
+
/** Stack name to use when all the series should be stacked together. If not provided, the series are not stacked. */
|
|
90
|
+
stack?: string;
|
|
91
|
+
/** Ranger slider options for the horizontal axis. */
|
|
92
|
+
horizontalRangeSlider?: {
|
|
93
|
+
/** Whether to show the ranger slider or not. Defaults to `false`. */
|
|
94
|
+
show?: boolean;
|
|
95
|
+
};
|
|
96
|
+
/** Grid options. */
|
|
97
|
+
grid?: HvChartGrid;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Line chart props only */
|
|
101
|
+
declare interface HvBaseChartLineProps {
|
|
102
|
+
/** Columns to measure on the chart. */
|
|
103
|
+
measures: Arrayable<LineMeasuresField>;
|
|
104
|
+
/** Strategy to use when there are empty cells. Defaults to `void`. */
|
|
105
|
+
emptyCellMode?: HvChartEmptyCellMode;
|
|
106
|
+
/** Whether the area under the lines should be filled. Defaults to `false`. */
|
|
107
|
+
area?: boolean;
|
|
108
|
+
/** Sets opacity of the filled area if `area` is true. Defaults to `0.5`. */
|
|
109
|
+
areaOpacity?: number;
|
|
110
|
+
}
|
|
111
|
+
|
|
48
112
|
/** Aggregation functions */
|
|
49
113
|
export declare type HvChartAggregation = "sum" | "average" | "min" | "max" | "count";
|
|
50
114
|
|
|
@@ -81,87 +145,59 @@ export declare type HvChartAxisType = "continuous" | "categorical" | "time";
|
|
|
81
145
|
|
|
82
146
|
export declare type HvChartEmptyCellMode = (typeof emptyCellMode)[number];
|
|
83
147
|
|
|
148
|
+
export declare interface HvChartGrid {
|
|
149
|
+
/** Distance between the grid and the top of the container. */
|
|
150
|
+
top?: string | number;
|
|
151
|
+
/** Distance between the grid and the right side of the container. */
|
|
152
|
+
right?: string | number;
|
|
153
|
+
/** Distance between the grid and the left side of the container. */
|
|
154
|
+
left?: string | number;
|
|
155
|
+
/** Distance between the grid and the bottom of the container. */
|
|
156
|
+
bottom?: string | number;
|
|
157
|
+
}
|
|
158
|
+
|
|
84
159
|
/** Order functions */
|
|
85
160
|
export declare type HvChartOrder = "asc" | "desc";
|
|
86
161
|
|
|
87
162
|
/** Sampling functions */
|
|
88
163
|
export declare type HvChartSampling = "none" | "average" | "min" | "max" | "sum" | "lttb";
|
|
89
164
|
|
|
165
|
+
export declare interface HvChartTooltip {
|
|
166
|
+
/** Whether to show the tooltip or not. Defaults to `true`. */
|
|
167
|
+
show?: boolean;
|
|
168
|
+
/** Tooltip type: single line or multiple lines modes. The single line mode should only be used when there's one series. Defaults to `multiple`. */
|
|
169
|
+
type?: HvChartTooltipType;
|
|
170
|
+
/** Formatter for the value in the tooltip. */
|
|
171
|
+
valueFormatter?: (value?: string | number) => string;
|
|
172
|
+
/** Formatter for the title in the tooltip. */
|
|
173
|
+
titleFormatter?: (value?: string | number) => string;
|
|
174
|
+
/** Custom tooltip. */
|
|
175
|
+
component?: string | ((params?: HvChartTooltipParams) => string | HTMLElement | HTMLElement[]);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export declare interface HvChartTooltipParams {
|
|
179
|
+
title?: string | number;
|
|
180
|
+
series?: {
|
|
181
|
+
name?: string;
|
|
182
|
+
value?: string | number;
|
|
183
|
+
color?: string;
|
|
184
|
+
}[];
|
|
185
|
+
}
|
|
186
|
+
|
|
90
187
|
export declare type HvChartTooltipType = (typeof tooltipType)[number];
|
|
91
188
|
|
|
92
189
|
/**
|
|
93
190
|
* A line chart or line plot or line graph is a type of chart which displays information as a series of data points
|
|
94
191
|
* connected by straight line segments. It is a basic type of chart common in many fields.
|
|
95
192
|
*/
|
|
96
|
-
export declare const HvLineChart: ({
|
|
193
|
+
export declare const HvLineChart: ({ area, emptyCellMode, areaOpacity, ...others }: HvLineChartProps) => JSX_2.Element;
|
|
97
194
|
|
|
98
|
-
export declare
|
|
195
|
+
export declare interface HvLineChartClasses extends HvBaseChartClasses {
|
|
196
|
+
}
|
|
99
197
|
|
|
100
|
-
export declare interface HvLineChartProps {
|
|
101
|
-
/** Chart data. */
|
|
102
|
-
data: Map<string | number, (string | number)[]> | Record<string | number, (string | number)[]> | Record<string | number, string | number>[] | ColumnTable;
|
|
103
|
-
/** Columns to use to group the data. */
|
|
104
|
-
groupBy: GroupByField | GroupByField[];
|
|
105
|
-
/** Columns to measure on the chart. */
|
|
106
|
-
measures: MeasuresField | MeasuresField[];
|
|
107
|
-
/** Columns to use to split the measures. */
|
|
108
|
-
splitBy?: SplitByField | SplitByField[];
|
|
109
|
-
/** Columns to use to sort the data points. */
|
|
110
|
-
sortBy?: SortByField | SortByField[];
|
|
111
|
-
/**
|
|
112
|
-
* Options for the xAxis, i.e. the horizontal axis.
|
|
113
|
-
*
|
|
114
|
-
* The default `type` for this axis is `categorical`.
|
|
115
|
-
* */
|
|
116
|
-
xAxis?: HvChartAxis;
|
|
117
|
-
/**
|
|
118
|
-
* Options for the yAxis, i.e. the vertical axis.
|
|
119
|
-
*
|
|
120
|
-
* The default `type` for this axis is `continuous`.
|
|
121
|
-
* */
|
|
122
|
-
yAxis?: HvChartAxis | [HvChartAxis, HvChartAxis];
|
|
123
|
-
/** Tooltip options. */
|
|
124
|
-
tooltip?: {
|
|
125
|
-
/** Whether to show the tooltip or not. Defaults to `true`. */
|
|
126
|
-
show?: boolean;
|
|
127
|
-
/** Formatter for the value in the tooltip. */
|
|
128
|
-
valueFormatter?: (value?: string | number) => string;
|
|
129
|
-
/** Tooltip type: single line or multiple lines modes. The single line mode should only be used when there's one series. Defaults to `multiple`. */
|
|
130
|
-
type?: HvChartTooltipType;
|
|
131
|
-
};
|
|
132
|
-
/** Legend options. */
|
|
133
|
-
legend?: {
|
|
134
|
-
/** Whether to show the legend or not. The legend will appear by default for multiple series. Otherwise, the legend will not be shown. */
|
|
135
|
-
show?: boolean;
|
|
136
|
-
};
|
|
137
|
-
/** Formatter for the series names used on the tooltips and legend. */
|
|
138
|
-
seriesNameFormatter?: (value?: string) => string;
|
|
139
|
-
/** Strategy to use when there are empty cells. Defaults to `void`. */
|
|
140
|
-
emptyCellMode?: HvChartEmptyCellMode;
|
|
141
|
-
/** Whether the area under the lines should be filled. Defaults to `false`. */
|
|
142
|
-
area?: boolean;
|
|
143
|
-
/** Sets opacity of the filled area if `area` is true. Defaults to `0.5`. */
|
|
144
|
-
areaOpacity?: number;
|
|
145
|
-
/** Stack name to use when all the series should be stacked together. If not provided, the series are not stacked. */
|
|
146
|
-
stack?: string;
|
|
147
|
-
/** Ranger slider options for the horizontal axis. */
|
|
148
|
-
horizontalRangeSlider?: {
|
|
149
|
-
/** Whether to show the ranger slider or not. Defaults to `false`. */
|
|
150
|
-
show?: boolean;
|
|
151
|
-
};
|
|
198
|
+
export declare interface HvLineChartProps extends HvBaseChartCommonProps, HvBaseChartLineProps {
|
|
152
199
|
/** A Jss Object used to override or extend the styles applied to the component. */
|
|
153
|
-
classes?:
|
|
154
|
-
/** Grid options. */
|
|
155
|
-
grid?: {
|
|
156
|
-
/** Distance between the grid and the top of the container. */
|
|
157
|
-
top?: string | number;
|
|
158
|
-
/** Distance between the grid and the right side of the container. */
|
|
159
|
-
right?: string | number;
|
|
160
|
-
/** Distance between the grid and the left side of the container. */
|
|
161
|
-
left?: string | number;
|
|
162
|
-
/** Distance between the grid and the bottom of the container. */
|
|
163
|
-
bottom?: string | number;
|
|
164
|
-
};
|
|
200
|
+
classes?: HvLineChartClasses;
|
|
165
201
|
}
|
|
166
202
|
|
|
167
203
|
export declare const HvVizContext: Context<HvVizContextValue>;
|
|
@@ -200,7 +236,18 @@ export declare interface HvVizProviderProps {
|
|
|
200
236
|
children?: React.ReactNode;
|
|
201
237
|
}
|
|
202
238
|
|
|
203
|
-
declare
|
|
239
|
+
declare interface LineFullMeasuresField extends BaseFullMeasuresField {
|
|
240
|
+
/** Whether to hide the symbol for data points. Defaults to `false`. */
|
|
241
|
+
hideSymbol?: boolean;
|
|
242
|
+
/** Whether the area under the lines should be filled. If not specified, it defaults to the global `area` prop. */
|
|
243
|
+
area?: boolean;
|
|
244
|
+
/** Sets opacity of the filled area if `area` is true. If not specified, it defaults to the global `areaOpacity` prop. */
|
|
245
|
+
areaOpacity?: number;
|
|
246
|
+
/** Strategy to use when there are empty cells. If not specified, it defaults to the global `emptyCellMode` prop. */
|
|
247
|
+
emptyCellMode?: HvChartEmptyCellMode;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
declare type LineMeasuresField = string | LineFullMeasuresField;
|
|
204
251
|
|
|
205
252
|
declare type SortByField = string | FullSortByField;
|
|
206
253
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/uikit-react-viz",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Hitachi Vantara UI Kit Team",
|
|
6
6
|
"description": "Contributed React visualization components for the NEXT UI Kit.",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@emotion/css": "^11.11.0",
|
|
36
|
-
"@hitachivantara/uikit-react-core": "^5.
|
|
36
|
+
"@hitachivantara/uikit-react-core": "^5.17.0"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"dist"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"access": "public",
|
|
43
43
|
"directory": "package"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "bccee7d5747d83da4ba75b5a83fdd780383e10ed",
|
|
46
46
|
"main": "dist/cjs/index.cjs",
|
|
47
47
|
"exports": {
|
|
48
48
|
".": {
|