@spaced-out/ui-design-system 0.1.86 → 0.1.87-beta.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/.cspell/custom-words.txt +5 -1
- package/.storybook/preview-head.html +4 -0
- package/CHANGELOG.md +7 -0
- package/design-tokens/color/app-color.json +26 -0
- package/design-tokens/font/base-font.json +1 -1
- package/design-tokens/size/base-size.json +12 -0
- package/lib/components/ChartWrapper/ChartWrapper.js +124 -0
- package/lib/components/ChartWrapper/ChartWrapper.js.flow +156 -0
- package/lib/components/ChartWrapper/ChartWrapper.module.css +19 -0
- package/lib/components/ChartWrapper/index.js +16 -0
- package/lib/components/ChartWrapper/index.js.flow +3 -0
- package/lib/components/Charts/ChartTooltip.js +18 -0
- package/lib/components/Charts/ChartTooltip.js.flow +15 -0
- package/lib/components/Charts/ChartTooltip.module.css +36 -0
- package/lib/components/Charts/index.js +71 -0
- package/lib/components/Charts/index.js.flow +8 -0
- package/lib/components/ColumnChart/ColumnChart.js +79 -0
- package/lib/components/ColumnChart/ColumnChart.js.flow +108 -0
- package/lib/components/ColumnChart/ColumnChart.module.css +12 -0
- package/lib/components/ColumnChart/index.js +16 -0
- package/lib/components/ColumnChart/index.js.flow +3 -0
- package/lib/components/DonutChart/DonutChart.js +94 -0
- package/lib/components/DonutChart/DonutChart.js.flow +146 -0
- package/lib/components/DonutChart/DonutChart.module.css +65 -0
- package/lib/components/DonutChart/index.js +16 -0
- package/lib/components/DonutChart/index.js.flow +3 -0
- package/lib/components/Icon/index.js +31 -25
- package/lib/components/Icon/index.js.flow +3 -6
- package/lib/components/LineChart/LineChart.js +64 -0
- package/lib/components/LineChart/LineChart.js.flow +85 -0
- package/lib/components/LineChart/LineChart.module.css +17 -0
- package/lib/components/LineChart/index.js +16 -0
- package/lib/components/LineChart/index.js.flow +3 -0
- package/lib/components/SpiderChart/SpiderChart.js +88 -0
- package/lib/components/SpiderChart/SpiderChart.js.flow +123 -0
- package/lib/components/SpiderChart/SpiderChart.module.css +17 -0
- package/lib/components/SpiderChart/index.js +16 -0
- package/lib/components/SpiderChart/index.js.flow +3 -0
- package/lib/components/index.js +11 -0
- package/lib/components/index.js.flow +1 -0
- package/lib/styles/index.css +25 -1
- package/lib/styles/index.js +28 -4
- package/lib/styles/index.js.flow +25 -1
- package/lib/styles/variables/_color.css +16 -0
- package/lib/styles/variables/_color.js +17 -1
- package/lib/styles/variables/_color.js.flow +16 -0
- package/lib/styles/variables/_font.css +1 -1
- package/lib/styles/variables/_font.js +1 -1
- package/lib/styles/variables/_font.js.flow +1 -1
- package/lib/styles/variables/_size.css +8 -0
- package/lib/styles/variables/_size.js +9 -1
- package/lib/styles/variables/_size.js.flow +8 -0
- package/lib/types/charts.js +0 -0
- package/lib/types/charts.js.flow +151 -0
- package/lib/utils/charts/charts.js +71 -0
- package/lib/utils/charts/charts.js.flow +89 -0
- package/lib/utils/charts/columnChart.js +55 -0
- package/lib/utils/charts/columnChart.js.flow +59 -0
- package/lib/utils/charts/donutChart.js +114 -0
- package/lib/utils/charts/donutChart.js.flow +138 -0
- package/lib/utils/charts/helpers.js +65 -0
- package/lib/utils/charts/helpers.js.flow +68 -0
- package/lib/utils/charts/index.js +82 -0
- package/lib/utils/charts/index.js.flow +9 -0
- package/lib/utils/charts/lineChart.js +47 -0
- package/lib/utils/charts/lineChart.js.flow +49 -0
- package/lib/utils/charts/spiderChart.js +59 -0
- package/lib/utils/charts/spiderChart.js.flow +72 -0
- package/lib/utils/charts/typography.js +59 -0
- package/lib/utils/charts/typography.js.flow +67 -0
- package/package.json +4 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.colorWarningLightest = exports.colorWarningLight = exports.colorWarningDarkest = exports.colorWarningDark = exports.colorWarning = exports.colorTooltipFill = exports.colorTextWarning = exports.colorTextTertiary = exports.colorTextSuccess = exports.colorTextSecondary = exports.colorTextPrimary = exports.colorTextNeutral = exports.colorTextInverseSecondary = exports.colorTextInversePrimary = exports.colorTextInformation = exports.colorTextFavorite = exports.colorTextDisabled = exports.colorTextDanger = exports.colorTextClickable = exports.colorSuccessLightest = exports.colorSuccessLight = exports.colorSuccessDarkest = exports.colorSuccessDark = exports.colorSuccess = exports.colorSubMenuStar = exports.colorSubMenuBackgroundDefault = exports.colorSideMenuIconDefault = exports.colorSideMenuIconActive = exports.colorNeutralLightest = exports.colorNeutralLight = exports.colorNeutralDarkest = exports.colorNeutralDark = exports.colorNeutral = exports.colorInformationLightest = exports.colorInformationLight = exports.colorInformationDarkest = exports.colorInformationDark = exports.colorInformation = exports.colorGrayLightest = exports.colorFocusPrimary = exports.colorFocusDanger = exports.colorFillSecondary = exports.colorFillPrimary = exports.colorFillNone = exports.colorFillInversePrimary = exports.colorFillDisabled = exports.colorDangerLightest = exports.colorDangerLight = exports.colorDangerDarkest = exports.colorDangerDark = exports.colorDanger = exports.colorButtonFillTertiaryPressed = exports.colorButtonFillTertiaryHovered = exports.colorButtonFillTertiaryEnabled = exports.colorButtonFillTableActionPressed = exports.colorButtonFillTableActionHovered = exports.colorButtonFillTableActionEnabled = exports.colorButtonFillTableActionBorder = exports.colorButtonFillSecondaryPressed = exports.colorButtonFillSecondaryHovered = exports.colorButtonFillSecondaryEnabled = exports.colorButtonFillPrimaryPressed = exports.colorButtonFillPrimaryHovered = exports.colorButtonFillPrimaryEnabled = exports.colorButtonFillGhostPressed = exports.colorButtonFillGhostHovered = exports.colorButtonFillGhostEnabled = exports.colorButtonFillDangerPressed = exports.colorButtonFillDangerHovered = exports.colorButtonFillDangerEnabled = exports.colorBorderTertiary = exports.colorBorderSecondary = exports.colorBorderPrimary = exports.colorBorderDanger = exports.colorBackgroundTertiary = exports.colorBackgroundSecondary = exports.colorBackgroundPrimary = exports.colorBackgroundBrand = exports.colorBackdropFill = void 0;
|
|
6
|
+
exports.colorWarningLightest = exports.colorWarningLight = exports.colorWarningDarkest = exports.colorWarningDark = exports.colorWarning = exports.colorTooltipFill = exports.colorTextWarning = exports.colorTextTertiary = exports.colorTextSuccess = exports.colorTextSecondary = exports.colorTextPrimary = exports.colorTextNeutral = exports.colorTextInverseSecondary = exports.colorTextInversePrimary = exports.colorTextInformation = exports.colorTextFavorite = exports.colorTextDisabled = exports.colorTextDanger = exports.colorTextClickable = exports.colorSuccessLightest = exports.colorSuccessLight = exports.colorSuccessDarkest = exports.colorSuccessDark = exports.colorSuccess = exports.colorSubMenuStar = exports.colorSubMenuBackgroundDefault = exports.colorSideMenuIconDefault = exports.colorSideMenuIconActive = exports.colorNeutralLightest = exports.colorNeutralLight = exports.colorNeutralDarkest = exports.colorNeutralDark = exports.colorNeutral = exports.colorInformationLightest = exports.colorInformationLight = exports.colorInformationDarkest = exports.colorInformationDark = exports.colorInformation = exports.colorGrayLightest = exports.colorFocusPrimary = exports.colorFocusDanger = exports.colorFillSecondary = exports.colorFillPrimary = exports.colorFillNone = exports.colorFillInversePrimary = exports.colorFillDisabled = exports.colorDataViz8 = exports.colorDataViz7 = exports.colorDataViz6 = exports.colorDataViz5 = exports.colorDataViz4 = exports.colorDataViz3 = exports.colorDataViz2 = exports.colorDataViz1 = exports.colorDangerLightest = exports.colorDangerLight = exports.colorDangerDarkest = exports.colorDangerDark = exports.colorDanger = exports.colorButtonFillTertiaryPressed = exports.colorButtonFillTertiaryHovered = exports.colorButtonFillTertiaryEnabled = exports.colorButtonFillTableActionPressed = exports.colorButtonFillTableActionHovered = exports.colorButtonFillTableActionEnabled = exports.colorButtonFillTableActionBorder = exports.colorButtonFillSecondaryPressed = exports.colorButtonFillSecondaryHovered = exports.colorButtonFillSecondaryEnabled = exports.colorButtonFillPrimaryPressed = exports.colorButtonFillPrimaryHovered = exports.colorButtonFillPrimaryEnabled = exports.colorButtonFillGhostPressed = exports.colorButtonFillGhostHovered = exports.colorButtonFillGhostEnabled = exports.colorButtonFillDangerPressed = exports.colorButtonFillDangerHovered = exports.colorButtonFillDangerEnabled = exports.colorBorderTertiary = exports.colorBorderSecondary = exports.colorBorderPrimary = exports.colorBorderDanger = exports.colorBackgroundTertiary = exports.colorBackgroundSecondary = exports.colorBackgroundPrimary = exports.colorBackgroundBrand = exports.colorBackdropFill = void 0;
|
|
7
7
|
|
|
8
8
|
const colorTextPrimary = '#17172A';
|
|
9
9
|
exports.colorTextPrimary = colorTextPrimary;
|
|
@@ -111,6 +111,22 @@ const colorSubMenuBackgroundDefault = '#1F1F36';
|
|
|
111
111
|
exports.colorSubMenuBackgroundDefault = colorSubMenuBackgroundDefault;
|
|
112
112
|
const colorSubMenuStar = '#DFBD0D';
|
|
113
113
|
exports.colorSubMenuStar = colorSubMenuStar;
|
|
114
|
+
const colorDataViz1 = '#8dbaf8';
|
|
115
|
+
exports.colorDataViz1 = colorDataViz1;
|
|
116
|
+
const colorDataViz2 = '#b4a2e8';
|
|
117
|
+
exports.colorDataViz2 = colorDataViz2;
|
|
118
|
+
const colorDataViz3 = '#8bcfad';
|
|
119
|
+
exports.colorDataViz3 = colorDataViz3;
|
|
120
|
+
const colorDataViz4 = '#f0c48f';
|
|
121
|
+
exports.colorDataViz4 = colorDataViz4;
|
|
122
|
+
const colorDataViz5 = '#f297ad';
|
|
123
|
+
exports.colorDataViz5 = colorDataViz5;
|
|
124
|
+
const colorDataViz6 = '#B0F0E3';
|
|
125
|
+
exports.colorDataViz6 = colorDataViz6;
|
|
126
|
+
const colorDataViz7 = '#F5B8E1';
|
|
127
|
+
exports.colorDataViz7 = colorDataViz7;
|
|
128
|
+
const colorDataViz8 = '#F5EBB4';
|
|
129
|
+
exports.colorDataViz8 = colorDataViz8;
|
|
114
130
|
const colorGrayLightest = '#EBEBEB';
|
|
115
131
|
exports.colorGrayLightest = colorGrayLightest;
|
|
116
132
|
const colorNeutral = '#706F9B';
|
|
@@ -106,6 +106,22 @@ export const colorSubMenuBackgroundDefault = '#1F1F36';
|
|
|
106
106
|
|
|
107
107
|
export const colorSubMenuStar = '#DFBD0D';
|
|
108
108
|
|
|
109
|
+
export const colorDataViz1 = '#8dbaf8';
|
|
110
|
+
|
|
111
|
+
export const colorDataViz2 = '#b4a2e8';
|
|
112
|
+
|
|
113
|
+
export const colorDataViz3 = '#8bcfad';
|
|
114
|
+
|
|
115
|
+
export const colorDataViz4 = '#f0c48f';
|
|
116
|
+
|
|
117
|
+
export const colorDataViz5 = '#f297ad';
|
|
118
|
+
|
|
119
|
+
export const colorDataViz6 = '#B0F0E3';
|
|
120
|
+
|
|
121
|
+
export const colorDataViz7 = '#F5B8E1';
|
|
122
|
+
|
|
123
|
+
export const colorDataViz8 = '#F5EBB4';
|
|
124
|
+
|
|
109
125
|
export const colorGrayLightest = '#EBEBEB';
|
|
110
126
|
|
|
111
127
|
export const colorNeutral = '#706F9B';
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.fontWeightMedium = exports.fontWeightBook = exports.fontTextDecorationNone = exports.fontTextCaseNone = exports.fontSize46 = exports.fontSize36 = exports.fontSize26 = exports.fontSize24 = exports.fontSize18 = exports.fontSize16 = exports.fontSize14 = exports.fontSize13 = exports.fontSize12 = exports.fontParagraphSpacing0 = exports.fontLineHeight170 = exports.fontLineHeight150 = exports.fontLineHeight140 = exports.fontLineHeight130 = exports.fontLineHeight125 = exports.fontLineHeight120 = exports.fontLineHeight100 = exports.fontLetterSpacingMinus4 = exports.fontLetterSpacingMinus3 = exports.fontLetterSpacingMinus2 = exports.fontLetterSpacingMinus1 = exports.fontLetterSpacing4 = exports.fontLetterSpacing2 = exports.fontLetterSpacing1 = exports.fontLetterSpacing0 = exports.fontFamilyCentra = void 0;
|
|
7
7
|
|
|
8
|
-
const fontFamilyCentra = '"Centra
|
|
8
|
+
const fontFamilyCentra = '"Centra No 2"';
|
|
9
9
|
exports.fontFamilyCentra = fontFamilyCentra;
|
|
10
10
|
const fontWeightBook = '400';
|
|
11
11
|
exports.fontWeightBook = fontWeightBook;
|
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
|
|
55
55
|
@value size160: 160px;
|
|
56
56
|
|
|
57
|
+
@value size180: 180px;
|
|
58
|
+
|
|
57
59
|
@value size228: 228px;
|
|
58
60
|
|
|
59
61
|
@value size240: 240px;
|
|
@@ -76,12 +78,18 @@
|
|
|
76
78
|
|
|
77
79
|
@value size500: 500px;
|
|
78
80
|
|
|
81
|
+
@value size540: 540px;
|
|
82
|
+
|
|
79
83
|
@value size580: 580px;
|
|
80
84
|
|
|
81
85
|
@value size640: 640px;
|
|
82
86
|
|
|
87
|
+
@value size660: 660px;
|
|
88
|
+
|
|
83
89
|
@value size720: 720px;
|
|
84
90
|
|
|
91
|
+
@value size880: 880px;
|
|
92
|
+
|
|
85
93
|
@value size960: 960px;
|
|
86
94
|
|
|
87
95
|
@value size1280: 1280px;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.sizeFullViewportWidth = exports.sizeFullViewportHeight = exports.sizeFluid = exports.size960 = exports.size90 = exports.size8 = exports.size720 = exports.size70 = exports.size640 = exports.size60 = exports.size580 = exports.size58 = exports.size500 = exports.size50 = exports.size5 = exports.size480 = exports.size48 = exports.size42 = exports.size400 = exports.size40 = exports.size4 = exports.size380 = exports.size38 = exports.size36 = exports.size34 = exports.size320 = exports.size300 = exports.size30 = exports.size276 = exports.size260 = exports.size26 = exports.size252 = exports.size240 = exports.size24 = exports.size228 = exports.size22 = exports.size20 = exports.size2 = exports.size18 = exports.size160 = exports.size140 = exports.size1280 = exports.size125 = exports.size12 = exports.size110 = exports.size100 = exports.size10 = void 0;
|
|
6
|
+
exports.sizeFullViewportWidth = exports.sizeFullViewportHeight = exports.sizeFluid = exports.size960 = exports.size90 = exports.size880 = exports.size8 = exports.size720 = exports.size70 = exports.size660 = exports.size640 = exports.size60 = exports.size580 = exports.size58 = exports.size540 = exports.size500 = exports.size50 = exports.size5 = exports.size480 = exports.size48 = exports.size42 = exports.size400 = exports.size40 = exports.size4 = exports.size380 = exports.size38 = exports.size36 = exports.size34 = exports.size320 = exports.size300 = exports.size30 = exports.size276 = exports.size260 = exports.size26 = exports.size252 = exports.size240 = exports.size24 = exports.size228 = exports.size22 = exports.size20 = exports.size2 = exports.size180 = exports.size18 = exports.size160 = exports.size140 = exports.size1280 = exports.size125 = exports.size12 = exports.size110 = exports.size100 = exports.size10 = void 0;
|
|
7
7
|
|
|
8
8
|
const size2 = '2px';
|
|
9
9
|
exports.size2 = size2;
|
|
@@ -61,6 +61,8 @@ const size140 = '140px';
|
|
|
61
61
|
exports.size140 = size140;
|
|
62
62
|
const size160 = '160px';
|
|
63
63
|
exports.size160 = size160;
|
|
64
|
+
const size180 = '180px';
|
|
65
|
+
exports.size180 = size180;
|
|
64
66
|
const size228 = '228px';
|
|
65
67
|
exports.size228 = size228;
|
|
66
68
|
const size240 = '240px';
|
|
@@ -83,12 +85,18 @@ const size480 = '480px';
|
|
|
83
85
|
exports.size480 = size480;
|
|
84
86
|
const size500 = '500px';
|
|
85
87
|
exports.size500 = size500;
|
|
88
|
+
const size540 = '540px';
|
|
89
|
+
exports.size540 = size540;
|
|
86
90
|
const size580 = '580px';
|
|
87
91
|
exports.size580 = size580;
|
|
88
92
|
const size640 = '640px';
|
|
89
93
|
exports.size640 = size640;
|
|
94
|
+
const size660 = '660px';
|
|
95
|
+
exports.size660 = size660;
|
|
90
96
|
const size720 = '720px';
|
|
91
97
|
exports.size720 = size720;
|
|
98
|
+
const size880 = '880px';
|
|
99
|
+
exports.size880 = size880;
|
|
92
100
|
const size960 = '960px';
|
|
93
101
|
exports.size960 = size960;
|
|
94
102
|
const size1280 = '1280px';
|
|
@@ -56,6 +56,8 @@ export const size140 = '140px';
|
|
|
56
56
|
|
|
57
57
|
export const size160 = '160px';
|
|
58
58
|
|
|
59
|
+
export const size180 = '180px';
|
|
60
|
+
|
|
59
61
|
export const size228 = '228px';
|
|
60
62
|
|
|
61
63
|
export const size240 = '240px';
|
|
@@ -78,12 +80,18 @@ export const size480 = '480px';
|
|
|
78
80
|
|
|
79
81
|
export const size500 = '500px';
|
|
80
82
|
|
|
83
|
+
export const size540 = '540px';
|
|
84
|
+
|
|
81
85
|
export const size580 = '580px';
|
|
82
86
|
|
|
83
87
|
export const size640 = '640px';
|
|
84
88
|
|
|
89
|
+
export const size660 = '660px';
|
|
90
|
+
|
|
85
91
|
export const size720 = '720px';
|
|
86
92
|
|
|
93
|
+
export const size880 = '880px';
|
|
94
|
+
|
|
87
95
|
export const size960 = '960px';
|
|
88
96
|
|
|
89
97
|
export const size1280 = '1280px';
|
|
File without changes
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// @flow strict
|
|
2
|
+
|
|
3
|
+
export type ChartOptions = {
|
|
4
|
+
chart?: {
|
|
5
|
+
polar?: boolean,
|
|
6
|
+
type?: string,
|
|
7
|
+
spacing?: Array<number>,
|
|
8
|
+
margin?: Array<number>,
|
|
9
|
+
style?: CSSObject,
|
|
10
|
+
...
|
|
11
|
+
},
|
|
12
|
+
title?: {
|
|
13
|
+
text: string | null,
|
|
14
|
+
},
|
|
15
|
+
exporting?: {
|
|
16
|
+
buttons: {
|
|
17
|
+
contextButton: {
|
|
18
|
+
enabled: boolean,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
credits?: {
|
|
23
|
+
enabled: boolean,
|
|
24
|
+
},
|
|
25
|
+
tooltip?: Tooltip,
|
|
26
|
+
xAxis?: AxisOptions,
|
|
27
|
+
yAxis?: AxisOptions,
|
|
28
|
+
drilldown?: Drilldown,
|
|
29
|
+
legend?: LegendOptionsType,
|
|
30
|
+
plotOptions?: PlotOptionsType,
|
|
31
|
+
series?: Array<SeriesOptionsType>,
|
|
32
|
+
subtitle?: {
|
|
33
|
+
useHTML: true,
|
|
34
|
+
text?: string,
|
|
35
|
+
verticalAlign: 'middle',
|
|
36
|
+
align: string,
|
|
37
|
+
style: CSSObject,
|
|
38
|
+
x?: number,
|
|
39
|
+
},
|
|
40
|
+
pane?: {
|
|
41
|
+
center: [string, string],
|
|
42
|
+
size: string,
|
|
43
|
+
},
|
|
44
|
+
...
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type AxisOptions = {
|
|
48
|
+
categories?: Array<string>,
|
|
49
|
+
gridLineInterpolation?: 'circle' | 'polygon',
|
|
50
|
+
lineWidth?: number,
|
|
51
|
+
tickmarkPlacement?: string,
|
|
52
|
+
labels?: {
|
|
53
|
+
align?: string,
|
|
54
|
+
distance?: number,
|
|
55
|
+
style?: CSSObject,
|
|
56
|
+
},
|
|
57
|
+
title?: {
|
|
58
|
+
margin?: number,
|
|
59
|
+
style: ?CSSObject,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type BreadcrumbsOptions = {
|
|
64
|
+
floating?: boolean,
|
|
65
|
+
style?: CSSObject,
|
|
66
|
+
...
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export type LegendOptionsType = {
|
|
70
|
+
layout?: string,
|
|
71
|
+
align?: string,
|
|
72
|
+
verticalAlign?: string,
|
|
73
|
+
itemMarginBottom?: number,
|
|
74
|
+
padding?: number,
|
|
75
|
+
itemStyle?: CSSObject,
|
|
76
|
+
enabled?: boolean,
|
|
77
|
+
symbolHeight?: number,
|
|
78
|
+
symbolWidth?: number,
|
|
79
|
+
...
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export type CSSObject = {
|
|
83
|
+
alignItems?: string,
|
|
84
|
+
color?: string,
|
|
85
|
+
display?: string,
|
|
86
|
+
fontFamily?: string,
|
|
87
|
+
fontSize?: string,
|
|
88
|
+
fontStyle?: string,
|
|
89
|
+
fontWeight?: string,
|
|
90
|
+
letterSpacing?: string,
|
|
91
|
+
lineHeight?: string,
|
|
92
|
+
margin?: number,
|
|
93
|
+
textAlign?: string,
|
|
94
|
+
minWidth?: string,
|
|
95
|
+
maxWidth?: string,
|
|
96
|
+
minHeight?: string,
|
|
97
|
+
maxHeight?: string,
|
|
98
|
+
alignContent?: string,
|
|
99
|
+
overflow?: string,
|
|
100
|
+
textOverflow?: string,
|
|
101
|
+
zIndex?: number,
|
|
102
|
+
...
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type DataOptionsType = {y: number, name: string, color: string, ...};
|
|
106
|
+
|
|
107
|
+
export type SeriesOptionsType = {
|
|
108
|
+
id?: string,
|
|
109
|
+
name?: string,
|
|
110
|
+
data: Array<DataOptionsType>,
|
|
111
|
+
...
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export type Drilldown = {
|
|
115
|
+
activeAxisLabelStyle?: CSSObject,
|
|
116
|
+
activeDataLabelStyle?: CSSObject,
|
|
117
|
+
series?: Array<SeriesOptionsType>,
|
|
118
|
+
breadcrumbs?: BreadcrumbsOptions,
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export type PlotOptionsType = {
|
|
122
|
+
['pie' | 'line']: {
|
|
123
|
+
innerSize: string,
|
|
124
|
+
allowPointSelect: boolean,
|
|
125
|
+
cursor: 'pointer',
|
|
126
|
+
dataLabels: {
|
|
127
|
+
enabled?: boolean,
|
|
128
|
+
distance?: number,
|
|
129
|
+
connectorColor?: string,
|
|
130
|
+
},
|
|
131
|
+
showInLegend: boolean,
|
|
132
|
+
center: [string, string],
|
|
133
|
+
size: string,
|
|
134
|
+
minSize?: number | string,
|
|
135
|
+
borderWidth: number,
|
|
136
|
+
borderRadius: number,
|
|
137
|
+
...
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export type Tooltip = {
|
|
142
|
+
useHTML?: boolean,
|
|
143
|
+
followPointer?: boolean,
|
|
144
|
+
backgroundColor?: string,
|
|
145
|
+
style?: CSSObject,
|
|
146
|
+
outside?: boolean,
|
|
147
|
+
headerFormat?: string,
|
|
148
|
+
pointFormat?: string,
|
|
149
|
+
shared?: boolean,
|
|
150
|
+
...
|
|
151
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.mergeChartUserOptions = exports.getDataVizColor = exports.commonChartOptions = exports.breadcrumbStyle = exports.DATA_VIZ_COLORS = void 0;
|
|
7
|
+
var _Charts = require("../../components/Charts");
|
|
8
|
+
var _color = require("../../styles/variables/_color");
|
|
9
|
+
var _helpers = require("./helpers");
|
|
10
|
+
var _typography = require("./typography");
|
|
11
|
+
|
|
12
|
+
const DATA_VIZ_COLORS = [_color.colorDataViz1, _color.colorDataViz2, _color.colorDataViz3, _color.colorDataViz4, _color.colorDataViz5, _color.colorDataViz6, _color.colorDataViz7, _color.colorDataViz8];
|
|
13
|
+
exports.DATA_VIZ_COLORS = DATA_VIZ_COLORS;
|
|
14
|
+
const getDataVizColor = dataIndex => {
|
|
15
|
+
const colorIndex = dataIndex % DATA_VIZ_COLORS.length;
|
|
16
|
+
return DATA_VIZ_COLORS[colorIndex];
|
|
17
|
+
};
|
|
18
|
+
exports.getDataVizColor = getDataVizColor;
|
|
19
|
+
const breadcrumbStyle = {
|
|
20
|
+
..._typography.subTitleExtraSmall,
|
|
21
|
+
color: _color.colorTextSecondary
|
|
22
|
+
};
|
|
23
|
+
exports.breadcrumbStyle = breadcrumbStyle;
|
|
24
|
+
const commonChartOptions = {
|
|
25
|
+
chart: {
|
|
26
|
+
style: {
|
|
27
|
+
fontFamily: 'inherit'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
title: {
|
|
31
|
+
text: null
|
|
32
|
+
},
|
|
33
|
+
exporting: {
|
|
34
|
+
buttons: {
|
|
35
|
+
contextButton: {
|
|
36
|
+
enabled: false
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
credits: {
|
|
41
|
+
enabled: false
|
|
42
|
+
},
|
|
43
|
+
tooltip: {
|
|
44
|
+
followPointer: false,
|
|
45
|
+
backgroundColor: _color.colorTooltipFill,
|
|
46
|
+
useHTML: true,
|
|
47
|
+
outside: true,
|
|
48
|
+
..._Charts.tooltipTheme
|
|
49
|
+
},
|
|
50
|
+
drilldown: {
|
|
51
|
+
breadcrumbs: {
|
|
52
|
+
floating: true,
|
|
53
|
+
style: breadcrumbStyle,
|
|
54
|
+
buttonTheme: {
|
|
55
|
+
style: breadcrumbStyle
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
legend: {
|
|
60
|
+
useHTML: true,
|
|
61
|
+
itemStyle: {
|
|
62
|
+
..._typography.formLabelSmall,
|
|
63
|
+
paddingTop: '1px'
|
|
64
|
+
},
|
|
65
|
+
symbolHeight: 8,
|
|
66
|
+
enabled: true
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
exports.commonChartOptions = commonChartOptions;
|
|
70
|
+
const mergeChartUserOptions = (defaultoptions, userOptions) => (0, _helpers.deepMerge)(defaultoptions, userOptions);
|
|
71
|
+
exports.mergeChartUserOptions = mergeChartUserOptions;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// @flow strict
|
|
2
|
+
|
|
3
|
+
import {tooltipTheme} from '../../components/Charts';
|
|
4
|
+
import {
|
|
5
|
+
colorDataViz1,
|
|
6
|
+
colorDataViz2,
|
|
7
|
+
colorDataViz3,
|
|
8
|
+
colorDataViz4,
|
|
9
|
+
colorDataViz5,
|
|
10
|
+
colorDataViz6,
|
|
11
|
+
colorDataViz7,
|
|
12
|
+
colorDataViz8,
|
|
13
|
+
colorTextSecondary,
|
|
14
|
+
colorTooltipFill,
|
|
15
|
+
} from '../../styles/variables/_color';
|
|
16
|
+
import type {ChartOptions} from '../../types/charts';
|
|
17
|
+
|
|
18
|
+
import {deepMerge} from './helpers';
|
|
19
|
+
import {formLabelSmall, subTitleExtraSmall} from './typography';
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export const DATA_VIZ_COLORS = [
|
|
23
|
+
colorDataViz1,
|
|
24
|
+
colorDataViz2,
|
|
25
|
+
colorDataViz3,
|
|
26
|
+
colorDataViz4,
|
|
27
|
+
colorDataViz5,
|
|
28
|
+
colorDataViz6,
|
|
29
|
+
colorDataViz7,
|
|
30
|
+
colorDataViz8,
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
export const getDataVizColor = (dataIndex: number): string => {
|
|
34
|
+
const colorIndex = dataIndex % DATA_VIZ_COLORS.length;
|
|
35
|
+
return DATA_VIZ_COLORS[colorIndex];
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const breadcrumbStyle = {
|
|
39
|
+
...subTitleExtraSmall,
|
|
40
|
+
color: colorTextSecondary,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const commonChartOptions: $Shape<ChartOptions> = {
|
|
44
|
+
chart: {
|
|
45
|
+
style: {
|
|
46
|
+
fontFamily: 'inherit',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
title: {
|
|
50
|
+
text: null,
|
|
51
|
+
},
|
|
52
|
+
exporting: {
|
|
53
|
+
buttons: {
|
|
54
|
+
contextButton: {
|
|
55
|
+
enabled: false,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
credits: {
|
|
60
|
+
enabled: false,
|
|
61
|
+
},
|
|
62
|
+
tooltip: {
|
|
63
|
+
followPointer: false,
|
|
64
|
+
backgroundColor: colorTooltipFill,
|
|
65
|
+
useHTML: true,
|
|
66
|
+
outside: true,
|
|
67
|
+
...tooltipTheme,
|
|
68
|
+
},
|
|
69
|
+
drilldown: {
|
|
70
|
+
breadcrumbs: {
|
|
71
|
+
floating: true,
|
|
72
|
+
style: breadcrumbStyle,
|
|
73
|
+
buttonTheme: {
|
|
74
|
+
style: breadcrumbStyle,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
legend: {
|
|
79
|
+
useHTML: true,
|
|
80
|
+
itemStyle: {...formLabelSmall, paddingTop: '1px'},
|
|
81
|
+
symbolHeight: 8,
|
|
82
|
+
enabled: true,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const mergeChartUserOptions = (
|
|
87
|
+
defaultoptions: ChartOptions,
|
|
88
|
+
userOptions: ChartOptions,
|
|
89
|
+
): ChartOptions => deepMerge(defaultoptions, userOptions);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getColumnChartOptions = exports.columnPlotWidth = void 0;
|
|
7
|
+
var _charts = require("./charts");
|
|
8
|
+
var _helpers = require("./helpers");
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This function modifies the the common chart behavior to column chart default behavior.
|
|
12
|
+
* It will not take userPassed option into account.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const getColumnChartOptions = () => ({
|
|
16
|
+
..._charts.commonChartOptions,
|
|
17
|
+
chart: {
|
|
18
|
+
type: 'column'
|
|
19
|
+
},
|
|
20
|
+
legend: {
|
|
21
|
+
..._charts.commonChartOptions.legend,
|
|
22
|
+
..._helpers.bottomLegendRow,
|
|
23
|
+
symbolWidth: 18
|
|
24
|
+
},
|
|
25
|
+
xAxis: {
|
|
26
|
+
labels: {
|
|
27
|
+
style: _helpers.xAxisLabelStyle
|
|
28
|
+
},
|
|
29
|
+
title: {
|
|
30
|
+
margin: 12,
|
|
31
|
+
style: _helpers.xAxisTitleStyle
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
yAxis: {
|
|
35
|
+
labels: {
|
|
36
|
+
align: 'right',
|
|
37
|
+
distance: 12,
|
|
38
|
+
style: _helpers.yAxisLabelStyle
|
|
39
|
+
},
|
|
40
|
+
title: {
|
|
41
|
+
margin: 12,
|
|
42
|
+
style: _helpers.yAxisTitleStyle
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
drilldown: {
|
|
46
|
+
activeAxisLabelStyle: _helpers.activeLabelStyle,
|
|
47
|
+
activeDataLabelStyle: _helpers.activeLabelStyle,
|
|
48
|
+
breadcrumbs: {
|
|
49
|
+
floating: true
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
exports.getColumnChartOptions = getColumnChartOptions;
|
|
54
|
+
const columnPlotWidth = 28;
|
|
55
|
+
exports.columnPlotWidth = columnPlotWidth;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// @flow strict
|
|
2
|
+
|
|
3
|
+
import type {ChartOptions} from '../../types/charts';
|
|
4
|
+
|
|
5
|
+
import {commonChartOptions} from './charts';
|
|
6
|
+
import {
|
|
7
|
+
activeLabelStyle,
|
|
8
|
+
bottomLegendRow,
|
|
9
|
+
xAxisLabelStyle,
|
|
10
|
+
xAxisTitleStyle,
|
|
11
|
+
yAxisLabelStyle,
|
|
12
|
+
yAxisTitleStyle,
|
|
13
|
+
} from './helpers';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* This function modifies the the common chart behavior to column chart default behavior.
|
|
17
|
+
* It will not take userPassed option into account.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export const getColumnChartOptions = (): ChartOptions => ({
|
|
21
|
+
...commonChartOptions,
|
|
22
|
+
chart: {
|
|
23
|
+
type: 'column',
|
|
24
|
+
},
|
|
25
|
+
legend: {
|
|
26
|
+
...commonChartOptions.legend,
|
|
27
|
+
...bottomLegendRow,
|
|
28
|
+
symbolWidth: 18,
|
|
29
|
+
},
|
|
30
|
+
xAxis: {
|
|
31
|
+
labels: {
|
|
32
|
+
style: xAxisLabelStyle,
|
|
33
|
+
},
|
|
34
|
+
title: {
|
|
35
|
+
margin: 12,
|
|
36
|
+
style: xAxisTitleStyle,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
yAxis: {
|
|
40
|
+
labels: {
|
|
41
|
+
align: 'right',
|
|
42
|
+
distance: 12,
|
|
43
|
+
style: yAxisLabelStyle,
|
|
44
|
+
},
|
|
45
|
+
title: {
|
|
46
|
+
margin: 12,
|
|
47
|
+
style: yAxisTitleStyle,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
drilldown: {
|
|
51
|
+
activeAxisLabelStyle: activeLabelStyle,
|
|
52
|
+
activeDataLabelStyle: activeLabelStyle,
|
|
53
|
+
breadcrumbs: {
|
|
54
|
+
floating: true,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export const columnPlotWidth = 28;
|