@spaced-out/ui-design-system 0.1.93 → 0.1.94-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/lib/components/ChartWrapper/ChartWrapper.js +8 -2
- package/lib/components/ChartWrapper/ChartWrapper.js.flow +31 -15
- package/lib/components/ChartWrapper/ChartWrapper.module.css +8 -1
- package/lib/components/Charts/index.js +11 -0
- package/lib/components/Charts/index.js.flow +1 -0
- package/lib/components/ColumnChart/ColumnChart.js +2 -0
- package/lib/components/ColumnChart/ColumnChart.js.flow +9 -6
- package/lib/components/DateRangePicker/Calendar.js +7 -3
- package/lib/components/DateRangePicker/Calendar.js.flow +5 -3
- package/lib/components/DateRangePicker/DateRangePicker.js +23 -37
- package/lib/components/DateRangePicker/DateRangePicker.js.flow +53 -55
- package/lib/components/DateRangePicker/DateRangeWrapper.js +15 -10
- package/lib/components/DateRangePicker/DateRangeWrapper.js.flow +20 -16
- package/lib/components/DateRangePicker/Day.js +5 -7
- package/lib/components/DateRangePicker/Day.js.flow +4 -10
- package/lib/components/DateRangePicker/Day.module.css +7 -20
- package/lib/components/DateRangePicker/index.js.flow +1 -0
- package/lib/components/DateRangePicker/utils.js +87 -72
- package/lib/components/DateRangePicker/utils.js.flow +111 -103
- package/lib/components/DonutChart/DonutChart.js +5 -3
- package/lib/components/DonutChart/DonutChart.js.flow +6 -6
- package/lib/components/Dropdown/Dropdown.js +6 -0
- package/lib/components/Dropdown/Dropdown.js.flow +6 -0
- package/lib/components/Dropdown/SimpleDropdown.js +2 -0
- package/lib/components/Dropdown/SimpleDropdown.js.flow +4 -1
- package/lib/components/LineChart/LineChart.js +2 -0
- package/lib/components/LineChart/LineChart.js.flow +7 -4
- package/lib/components/Menu/Menu.js +48 -4
- package/lib/components/Menu/Menu.js.flow +79 -13
- package/lib/components/Menu/MenuOptionButton.js +3 -1
- package/lib/components/Menu/MenuOptionButton.js.flow +3 -0
- package/lib/components/SpiderChart/SpiderChart.js +2 -0
- package/lib/components/SpiderChart/SpiderChart.js.flow +5 -14
- package/lib/components/StickyBar/StickyBar.module.css +2 -2
- package/lib/types/charts.js.flow +47 -2
- package/lib/utils/charts/charts.js +8 -3
- package/lib/utils/charts/charts.js.flow +8 -3
- package/lib/utils/charts/donutChart.js +2 -7
- package/lib/utils/charts/donutChart.js.flow +2 -21
- package/package.json +3 -2
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// @flow strict
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
// $FlowIssue[nonstrict-import] react-window
|
|
4
|
+
import {FixedSizeList} from 'react-window';
|
|
3
5
|
|
|
4
6
|
import {classify} from '../../utils/classify';
|
|
5
7
|
import {
|
|
@@ -31,6 +33,12 @@ type OptionClassNames = $ReadOnly<{
|
|
|
31
33
|
wrapper?: string,
|
|
32
34
|
}>;
|
|
33
35
|
|
|
36
|
+
export type Virtualization = $ReadOnly<{
|
|
37
|
+
enable: boolean,
|
|
38
|
+
itemHeight?: number,
|
|
39
|
+
menuHeight?: number,
|
|
40
|
+
}>;
|
|
41
|
+
|
|
34
42
|
export type MenuOption = {
|
|
35
43
|
key: string,
|
|
36
44
|
classNames?: OptionClassNames,
|
|
@@ -68,6 +76,8 @@ export type BaseMenuProps = {
|
|
|
68
76
|
// A function that resolves the secondaryLabel for a MenuOption.
|
|
69
77
|
// It takes a MenuOption as a parameter and returns either a string or a React Node.
|
|
70
78
|
resolveSecondaryLabel?: (option: MenuOption) => string | React.Node,
|
|
79
|
+
// When virtualization is enabled, the MenuOptionButtons will be rendered only when they are present in the Menu's viewport
|
|
80
|
+
virtualization?: Virtualization,
|
|
71
81
|
};
|
|
72
82
|
|
|
73
83
|
export type MenuOptionTypes = {
|
|
@@ -95,6 +105,12 @@ export type RenderOptionProps = {
|
|
|
95
105
|
searchText?: string,
|
|
96
106
|
};
|
|
97
107
|
|
|
108
|
+
const menuSizeMedium = 276,
|
|
109
|
+
menuSizeSmall = 228;
|
|
110
|
+
|
|
111
|
+
const buttonSizeMedium = 40,
|
|
112
|
+
buttonSizeSmall = 32;
|
|
113
|
+
|
|
98
114
|
const RenderOption = ({
|
|
99
115
|
options,
|
|
100
116
|
composeOptions,
|
|
@@ -103,7 +119,15 @@ const RenderOption = ({
|
|
|
103
119
|
searchText = '',
|
|
104
120
|
...restProps
|
|
105
121
|
}: RenderOptionProps): React.Node => {
|
|
106
|
-
const {
|
|
122
|
+
const {
|
|
123
|
+
allowSearch,
|
|
124
|
+
size,
|
|
125
|
+
virtualization = {
|
|
126
|
+
enable: false,
|
|
127
|
+
menuHeight: null,
|
|
128
|
+
itemHeight: null,
|
|
129
|
+
},
|
|
130
|
+
} = restProps;
|
|
107
131
|
if (options && Array.isArray(options) && options.length) {
|
|
108
132
|
const optionsFiltered = !allowSearch
|
|
109
133
|
? options
|
|
@@ -112,6 +136,12 @@ const RenderOption = ({
|
|
|
112
136
|
? ''
|
|
113
137
|
: getFilteredOptionsResultText(optionsFiltered);
|
|
114
138
|
|
|
139
|
+
const {
|
|
140
|
+
enable: isVirtualizationEnabled,
|
|
141
|
+
menuHeight,
|
|
142
|
+
itemHeight,
|
|
143
|
+
} = virtualization;
|
|
144
|
+
|
|
115
145
|
return (
|
|
116
146
|
<>
|
|
117
147
|
{allowSearch && (
|
|
@@ -122,16 +152,44 @@ const RenderOption = ({
|
|
|
122
152
|
{resultText}
|
|
123
153
|
</FormLabelSmall>
|
|
124
154
|
)}
|
|
125
|
-
{
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
155
|
+
{virtualization && isVirtualizationEnabled ? (
|
|
156
|
+
<FixedSizeList
|
|
157
|
+
height={
|
|
158
|
+
menuHeight || (size === 'medium' ? menuSizeMedium : menuSizeSmall)
|
|
159
|
+
}
|
|
160
|
+
itemSize={
|
|
161
|
+
itemHeight ||
|
|
162
|
+
(size === 'medium' ? buttonSizeMedium : buttonSizeSmall)
|
|
163
|
+
}
|
|
164
|
+
itemCount={optionsFiltered.length}
|
|
165
|
+
>
|
|
166
|
+
{({index: idx, style}) => {
|
|
167
|
+
const buttonOption = optionsFiltered[idx];
|
|
168
|
+
return (
|
|
169
|
+
<React.Fragment key={buttonOption.key}>
|
|
170
|
+
<MenuOptionButton
|
|
171
|
+
option={buttonOption}
|
|
172
|
+
classNames={classNames}
|
|
173
|
+
style={style}
|
|
174
|
+
{...restProps}
|
|
175
|
+
isLastItem={idx === optionsFiltered.length - 1}
|
|
176
|
+
/>
|
|
177
|
+
</React.Fragment>
|
|
178
|
+
);
|
|
179
|
+
}}
|
|
180
|
+
</FixedSizeList>
|
|
181
|
+
) : (
|
|
182
|
+
optionsFiltered.map((option, idx) => (
|
|
183
|
+
<React.Fragment key={option.key}>
|
|
184
|
+
<MenuOptionButton
|
|
185
|
+
option={option}
|
|
186
|
+
classNames={classNames}
|
|
187
|
+
{...restProps}
|
|
188
|
+
isLastItem={idx === optionsFiltered.length - 1}
|
|
189
|
+
/>
|
|
190
|
+
</React.Fragment>
|
|
191
|
+
))
|
|
192
|
+
)}
|
|
135
193
|
</>
|
|
136
194
|
);
|
|
137
195
|
}
|
|
@@ -248,9 +306,14 @@ export const Menu: React$AbstractComponent<MenuProps, HTMLDivElement> =
|
|
|
248
306
|
width,
|
|
249
307
|
isFluid = true,
|
|
250
308
|
allowSearch,
|
|
309
|
+
virtualization = {
|
|
310
|
+
enable: false,
|
|
311
|
+
menuHeight: null,
|
|
312
|
+
itemHeight: null,
|
|
313
|
+
},
|
|
251
314
|
} = props;
|
|
252
315
|
const [searchText, setSearchText] = React.useState('');
|
|
253
|
-
|
|
316
|
+
const {menuHeight} = virtualization;
|
|
254
317
|
return (
|
|
255
318
|
<div
|
|
256
319
|
className={classify(
|
|
@@ -262,7 +325,10 @@ export const Menu: React$AbstractComponent<MenuProps, HTMLDivElement> =
|
|
|
262
325
|
},
|
|
263
326
|
classNames?.wrapper,
|
|
264
327
|
)}
|
|
265
|
-
style={{
|
|
328
|
+
style={{
|
|
329
|
+
width,
|
|
330
|
+
maxHeight: menuHeight ? menuHeight + 'px' : '',
|
|
331
|
+
}}
|
|
266
332
|
ref={ref}
|
|
267
333
|
>
|
|
268
334
|
{allowSearch && (
|
|
@@ -30,7 +30,8 @@ const MenuOptionButton = props => {
|
|
|
30
30
|
isLastItem,
|
|
31
31
|
onTabOut,
|
|
32
32
|
resolveLabel,
|
|
33
|
-
resolveSecondaryLabel
|
|
33
|
+
resolveSecondaryLabel,
|
|
34
|
+
style
|
|
34
35
|
} = props;
|
|
35
36
|
const {
|
|
36
37
|
key,
|
|
@@ -79,6 +80,7 @@ const MenuOptionButton = props => {
|
|
|
79
80
|
[_MenuModule.default.withIconLeft]: !!iconLeft,
|
|
80
81
|
[_MenuModule.default.withIconRight]: !!iconRight
|
|
81
82
|
}, classNames?.option, optionClassNames?.wrapper),
|
|
83
|
+
style: style,
|
|
82
84
|
disabled: menuDisabled || disabled,
|
|
83
85
|
onClick: e => onSelect && onSelect(option, e),
|
|
84
86
|
autoFocus: selectedOption?.key === key
|
|
@@ -17,6 +17,7 @@ export type MenuOptionProps = {
|
|
|
17
17
|
...BaseMenuProps,
|
|
18
18
|
option: MenuOption,
|
|
19
19
|
isLastItem?: boolean,
|
|
20
|
+
style?: mixed,
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
export const MenuOptionButton = (props: MenuOptionProps): React.Node => {
|
|
@@ -35,6 +36,7 @@ export const MenuOptionButton = (props: MenuOptionProps): React.Node => {
|
|
|
35
36
|
onTabOut,
|
|
36
37
|
resolveLabel,
|
|
37
38
|
resolveSecondaryLabel,
|
|
39
|
+
style,
|
|
38
40
|
} = props;
|
|
39
41
|
const {
|
|
40
42
|
key,
|
|
@@ -97,6 +99,7 @@ export const MenuOptionButton = (props: MenuOptionProps): React.Node => {
|
|
|
97
99
|
classNames?.option,
|
|
98
100
|
optionClassNames?.wrapper,
|
|
99
101
|
)}
|
|
102
|
+
style={style}
|
|
100
103
|
disabled={menuDisabled || disabled}
|
|
101
104
|
onClick={(e) => onSelect && onSelect(option, e)}
|
|
102
105
|
autoFocus={selectedOption?.key === key}
|
|
@@ -27,6 +27,7 @@ if (!!_highchartsMore.default && !!_highcharts.default && typeof _highchartsMore
|
|
|
27
27
|
}
|
|
28
28
|
const SpiderChart = _ref => {
|
|
29
29
|
let {
|
|
30
|
+
isLoading,
|
|
30
31
|
classNames,
|
|
31
32
|
cardTitle,
|
|
32
33
|
customExportOptions,
|
|
@@ -54,6 +55,7 @@ const SpiderChart = _ref => {
|
|
|
54
55
|
...wrapperClassNames
|
|
55
56
|
} = classNames || {};
|
|
56
57
|
return /*#__PURE__*/React.createElement(_ChartWrapper.ChartWrapper, {
|
|
58
|
+
isLoading: isLoading,
|
|
57
59
|
title: cardTitle,
|
|
58
60
|
ref: chartRef,
|
|
59
61
|
customExportOptions: customExportOptions,
|
|
@@ -8,6 +8,7 @@ import highChartsMore from 'highcharts/highcharts-more';
|
|
|
8
8
|
//$FlowFixMe[untyped-import]
|
|
9
9
|
import HighchartsReact from 'highcharts-react-official';
|
|
10
10
|
|
|
11
|
+
import type {DataOptionsType} from '../../types/charts';
|
|
11
12
|
import {
|
|
12
13
|
getDataVizColor,
|
|
13
14
|
getSpiderChartOptions,
|
|
@@ -36,32 +37,21 @@ type ClassNames = $ReadOnly<{
|
|
|
36
37
|
|
|
37
38
|
type SpiderSeriesItem = {
|
|
38
39
|
name: string,
|
|
39
|
-
data: [],
|
|
40
|
+
data: DataOptionsType[],
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
export type SpiderChartProps = {
|
|
44
|
+
isLoading?: boolean,
|
|
43
45
|
classNames?: ClassNames,
|
|
44
46
|
cardTitle?: React.Node,
|
|
45
47
|
customExportOptions?: Array<ExportOptionType> | null,
|
|
46
48
|
headerActions?: React.Node,
|
|
47
49
|
series: Array<SpiderSeriesItem>,
|
|
48
|
-
legend: {...},
|
|
49
|
-
xAxis: {
|
|
50
|
-
categories: Array<string>,
|
|
51
|
-
tickmarkPlacement: string,
|
|
52
|
-
lineWidth: number,
|
|
53
|
-
...
|
|
54
|
-
},
|
|
55
|
-
yAxis: {
|
|
56
|
-
gridLineInterpolation: 'circle' | 'polygon',
|
|
57
|
-
lineWidth: 0,
|
|
58
|
-
min: 0,
|
|
59
|
-
...
|
|
60
|
-
},
|
|
61
50
|
...
|
|
62
51
|
};
|
|
63
52
|
|
|
64
53
|
export const SpiderChart = ({
|
|
54
|
+
isLoading,
|
|
65
55
|
classNames,
|
|
66
56
|
cardTitle,
|
|
67
57
|
customExportOptions,
|
|
@@ -91,6 +81,7 @@ export const SpiderChart = ({
|
|
|
91
81
|
|
|
92
82
|
return (
|
|
93
83
|
<ChartWrapper
|
|
84
|
+
isLoading={isLoading}
|
|
94
85
|
title={cardTitle}
|
|
95
86
|
ref={chartRef}
|
|
96
87
|
customExportOptions={customExportOptions}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
@value (colorFillPrimary, colorBackgroundTertiary) from '../../styles/variables/_color.css';
|
|
2
2
|
@value (sizeFluid) from '../../styles/variables/_size.css';
|
|
3
|
-
@value (
|
|
3
|
+
@value (spaceMedium, spaceXSmall, spaceSmall) from '../../styles/variables/_space.css';
|
|
4
4
|
|
|
5
5
|
.wrapper {
|
|
6
6
|
display: flex;
|
|
7
7
|
width: sizeFluid;
|
|
8
8
|
align-items: center;
|
|
9
9
|
justify-content: space-between;
|
|
10
|
-
padding: spaceMedium
|
|
10
|
+
padding: spaceMedium spaceMedium;
|
|
11
11
|
gap: spaceXSmall;
|
|
12
12
|
background: colorBackgroundTertiary;
|
|
13
13
|
}
|
package/lib/types/charts.js.flow
CHANGED
|
@@ -25,12 +25,13 @@ export type ChartOptions = {
|
|
|
25
25
|
tooltip?: Tooltip,
|
|
26
26
|
xAxis?: AxisOptions,
|
|
27
27
|
yAxis?: AxisOptions,
|
|
28
|
+
zAxis?: AxisOptions,
|
|
28
29
|
drilldown?: Drilldown,
|
|
29
30
|
legend?: LegendOptionsType,
|
|
30
31
|
plotOptions?: PlotOptionsType,
|
|
31
32
|
series?: Array<SeriesOptionsType>,
|
|
32
33
|
subtitle?: {
|
|
33
|
-
useHTML:
|
|
34
|
+
useHTML: boolean,
|
|
34
35
|
text?: string,
|
|
35
36
|
verticalAlign: 'middle',
|
|
36
37
|
align: string,
|
|
@@ -41,6 +42,8 @@ export type ChartOptions = {
|
|
|
41
42
|
center: [string, string],
|
|
42
43
|
size: string,
|
|
43
44
|
},
|
|
45
|
+
credits?: Credits,
|
|
46
|
+
legend?: Legend,
|
|
44
47
|
...
|
|
45
48
|
};
|
|
46
49
|
|
|
@@ -103,7 +106,13 @@ export type CSSObject = {
|
|
|
103
106
|
...
|
|
104
107
|
};
|
|
105
108
|
|
|
106
|
-
export type DataOptionsType = {
|
|
109
|
+
export type DataOptionsType = {
|
|
110
|
+
y: number,
|
|
111
|
+
name: string,
|
|
112
|
+
color: string,
|
|
113
|
+
drilldown?: string,
|
|
114
|
+
...
|
|
115
|
+
};
|
|
107
116
|
|
|
108
117
|
export type SeriesOptionsType = {
|
|
109
118
|
id?: string,
|
|
@@ -150,3 +159,39 @@ export type Tooltip = {
|
|
|
150
159
|
shared?: boolean,
|
|
151
160
|
...
|
|
152
161
|
};
|
|
162
|
+
|
|
163
|
+
export type Legend = {
|
|
164
|
+
align?: 'left' | 'center' | 'right',
|
|
165
|
+
alignColumns?: boolean,
|
|
166
|
+
backgroundColor?: string,
|
|
167
|
+
borderColor?: string,
|
|
168
|
+
borderRadius?: number,
|
|
169
|
+
borderWidth?: number,
|
|
170
|
+
className?: string,
|
|
171
|
+
enabled?: boolean,
|
|
172
|
+
floating?: boolean,
|
|
173
|
+
itemDistance?: number,
|
|
174
|
+
itemMarginBottom?: number,
|
|
175
|
+
itemMarginBottom?: number,
|
|
176
|
+
itemMarginBottom?: number,
|
|
177
|
+
labelFormat?: string,
|
|
178
|
+
layout?: 'horizontal' | 'vertical' | 'proximate',
|
|
179
|
+
margin?: number,
|
|
180
|
+
maxHeight?: number,
|
|
181
|
+
padding?: number,
|
|
182
|
+
reversed?: boolean,
|
|
183
|
+
x?: number,
|
|
184
|
+
y?: number,
|
|
185
|
+
...
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export type Credits = {
|
|
189
|
+
enabled?: boolean,
|
|
190
|
+
href?: string,
|
|
191
|
+
position?: {
|
|
192
|
+
align?: 'right' | 'left',
|
|
193
|
+
verticalAlign?: 'bottom' | 'top',
|
|
194
|
+
x?: number,
|
|
195
|
+
y?: number,
|
|
196
|
+
},
|
|
197
|
+
};
|
|
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.mergeChartUserOptions = exports.getDataVizColor = exports.commonChartOptions = exports.breadcrumbStyle = exports.DATA_VIZ_COLORS = void 0;
|
|
7
|
-
var _Charts = require("../../components/Charts");
|
|
8
7
|
var _color = require("../../styles/variables/_color");
|
|
9
8
|
var _helpers = require("./helpers");
|
|
10
9
|
var _typography = require("./typography");
|
|
10
|
+
var _ChartTooltipModule = _interopRequireDefault(require("../../components/Charts/ChartTooltip.module.css"));
|
|
11
|
+
var _typographyModule = _interopRequireDefault(require("../../styles/typography.module.css"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
13
|
|
|
12
14
|
const DATA_VIZ_COLORS = [_color.colorDataViz1, _color.colorDataViz2, _color.colorDataViz3, _color.colorDataViz4, _color.colorDataViz5, _color.colorDataViz6, _color.colorDataViz7, _color.colorDataViz8];
|
|
13
15
|
exports.DATA_VIZ_COLORS = DATA_VIZ_COLORS;
|
|
@@ -45,7 +47,11 @@ const commonChartOptions = {
|
|
|
45
47
|
backgroundColor: _color.colorTooltipFill,
|
|
46
48
|
useHTML: true,
|
|
47
49
|
outside: true,
|
|
48
|
-
|
|
50
|
+
headerFormat: `<span class="${_typographyModule.default.bodySmall} ${_ChartTooltipModule.default.tooltipHeader}">{point.key}</span>`,
|
|
51
|
+
pointFormat: `<span class=${_ChartTooltipModule.default.tooltipPoint}>
|
|
52
|
+
<span style="background-color:{point.color};" class=${_ChartTooltipModule.default.indicatorCircle}></span>
|
|
53
|
+
<span class="${_ChartTooltipModule.default.tooltipContent} ${_typographyModule.default.bodyMedium}"> {series.name}: {point.y}</span>
|
|
54
|
+
</span>`
|
|
49
55
|
},
|
|
50
56
|
drilldown: {
|
|
51
57
|
breadcrumbs: {
|
|
@@ -57,7 +63,6 @@ const commonChartOptions = {
|
|
|
57
63
|
}
|
|
58
64
|
},
|
|
59
65
|
legend: {
|
|
60
|
-
useHTML: true,
|
|
61
66
|
itemStyle: {
|
|
62
67
|
..._typography.formLabelSmall,
|
|
63
68
|
paddingTop: '1px'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @flow strict
|
|
2
2
|
|
|
3
|
-
import {tooltipTheme} from '../../components/Charts';
|
|
4
3
|
import {
|
|
5
4
|
colorDataViz1,
|
|
6
5
|
colorDataViz2,
|
|
@@ -18,6 +17,9 @@ import type {ChartOptions} from '../../types/charts';
|
|
|
18
17
|
import {deepMerge} from './helpers';
|
|
19
18
|
import {formLabelSmall, subTitleExtraSmall} from './typography';
|
|
20
19
|
|
|
20
|
+
import css from '../../components/Charts/ChartTooltip.module.css';
|
|
21
|
+
import typographyCss from '../../styles/typography.module.css';
|
|
22
|
+
|
|
21
23
|
|
|
22
24
|
export const DATA_VIZ_COLORS = [
|
|
23
25
|
colorDataViz1,
|
|
@@ -64,7 +66,11 @@ export const commonChartOptions: $Shape<ChartOptions> = {
|
|
|
64
66
|
backgroundColor: colorTooltipFill,
|
|
65
67
|
useHTML: true,
|
|
66
68
|
outside: true,
|
|
67
|
-
|
|
69
|
+
headerFormat: `<span class="${typographyCss.bodySmall} ${css.tooltipHeader}">{point.key}</span>`,
|
|
70
|
+
pointFormat: `<span class=${css.tooltipPoint}>
|
|
71
|
+
<span style="background-color:{point.color};" class=${css.indicatorCircle}></span>
|
|
72
|
+
<span class="${css.tooltipContent} ${typographyCss.bodyMedium}"> {series.name}: {point.y}</span>
|
|
73
|
+
</span>`,
|
|
68
74
|
},
|
|
69
75
|
drilldown: {
|
|
70
76
|
breadcrumbs: {
|
|
@@ -76,7 +82,6 @@ export const commonChartOptions: $Shape<ChartOptions> = {
|
|
|
76
82
|
},
|
|
77
83
|
},
|
|
78
84
|
legend: {
|
|
79
|
-
useHTML: true,
|
|
80
85
|
itemStyle: {...formLabelSmall, paddingTop: '1px'},
|
|
81
86
|
symbolHeight: 8,
|
|
82
87
|
enabled: true,
|
|
@@ -26,21 +26,16 @@ const rightLegendColumn = {
|
|
|
26
26
|
// take it as 10% of width as left margin
|
|
27
27
|
width: `${LEGEND_WIDTH * 90}%`
|
|
28
28
|
};
|
|
29
|
-
exports.rightLegendColumn = rightLegendColumn;
|
|
30
|
-
const commonLegendOption = _charts.commonChartOptions.legend;
|
|
31
29
|
|
|
32
30
|
/**
|
|
33
31
|
* This function modifies the the common chart behavior to donut chart default behavior.
|
|
34
32
|
* It will not take userPassed option into account.
|
|
35
33
|
*/
|
|
36
|
-
|
|
34
|
+
exports.rightLegendColumn = rightLegendColumn;
|
|
37
35
|
const getDonutChartOptions = _ref => {
|
|
38
36
|
let {
|
|
39
37
|
legend,
|
|
40
|
-
defaultCenterHTML
|
|
41
|
-
subtitleSize,
|
|
42
|
-
centerTextX,
|
|
43
|
-
tooltip
|
|
38
|
+
defaultCenterHTML
|
|
44
39
|
} = _ref;
|
|
45
40
|
const legendOption = (0, _helpers.deepMerge)(_charts.commonChartOptions.legend, legend);
|
|
46
41
|
const isLegendEnabled = legendOption.enabled;
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
// @flow strict
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
ChartOptions,
|
|
5
|
-
LegendOptionsType,
|
|
6
|
-
Tooltip,
|
|
7
|
-
} from '../../types/charts';
|
|
3
|
+
import type {ChartOptions, LegendOptionsType} from '../../types/charts';
|
|
8
4
|
|
|
9
5
|
import {commonChartOptions} from './charts';
|
|
10
6
|
import {deepMerge} from './helpers';
|
|
11
7
|
|
|
12
8
|
|
|
13
|
-
type DonutChartDataType = {
|
|
14
|
-
name?: string,
|
|
15
|
-
color?: string,
|
|
16
|
-
y?: number,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
9
|
type DonutChartPropsType = {
|
|
20
10
|
legend?: LegendOptionsType,
|
|
21
11
|
defaultCenterHTML?: string,
|
|
22
|
-
subtitleSize?: string,
|
|
23
|
-
centerTextX?: number,
|
|
24
|
-
tooltip?: Tooltip,
|
|
25
12
|
};
|
|
26
13
|
|
|
27
14
|
/**
|
|
@@ -44,8 +31,6 @@ export const rightLegendColumn = {
|
|
|
44
31
|
width: `${LEGEND_WIDTH * 90}%`,
|
|
45
32
|
};
|
|
46
33
|
|
|
47
|
-
const commonLegendOption = commonChartOptions.legend;
|
|
48
|
-
|
|
49
34
|
/**
|
|
50
35
|
* This function modifies the the common chart behavior to donut chart default behavior.
|
|
51
36
|
* It will not take userPassed option into account.
|
|
@@ -54,11 +39,7 @@ const commonLegendOption = commonChartOptions.legend;
|
|
|
54
39
|
export const getDonutChartOptions = ({
|
|
55
40
|
legend,
|
|
56
41
|
defaultCenterHTML,
|
|
57
|
-
|
|
58
|
-
centerTextX,
|
|
59
|
-
tooltip,
|
|
60
|
-
}: //$FlowFixMe[prop-missing]
|
|
61
|
-
DonutChartPropsType): ChartOptions => {
|
|
42
|
+
}: DonutChartPropsType): ChartOptions => {
|
|
62
43
|
const legendOption = deepMerge(commonChartOptions.legend, legend);
|
|
63
44
|
const isLegendEnabled = legendOption.enabled;
|
|
64
45
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spaced-out/ui-design-system",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.94-beta.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "Sense UI components library",
|
|
6
6
|
"author": {
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"highcharts-react-official": "^3.2.1",
|
|
51
51
|
"lodash": "^4.17.21",
|
|
52
52
|
"moment-timezone": "^0.5.45",
|
|
53
|
-
"react-dropzone": "^14.2.3"
|
|
53
|
+
"react-dropzone": "^14.2.3",
|
|
54
|
+
"react-window": "^1.8.10"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@babel/cli": "^7.18.10",
|