sea-chart 0.0.17 → 0.0.18
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/api/index.js +11 -0
- package/dist/assets/css/color-picker.css +53 -0
- package/dist/assets/css/slider.css +77 -0
- package/dist/components/color-setting/color-group-selector.js +48 -0
- package/dist/components/color-setting/color-picker.js +123 -0
- package/dist/components/dtable-popover/index.js +2 -2
- package/dist/components/number-input/index.js +4 -1
- package/dist/components/pixel-editor/index.js +5 -2
- package/dist/constants/color-rules.js +32 -1
- package/dist/constants/geolocation.js +12 -1
- package/dist/constants/index.js +32 -6
- package/dist/constants/model.js +3 -0
- package/dist/constants/style.js +89 -0
- package/dist/constants/type-image.js +1 -0
- package/dist/constants/type.js +22 -29
- package/dist/context.js +18 -1
- package/dist/locale/lang/de.js +25 -1
- package/dist/locale/lang/en.js +63 -1
- package/dist/locale/lang/es.js +25 -1
- package/dist/locale/lang/fr.js +25 -1
- package/dist/locale/lang/pt.js +25 -1
- package/dist/locale/lang/ru.js +25 -1
- package/dist/locale/lang/zh_CN.js +63 -1
- package/dist/model/bar-custom.js +1 -0
- package/dist/model/completeness-group.js +15 -9
- package/dist/model/completeness.js +10 -1
- package/dist/model/generic-model.js +1 -0
- package/dist/model/heat-map.js +4 -1
- package/dist/model/map-bubble.js +2 -2
- package/dist/model/map.js +6 -3
- package/dist/model/mirror.js +5 -2
- package/dist/model/scatter.js +7 -2
- package/dist/model/stacked-horizontal-bar.js +18 -7
- package/dist/model/trend.js +2 -2
- package/dist/model/world-map-bubble.js +9 -5
- package/dist/model/world-map.js +10 -6
- package/dist/services/map-json.js +92 -0
- package/dist/settings/bar-settings/data-settings.js +1 -1
- package/dist/settings/completeness-settings/callbacks/callbacks.js +93 -0
- package/dist/settings/completeness-settings/data-settings/completion-settings.js +58 -0
- package/dist/settings/completeness-settings/data-settings/data-settings.js +62 -0
- package/dist/settings/completeness-settings/index.js +3 -0
- package/dist/settings/completeness-settings/style-settings.js +79 -0
- package/dist/settings/data-settings.js +41 -0
- package/dist/settings/heat-map-settings/data-settings.js +72 -0
- package/dist/settings/heat-map-settings/index.js +3 -0
- package/dist/settings/heat-map-settings/style-settings.js +66 -0
- package/dist/settings/horizontal-bar-settings/data-settings.js +1 -1
- package/dist/settings/index.css +28 -4
- package/dist/settings/map-settings/components/location-field-selector.js +32 -0
- package/dist/settings/map-settings/components/map-level-selector.js +44 -0
- package/dist/settings/map-settings/components/map-province-city-selector.js +110 -0
- package/dist/settings/map-settings/index.js +3 -0
- package/dist/settings/map-settings/map-data-settings.js +76 -0
- package/dist/settings/map-settings/map-style-settings.js +97 -0
- package/dist/settings/mirror-settings/data-settings.js +119 -0
- package/dist/settings/mirror-settings/index.js +2 -0
- package/dist/settings/scatter/data-settings.js +148 -0
- package/dist/settings/scatter/index.js +4 -0
- package/dist/settings/stacks-settings/index.js +80 -7
- package/dist/settings/stacks-settings/stack-item-settings.js +14 -5
- package/dist/settings/style-settings.js +23 -2
- package/dist/settings/trend-settings/data-settings.js +114 -0
- package/dist/settings/trend-settings/index.js +2 -0
- package/dist/settings/widgets/color-settings/index.css +22 -0
- package/dist/settings/widgets/data-sort.js +1 -1
- package/dist/settings/widgets/group-by.js +28 -10
- package/dist/settings/widgets/mininum-slice-percent.js +1 -1
- package/dist/settings/widgets/numeric-summary-item.js +52 -5
- package/dist/settings/widgets/title-settings/title-text.js +1 -1
- package/dist/settings/widgets/y-axis-group-settings.js +13 -6
- package/dist/utils/chart-utils/base-utils.js +134 -32
- package/dist/utils/chart-utils/index.js +1 -1
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +2 -2
- package/dist/utils/chart-utils/sql-statistics-utils.js +616 -180
- package/dist/utils/collaborator-utils.js +69 -14
- package/dist/utils/column-utils.js +89 -1
- package/dist/utils/custom-g2.js +6 -1
- package/dist/utils/index.js +88 -1
- package/dist/utils/map.js +1 -19
- package/dist/utils/sql/chart-data-sql.js +313 -28
- package/dist/utils/sql/column-2-sql-column.js +279 -1
- package/dist/view/index.css +15 -0
- package/dist/view/index.js +4 -3
- package/dist/view/wrapper/area.js +50 -16
- package/dist/view/wrapper/bar-custom.js +62 -29
- package/dist/view/wrapper/bar-group.js +57 -33
- package/dist/view/wrapper/bar.js +30 -36
- package/dist/view/wrapper/chart-component.js +184 -17
- package/dist/view/wrapper/completeness.js +163 -0
- package/dist/view/wrapper/heat-map.js +407 -0
- package/dist/view/wrapper/horizontal-bar-group.js +55 -33
- package/dist/view/wrapper/horizontal-bar.js +33 -28
- package/dist/view/wrapper/index.js +54 -0
- package/dist/view/wrapper/line-group.js +4 -4
- package/dist/view/wrapper/line.js +1 -1
- package/dist/view/wrapper/map.js +322 -0
- package/dist/view/wrapper/mirror.js +207 -0
- package/dist/view/wrapper/scatter.js +130 -0
- package/dist/view/wrapper/trend.js +169 -0
- package/dist/view/wrapper/world-map.js +350 -0
- package/package.json +4 -4
package/dist/api/index.js
CHANGED
|
@@ -97,5 +97,16 @@ class SeaChartAPI {
|
|
|
97
97
|
this.dtableSocket = dtable_socket.replace(/\/+$/, '') + '/';
|
|
98
98
|
this.dtableDB = dtable_db.replace(/\/+$/, '') + '/';
|
|
99
99
|
}
|
|
100
|
+
|
|
101
|
+
// queryUsers(userIdList) {
|
|
102
|
+
// const { dtableServer, accessToken } = this;
|
|
103
|
+
// const url = dtableServer + 'api/v2.1/user-list';
|
|
104
|
+
// let operation = { user_id_list: userIdList };
|
|
105
|
+
// const headers = {
|
|
106
|
+
// 'Content-type': 'application/json',
|
|
107
|
+
// 'Authorization': 'Token ' + accessToken
|
|
108
|
+
// };
|
|
109
|
+
// return axios.post(url, operation, { headers });
|
|
110
|
+
// }
|
|
100
111
|
}
|
|
101
112
|
export default SeaChartAPI;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* color-picker */
|
|
2
|
+
.statistic-chart-color-picker-container {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: block;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 2.375rem;
|
|
7
|
+
line-height: 2.375rem;
|
|
8
|
+
background-clip: padding-box;
|
|
9
|
+
color: #495057;
|
|
10
|
+
background-color: #fff;
|
|
11
|
+
border: 1px solid rgba(0, 40, 100, 0.12);
|
|
12
|
+
border-radius: 3px;
|
|
13
|
+
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.statistic-chart-color-picker-container .picker-control {
|
|
17
|
+
height: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.statistic-chart-color-picker-container .picker-control .color-control {
|
|
23
|
+
width: 24px;
|
|
24
|
+
height: 24px;
|
|
25
|
+
margin-left: 10px;
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.statistic-chart-color-picker-container .picker-control.readOnly,
|
|
31
|
+
.statistic-chart-color-picker-container .picker-control.readOnly .text-control {
|
|
32
|
+
background-color: #f7f7f7;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.statistic-chart-color-picker-container .picker-control .color-control {
|
|
36
|
+
cursor: default;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.statistic-chart-color-picker-container .picker-control .color-control.white-color {
|
|
40
|
+
border: 3px #eee solid;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.statistic-chart-color-picker-container .picker-control .text-control {
|
|
44
|
+
height: 100%;
|
|
45
|
+
border: none;
|
|
46
|
+
outline: none;
|
|
47
|
+
padding-left: 10px;
|
|
48
|
+
font-size: 14px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.statistic-chart-color-picker-container .picker-control.readOnly .text-control {
|
|
52
|
+
cursor: default;
|
|
53
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
.sea-chart-settings .rc-slider {
|
|
2
|
+
position: relative;
|
|
3
|
+
height: 14px;
|
|
4
|
+
padding: 5px 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
border-radius: 6px;
|
|
7
|
+
touch-action: none;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.sea-chart-settings .rc-slider * {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.sea-chart-settings .rc-slider-rail {
|
|
18
|
+
position: absolute;
|
|
19
|
+
width: 100%;
|
|
20
|
+
background-color: #e9e9e9;
|
|
21
|
+
height: 4px;
|
|
22
|
+
border-radius: 6px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.sea-chart-settings .rc-slider-track {
|
|
26
|
+
position: absolute;
|
|
27
|
+
left: 0;
|
|
28
|
+
height: 4px;
|
|
29
|
+
border-radius: 6px;
|
|
30
|
+
background-color: rgb(255, 128, 0);;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.sea-chart-settings .rc-slider-handle {
|
|
34
|
+
position: absolute;
|
|
35
|
+
width: 14px;
|
|
36
|
+
height: 14px;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
cursor: -webkit-grab;
|
|
39
|
+
margin-top: -5px;
|
|
40
|
+
cursor: grab;
|
|
41
|
+
border-radius: 50%;
|
|
42
|
+
border: solid 2px rgb(255, 128, 0);
|
|
43
|
+
background-color: #fff;
|
|
44
|
+
touch-action: pan-x;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.sea-chart-settings .rc-slider-handle-dragging{
|
|
48
|
+
border-color: rgb(255, 128, 0);
|
|
49
|
+
box-shadow: 0 0 0 5px rgb(255, 128, 0);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.sea-chart-settings .rc-slider-handle:focus {
|
|
53
|
+
outline: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.sea-chart-settings .rc-slider-handle-click-focused:focus {
|
|
57
|
+
border-color: rgb(255, 128, 0);
|
|
58
|
+
box-shadow: unset;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.sea-chart-settings .rc-slider-handle:hover {
|
|
62
|
+
border-color: rgb(255, 128, 0);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.sea-chart-settings .rc-slider-handle:active {
|
|
66
|
+
border-color: rgb(255, 128, 0);
|
|
67
|
+
box-shadow: 0 0 5px rgb(255, 128, 0);
|
|
68
|
+
cursor: -webkit-grabbing;
|
|
69
|
+
cursor: grabbing;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.sea-chart-settings .rc-slider-step {
|
|
73
|
+
position: absolute;
|
|
74
|
+
width: 100%;
|
|
75
|
+
height: 4px;
|
|
76
|
+
background: transparent;
|
|
77
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
import { FormGroup } from 'reactstrap';
|
|
4
|
+
import { COLOR_OPTIONS } from '../../constants/color-rules';
|
|
5
|
+
import intl from '../../intl';
|
|
6
|
+
class ColorGroupSelector extends Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
this.getColorOptions = () => {
|
|
10
|
+
return COLOR_OPTIONS.map(colorOption => {
|
|
11
|
+
return {
|
|
12
|
+
value: colorOption.name,
|
|
13
|
+
label: /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: "statistic-color-option d-flex"
|
|
15
|
+
}, colorOption.exampleColors.map((color, index) => {
|
|
16
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
17
|
+
className: "statistic-color-block",
|
|
18
|
+
key: index,
|
|
19
|
+
style: {
|
|
20
|
+
background: "".concat(color)
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}))
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
this.changeColor = option => {
|
|
28
|
+
const selected = option.value;
|
|
29
|
+
this.props.onChangeColor(selected);
|
|
30
|
+
};
|
|
31
|
+
this.colorOptions = this.getColorOptions();
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
const {
|
|
35
|
+
currentColor
|
|
36
|
+
} = this.props;
|
|
37
|
+
const currentOption = this.colorOptions.filter(item => item.value === currentColor)[0] || this.colorOptions[0];
|
|
38
|
+
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
39
|
+
className: "statistic-chart-parameter-item"
|
|
40
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Color')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
41
|
+
classNamePrefix: 'chart-color',
|
|
42
|
+
value: currentOption,
|
|
43
|
+
onChange: this.changeColor,
|
|
44
|
+
options: this.colorOptions
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export default ColorGroupSelector;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ChromePicker } from 'react-color';
|
|
3
|
+
import '../../assets/css/color-picker.css';
|
|
4
|
+
const COVER = {
|
|
5
|
+
position: 'fixed',
|
|
6
|
+
top: '0px',
|
|
7
|
+
right: '0px',
|
|
8
|
+
bottom: '0px',
|
|
9
|
+
left: '0px'
|
|
10
|
+
};
|
|
11
|
+
class ColorPicker extends React.PureComponent {
|
|
12
|
+
constructor(props) {
|
|
13
|
+
super(props);
|
|
14
|
+
this.onInputChanged = event => {
|
|
15
|
+
const value = event.target.value;
|
|
16
|
+
if (value === this.state.activeColor) return;
|
|
17
|
+
|
|
18
|
+
// todo valid color
|
|
19
|
+
this.updateColor(value);
|
|
20
|
+
this.setState({
|
|
21
|
+
activeColor: value
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
this.onPickColorToggle = () => {
|
|
25
|
+
const {
|
|
26
|
+
readOnly
|
|
27
|
+
} = this.props;
|
|
28
|
+
if (readOnly) return;
|
|
29
|
+
this.setState({
|
|
30
|
+
isShowColorPicker: !this.state.isShowColorPicker
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
this.onPickChanged = color => {
|
|
34
|
+
if (color.hex === this.state.activeColor) return;
|
|
35
|
+
this.updateColor(color);
|
|
36
|
+
this.setState({
|
|
37
|
+
activeColor: color.hex
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
this.updateColor = color => {
|
|
41
|
+
const {
|
|
42
|
+
isPickAllColor
|
|
43
|
+
} = this.props;
|
|
44
|
+
const colorValue = isPickAllColor ? color : color.hex;
|
|
45
|
+
this.props.onColorChanged(colorValue);
|
|
46
|
+
};
|
|
47
|
+
this.getPopoverStyle = () => {
|
|
48
|
+
if (!this.colorPickerContainerRef) return {};
|
|
49
|
+
const {
|
|
50
|
+
top,
|
|
51
|
+
height
|
|
52
|
+
} = this.colorPickerContainerRef.getBoundingClientRect();
|
|
53
|
+
const {
|
|
54
|
+
clientHeight
|
|
55
|
+
} = document.body;
|
|
56
|
+
const selectTop = top + height;
|
|
57
|
+
if (clientHeight - selectTop < 247) {
|
|
58
|
+
// 247: ChromePicker's height
|
|
59
|
+
return {
|
|
60
|
+
position: 'absolute',
|
|
61
|
+
left: 0,
|
|
62
|
+
bottom: '2.375rem',
|
|
63
|
+
zIndex: '2'
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
position: 'absolute',
|
|
68
|
+
left: 0,
|
|
69
|
+
zIndex: '2'
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
this.state = {
|
|
73
|
+
isShowColorPicker: false,
|
|
74
|
+
activeColor: props.activeColor
|
|
75
|
+
};
|
|
76
|
+
this.colorPickerContainerRef = null;
|
|
77
|
+
}
|
|
78
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
79
|
+
this.setState({
|
|
80
|
+
activeColor: nextProps.activeColor
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
render() {
|
|
84
|
+
const {
|
|
85
|
+
activeColor
|
|
86
|
+
} = this.state;
|
|
87
|
+
const isWhiteColor = activeColor && activeColor.toUpperCase() === '#FFFFFF';
|
|
88
|
+
const {
|
|
89
|
+
readOnly
|
|
90
|
+
} = this.props;
|
|
91
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: "statistic-chart-color-picker-container",
|
|
93
|
+
ref: ref => this.colorPickerContainerRef = ref
|
|
94
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: "picker-control ".concat(readOnly ? 'readOnly' : '')
|
|
96
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
className: "color-control ".concat(isWhiteColor ? 'white-color' : '', " ").concat(readOnly ? 'readOnly' : ''),
|
|
98
|
+
onClick: this.onPickColorToggle,
|
|
99
|
+
style: {
|
|
100
|
+
background: activeColor
|
|
101
|
+
}
|
|
102
|
+
}), /*#__PURE__*/React.createElement("input", {
|
|
103
|
+
className: "text-control",
|
|
104
|
+
type: "text",
|
|
105
|
+
value: activeColor,
|
|
106
|
+
onChange: this.onInputChanged,
|
|
107
|
+
readOnly: readOnly
|
|
108
|
+
})), this.state.isShowColorPicker && /*#__PURE__*/React.createElement("div", {
|
|
109
|
+
style: this.getPopoverStyle()
|
|
110
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
111
|
+
style: COVER,
|
|
112
|
+
onClick: this.onPickColorToggle
|
|
113
|
+
}), /*#__PURE__*/React.createElement(ChromePicker, {
|
|
114
|
+
disableAlpha: true,
|
|
115
|
+
color: activeColor,
|
|
116
|
+
onChange: this.onPickChanged
|
|
117
|
+
})));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
ColorPicker.defaultProps = {
|
|
121
|
+
activeColor: '#000000'
|
|
122
|
+
};
|
|
123
|
+
export default ColorPicker;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Popover } from 'reactstrap';
|
|
3
|
-
import {
|
|
4
|
-
import { CommonEventTypes } from '../../constants/common-constants.js';
|
|
3
|
+
import { CommonEventTypes } from '../../constants/common-constants';
|
|
5
4
|
import KeyCodes from '../../constants/key-codes.js';
|
|
5
|
+
import { getEventClassName } from '../../utils/common-utils';
|
|
6
6
|
class DTablePopover extends React.Component {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
@@ -9,12 +9,15 @@ function NumberInput(props) {
|
|
|
9
9
|
max,
|
|
10
10
|
readOnly,
|
|
11
11
|
className,
|
|
12
|
+
useEmpty,
|
|
12
13
|
...otherProps
|
|
13
14
|
} = props;
|
|
15
|
+
// useempty is used to control whether to use empty string or '0'
|
|
16
|
+
const number = value ? value : useEmpty ? '' : '0';
|
|
14
17
|
return /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
15
18
|
type: "number",
|
|
16
19
|
className: className,
|
|
17
|
-
value:
|
|
20
|
+
value: number,
|
|
18
21
|
min: min,
|
|
19
22
|
step: step,
|
|
20
23
|
max: max,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
2
1
|
import { isNumber } from 'dtable-utils';
|
|
2
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { isBoolean } from '../../utils';
|
|
3
4
|
import NumberInput from '../number-input';
|
|
4
5
|
import './index.css';
|
|
5
6
|
const PixelEditor = props => {
|
|
@@ -24,14 +25,16 @@ const PixelEditor = props => {
|
|
|
24
25
|
event.target.blur();
|
|
25
26
|
}
|
|
26
27
|
};
|
|
28
|
+
const showPx = isBoolean(props.showPx) ? props.showPx : true;
|
|
27
29
|
return /*#__PURE__*/React.createElement("div", {
|
|
28
30
|
className: "sea-chart-pixel-editor-wrapper"
|
|
29
31
|
}, /*#__PURE__*/React.createElement(NumberInput, {
|
|
30
32
|
value: currPixel,
|
|
33
|
+
useEmpty: props.useEmpty,
|
|
31
34
|
onChange: event => setCurrPixel(event.target.value),
|
|
32
35
|
onBlur: onSavePixel,
|
|
33
36
|
onKeyDown: onKeyDown
|
|
34
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
}), showPx && /*#__PURE__*/React.createElement("div", {
|
|
35
38
|
className: "pixel-unit"
|
|
36
39
|
}, /*#__PURE__*/React.createElement("span", null, "px")));
|
|
37
40
|
};
|
|
@@ -8,4 +8,35 @@ export const DISPLAY_COLOR_RULE_FILTER_TYPE = {
|
|
|
8
8
|
export const FILTER_TYPE_2_CELL_TYPE = {
|
|
9
9
|
[COLOR_RULE_FILTER_TYPE_MAP.NUMERIC_VALUE]: CellType.NUMBER
|
|
10
10
|
};
|
|
11
|
-
export const EMPTY_PREDICATE = [FILTER_PREDICATE_TYPE.EMPTY, FILTER_PREDICATE_TYPE.NOT_EMPTY];
|
|
11
|
+
export const EMPTY_PREDICATE = [FILTER_PREDICATE_TYPE.EMPTY, FILTER_PREDICATE_TYPE.NOT_EMPTY];
|
|
12
|
+
export const COLOR_OPTIONS = [{
|
|
13
|
+
name: 'blue',
|
|
14
|
+
exampleColors: ['#CAE9FF', '#9AC5FF', '#7DAAFF', '#5C90F9', '#3C77DD', '#075FBF', '#0047A5', '#053791', '#001E79'],
|
|
15
|
+
borderColor: '#5F7190',
|
|
16
|
+
highlightedBorderColor: '#30343A'
|
|
17
|
+
}, {
|
|
18
|
+
name: 'green',
|
|
19
|
+
exampleColors: ['#AAF7D2', '#74E6B6', '#42C090', '#17A675', '#008A5C', '#016F44', '#00572F', '#02421C', '#003300'],
|
|
20
|
+
borderColor: '#5F7190',
|
|
21
|
+
highlightedBorderColor: '#30343A'
|
|
22
|
+
}, {
|
|
23
|
+
name: 'purple',
|
|
24
|
+
exampleColors: ['#EBE2F1', '#D4C4E2', '#BFA8D4', '#A989C5', '#956DB8', '#7B4CA4', '#663095', '#55148E', '#410475'],
|
|
25
|
+
borderColor: '#5F7190',
|
|
26
|
+
highlightedBorderColor: '#30343A'
|
|
27
|
+
}, {
|
|
28
|
+
name: 'red',
|
|
29
|
+
exampleColors: ['#FBE2E1', '#F7C6C6', '#F3A9A9', '#F17F7E', '#ED5655', '#D73635', '#BD1615', '#920404', '#680303'],
|
|
30
|
+
borderColor: '#5F7190',
|
|
31
|
+
highlightedBorderColor: '#30343A'
|
|
32
|
+
}, {
|
|
33
|
+
name: 'yellow',
|
|
34
|
+
exampleColors: ['#FFF2D4', '#FFE9B8', '#FFDD95', '#FFD470', '#FFC741', '#EDB408', '#D09C10', '#A37B17', '#775816'],
|
|
35
|
+
borderColor: '#5F7190',
|
|
36
|
+
highlightedBorderColor: '#30343A'
|
|
37
|
+
}, {
|
|
38
|
+
name: 'orange',
|
|
39
|
+
exampleColors: ['#FEE6CE', '#FDD1A2', '#FDAD6B', '#FD8D3D', '#F06813', '#E64F04', '#C14308', '#943D04', '#6D2E02'],
|
|
40
|
+
borderColor: '#5F7190',
|
|
41
|
+
highlightedBorderColor: '#30343A'
|
|
42
|
+
}];
|
|
@@ -21,4 +21,15 @@ export const MAP_LEVEL = {
|
|
|
21
21
|
PROVINCE: 'province',
|
|
22
22
|
CITY: 'city'
|
|
23
23
|
};
|
|
24
|
-
export const MUNICIPALITIES = ['北京市', '天津市', '上海市', '重庆市'];
|
|
24
|
+
export const MUNICIPALITIES = ['北京市', '天津市', '上海市', '重庆市'];
|
|
25
|
+
export const MAP_LEVELS = [{
|
|
26
|
+
key: MAP_LEVEL.COUNTRY,
|
|
27
|
+
name: '国家'
|
|
28
|
+
}, {
|
|
29
|
+
key: MAP_LEVEL.PROVINCE,
|
|
30
|
+
name: '省级'
|
|
31
|
+
}, {
|
|
32
|
+
key: MAP_LEVEL.CITY,
|
|
33
|
+
name: '市级'
|
|
34
|
+
}];
|
|
35
|
+
export const LABEL_COLORS = ['#2a67d1', '#4ecccb', '#59cb74', '#fbd44a', '#f4667c', '#9860e5', '#9f8cf1', '#dc82d2', '#eaa775', '#addf84', '#85e0be', '#89d2ea'];
|
package/dist/constants/index.js
CHANGED
|
@@ -6,11 +6,15 @@ import { CHART_TYPE, CHART_TYPE_SHOW, CHART_TYPES } from './type';
|
|
|
6
6
|
import { CHART_TYPE_IMAGE } from './type-image';
|
|
7
7
|
import { regions } from './regions';
|
|
8
8
|
import { TABLE_DIMENSIONS } from './table';
|
|
9
|
+
export const CHART_STYLE_COLORS = ['#5B8FF9', '#5AD8A6', '#5D7092', '#F6BD16', '#6F5EF9', '#6DC8EC', '#945FB9', '#FF9845', '#1E9493', '#FF99C3'];
|
|
10
|
+
export const ONLY_NEED_NUMBER_OPTIONS_CHART_TYPE = [CHART_TYPE.COMPLETENESS, CHART_TYPE.COMPLETENESS_GROUP, CHART_TYPE.SCATTER];
|
|
11
|
+
export const COMPLETENESS_GROUPBY_SUPPORTED_COLUMN_TYPE = [CellType.COLLABORATOR, CellType.TEXT, CellType.SINGLE_SELECT];
|
|
12
|
+
export const NUMBERIC_COLUMN_TYPE = [CellType.RATE, CellType.NUMBER];
|
|
9
13
|
export const ZH_CN_SUPPORT_CHARTS = [CHART_TYPE.MAP, CHART_TYPE.MAP_BUBBLE];
|
|
10
14
|
export const SUPPORT_DATA_SORT_CHART_TYPES = [CHART_TYPE.BAR, CHART_TYPE.BAR_STACK, CHART_TYPE.LINE, CHART_TYPE.PIE, CHART_TYPE.RING, CHART_TYPE.HORIZONTAL_BAR, CHART_TYPE.AREA, CHART_TYPE.TREE_MAP];
|
|
11
15
|
export const SUPPORT_STACK_VALUE_CHART_TYPES = [CHART_TYPE.BAR_STACK, CHART_TYPE.BAR_CUSTOM];
|
|
12
16
|
export const X_AXIS_IS_GROUPBY_COLUMN_KEY_CHART_TYPES = [CHART_TYPE.TABLE, CHART_TYPE.PIE, CHART_TYPE.RING, CHART_TYPE.TREE_MAP];
|
|
13
|
-
export const SUPPORT_TITLE_CHART_TYPES = [CHART_TYPE.BAR, CHART_TYPE.BAR_GROUP, CHART_TYPE.HORIZONTAL_BAR, CHART_TYPE.HORIZONTAL_GROUP_BAR, CHART_TYPE.LINE, CHART_TYPE.LINE_GROUP, CHART_TYPE.AREA, CHART_TYPE.PIE, CHART_TYPE.RING, CHART_TYPE.COMBINATION, CHART_TYPE.DASHBOARD, CHART_TYPE.TREE_MAP, CHART_TYPE.TABLE];
|
|
17
|
+
export const SUPPORT_TITLE_CHART_TYPES = [CHART_TYPE.BAR, CHART_TYPE.BAR_GROUP, CHART_TYPE.HORIZONTAL_BAR, CHART_TYPE.HORIZONTAL_GROUP_BAR, CHART_TYPE.STACKED_HORIZONTAL_BAR, CHART_TYPE.COMPLETENESS, CHART_TYPE.COMPLETENESS_GROUP, CHART_TYPE.LINE, CHART_TYPE.LINE_GROUP, CHART_TYPE.AREA, CHART_TYPE.PIE, CHART_TYPE.RING, CHART_TYPE.COMBINATION, CHART_TYPE.DASHBOARD, CHART_TYPE.TREE_MAP, CHART_TYPE.TABLE, CHART_TYPE.BAR_CUSTOM];
|
|
14
18
|
export const CHART_CHART_MAP = {
|
|
15
19
|
[CHART_TYPE.BAR]: CHART_TYPE.BAR,
|
|
16
20
|
[CHART_TYPE.PIE]: CHART_TYPE.PIE,
|
|
@@ -155,17 +159,21 @@ export const THEME_NAME_MAP = {
|
|
|
155
159
|
export const CHART_THEME_COLOR = {
|
|
156
160
|
dark: {
|
|
157
161
|
textColor: '#ffffff',
|
|
162
|
+
fontSize: 13,
|
|
158
163
|
gridColor: '#4E4E56',
|
|
159
164
|
labelColor: '#ffffff',
|
|
160
165
|
legendPageNavigatorMarkerColor: '#ffffff',
|
|
161
166
|
cardColor: '#ffffff'
|
|
162
167
|
},
|
|
163
168
|
light: {
|
|
164
|
-
textColor: '#
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
cardColor: '#545454'
|
|
169
|
+
textColor: '#666666',
|
|
170
|
+
fontSize: 13,
|
|
171
|
+
gridColor: '#e2e2e2',
|
|
172
|
+
labelColor: '#999999',
|
|
173
|
+
cardColor: '#545454',
|
|
174
|
+
legendTextColor: '#333333',
|
|
175
|
+
legendFontSize: 14,
|
|
176
|
+
legendPageNavigatorMarkerColor: '#999999'
|
|
169
177
|
}
|
|
170
178
|
};
|
|
171
179
|
export const DTABLE_DB_SUMMARY_METHOD = {
|
|
@@ -217,4 +225,22 @@ export const TYPE_DISPLAY_COLOR_USING = {
|
|
|
217
225
|
[TYPE_COLOR_USING.USE_SPECIFIC_COLORS]: 'Use_specific_colors',
|
|
218
226
|
[TYPE_COLOR_USING.USE_RULES]: 'Use_rules'
|
|
219
227
|
};
|
|
228
|
+
|
|
229
|
+
// default grid size, grid distance for heat map chart
|
|
230
|
+
export const DEFAULT_GRID_SIZE = 12;
|
|
231
|
+
export const DEFAULT_GRID_DISTANCE = 4;
|
|
232
|
+
export const MONTH_MIRROR = {
|
|
233
|
+
'0': 'Jan',
|
|
234
|
+
'1': 'Feb',
|
|
235
|
+
'2': 'Mar',
|
|
236
|
+
'3': 'Apr',
|
|
237
|
+
'4': 'May',
|
|
238
|
+
'5': 'Jun',
|
|
239
|
+
'6': 'Jul',
|
|
240
|
+
'7': 'Aug',
|
|
241
|
+
'8': 'Sep',
|
|
242
|
+
'9': 'Oct',
|
|
243
|
+
'10': 'Nov',
|
|
244
|
+
'11': 'Dec'
|
|
245
|
+
};
|
|
220
246
|
export { GEOLOCATION_FORMAT_CITY, GEOLOCATION_FORMAT_MAP, CHART_KEY, GENERIC_KEY, GENERIC_KEY_2_SIMILAR_KEYS, STYLE_COLORS, HORIZONTAL_ALIGN, HORIZONTAL_ALIGNS, HORIZONTAL_ALIGN_SHOW, CHART_TYPE, CHART_TYPE_SHOW, CHART_TYPES, CHART_TYPE_IMAGE, GEOLOCATION_GRANULARITY, GEOLOCATION_GRANULARITY_LIST, MAP_LEVEL, MUNICIPALITIES, regions, TABLE_DIMENSIONS };
|
package/dist/constants/model.js
CHANGED
|
@@ -60,6 +60,8 @@ export const CHART_KEY = {
|
|
|
60
60
|
// y_axis_auto_range
|
|
61
61
|
Y_AXIS_AUTO_RANGE: 'y_axis_auto_range',
|
|
62
62
|
HORIZONTAL_AXIS_AUTO_RANGE: 'horizontal_axis_auto_range',
|
|
63
|
+
// y_axises
|
|
64
|
+
Y_AXISES: 'y_axises',
|
|
63
65
|
// y_axis_min
|
|
64
66
|
Y_AXIS_MIN: 'y_axis_min',
|
|
65
67
|
HORIZONTAL_AXIS_MIN: 'horizontal_axis_min',
|
|
@@ -155,6 +157,7 @@ export const GENERIC_KEY = {
|
|
|
155
157
|
Y_AXIS_SHOW_LABEL: CHART_KEY.Y_AXIS_SHOW_LABEL,
|
|
156
158
|
Y_AXIS_LABEL_POSITION: CHART_KEY.Y_AXIS_LABEL_POSITION,
|
|
157
159
|
Y_AXIS_AUTO_RANGE: CHART_KEY.Y_AXIS_AUTO_RANGE,
|
|
160
|
+
Y_AXISES: CHART_KEY.Y_AXISES,
|
|
158
161
|
Y_AXIS_MIN: CHART_KEY.Y_AXIS_MIN,
|
|
159
162
|
Y_AXIS_MAX: CHART_KEY.Y_AXIS_MAX,
|
|
160
163
|
COLUMN_GROUPBY_COLUMN_KEY: CHART_KEY.COLUMN_GROUPBY_COLUMN_KEY,
|
package/dist/constants/style.js
CHANGED
|
@@ -30,4 +30,93 @@ export const STYLE_COLORS = [{
|
|
|
30
30
|
}, {
|
|
31
31
|
name: 'theme6',
|
|
32
32
|
colors: ['#F76856', '#FFAF53', '#6CCDFF', '#C4C4CC', '#D48C82', '#E3C19A', '#A47CFF', '#FFD637', '#96DCFF', '#FFB6B6']
|
|
33
|
+
}];
|
|
34
|
+
export const FILL_BORDER_COLOR_MAP = {
|
|
35
|
+
'#EBEDFO': '#E1E3E6',
|
|
36
|
+
'#9AC5FF': '#8BBBFB',
|
|
37
|
+
'#5C90F9': '#5284EA',
|
|
38
|
+
'#075FBF': '#0453A9',
|
|
39
|
+
'#053791': '#022A72',
|
|
40
|
+
'#CAE9FF': '#BDE1F7',
|
|
41
|
+
'#7DAAFF': '#6F9FF8',
|
|
42
|
+
'#3C77DD': '#356DCF',
|
|
43
|
+
'#0047A5': '#013C8A',
|
|
44
|
+
'#001E79': '#031859',
|
|
45
|
+
'#AAF7D2': '#94E7BF',
|
|
46
|
+
'#74E6B6': '#67D1A4',
|
|
47
|
+
'#42C090': '#36A97D',
|
|
48
|
+
'#17A675': '#139166',
|
|
49
|
+
'#008A5C': '#00734C',
|
|
50
|
+
'#016F44': '#005D39',
|
|
51
|
+
'#00572F': '#004224',
|
|
52
|
+
'#02421C': '#002E13',
|
|
53
|
+
'#003300': '#001E00',
|
|
54
|
+
'#EBE2F1': '#DDD2E4',
|
|
55
|
+
'#D4C4E2': '#C5B1D6',
|
|
56
|
+
'#BFA8D4': '#AE96C4',
|
|
57
|
+
'#A989C5': '#9176A9',
|
|
58
|
+
'#956DB8': '#8460A4',
|
|
59
|
+
'#7B4CA4': '#69408D',
|
|
60
|
+
'#663095': '#522479',
|
|
61
|
+
'#55148E': '#3E0D69',
|
|
62
|
+
'#410475': '#29014C',
|
|
63
|
+
'#FBE2E1': '#EECBC9',
|
|
64
|
+
'#F7C6C6': '#E9B0B0',
|
|
65
|
+
'#F3A9A9': '#E19696',
|
|
66
|
+
'#F17F7E': '#DB6B6A',
|
|
67
|
+
'#ED5655': '#D44746',
|
|
68
|
+
'#D73635': '#BA2C2B',
|
|
69
|
+
'#BD1615': '#9C0C0B',
|
|
70
|
+
'#920404': '#730101',
|
|
71
|
+
'#680303': '#480000',
|
|
72
|
+
'#FFF2D4': '#F4E5C5',
|
|
73
|
+
'#FFE9B8': '#F3DBA5',
|
|
74
|
+
'#FFDD95': '#EFCD84',
|
|
75
|
+
'#FFD470': '#F0C665',
|
|
76
|
+
'#FFC741': '#EDB737',
|
|
77
|
+
'#EDB408': '#D9A405',
|
|
78
|
+
'#D09C10': '#BB8A07',
|
|
79
|
+
'#A37B17': '#8C6911',
|
|
80
|
+
'#775816': '#65480C',
|
|
81
|
+
'#FEE6CE': '#F2D4B5',
|
|
82
|
+
'#FDD1A2': '#EFBF8B',
|
|
83
|
+
'#FDAD6B': '#EF9A54',
|
|
84
|
+
'#FD8D3D': '#EF7C2B',
|
|
85
|
+
'#F06813': '#D75706',
|
|
86
|
+
'#E64F04': '#C44100',
|
|
87
|
+
'#C14308': '#9D3302',
|
|
88
|
+
'#943D04': '#773001',
|
|
89
|
+
'#6D2E02': '#542301',
|
|
90
|
+
'#EBEDF0': '#E1E3E6'
|
|
91
|
+
};
|
|
92
|
+
export const COLOR_OPTIONS = [{
|
|
93
|
+
name: 'blue',
|
|
94
|
+
exampleColors: ['#CAE9FF', '#9AC5FF', '#7DAAFF', '#5C90F9', '#3C77DD', '#075FBF', '#0047A5', '#053791', '#001E79'],
|
|
95
|
+
borderColor: '#5F7190',
|
|
96
|
+
highlightedBorderColor: '#30343A'
|
|
97
|
+
}, {
|
|
98
|
+
name: 'green',
|
|
99
|
+
exampleColors: ['#AAF7D2', '#74E6B6', '#42C090', '#17A675', '#008A5C', '#016F44', '#00572F', '#02421C', '#003300'],
|
|
100
|
+
borderColor: '#5F7190',
|
|
101
|
+
highlightedBorderColor: '#30343A'
|
|
102
|
+
}, {
|
|
103
|
+
name: 'purple',
|
|
104
|
+
exampleColors: ['#EBE2F1', '#D4C4E2', '#BFA8D4', '#A989C5', '#956DB8', '#7B4CA4', '#663095', '#55148E', '#410475'],
|
|
105
|
+
borderColor: '#5F7190',
|
|
106
|
+
highlightedBorderColor: '#30343A'
|
|
107
|
+
}, {
|
|
108
|
+
name: 'red',
|
|
109
|
+
exampleColors: ['#FBE2E1', '#F7C6C6', '#F3A9A9', '#F17F7E', '#ED5655', '#D73635', '#BD1615', '#920404', '#680303'],
|
|
110
|
+
borderColor: '#5F7190',
|
|
111
|
+
highlightedBorderColor: '#30343A'
|
|
112
|
+
}, {
|
|
113
|
+
name: 'yellow',
|
|
114
|
+
exampleColors: ['#FFF2D4', '#FFE9B8', '#FFDD95', '#FFD470', '#FFC741', '#EDB408', '#D09C10', '#A37B17', '#775816'],
|
|
115
|
+
borderColor: '#5F7190',
|
|
116
|
+
highlightedBorderColor: '#30343A'
|
|
117
|
+
}, {
|
|
118
|
+
name: 'orange',
|
|
119
|
+
exampleColors: ['#FEE6CE', '#FDD1A2', '#FDAD6B', '#FD8D3D', '#F06813', '#E64F04', '#C14308', '#943D04', '#6D2E02'],
|
|
120
|
+
borderColor: '#5F7190',
|
|
121
|
+
highlightedBorderColor: '#30343A'
|
|
33
122
|
}];
|
|
@@ -4,6 +4,7 @@ export const CHART_TYPE_IMAGE = {
|
|
|
4
4
|
[CHART_TYPE.BAR_GROUP]: 'bar-group.png',
|
|
5
5
|
[CHART_TYPE.BAR_STACK]: 'bar-stack.png',
|
|
6
6
|
[CHART_TYPE.COMPARE_BAR]: 'compared-chart.png',
|
|
7
|
+
[CHART_TYPE.BAR_CUSTOM]: 'custom-bar.png',
|
|
7
8
|
[CHART_TYPE.HORIZONTAL_BAR]: 'horizontal-bar.png',
|
|
8
9
|
[CHART_TYPE.HORIZONTAL_GROUP_BAR]: 'horizontal-group-bar.png',
|
|
9
10
|
[CHART_TYPE.STACKED_HORIZONTAL_BAR]: 'stacked-horizontal-bar.png',
|