sea-chart 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +117 -1
- package/dist/api/index.js +101 -0
- package/{lib → dist}/components/collaborator/index.js +8 -6
- package/{lib → dist}/components/icon/index.css +1 -1
- package/{lib → dist}/components/icon/index.js +7 -5
- package/dist/components/index.js +8 -0
- package/{lib → dist}/components/loading/index.js +4 -2
- package/dist/components/number-input/index.js +31 -0
- package/{lib → dist}/components/pixel-editor/index.css +4 -4
- package/{lib → dist}/components/pixel-editor/index.js +11 -15
- package/{lib → dist}/components/select-group/index.css +10 -10
- package/dist/components/select-group/index.js +52 -0
- package/dist/components/types-dialog/index.css +97 -0
- package/dist/components/types-dialog/index.js +117 -0
- package/{lib → dist}/constants/geolocation.js +3 -3
- package/dist/constants/index.js +184 -0
- package/{lib → dist}/constants/model.js +25 -5
- package/dist/constants/style.js +15 -0
- package/dist/constants/type-image.js +59 -0
- package/dist/constants/type.js +124 -0
- package/dist/context.js +83 -0
- package/dist/editor/index.js +41 -0
- package/dist/index.js +9 -0
- package/dist/intl.js +37 -0
- package/dist/locale/index.js +18 -0
- package/{lib → dist}/locale/lang/de.js +1 -1
- package/{lib → dist}/locale/lang/en.js +1 -1
- package/{lib → dist}/locale/lang/es.js +1 -1
- package/{lib → dist}/locale/lang/fr.js +1 -1
- package/{lib → dist}/locale/lang/pt.js +1 -1
- package/{lib → dist}/locale/lang/ru.js +1 -1
- package/{lib → dist}/locale/lang/zh_CN.js +1 -1
- package/dist/model/area-group.js +41 -0
- package/dist/model/area.js +32 -0
- package/dist/model/bar-group.js +44 -0
- package/dist/model/bar-stack.js +41 -0
- package/dist/model/bar.js +38 -0
- package/dist/model/base-model.js +9 -0
- package/dist/model/basic-number-card.js +22 -0
- package/dist/model/chart.js +23 -0
- package/dist/model/combination.js +38 -0
- package/dist/model/compare-bar.js +39 -0
- package/dist/model/completeness-group.js +24 -0
- package/dist/model/completeness.js +18 -0
- package/dist/model/dashboard.js +16 -0
- package/dist/model/generic-model.js +224 -0
- package/dist/model/heat-map.js +23 -0
- package/dist/model/horizontal-bar.js +38 -0
- package/dist/model/horizontal-group-bar.js +43 -0
- package/dist/model/index.js +63 -0
- package/dist/model/line-group.js +44 -0
- package/dist/model/line.js +38 -0
- package/dist/model/map-bubble.js +27 -0
- package/dist/model/map.js +27 -0
- package/dist/model/mirror.js +26 -0
- package/dist/model/pie.js +26 -0
- package/dist/model/ring.js +26 -0
- package/dist/model/scatter.js +19 -0
- package/dist/model/stacked-horizontal-bar.js +32 -0
- package/dist/model/table.js +23 -0
- package/dist/model/tree-map.js +20 -0
- package/dist/model/trend.js +24 -0
- package/dist/model/user.js +15 -0
- package/dist/model/world-map-bubble.js +26 -0
- package/dist/model/world-map.js +26 -0
- package/{lib/components → dist}/settings/advance-bar-settings/data-settings.js +68 -45
- package/dist/settings/advance-bar-settings/style-settings.js +161 -0
- package/{lib/components → dist}/settings/bar-settings/data-settings.js +76 -51
- package/dist/settings/bar-settings/style-settings.js +179 -0
- package/dist/settings/basic-number-card/data-settings.js +126 -0
- package/dist/settings/basic-number-card/style-settings.js +42 -0
- package/dist/settings/combination-settings/data-settings.js +279 -0
- package/dist/settings/combination-settings/style-settings.js +174 -0
- package/dist/settings/dashboard-settings/data-settings.js +179 -0
- package/{lib/components → dist}/settings/data-settings.js +28 -22
- package/dist/settings/horizontal-bar-settings/data-settings.js +55 -0
- package/dist/settings/horizontal-bar-settings/style-settings.js +46 -0
- package/dist/settings/index.css +85 -0
- package/dist/settings/index.js +76 -0
- package/{lib/components → dist}/settings/pie-settings/data-settings.js +67 -44
- package/{lib/components → dist}/settings/pie-settings/style-settings.js +67 -49
- package/dist/settings/style-settings.js +118 -0
- package/{lib/components → dist}/settings/table-settings/data-settings.js +269 -208
- package/{lib/components → dist}/settings/time-comparison-settings/data-settings.js +82 -67
- package/dist/settings/time-comparison-settings/style-settings.js +213 -0
- package/dist/settings/widgets/basic-summary/index.css +12 -0
- package/dist/settings/widgets/basic-summary/index.js +176 -0
- package/{lib/components/settings/widgets/statistic-type → dist/settings/widgets/chart-type}/index.css +5 -5
- package/dist/settings/widgets/chart-type/index.js +59 -0
- package/{lib/components → dist}/settings/widgets/common-data-settings.js +24 -18
- package/dist/settings/widgets/data-filter/index.css +17 -0
- package/{lib/components → dist}/settings/widgets/data-filter/index.js +51 -37
- package/dist/settings/widgets/data-sort.js +44 -0
- package/dist/settings/widgets/date-summary-item.js +111 -0
- package/dist/settings/widgets/display-values-settings/index.css +13 -0
- package/{lib/components → dist}/settings/widgets/display-values-settings/index.js +19 -14
- package/{lib/components → dist}/settings/widgets/divider/index.css +1 -1
- package/dist/settings/widgets/divider/index.js +12 -0
- package/{lib/components → dist}/settings/widgets/font-settings/font-size-settings.js +14 -12
- package/{lib/components → dist}/settings/widgets/font-settings/font-weight-settings.js +14 -16
- package/dist/settings/widgets/group-by.js +160 -0
- package/{lib/components → dist}/settings/widgets/label-color.js +10 -10
- package/dist/settings/widgets/min-max-setting.js +52 -0
- package/dist/settings/widgets/mininum-slice-percent.js +63 -0
- package/dist/settings/widgets/numeric-summary-item.js +90 -0
- package/dist/settings/widgets/select-table/index.js +38 -0
- package/dist/settings/widgets/stack.js +50 -0
- package/dist/settings/widgets/summary-method-setting.js +66 -0
- package/dist/settings/widgets/summary-settings.js +411 -0
- package/dist/settings/widgets/switch/index.css +37 -0
- package/{lib/components → dist}/settings/widgets/switch/index.js +11 -8
- package/{lib/components → dist}/settings/widgets/text-horizontal-settings.js +12 -10
- package/dist/settings/widgets/time-picker.js +174 -0
- package/{lib/components → dist}/settings/widgets/title-settings/index.js +15 -13
- package/dist/settings/widgets/title-settings/title-text.js +25 -0
- package/dist/settings/widgets/x-axios.js +0 -0
- package/dist/settings/widgets/y-axis-group-settings.js +438 -0
- package/dist/utils/cell-format-utils.js +42 -0
- package/dist/utils/chart-data-sql.js +606 -0
- package/dist/utils/chart-utils.js +1803 -0
- package/dist/utils/chart.js +6 -0
- package/dist/utils/collaborator-manager.js +24 -0
- package/dist/utils/collaborator-utils.js +40 -0
- package/dist/utils/column-2-sql-column.js +551 -0
- package/dist/utils/column-utils.js +208 -0
- package/{lib → dist}/utils/custom-g2.js +11 -11
- package/{lib → dist}/utils/date-translate.js +11 -11
- package/dist/utils/index.js +48 -0
- package/dist/utils/key-generator.js +13 -0
- package/dist/utils/object-utils.js +45 -0
- package/{lib → dist}/utils/options-utils.js +17 -18
- package/dist/view/index.css +53 -0
- package/dist/view/index.js +169 -0
- package/{lib/layout → dist/view}/title/index.css +1 -1
- package/dist/view/title/index.js +46 -0
- package/dist/view/wrapper/area.js +150 -0
- package/dist/view/wrapper/bar-group.js +148 -0
- package/dist/view/wrapper/bar.js +138 -0
- package/dist/view/wrapper/basic-number-card.js +127 -0
- package/dist/view/wrapper/chart-component.js +261 -0
- package/dist/view/wrapper/combination.js +399 -0
- package/dist/view/wrapper/dashboard.js +164 -0
- package/dist/view/wrapper/horizontal-bar-group.js +149 -0
- package/dist/view/wrapper/horizontal-bar.js +140 -0
- package/dist/view/wrapper/horizontal-component.js +78 -0
- package/{lib/components/formatter → dist/view/wrapper}/index.js +90 -71
- package/dist/view/wrapper/line-group.js +145 -0
- package/dist/view/wrapper/line.js +157 -0
- package/dist/view/wrapper/pie.js +185 -0
- package/dist/view/wrapper/ring.js +264 -0
- package/{lib/components/formatter → dist/view/wrapper}/table/index.css +18 -18
- package/dist/view/wrapper/table/index.js +31 -0
- package/dist/view/wrapper/table/one-dimension-table-no-numeric-columns.js +144 -0
- package/dist/view/wrapper/table/one-dimension-table-with-numeric-columns.js +198 -0
- package/dist/view/wrapper/table/pivot-table-display-name.js +248 -0
- package/dist/view/wrapper/table/two-dimension-table.js +249 -0
- package/dist/view/wrapper/treemap.js +186 -0
- package/package.json +92 -101
- package/lib/components/formatter/area.js +0 -162
- package/lib/components/formatter/bar-group.js +0 -160
- package/lib/components/formatter/bar.js +0 -150
- package/lib/components/formatter/basic-number-card.js +0 -138
- package/lib/components/formatter/chart-component.js +0 -266
- package/lib/components/formatter/combination.js +0 -407
- package/lib/components/formatter/dashboard.js +0 -182
- package/lib/components/formatter/horizontal-bar-group.js +0 -161
- package/lib/components/formatter/horizontal-bar.js +0 -152
- package/lib/components/formatter/horizontal-component.js +0 -91
- package/lib/components/formatter/line-group.js +0 -157
- package/lib/components/formatter/line.js +0 -170
- package/lib/components/formatter/pie.js +0 -201
- package/lib/components/formatter/ring.js +0 -277
- package/lib/components/formatter/table/index.js +0 -42
- package/lib/components/formatter/table/one-dimension-table-no-numeric-columns.js +0 -145
- package/lib/components/formatter/table/one-dimension-table-with-numeric-columns.js +0 -193
- package/lib/components/formatter/table/pivot-table-display-name.js +0 -249
- package/lib/components/formatter/table/two-dimension-table.js +0 -241
- package/lib/components/formatter/treemap.js +0 -213
- package/lib/components/index.js +0 -5
- package/lib/components/number-input/index.js +0 -31
- package/lib/components/select-group/index.js +0 -63
- package/lib/components/settings/advance-bar-settings/style-settings.js +0 -149
- package/lib/components/settings/bar-settings/style-settings.js +0 -163
- package/lib/components/settings/basic-number-card/data-settings.js +0 -121
- package/lib/components/settings/basic-number-card/style-settings.js +0 -42
- package/lib/components/settings/combination-settings/data-settings.js +0 -256
- package/lib/components/settings/combination-settings/style-settings.js +0 -183
- package/lib/components/settings/dashboard-settings/data-settings.js +0 -167
- package/lib/components/settings/horizontal-bar-settings/data-settings.js +0 -45
- package/lib/components/settings/horizontal-bar-settings/style-settings.js +0 -38
- package/lib/components/settings/index.css +0 -73
- package/lib/components/settings/index.js +0 -74
- package/lib/components/settings/style-settings.js +0 -100
- package/lib/components/settings/time-comparison-settings/style-settings.js +0 -191
- package/lib/components/settings/widgets/basic-summary/index.css +0 -12
- package/lib/components/settings/widgets/basic-summary/index.js +0 -173
- package/lib/components/settings/widgets/data-filter/index.css +0 -17
- package/lib/components/settings/widgets/data-sort.js +0 -38
- package/lib/components/settings/widgets/date-summary-item.js +0 -126
- package/lib/components/settings/widgets/display-values-settings/index.css +0 -13
- package/lib/components/settings/widgets/divider/index.js +0 -10
- package/lib/components/settings/widgets/group-by.js +0 -168
- package/lib/components/settings/widgets/min-max-setting.js +0 -64
- package/lib/components/settings/widgets/mininum-slice-percent.js +0 -72
- package/lib/components/settings/widgets/numeric-summary-item.js +0 -109
- package/lib/components/settings/widgets/select-table/index.js +0 -49
- package/lib/components/settings/widgets/stack.js +0 -58
- package/lib/components/settings/widgets/statistic-type/index.js +0 -54
- package/lib/components/settings/widgets/summary-method-setting.js +0 -80
- package/lib/components/settings/widgets/summary-settings.js +0 -394
- package/lib/components/settings/widgets/switch/index.css +0 -37
- package/lib/components/settings/widgets/time-picker.js +0 -182
- package/lib/components/settings/widgets/title-settings/title-text.js +0 -31
- package/lib/components/settings/widgets/y-axis-group-settings.js +0 -399
- package/lib/components/types-dialog/index.css +0 -97
- package/lib/components/types-dialog/index.js +0 -127
- package/lib/constants/index.js +0 -164
- package/lib/constants/style.js +0 -13
- package/lib/constants/type-image.js +0 -32
- package/lib/constants/type.js +0 -97
- package/lib/context.js +0 -49
- package/lib/index.js +0 -6
- package/lib/intl.js +0 -37
- package/lib/layout/index.js +0 -4
- package/lib/layout/statistic/index.css +0 -53
- package/lib/layout/statistic/index.js +0 -190
- package/lib/layout/title/index.js +0 -41
- package/lib/locale/index.js +0 -11
- package/lib/model/area-group.js +0 -51
- package/lib/model/area.js +0 -42
- package/lib/model/bar-group.js +0 -54
- package/lib/model/bar-stack.js +0 -51
- package/lib/model/bar.js +0 -48
- package/lib/model/base-model.js +0 -11
- package/lib/model/basic-number-card.js +0 -32
- package/lib/model/combination.js +0 -48
- package/lib/model/compare-bar.js +0 -49
- package/lib/model/completeness-group.js +0 -34
- package/lib/model/completeness.js +0 -28
- package/lib/model/dashboard.js +0 -26
- package/lib/model/generic-model.js +0 -235
- package/lib/model/heat-map.js +0 -33
- package/lib/model/horizontal-bar.js +0 -48
- package/lib/model/horizontal-group-bar.js +0 -53
- package/lib/model/index.js +0 -36
- package/lib/model/line-group.js +0 -54
- package/lib/model/line.js +0 -48
- package/lib/model/map-bubble.js +0 -37
- package/lib/model/map.js +0 -37
- package/lib/model/mirror.js +0 -36
- package/lib/model/pie.js +0 -36
- package/lib/model/ring.js +0 -36
- package/lib/model/scatter.js +0 -29
- package/lib/model/stacked-horizontal-bar.js +0 -42
- package/lib/model/statistic.js +0 -22
- package/lib/model/table.js +0 -33
- package/lib/model/tree-map.js +0 -30
- package/lib/model/trend.js +0 -34
- package/lib/model/user.js +0 -22
- package/lib/model/world-map-bubble.js +0 -36
- package/lib/model/world-map.js +0 -36
- package/lib/utils/cell-format-utils.js +0 -41
- package/lib/utils/chart.js +0 -6
- package/lib/utils/collaborator-utils.js +0 -40
- package/lib/utils/column-utils.js +0 -247
- package/lib/utils/data-filter/filter-item-utils.js +0 -80
- package/lib/utils/data-filter/filters-utils.js +0 -406
- package/lib/utils/data-filter/index.js +0 -3
- package/lib/utils/index.js +0 -50
- package/lib/utils/key-generator.js +0 -13
- package/lib/utils/object-utils.js +0 -61
- package/lib/utils/statistic-column-2-sql-column-utils.js +0 -499
- package/lib/utils/statistic-utils.js +0 -1685
- /package/{lib → dist}/assets/icons/area-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/bar-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/card.svg +0 -0
- /package/{lib → dist}/assets/icons/combination-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/dtable-logo.svg +0 -0
- /package/{lib → dist}/assets/icons/facet-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/gauge.svg +0 -0
- /package/{lib → dist}/assets/icons/heat-map.svg +0 -0
- /package/{lib → dist}/assets/icons/histogram.svg +0 -0
- /package/{lib → dist}/assets/icons/line-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/map.svg +0 -0
- /package/{lib → dist}/assets/icons/pie-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/rectangular-tree-diagram.svg +0 -0
- /package/{lib → dist}/assets/icons/scatter-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/type-change.svg +0 -0
- /package/{lib → dist}/assets/img/area-chart.png +0 -0
- /package/{lib → dist}/assets/img/area-group-chart.png +0 -0
- /package/{lib → dist}/assets/img/bar-group.png +0 -0
- /package/{lib → dist}/assets/img/bar-stack.png +0 -0
- /package/{lib → dist}/assets/img/bar.png +0 -0
- /package/{lib → dist}/assets/img/combination-chart.png +0 -0
- /package/{lib → dist}/assets/img/compared-chart.png +0 -0
- /package/{lib → dist}/assets/img/completeness-chart.png +0 -0
- /package/{lib → dist}/assets/img/custom-bar.png +0 -0
- /package/{lib → dist}/assets/img/dashboard-chart.png +0 -0
- /package/{lib → dist}/assets/img/group-completeness-chart.png +0 -0
- /package/{lib → dist}/assets/img/group_line.png +0 -0
- /package/{lib → dist}/assets/img/heat-map.png +0 -0
- /package/{lib → dist}/assets/img/horizontal-bar.png +0 -0
- /package/{lib → dist}/assets/img/horizontal-group-bar.png +0 -0
- /package/{lib → dist}/assets/img/line.png +0 -0
- /package/{lib → dist}/assets/img/map-bubble.png +0 -0
- /package/{lib → dist}/assets/img/map.png +0 -0
- /package/{lib → dist}/assets/img/mirror.png +0 -0
- /package/{lib → dist}/assets/img/number-card.png +0 -0
- /package/{lib → dist}/assets/img/pie.png +0 -0
- /package/{lib → dist}/assets/img/pivot-table.png +0 -0
- /package/{lib → dist}/assets/img/ring.png +0 -0
- /package/{lib → dist}/assets/img/scatter.png +0 -0
- /package/{lib → dist}/assets/img/stacked-horizontal-bar.png +0 -0
- /package/{lib → dist}/assets/img/treemap.png +0 -0
- /package/{lib → dist}/assets/img/trend-chart.png +0 -0
- /package/{lib → dist}/assets/img/world-map-bubble.png +0 -0
- /package/{lib → dist}/assets/img/world-map.png +0 -0
- /package/{lib → dist}/components/loading/index.css +0 -0
- /package/{lib/components/settings/widgets/select-table → dist/editor}/index.css +0 -0
- /package/{lib/components → dist}/settings/advance-bar-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/bar-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/basic-number-card/index.js +0 -0
- /package/{lib/components → dist}/settings/combination-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/dashboard-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/horizontal-bar-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/pie-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/table-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/time-comparison-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/widgets/font-settings/index.js +0 -0
- /package/{lib/components/settings/widgets/x-axios.js → dist/settings/widgets/select-table/index.css} +0 -0
package/lib/constants/index.js
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
var _STATISTIC_CHART_MAP, _STATISTIC_DATA_SORT_, _LABEL_POSITION_TYPE_, _STATISTIC_LABEL_FORM, _STATISTIC_LABEL_POSI;
|
|
3
|
-
import { CellType, DEFAULT_NUMBER_FORMAT } from 'dtable-utils';
|
|
4
|
-
import { GEOLOCATION_FORMAT_CITY, GEOLOCATION_FORMAT_MAP } from './geolocation';
|
|
5
|
-
import { CHART_KEY, GENERIC_KEY, GENERIC_KEY_2_SIMILAR_KEYS } from './model';
|
|
6
|
-
import { STYLE_COLORS, HORIZONTAL_ALIGN, HORIZONTAL_ALIGNS, HORIZONTAL_ALIGN_SHOW } from './style';
|
|
7
|
-
import { STATISTIC_TYPE, STATISTIC_TYPE_SHOW, STATISTIC_TYPES } from './type';
|
|
8
|
-
import { STATISTIC_TYPE_IMAGE } from './type-image';
|
|
9
|
-
export var ZH_CN_SUPPORT_STATISTICS = [STATISTIC_TYPE.MAP, STATISTIC_TYPE.MAP_BUBBLE];
|
|
10
|
-
export var SUPPORT_DATA_SORT_STATISTIC_TYPES = [STATISTIC_TYPE.BAR, STATISTIC_TYPE.LINE, STATISTIC_TYPE.PIE, STATISTIC_TYPE.RING, STATISTIC_TYPE.HORIZONTAL_BAR, STATISTIC_TYPE.AREA, STATISTIC_TYPE.TREE_MAP];
|
|
11
|
-
export var X_AXIS_IS_GROUPBY_COLUMN_KEY_STATISTIC_TYPES = [STATISTIC_TYPE.TABLE, STATISTIC_TYPE.PIE, STATISTIC_TYPE.RING, STATISTIC_TYPE.TREE_MAP];
|
|
12
|
-
export var SUPPORT_TITLE_CHART_TYPES = [STATISTIC_TYPE.BAR, STATISTIC_TYPE.BAR_GROUP, STATISTIC_TYPE.HORIZONTAL_BAR, STATISTIC_TYPE.HORIZONTAL_GROUP_BAR, STATISTIC_TYPE.LINE, STATISTIC_TYPE.LINE_GROUP, STATISTIC_TYPE.AREA, STATISTIC_TYPE.PIE, STATISTIC_TYPE.RING, STATISTIC_TYPE.COMBINATION, STATISTIC_TYPE.DASHBOARD, STATISTIC_TYPE.TREE_MAP];
|
|
13
|
-
export var STATISTIC_CHART_MAP = (_STATISTIC_CHART_MAP = {}, _defineProperty(_STATISTIC_CHART_MAP, STATISTIC_TYPE.BAR, STATISTIC_TYPE.BAR), _defineProperty(_STATISTIC_CHART_MAP, STATISTIC_TYPE.PIE, STATISTIC_TYPE.PIE), _defineProperty(_STATISTIC_CHART_MAP, STATISTIC_TYPE.LINE, STATISTIC_TYPE.LINE), _defineProperty(_STATISTIC_CHART_MAP, STATISTIC_TYPE.TABLE, STATISTIC_TYPE.TABLE), _STATISTIC_CHART_MAP);
|
|
14
|
-
export var STATISTIC_SUMMARY_TYPE = {
|
|
15
|
-
COUNT: 'count',
|
|
16
|
-
ADVANCED: 'advanced',
|
|
17
|
-
DAY: 'day',
|
|
18
|
-
WEEK: 'week',
|
|
19
|
-
QUARTER: 'quarter',
|
|
20
|
-
MONTH: 'month',
|
|
21
|
-
YEAR: 'year',
|
|
22
|
-
SUM: 'Sum',
|
|
23
|
-
MAX: 'Max',
|
|
24
|
-
MIN: 'Min',
|
|
25
|
-
MEAN: 'Mean',
|
|
26
|
-
PROVINCE: GEOLOCATION_FORMAT_MAP.PROVINCE,
|
|
27
|
-
CITY: GEOLOCATION_FORMAT_CITY,
|
|
28
|
-
DISTRICT: 'district',
|
|
29
|
-
DISTINCT_VALUES: 'distinct_values',
|
|
30
|
-
ROW_COUNT: 'Row_count'
|
|
31
|
-
};
|
|
32
|
-
export var STATISTIC_SUMMARY_SHOW = {
|
|
33
|
-
'count': 'Counting',
|
|
34
|
-
'advanced': 'Summarize_a_field',
|
|
35
|
-
'day': 'By_day',
|
|
36
|
-
'week': 'By_week',
|
|
37
|
-
'month': 'By_month',
|
|
38
|
-
'quarter': 'By_quarter',
|
|
39
|
-
'year': 'By_year',
|
|
40
|
-
'Sum': 'Sum',
|
|
41
|
-
'Max': 'Max',
|
|
42
|
-
'Min': 'Min',
|
|
43
|
-
'Mean': 'Mean',
|
|
44
|
-
'Distinct_values': 'Number_of_distinct_values',
|
|
45
|
-
'province': 'By_province',
|
|
46
|
-
'city': 'By_city',
|
|
47
|
-
'district': 'By_district',
|
|
48
|
-
'Row_count': 'Row_count'
|
|
49
|
-
};
|
|
50
|
-
export var PIE_CHART_COLORS = ['#46A1FD', '#4ECCCB', '#59CB74', '#FBD44A', '#F4667C', '#9860E5', '#9F8CF1', '#DC82D2', '#EAA775', '#ADDF84', '#85E0BE', '#89D2EA'];
|
|
51
|
-
export var STATISTIC_SUMMARY_CALCULATION_METHOD = ['Sum', 'Max', 'Min', 'Mean', 'Distinct_values'];
|
|
52
|
-
export var BASIC_NUMBER_CARD_CALCULATION_METHOD = 'Row_count';
|
|
53
|
-
export var STATISTIC_DATE_SUMMARY_CALCULATION_METHOD = ['Max', 'Min', 'Distinct_values'];
|
|
54
|
-
export var STATISTIC_SUPPORT_COLUMNS = [CellType.DATE, CellType.SINGLE_SELECT, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR, CellType.TEXT, CellType.NUMBER, CellType.FORMULA, CellType.LINK_FORMULA, CellType.GEOLOCATION, CellType.LINK, CellType.MTIME, CellType.CTIME, CellType.CREATOR, CellType.LAST_MODIFIER, CellType.CHECKBOX, CellType.RATE, CellType.DURATION];
|
|
55
|
-
export var STATISTIC_SUPPORT_SORT_COLUMNS = [CellType.TEXT, CellType.NUMBER, CellType.DATE, CellType.SINGLE_SELECT, CellType.FORMULA, CellType.LINK_FORMULA, CellType.CTIME, CellType.MTIME, CellType.RATE, CellType.DURATION];
|
|
56
|
-
export var LABEL_COLORS = ['#2a67d1', '#4ecccb', '#59cb74', '#fbd44a', '#f4667c', '#9860e5', '#9f8cf1', '#dc82d2', '#eaa775', '#addf84', '#85e0be', '#89d2ea'];
|
|
57
|
-
export var DATE_GRANULATES = [STATISTIC_SUMMARY_TYPE.DAY, STATISTIC_SUMMARY_TYPE.WEEK, STATISTIC_SUMMARY_TYPE.MONTH, STATISTIC_SUMMARY_TYPE.QUARTER, STATISTIC_SUMMARY_TYPE.YEAR];
|
|
58
|
-
export var GEOLOCATION_GRANULATES = [STATISTIC_SUMMARY_TYPE.PROVINCE, STATISTIC_SUMMARY_TYPE.CITY, STATISTIC_SUMMARY_TYPE.DISTRICT];
|
|
59
|
-
export var STATISTIC_SUMMARY_TYPES = [STATISTIC_SUMMARY_TYPE.COUNT, STATISTIC_SUMMARY_TYPE.ADVANCED];
|
|
60
|
-
export var STATISTIC_DATA_SORT_TYPE = {
|
|
61
|
-
NOT_SORTED: 'not_sorted',
|
|
62
|
-
ASCENDING: 'ascending',
|
|
63
|
-
DESCENDING: 'descending'
|
|
64
|
-
};
|
|
65
|
-
export var STATISTIC_DATA_SORT_TYPES = [STATISTIC_DATA_SORT_TYPE.NOT_SORTED, STATISTIC_DATA_SORT_TYPE.ASCENDING, STATISTIC_DATA_SORT_TYPE.DESCENDING];
|
|
66
|
-
export var STATISTIC_DATA_SORT_TYPE_SHOW = (_STATISTIC_DATA_SORT_ = {}, _defineProperty(_STATISTIC_DATA_SORT_, STATISTIC_DATA_SORT_TYPE.NOT_SORTED, 'Not_sorted'), _defineProperty(_STATISTIC_DATA_SORT_, STATISTIC_DATA_SORT_TYPE.ASCENDING, 'Ascending'), _defineProperty(_STATISTIC_DATA_SORT_, STATISTIC_DATA_SORT_TYPE.DESCENDING, 'Descending'), _STATISTIC_DATA_SORT_);
|
|
67
|
-
export var LABEL_POSITION_TYPE = {
|
|
68
|
-
LEFT: 'left',
|
|
69
|
-
CENTER: 'center',
|
|
70
|
-
RIGHT: 'right',
|
|
71
|
-
BOTTOM: 'bottom',
|
|
72
|
-
TOP: 'top'
|
|
73
|
-
};
|
|
74
|
-
export var X_LABEL_POSITIONS = [LABEL_POSITION_TYPE.LEFT, LABEL_POSITION_TYPE.CENTER, LABEL_POSITION_TYPE.RIGHT];
|
|
75
|
-
export var Y_LABEL_POSITIONS = [LABEL_POSITION_TYPE.BOTTOM, LABEL_POSITION_TYPE.CENTER, LABEL_POSITION_TYPE.TOP];
|
|
76
|
-
export var LABEL_POSITION_TYPE_SHOW = (_LABEL_POSITION_TYPE_ = {}, _defineProperty(_LABEL_POSITION_TYPE_, LABEL_POSITION_TYPE.LEFT, 'Left'), _defineProperty(_LABEL_POSITION_TYPE_, LABEL_POSITION_TYPE.CENTER, 'Center'), _defineProperty(_LABEL_POSITION_TYPE_, LABEL_POSITION_TYPE.RIGHT, 'Right'), _defineProperty(_LABEL_POSITION_TYPE_, LABEL_POSITION_TYPE.BOTTOM, 'Bottom'), _defineProperty(_LABEL_POSITION_TYPE_, LABEL_POSITION_TYPE.TOP, 'Top'), _LABEL_POSITION_TYPE_);
|
|
77
|
-
export var STATISTIC_STYLE_SETTING_KEYS = ['x_axis_show_label', 'x_axis_label_position', 'y_axis_show_label', 'y_axis_label_position', 'y_axis_auto_range', 'y_axis_min', 'y_axis_max', 'y_axis_label_color', 'y_axis_show_value', 'label_font_size', 'increase_display_color', 'display_increase', 'display_increase_percentage', 'show_legend', 'minimum_slice_percent', 'label_format', 'label_position', 'display_label', 'horizontal_axis_label_color', 'display_data', 'name', 'y_axis_left_label_position', 'y_axis_right_label_position', 'show_y_axis_left_label', 'show_y_axis_right_label', 'y_axis_auto_range_left', 'y_axis_min_left', 'y_axis_max_left', 'y_axis_auto_range_right', 'y_axis_min_right', 'y_axis_max_right'];
|
|
78
|
-
export var DEFAULT_LABEL_FONT_SIZE = 12;
|
|
79
|
-
export var STATISTIC_Y_GROUP_TYPE = {
|
|
80
|
-
COUNT: 'count',
|
|
81
|
-
SINGLE_NUMERIC_COLUMN: 'single_numeric_column',
|
|
82
|
-
MULTIPLE_NUMERIC_COLUMN: 'multiple_numeric_column'
|
|
83
|
-
};
|
|
84
|
-
export var STATISTIC_DATE_COLUMN_LIST = [CellType.CTIME, CellType.MTIME, CellType.DATE];
|
|
85
|
-
|
|
86
|
-
// label formats for pie, ring charts
|
|
87
|
-
export var STATISTIC_LABEL_FORMAT = {
|
|
88
|
-
PERCENT: 'percent',
|
|
89
|
-
VALUE: 'value',
|
|
90
|
-
VALUE_PERCENT: 'value_percent'
|
|
91
|
-
};
|
|
92
|
-
export var STATISTIC_LABEL_FORMATS = [STATISTIC_LABEL_FORMAT.PERCENT, STATISTIC_LABEL_FORMAT.VALUE, STATISTIC_LABEL_FORMAT.VALUE_PERCENT];
|
|
93
|
-
export var STATISTIC_LABEL_FORMAT_SHOW = (_STATISTIC_LABEL_FORM = {}, _defineProperty(_STATISTIC_LABEL_FORM, STATISTIC_LABEL_FORMAT.PERCENT, 'Percent'), _defineProperty(_STATISTIC_LABEL_FORM, STATISTIC_LABEL_FORMAT.VALUE, 'Numeric_value'), _defineProperty(_STATISTIC_LABEL_FORM, STATISTIC_LABEL_FORMAT.VALUE_PERCENT, 'Numeric_value_and_percent'), _STATISTIC_LABEL_FORM);
|
|
94
|
-
|
|
95
|
-
// label positions for pie, ring charts
|
|
96
|
-
export var STATISTIC_LABEL_POSITION = {
|
|
97
|
-
INSIDE: 'inside',
|
|
98
|
-
OUTSIDE: 'outside'
|
|
99
|
-
};
|
|
100
|
-
export var STATISTIC_LABEL_POSITIONS = [STATISTIC_LABEL_POSITION.INSIDE, STATISTIC_LABEL_POSITION.OUTSIDE];
|
|
101
|
-
export var STATISTIC_LABEL_POSITION_SHOW = (_STATISTIC_LABEL_POSI = {}, _defineProperty(_STATISTIC_LABEL_POSI, STATISTIC_LABEL_POSITION.INSIDE, 'Inside_the_chart'), _defineProperty(_STATISTIC_LABEL_POSI, STATISTIC_LABEL_POSITION.OUTSIDE, 'Outside_the_chart'), _STATISTIC_LABEL_POSI);
|
|
102
|
-
export var BAR_MAP_TO_HORIZONTAL_MAP = {
|
|
103
|
-
x_axis_column_key: 'vertical_axis_column_key',
|
|
104
|
-
x_axis_date_granularity: 'vertical_axis_date_granularity',
|
|
105
|
-
x_axis_geolocation_granularity: 'vertical_axis_geolocation_granularity',
|
|
106
|
-
x_axis_include_empty_cells: 'vertical_axis_include_empty',
|
|
107
|
-
y_axis_summary_type: 'horizontal_axis_summary_type',
|
|
108
|
-
y_axis_summary_method: 'horizontal_axis_summary_method',
|
|
109
|
-
y_axis_summary_column_key: 'horizontal_axis_column_key',
|
|
110
|
-
x_axis_show_label: 'show_vertical_axis_label',
|
|
111
|
-
x_axis_label_position: 'vertical_axis_label_position',
|
|
112
|
-
y_axis_show_label: 'show_horizontal_axis_label',
|
|
113
|
-
y_axis_label_position: 'horizontal_axis_label_position',
|
|
114
|
-
y_axis_show_value: 'display_data',
|
|
115
|
-
y_axis_label_color: 'horizontal_axis_label_color',
|
|
116
|
-
y_axis_auto_range: 'horizontal_axis_auto_range',
|
|
117
|
-
y_axis_max: 'horizontal_axis_max',
|
|
118
|
-
y_axis_mix: 'horizontal_axis_min'
|
|
119
|
-
};
|
|
120
|
-
export var DEFAULT_NUMBER_FORMAT_OBJECT = {
|
|
121
|
-
format: DEFAULT_NUMBER_FORMAT
|
|
122
|
-
};
|
|
123
|
-
export var EMPTY_NAME = 'Empty';
|
|
124
|
-
export var STATISTIC_THEME_COLOR = {
|
|
125
|
-
dark: {
|
|
126
|
-
textColor: '#ffffff',
|
|
127
|
-
gridColor: '#4E4E56',
|
|
128
|
-
labelColor: '#ffffff',
|
|
129
|
-
legendPageNavigatorMarkerColor: '#ffffff',
|
|
130
|
-
cardColor: '#ffffff'
|
|
131
|
-
},
|
|
132
|
-
light: {
|
|
133
|
-
textColor: '#6e6e6e',
|
|
134
|
-
gridColor: '#bfbfbf',
|
|
135
|
-
labelColor: '#000000',
|
|
136
|
-
legendPageNavigatorMarkerColor: '#000000',
|
|
137
|
-
cardColor: '#545454'
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
export var DTABLE_DB_SUMMARY_METHOD = {
|
|
141
|
-
MEAN: 'AVG',
|
|
142
|
-
MAX: 'MAX',
|
|
143
|
-
SUM: 'SUM',
|
|
144
|
-
MIN: 'MIN',
|
|
145
|
-
COUNT: 'COUNT',
|
|
146
|
-
ROW_COUNT: 'COUNT',
|
|
147
|
-
DISTINCT_VALUES: 'DISTINCT_VALUES'
|
|
148
|
-
};
|
|
149
|
-
export var LEGEND_DIRECTION = {
|
|
150
|
-
VERTICAL: 'vertical'
|
|
151
|
-
};
|
|
152
|
-
export var MIRROR_COLUMN_LIST = [CellType.TEXT, CellType.NUMBER, CellType.CTIME, CellType.MTIME, CellType.DATE, CellType.COLLABORATOR, CellType.AUTO_NUMBER, CellType.FORMULA, CellType.GEOLOCATION, CellType.URL, CellType.SINGLE_SELECT, CellType.LINK, CellType.CREATOR, CellType.LAST_MODIFIER, CellType.DURATION, CellType.EMAIL];
|
|
153
|
-
export var STATISTIC_SUPPORT_FONT_WEIGHTS = [400, 700];
|
|
154
|
-
export var DEFAULT_STATISTIC_FONT_WEIGHT = STATISTIC_SUPPORT_FONT_WEIGHTS[1];
|
|
155
|
-
export var DEFAULT_STATISTIC_TITLE_FONT_SIZE = 24;
|
|
156
|
-
export var STATISTIC_SETTINGS_TYPE = {
|
|
157
|
-
DATA: 'data',
|
|
158
|
-
STYLE: 'style'
|
|
159
|
-
};
|
|
160
|
-
export var COMBINATION_POSITION = {
|
|
161
|
-
LEFT: 'left',
|
|
162
|
-
RIGHT: 'right'
|
|
163
|
-
};
|
|
164
|
-
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, STATISTIC_TYPE, STATISTIC_TYPE_SHOW, STATISTIC_TYPES, STATISTIC_TYPE_IMAGE };
|
package/lib/constants/style.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
var _HORIZONTAL_ALIGN_SHO;
|
|
3
|
-
export var HORIZONTAL_ALIGN = {
|
|
4
|
-
LEFT: 'left',
|
|
5
|
-
CENTER: 'center',
|
|
6
|
-
RIGHT: 'right'
|
|
7
|
-
};
|
|
8
|
-
export var HORIZONTAL_ALIGNS = [HORIZONTAL_ALIGN.LEFT, HORIZONTAL_ALIGN.CENTER, HORIZONTAL_ALIGN.RIGHT];
|
|
9
|
-
export var HORIZONTAL_ALIGN_SHOW = (_HORIZONTAL_ALIGN_SHO = {}, _defineProperty(_HORIZONTAL_ALIGN_SHO, HORIZONTAL_ALIGN.LEFT, 'Left'), _defineProperty(_HORIZONTAL_ALIGN_SHO, HORIZONTAL_ALIGN.CENTER, 'Center'), _defineProperty(_HORIZONTAL_ALIGN_SHO, HORIZONTAL_ALIGN.RIGHT, 'Right'), _HORIZONTAL_ALIGN_SHO);
|
|
10
|
-
export var STYLE_COLORS = [{
|
|
11
|
-
name: 'theme0',
|
|
12
|
-
colors: ['#5B8FF9', '#5AD8A6', '#5D7092', '#F6BD16', '#6F5EF9', '#6DC8EC', '#945FB9', '#FF9845', '#1E9493', '#FF99C3']
|
|
13
|
-
}];
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
var _STATISTIC_TYPE_IMAGE;
|
|
3
|
-
import bar from '../assets/img/bar.png';
|
|
4
|
-
import barGroup from '../assets/img/bar-group.png';
|
|
5
|
-
import barStack from '../assets/img/bar-stack.png';
|
|
6
|
-
import comparedChart from '../assets/img/compared-chart.png';
|
|
7
|
-
import horizontalBar from '../assets/img/horizontal-bar.png';
|
|
8
|
-
import horizontalGroupBar from '../assets/img/horizontal-group-bar.png';
|
|
9
|
-
import stackedHorizontalBar from '../assets/img/stacked-horizontal-bar.png';
|
|
10
|
-
import completenessChart from '../assets/img/combination-chart.png';
|
|
11
|
-
import groupCompletenessChart from '../assets/img/group-completeness-chart.png';
|
|
12
|
-
import line from '../assets/img/line.png';
|
|
13
|
-
import groupLine from '../assets/img/group_line.png';
|
|
14
|
-
import area from '../assets/img/area-chart.png';
|
|
15
|
-
import areaGroupChat from '../assets/img/area-group-chart.png';
|
|
16
|
-
import pie from '../assets/img/pie.png';
|
|
17
|
-
import ring from '../assets/img/ring.png';
|
|
18
|
-
import scatter from '../assets/img/scatter.png';
|
|
19
|
-
import combinationChart from '../assets/img/combination-chart.png';
|
|
20
|
-
import map from '../assets/img/map.png';
|
|
21
|
-
import mapBubble from '../assets/img/map-bubble.png';
|
|
22
|
-
import worldMap from '../assets/img/world-map.png';
|
|
23
|
-
import worldMapBubble from '../assets/img/world-map-bubble.png';
|
|
24
|
-
import heatMap from '../assets/img/heat-map.png';
|
|
25
|
-
import mirror from '../assets/img/mirror.png';
|
|
26
|
-
import numberCard from '../assets/img/number-card.png';
|
|
27
|
-
import trendChart from '../assets/img/trend-chart.png';
|
|
28
|
-
import dashboardChart from '../assets/img/dashboard-chart.png';
|
|
29
|
-
import treemap from '../assets/img/treemap.png';
|
|
30
|
-
import pivotTable from '../assets/img/pivot-table.png';
|
|
31
|
-
import { STATISTIC_TYPE } from './type';
|
|
32
|
-
export var STATISTIC_TYPE_IMAGE = (_STATISTIC_TYPE_IMAGE = {}, _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.BAR, bar), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.BAR_GROUP, barGroup), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.BAR_STACK, barStack), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.COMPARE_BAR, comparedChart), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.HORIZONTAL_BAR, horizontalBar), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.HORIZONTAL_GROUP_BAR, horizontalGroupBar), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.STACKED_HORIZONTAL_BAR, stackedHorizontalBar), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.COMPLETENESS, completenessChart), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.COMPLETENESS_GROUP, groupCompletenessChart), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.LINE, line), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.LINE_GROUP, groupLine), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.AREA, area), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.AREA_GROUP, areaGroupChat), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.PIE, pie), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.RING, ring), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.SCATTER, scatter), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.COMBINATION, combinationChart), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.MAP, map), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.MAP_BUBBLE, mapBubble), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.WORLD_MAP, worldMap), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.WORLD_MAP_BUBBLE, worldMapBubble), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.HEAT_MAP, heatMap), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.MIRROR, mirror), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.BASIC_NUMBER_CARD, numberCard), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.TREND, trendChart), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.DASHBOARD, dashboardChart), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.TREE_MAP, treemap), _defineProperty(_STATISTIC_TYPE_IMAGE, STATISTIC_TYPE.TABLE, pivotTable), _STATISTIC_TYPE_IMAGE);
|
package/lib/constants/type.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
var _STATISTIC_TYPE_SHOW;
|
|
3
|
-
export var STATISTIC_TYPE = {
|
|
4
|
-
BAR: 'bar',
|
|
5
|
-
BAR_GROUP: 'bar_group',
|
|
6
|
-
BAR_STACK: 'bar_stack',
|
|
7
|
-
COMPARE_BAR: 'compare_bar',
|
|
8
|
-
HORIZONTAL_BAR: 'horizontal_bar',
|
|
9
|
-
HORIZONTAL_GROUP_BAR: 'horizontal_group_bar',
|
|
10
|
-
STACKED_HORIZONTAL_BAR: 'stacked_horizontal_bar',
|
|
11
|
-
COMPLETENESS: 'completeness',
|
|
12
|
-
COMPLETENESS_GROUP: 'completeness_group',
|
|
13
|
-
LINE: 'line',
|
|
14
|
-
LINE_GROUP: 'line_group',
|
|
15
|
-
AREA: 'area',
|
|
16
|
-
AREA_GROUP: 'area_group',
|
|
17
|
-
PIE: 'pie',
|
|
18
|
-
RING: 'ring',
|
|
19
|
-
SCATTER: 'scatter',
|
|
20
|
-
COMBINATION: 'combination',
|
|
21
|
-
MAP: 'map',
|
|
22
|
-
MAP_BUBBLE: 'map_bubble',
|
|
23
|
-
WORLD_MAP: 'world_map',
|
|
24
|
-
WORLD_MAP_BUBBLE: 'world_map_bubble',
|
|
25
|
-
HEAT_MAP: 'heat_map',
|
|
26
|
-
MIRROR: 'mirror',
|
|
27
|
-
BASIC_NUMBER_CARD: 'basic_number_card',
|
|
28
|
-
TREND: 'trend',
|
|
29
|
-
DASHBOARD: 'dashboard',
|
|
30
|
-
TREE_MAP: 'tree_map',
|
|
31
|
-
TABLE: 'table'
|
|
32
|
-
};
|
|
33
|
-
export var STATISTIC_TYPE_SHOW = (_STATISTIC_TYPE_SHOW = {}, _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.BAR, 'Basic_histogram'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.BAR_GROUP, 'Grouped_histogram'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.BAR_STACK, 'Stacked_histogram'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.COMPARE_BAR, 'Time_comparison_histogram'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.HORIZONTAL_BAR, 'Basic_bar_chart'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.HORIZONTAL_GROUP_BAR, 'Grouped_bar_chart'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.STACKED_HORIZONTAL_BAR, 'Stacked_bar_chart'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.COMPLETENESS, 'Completeness'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.COMPLETENESS_GROUP, 'Grouped_completeness'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.LINE, 'Basic_line_chart'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.LINE_GROUP, 'Grouped_line_chart'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.AREA, 'Area'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.AREA_GROUP, 'Grouped_area'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.PIE, 'Basic_pie_chart'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.RING, 'Ring_chart'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.SCATTER, 'Scatter_chart'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.COMBINATION, 'Combination'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.MAP, '中国地图'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.MAP_BUBBLE, '中国地图(气泡图)'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.WORLD_MAP, 'World_map'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.WORLD_MAP_BUBBLE, 'World_map_bubble'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.HEAT_MAP, 'Heat_map'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.MIRROR, 'Mirror_chart'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.BASIC_NUMBER_CARD, 'Basic_number_card'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.TREND, 'Trend'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.DASHBOARD, 'Gauge'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.TREE_MAP, 'Tree_map'), _defineProperty(_STATISTIC_TYPE_SHOW, STATISTIC_TYPE.TABLE, 'Pivot_table'), _STATISTIC_TYPE_SHOW);
|
|
34
|
-
export var STATISTIC_TYPES = [{
|
|
35
|
-
name: 'Histogram',
|
|
36
|
-
icon: 'histogram',
|
|
37
|
-
// children: [STATISTIC_TYPE.BAR, STATISTIC_TYPE.BAR_GROUP, STATISTIC_TYPE.BAR_STACK, STATISTIC_TYPE.COMPARE_BAR]
|
|
38
|
-
children: [STATISTIC_TYPE.BAR, STATISTIC_TYPE.BAR_GROUP]
|
|
39
|
-
}, {
|
|
40
|
-
name: 'Bar_chart',
|
|
41
|
-
icon: 'bar-chart',
|
|
42
|
-
// children: [STATISTIC_TYPE.HORIZONTAL_BAR, STATISTIC_TYPE.HORIZONTAL_GROUP_BAR, STATISTIC_TYPE.STACKED_HORIZONTAL_BAR,
|
|
43
|
-
// STATISTIC_TYPE.COMPLETENESS, STATISTIC_TYPE.COMPLETENESS_GROUP]
|
|
44
|
-
children: [STATISTIC_TYPE.HORIZONTAL_BAR, STATISTIC_TYPE.HORIZONTAL_GROUP_BAR]
|
|
45
|
-
}, {
|
|
46
|
-
name: 'Line_chart',
|
|
47
|
-
icon: 'line-chart',
|
|
48
|
-
children: [STATISTIC_TYPE.LINE, STATISTIC_TYPE.LINE_GROUP]
|
|
49
|
-
}, {
|
|
50
|
-
name: 'Area',
|
|
51
|
-
icon: 'area-chart',
|
|
52
|
-
// children: [STATISTIC_TYPE.AREA, STATISTIC_TYPE.AREA_GROUP]
|
|
53
|
-
children: [STATISTIC_TYPE.AREA]
|
|
54
|
-
}, {
|
|
55
|
-
name: 'Pie_chart',
|
|
56
|
-
icon: 'pie-chart',
|
|
57
|
-
children: [STATISTIC_TYPE.PIE, STATISTIC_TYPE.RING]
|
|
58
|
-
},
|
|
59
|
-
// {
|
|
60
|
-
// name: 'Scatter_chart',
|
|
61
|
-
// icon: 'scatter-chart',
|
|
62
|
-
// children: [STATISTIC_TYPE.SCATTER]
|
|
63
|
-
// },
|
|
64
|
-
{
|
|
65
|
-
name: 'Combination',
|
|
66
|
-
icon: 'combination-chart',
|
|
67
|
-
children: [STATISTIC_TYPE.COMBINATION]
|
|
68
|
-
}, {
|
|
69
|
-
// name: 'Map',
|
|
70
|
-
// icon: 'map',
|
|
71
|
-
// children: [STATISTIC_TYPE.MAP, STATISTIC_TYPE.MAP_BUBBLE, STATISTIC_TYPE.WORLD_MAP, STATISTIC_TYPE.WORLD_MAP_BUBBLE]
|
|
72
|
-
// }, {
|
|
73
|
-
// name: 'Heat_map',
|
|
74
|
-
// icon: 'heat-map',
|
|
75
|
-
// children: [STATISTIC_TYPE.HEAT_MAP]
|
|
76
|
-
// }, {
|
|
77
|
-
// name: 'Facet_chart',
|
|
78
|
-
// icon: 'facet-chart',
|
|
79
|
-
// children: [STATISTIC_TYPE.MIRROR]
|
|
80
|
-
// }, {
|
|
81
|
-
name: 'Card',
|
|
82
|
-
icon: 'card',
|
|
83
|
-
// children: [STATISTIC_TYPE.BASIC_NUMBER_CARD, STATISTIC_TYPE.TREND]
|
|
84
|
-
children: [STATISTIC_TYPE.BASIC_NUMBER_CARD]
|
|
85
|
-
}, {
|
|
86
|
-
name: 'Gauge',
|
|
87
|
-
icon: 'gauge',
|
|
88
|
-
children: [STATISTIC_TYPE.DASHBOARD]
|
|
89
|
-
}, {
|
|
90
|
-
name: 'Tree_map',
|
|
91
|
-
icon: 'rectangular-tree-diagram',
|
|
92
|
-
children: [STATISTIC_TYPE.TREE_MAP]
|
|
93
|
-
}, {
|
|
94
|
-
name: 'Pivot_table',
|
|
95
|
-
icon: 'dtable-logo',
|
|
96
|
-
children: [STATISTIC_TYPE.TABLE]
|
|
97
|
-
}];
|
package/lib/context.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import { User } from './model';
|
|
4
|
-
var Context = /*#__PURE__*/function () {
|
|
5
|
-
function Context(eventBus, config) {
|
|
6
|
-
_classCallCheck(this, Context);
|
|
7
|
-
this.settings = config || {};
|
|
8
|
-
this.collaboratorsCache = {};
|
|
9
|
-
this.eventBus = eventBus || {};
|
|
10
|
-
}
|
|
11
|
-
_createClass(Context, [{
|
|
12
|
-
key: "getCollaboratorFromCache",
|
|
13
|
-
value: function getCollaboratorFromCache(email) {
|
|
14
|
-
return this.collaboratorsCache[email];
|
|
15
|
-
}
|
|
16
|
-
}, {
|
|
17
|
-
key: "getCollaboratorsFromCache",
|
|
18
|
-
value: function getCollaboratorsFromCache() {
|
|
19
|
-
var collaboratorsCache = this.collaboratorsCache;
|
|
20
|
-
return Object.values(collaboratorsCache).filter(function (item) {
|
|
21
|
-
return item.email !== 'anonymous';
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}, {
|
|
25
|
-
key: "updateCollaboratorsCache",
|
|
26
|
-
value: function updateCollaboratorsCache(email, collaborator) {
|
|
27
|
-
this.collaboratorsCache[email] = collaborator instanceof User ? collaborator : new User(collaborator);
|
|
28
|
-
this.eventBus.dispatch && this.eventBus.dispatch('query-collaborator', email);
|
|
29
|
-
}
|
|
30
|
-
}, {
|
|
31
|
-
key: "setSettings",
|
|
32
|
-
value: function setSettings() {
|
|
33
|
-
var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
34
|
-
this.settings = settings;
|
|
35
|
-
}
|
|
36
|
-
}, {
|
|
37
|
-
key: "getSettings",
|
|
38
|
-
value: function getSettings() {
|
|
39
|
-
return this.settings;
|
|
40
|
-
}
|
|
41
|
-
}, {
|
|
42
|
-
key: "getSetting",
|
|
43
|
-
value: function getSetting(key) {
|
|
44
|
-
return this.settings[key] || this.settings[key] === false ? this.settings[key] : '';
|
|
45
|
-
}
|
|
46
|
-
}]);
|
|
47
|
-
return Context;
|
|
48
|
-
}();
|
|
49
|
-
export default Context;
|
package/lib/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import Statistic, { Settings, StyleSettings } from './layout';
|
|
2
|
-
import { StatisticsUtils } from './utils';
|
|
3
|
-
import { StatisticModel } from './model';
|
|
4
|
-
import { STATISTIC_TYPE } from './constants';
|
|
5
|
-
export default Statistic;
|
|
6
|
-
export { Settings, StyleSettings, StatisticsUtils, StatisticModel, STATISTIC_TYPE };
|
package/lib/intl.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import LOCALES from './locale';
|
|
4
|
-
var Intl = /*#__PURE__*/_createClass(function Intl(_ref) {
|
|
5
|
-
var _this = this;
|
|
6
|
-
var _ref$lang = _ref.lang,
|
|
7
|
-
_lang = _ref$lang === void 0 ? 'en' : _ref$lang;
|
|
8
|
-
_classCallCheck(this, Intl);
|
|
9
|
-
this.setLang = function () {
|
|
10
|
-
var lang = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en';
|
|
11
|
-
var validLang = lang.toLowerCase();
|
|
12
|
-
if (validLang === _this.lang) return;
|
|
13
|
-
_this.lang = validLang;
|
|
14
|
-
_this.translation = LOCALES[_this.lang] || LOCALES['en'];
|
|
15
|
-
};
|
|
16
|
-
this.get = function (key) {
|
|
17
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
18
|
-
if (typeof key !== 'string') return '';
|
|
19
|
-
var optionsKeys = Object.keys(options);
|
|
20
|
-
if (optionsKeys.length === 0) {
|
|
21
|
-
return _this.translation[key] || key;
|
|
22
|
-
}
|
|
23
|
-
if (key.indexOf('{') < 0) return key;
|
|
24
|
-
return key.replace(/\\?\{([^{}]+)\}/g, function (match, name) {
|
|
25
|
-
if (match.charAt(0) === '\\') {
|
|
26
|
-
return match.slice(1);
|
|
27
|
-
}
|
|
28
|
-
return options[name] === null || options[name] === undefined ? '' : options[name];
|
|
29
|
-
}) || key;
|
|
30
|
-
};
|
|
31
|
-
this.lang = _lang.toLowerCase();
|
|
32
|
-
this.translation = LOCALES[this.lang];
|
|
33
|
-
});
|
|
34
|
-
var intl = new Intl({
|
|
35
|
-
lang: 'en'
|
|
36
|
-
});
|
|
37
|
-
export default intl;
|
package/lib/layout/index.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
.seastatistic-formatter {
|
|
2
|
-
height: 100%;
|
|
3
|
-
width: 100%;
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
justify-content: center;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.seastatistic-formatter-tip {
|
|
10
|
-
background-color: #F5F5F5;
|
|
11
|
-
border-radius: 4px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.seastatistic-formatter.error {
|
|
15
|
-
color: red;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.seastatistic-formatter .seastatistic-formatter-container {
|
|
19
|
-
height: 100%;
|
|
20
|
-
width: 100%;
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.seastatistic-formatter .seastatistic-table-formatter-container {
|
|
27
|
-
overflow: scroll;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.seastatistic-formatter .seastatistic-container {
|
|
31
|
-
flex: 1;
|
|
32
|
-
font-size: 12px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.seastatistic-formatter .seastatistic-container.show-x-axis-label,
|
|
36
|
-
.seastatistic-formatter .seastatistic-container.show-horizontal-axis-label {
|
|
37
|
-
padding-bottom: 20px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.seastatistic-formatter .seastatistic-container.show-y-axis-label,
|
|
41
|
-
.seastatistic-formatter .seastatistic-container.show-y-axis-left-label,
|
|
42
|
-
.seastatistic-formatter .seastatistic-container.show-vertical-axis-label {
|
|
43
|
-
padding-left: 20px;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.seastatistic-formatter .seastatistic-container.show-y-axis-right-label {
|
|
47
|
-
padding-right: 20px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.seastatistic-formatter .g2-html-annotation {
|
|
51
|
-
transform: translate(-50%, -50%);
|
|
52
|
-
width: fit-content;
|
|
53
|
-
}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import classnames from 'classnames';
|
|
7
|
-
import shallowEqual from 'shallowequal';
|
|
8
|
-
import intl from '../../intl';
|
|
9
|
-
import { Formatter, Loading } from '../../components';
|
|
10
|
-
import { StatisticsUtils } from '../../utils';
|
|
11
|
-
import Context from '../../context';
|
|
12
|
-
import Title from '../title';
|
|
13
|
-
import './index.css';
|
|
14
|
-
var Statistic = /*#__PURE__*/function (_React$PureComponent) {
|
|
15
|
-
_inherits(Statistic, _React$PureComponent);
|
|
16
|
-
var _super = _createSuper(Statistic);
|
|
17
|
-
function Statistic(props) {
|
|
18
|
-
var _this;
|
|
19
|
-
_classCallCheck(this, Statistic);
|
|
20
|
-
_this = _super.call(this, props);
|
|
21
|
-
_this.callback = function (errorMessage, tipMessage, data) {
|
|
22
|
-
if (errorMessage) {
|
|
23
|
-
_this.setState({
|
|
24
|
-
errorMessage: errorMessage,
|
|
25
|
-
tipMessage: '',
|
|
26
|
-
data: null,
|
|
27
|
-
isCalculated: true
|
|
28
|
-
});
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (tipMessage) {
|
|
32
|
-
_this.setState({
|
|
33
|
-
errorMessage: '',
|
|
34
|
-
tipMessage: tipMessage,
|
|
35
|
-
data: null,
|
|
36
|
-
isCalculated: true
|
|
37
|
-
});
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
if (!data) {
|
|
41
|
-
_this.setState({
|
|
42
|
-
errorMessage: '',
|
|
43
|
-
tipMessage: 'There_are_no_statistic_results_yet',
|
|
44
|
-
data: null,
|
|
45
|
-
isCalculated: true
|
|
46
|
-
});
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
_this.setState({
|
|
50
|
-
errorMessage: '',
|
|
51
|
-
tipMessage: '',
|
|
52
|
-
data: data,
|
|
53
|
-
isCalculated: true
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
_this.calculateStatistic = function () {
|
|
57
|
-
var isNeedRequestData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
58
|
-
var _this$props = _this.props,
|
|
59
|
-
tables = _this$props.tables,
|
|
60
|
-
statistic = _this$props.statistic,
|
|
61
|
-
queryDataAPI = _this$props.queryDataAPI,
|
|
62
|
-
isStatisticalData = _this$props.isStatisticalData;
|
|
63
|
-
var data = _this.state.data;
|
|
64
|
-
if (!isNeedRequestData) {
|
|
65
|
-
StatisticsUtils.calculateStaticStatistic(tables, statistic, data, _this.callback);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
StatisticsUtils.calculateStatistic(statistic, queryDataAPI, tables, _this.callback, isStatisticalData);
|
|
69
|
-
};
|
|
70
|
-
_this.state = {
|
|
71
|
-
isCalculated: false,
|
|
72
|
-
data: null,
|
|
73
|
-
errorMessage: '',
|
|
74
|
-
tipMessage: ''
|
|
75
|
-
};
|
|
76
|
-
return _this;
|
|
77
|
-
}
|
|
78
|
-
_createClass(Statistic, [{
|
|
79
|
-
key: "componentDidMount",
|
|
80
|
-
value: function componentDidMount() {
|
|
81
|
-
var _window$seaStatistic, _window$seaStatistic2;
|
|
82
|
-
var _this$props2 = this.props,
|
|
83
|
-
queryUsersAPI = _this$props2.queryUsersAPI,
|
|
84
|
-
context = _this$props2.context,
|
|
85
|
-
config = _this$props2.config,
|
|
86
|
-
eventBus = _this$props2.eventBus;
|
|
87
|
-
if (!window.seaStatistic) {
|
|
88
|
-
window.seaStatistic = {};
|
|
89
|
-
}
|
|
90
|
-
if (!((_window$seaStatistic = window.seaStatistic) === null || _window$seaStatistic === void 0 ? void 0 : _window$seaStatistic.queryUsers)) {
|
|
91
|
-
window.seaStatistic.queryUsers = queryUsersAPI;
|
|
92
|
-
}
|
|
93
|
-
if (!((_window$seaStatistic2 = window.seaStatistic) === null || _window$seaStatistic2 === void 0 ? void 0 : _window$seaStatistic2.context)) {
|
|
94
|
-
var validContext = context || new Context(eventBus, config);
|
|
95
|
-
window.seaStatistic.context = validContext;
|
|
96
|
-
var lang = validContext.getSetting('lang') || 'zh-cn';
|
|
97
|
-
intl.setLang(lang);
|
|
98
|
-
}
|
|
99
|
-
this.calculateStatistic();
|
|
100
|
-
}
|
|
101
|
-
}, {
|
|
102
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
103
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
104
|
-
var _this2 = this;
|
|
105
|
-
var oldStatistic = this.props.statistic;
|
|
106
|
-
var statistic = nextProps.statistic;
|
|
107
|
-
if (shallowEqual(statistic, oldStatistic)) return;
|
|
108
|
-
this.setState({
|
|
109
|
-
isCalculated: false
|
|
110
|
-
}, function () {
|
|
111
|
-
if (StatisticsUtils.isStatisticTypeChange(statistic, oldStatistic)) {
|
|
112
|
-
_this2.calculateStatistic();
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
if (StatisticsUtils.isStatisticStyleChange(statistic, oldStatistic)) {
|
|
116
|
-
_this2.setState({
|
|
117
|
-
isCalculated: true
|
|
118
|
-
});
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
if (StatisticsUtils.isStatisticSortChange(statistic, oldStatistic)) {
|
|
122
|
-
_this2.calculateStatistic(false);
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
_this2.calculateStatistic();
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
}, {
|
|
129
|
-
key: "render",
|
|
130
|
-
value: function render() {
|
|
131
|
-
var _statistic$config;
|
|
132
|
-
var _this$props3 = this.props,
|
|
133
|
-
statistic = _this$props3.statistic,
|
|
134
|
-
className = _this$props3.className,
|
|
135
|
-
tables = _this$props3.tables,
|
|
136
|
-
canvasStyle = _this$props3.canvasStyle;
|
|
137
|
-
var _this$state = this.state,
|
|
138
|
-
data = _this$state.data,
|
|
139
|
-
isCalculated = _this$state.isCalculated,
|
|
140
|
-
errorMessage = _this$state.errorMessage,
|
|
141
|
-
tipMessage = _this$state.tipMessage;
|
|
142
|
-
var validClassName = classnames('seastatistic-formatter', className);
|
|
143
|
-
var tipBackgroundColorClassName = 'seastatistic-formatter-tip';
|
|
144
|
-
if (!isCalculated) {
|
|
145
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
146
|
-
className: classnames('loading', validClassName)
|
|
147
|
-
}, /*#__PURE__*/React.createElement(Loading, null));
|
|
148
|
-
}
|
|
149
|
-
if (errorMessage) {
|
|
150
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
151
|
-
className: classnames('error', validClassName, tipBackgroundColorClassName)
|
|
152
|
-
}, intl.get(errorMessage));
|
|
153
|
-
}
|
|
154
|
-
if (tipMessage) {
|
|
155
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
156
|
-
className: classnames('error', validClassName, tipBackgroundColorClassName)
|
|
157
|
-
}, intl.get(tipMessage));
|
|
158
|
-
}
|
|
159
|
-
if (StatisticsUtils.imEmptyStatistic(data)) {
|
|
160
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
161
|
-
className: classnames('error', validClassName, tipBackgroundColorClassName)
|
|
162
|
-
}, intl.get('There_are_no_statistic_results_yet'));
|
|
163
|
-
}
|
|
164
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
165
|
-
className: validClassName
|
|
166
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
167
|
-
className: classnames('seastatistic-formatter-container', "seastatistic-".concat(statistic === null || statistic === void 0 ? void 0 : (_statistic$config = statistic.config) === null || _statistic$config === void 0 ? void 0 : _statistic$config.type, "-formatter-container"))
|
|
168
|
-
}, /*#__PURE__*/React.createElement(Title, {
|
|
169
|
-
statistic: statistic
|
|
170
|
-
}), /*#__PURE__*/React.createElement(Formatter, {
|
|
171
|
-
statistic: statistic,
|
|
172
|
-
data: data,
|
|
173
|
-
tables: tables,
|
|
174
|
-
canvasStyle: canvasStyle
|
|
175
|
-
})));
|
|
176
|
-
}
|
|
177
|
-
}]);
|
|
178
|
-
return Statistic;
|
|
179
|
-
}(React.PureComponent);
|
|
180
|
-
Statistic.defaultProps = {
|
|
181
|
-
isStatisticalData: true,
|
|
182
|
-
canvasStyle: {},
|
|
183
|
-
tables: [],
|
|
184
|
-
statistic: {
|
|
185
|
-
id: '',
|
|
186
|
-
config: {},
|
|
187
|
-
style_config: {}
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
export default Statistic;
|