sea-chart 2.0.36 → 2.0.38
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 +8 -15
- package/dist/components/cell-factory/FormatterConfig.js +55 -62
- package/dist/components/cell-factory/SimpleCellFormatter.js +5 -12
- package/dist/components/cell-factory/SingleSelectOption.js +11 -18
- package/dist/components/cell-factory/cell-editor-factory.js +5 -12
- package/dist/components/cell-factory/cell-formatter-factory.js +4 -11
- package/dist/components/cell-factory/link-content.js +30 -38
- package/dist/components/chart-color-selector/color-selector.js +11 -18
- package/dist/components/collaborator/index.js +7 -14
- package/dist/components/color-picker/index.js +12 -19
- package/dist/components/color-popover/color-rules/color-rule.js +26 -34
- package/dist/components/color-popover/color-rules/index.js +7 -15
- package/dist/components/color-popover/color-rules/rule-filters/filter.js +27 -34
- package/dist/components/color-popover/color-rules/rule-filters/index.js +17 -25
- package/dist/components/color-popover/color-rules/rule-filters/number-input.js +9 -17
- package/dist/components/color-popover/color-rules-popover.js +30 -38
- package/dist/components/color-popover/color-selector-popover.js +12 -20
- package/dist/components/color-setting/color-group-selector.js +13 -21
- package/dist/components/common-add-tool/index.js +8 -15
- package/dist/components/data-process-setter/data-setting-header.js +7 -14
- package/dist/components/data-process-setter/hide-column-setter.js +13 -20
- package/dist/components/data-process-setter/index.js +4 -27
- package/dist/components/data-process-setter/sort-setter.js +18 -26
- package/dist/components/draggable/Draggable.js +7 -13
- package/dist/components/drill-down-settings/drill-down-fields-popover/index.js +40 -48
- package/dist/components/drill-down-settings/drill-down-fields-settings/index.js +10 -18
- package/dist/components/drill-down-settings/index.js +11 -18
- package/dist/components/dtable-popover/index.js +13 -20
- package/dist/components/dtable-search-input/index.js +13 -21
- package/dist/components/font-settings/index.js +14 -22
- package/dist/components/goal-line-setting/goal-setting-item.js +6 -14
- package/dist/components/goal-line-setting/index.js +12 -19
- package/dist/components/highlighter/highlighter.js +7 -14
- package/dist/components/icon/index.js +5 -12
- package/dist/components/index.js +7 -48
- package/dist/components/loading/index.js +6 -13
- package/dist/components/number-input/index.js +4 -11
- package/dist/components/pixel-editor/index.js +15 -23
- package/dist/components/popover/hide-column-popover/hide-column-popover-widgets/hide-column-item.js +8 -15
- package/dist/components/popover/hide-column-popover/hide-column-popover.js +26 -34
- package/dist/components/popover/sort-popover/sort-popover-widgets/sort-utils.js +9 -18
- package/dist/components/popover/sort-popover/sort-popover.js +55 -65
- package/dist/components/resize-handle/ResizeHandle.js +6 -13
- package/dist/components/row-card/row-card-header-cell.js +17 -24
- package/dist/components/row-card/row-card-header.js +15 -22
- package/dist/components/row-card/row-card-item.js +35 -43
- package/dist/components/row-card/row-card.js +17 -25
- package/dist/components/statistic-record-dialog/index.js +56 -64
- package/dist/components/tooltip/index.js +14 -21
- package/dist/components/types-dialog/index.js +62 -70
- package/dist/components/types-dialog/use-force-update.js +4 -10
- package/dist/constants/color-rules.js +8 -14
- package/dist/constants/common-constants.js +8 -14
- package/dist/constants/error.js +2 -8
- package/dist/constants/geolocation.js +9 -15
- package/dist/constants/index.js +142 -271
- package/dist/constants/key-codes.js +0 -2
- package/dist/constants/model.js +3 -9
- package/dist/constants/regions.js +3 -8
- package/dist/constants/style.js +6 -12
- package/dist/constants/table.js +1 -7
- package/dist/constants/type-image.js +33 -39
- package/dist/constants/type.js +3 -9
- package/dist/context.js +13 -20
- package/dist/editor/index.js +8 -15
- package/dist/index.js +13 -104
- package/dist/intl.js +10 -17
- package/dist/locale/index.js +16 -23
- package/dist/locale/lang/de.js +1 -7
- package/dist/locale/lang/en.js +1 -7
- package/dist/locale/lang/es.js +1 -7
- package/dist/locale/lang/fr.js +1 -7
- package/dist/locale/lang/pt.js +1 -7
- package/dist/locale/lang/ru.js +1 -7
- package/dist/locale/lang/zh_CN.js +1 -7
- package/dist/model/area-group.js +12 -19
- package/dist/model/area.js +12 -19
- package/dist/model/bar-custom.js +11 -18
- package/dist/model/bar-group.js +12 -19
- package/dist/model/bar-stack.js +10 -17
- package/dist/model/bar.js +11 -18
- package/dist/model/base-model.js +4 -11
- package/dist/model/basic-number-card.js +13 -20
- package/dist/model/chart.js +7 -13
- package/dist/model/combination.js +15 -22
- package/dist/model/compare-bar.js +14 -21
- package/dist/model/completeness-group.js +11 -18
- package/dist/model/completeness.js +10 -17
- package/dist/model/dashboard.js +7 -14
- package/dist/model/funnel.js +14 -21
- package/dist/model/generic-model.js +135 -143
- package/dist/model/heat-map.js +9 -16
- package/dist/model/horizontal-bar.js +11 -18
- package/dist/model/horizontal-group-bar.js +10 -17
- package/dist/model/index.js +69 -93
- package/dist/model/line-group.js +13 -20
- package/dist/model/line.js +12 -19
- package/dist/model/map-bubble.js +12 -19
- package/dist/model/map.js +12 -19
- package/dist/model/mirror.js +13 -20
- package/dist/model/pie.js +12 -19
- package/dist/model/ring.js +12 -19
- package/dist/model/scatter.js +10 -17
- package/dist/model/stacked-horizontal-bar.js +11 -18
- package/dist/model/table-element.js +5 -12
- package/dist/model/table.js +7 -14
- package/dist/model/tree-map.js +7 -14
- package/dist/model/trend.js +11 -18
- package/dist/model/user.js +1 -7
- package/dist/model/world-map-bubble.js +12 -19
- package/dist/model/world-map.js +12 -19
- package/dist/services/map-json.js +11 -17
- package/dist/settings/advance-bar-settings/data-settings.js +36 -44
- package/dist/settings/advance-bar-settings/index.js +3 -20
- package/dist/settings/advance-bar-settings/style-settings.js +63 -71
- package/dist/settings/bar-settings/data-settings.js +39 -47
- package/dist/settings/bar-settings/index.js +3 -20
- package/dist/settings/bar-settings/style-settings.js +49 -57
- package/dist/settings/basic-number-card/data-settings.js +49 -57
- package/dist/settings/basic-number-card/index.js +3 -20
- package/dist/settings/basic-number-card/style-settings.js +19 -27
- package/dist/settings/combination-settings/data-settings.js +55 -63
- package/dist/settings/combination-settings/index.js +3 -20
- package/dist/settings/combination-settings/style-settings.js +65 -73
- package/dist/settings/completeness-settings/callbacks/callbacks.js +16 -27
- package/dist/settings/completeness-settings/data-settings/completion-settings.js +21 -28
- package/dist/settings/completeness-settings/data-settings/data-settings.js +25 -32
- package/dist/settings/completeness-settings/index.js +3 -20
- package/dist/settings/completeness-settings/style-settings.js +19 -26
- package/dist/settings/dashboard-settings/data-settings.js +43 -51
- package/dist/settings/dashboard-settings/index.js +2 -13
- package/dist/settings/data-settings.js +72 -79
- package/dist/settings/funnel-settings/components/dnd-item/dnd-item.js +12 -19
- package/dist/settings/funnel-settings/components/dnd-list.js +15 -23
- package/dist/settings/funnel-settings/components/funnel-label-setting.js +32 -40
- package/dist/settings/funnel-settings/components/funnel-layer-setting.js +20 -28
- package/dist/settings/funnel-settings/data-settings.js +23 -31
- package/dist/settings/funnel-settings/index.js +3 -20
- package/dist/settings/funnel-settings/style-settings.js +11 -19
- package/dist/settings/heat-map-settings/data-settings.js +18 -26
- package/dist/settings/heat-map-settings/index.js +3 -20
- package/dist/settings/heat-map-settings/style-settings.js +18 -26
- package/dist/settings/horizontal-bar-settings/data-settings.js +12 -19
- package/dist/settings/horizontal-bar-settings/index.js +3 -20
- package/dist/settings/horizontal-bar-settings/style-settings.js +12 -19
- package/dist/settings/index.js +52 -70
- package/dist/settings/map-settings/components/location-field-selector.js +10 -17
- package/dist/settings/map-settings/components/map-level-selector.js +11 -18
- package/dist/settings/map-settings/components/map-province-city-selector.js +19 -26
- package/dist/settings/map-settings/index.js +3 -20
- package/dist/settings/map-settings/map-data-settings.js +23 -30
- package/dist/settings/map-settings/map-style-settings.js +27 -35
- package/dist/settings/mirror-settings/data-settings.js +26 -34
- package/dist/settings/mirror-settings/index.js +2 -13
- package/dist/settings/pie-settings/data-settings.js +33 -41
- package/dist/settings/pie-settings/index.js +3 -20
- package/dist/settings/pie-settings/style-settings.js +47 -55
- package/dist/settings/scatter/data-settings.js +27 -34
- package/dist/settings/scatter/index.js +3 -12
- package/dist/settings/stacks-settings/index.js +19 -27
- package/dist/settings/stacks-settings/stack-item-settings.js +19 -27
- package/dist/settings/style-settings.js +65 -73
- package/dist/settings/table-element-settings/components/data-filter.js +30 -38
- package/dist/settings/table-element-settings/data-settings.js +21 -29
- package/dist/settings/table-element-settings/index.js +2 -13
- package/dist/settings/table-settings/data-settings.js +112 -120
- package/dist/settings/table-settings/index.js +2 -13
- package/dist/settings/time-comparison-settings/data-settings.js +43 -51
- package/dist/settings/time-comparison-settings/index.js +3 -20
- package/dist/settings/time-comparison-settings/style-settings.js +42 -50
- package/dist/settings/trend-settings/data-settings.js +24 -32
- package/dist/settings/trend-settings/index.js +3 -20
- package/dist/settings/trend-settings/style-setting.js +19 -27
- package/dist/settings/widgets/basic-summary/index.js +55 -63
- package/dist/settings/widgets/chart-type/index.js +18 -26
- package/dist/settings/widgets/color-settings/index.js +72 -80
- package/dist/settings/widgets/common-data-settings.js +21 -29
- package/dist/settings/widgets/data-filter/index.js +35 -43
- package/dist/settings/widgets/data-sort.js +16 -24
- package/dist/settings/widgets/date-summary-item.js +26 -34
- package/dist/settings/widgets/display-values-settings/index.js +14 -22
- package/dist/settings/widgets/divider/index.js +8 -16
- package/dist/settings/widgets/font-settings/font-color-settings.js +11 -19
- package/dist/settings/widgets/font-settings/font-size-settings.js +14 -22
- package/dist/settings/widgets/font-settings/font-weight-settings.js +17 -25
- package/dist/settings/widgets/font-settings/index.js +4 -27
- package/dist/settings/widgets/group-by.js +51 -59
- package/dist/settings/widgets/min-max-setting.js +10 -18
- package/dist/settings/widgets/mininum-slice-percent.js +10 -18
- package/dist/settings/widgets/numeric-summary-item.js +25 -33
- package/dist/settings/widgets/select-line-type/index.js +10 -17
- package/dist/settings/widgets/select-table/index.js +9 -16
- package/dist/settings/widgets/select-view/index.js +20 -28
- package/dist/settings/widgets/stack.js +14 -22
- package/dist/settings/widgets/summary-method-setting.js +17 -25
- package/dist/settings/widgets/summary-settings.js +74 -82
- package/dist/settings/widgets/switch/index.js +9 -16
- package/dist/settings/widgets/text-horizontal-settings.js +15 -23
- package/dist/settings/widgets/time-picker.js +29 -37
- package/dist/settings/widgets/title-settings/index.js +29 -37
- package/dist/settings/widgets/title-settings/title-text.js +5 -12
- package/dist/settings/widgets/x-axios.js +0 -1
- package/dist/settings/widgets/y-axis-group-settings.js +64 -72
- package/dist/utils/cell-format-utils.js +17 -27
- package/dist/utils/cell-value-utils.js +4 -11
- package/dist/utils/chart-utils/base-utils.js +324 -332
- package/dist/utils/chart-utils/index.js +28 -41
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +77 -84
- package/dist/utils/chart-utils/original-data-utils/card-calculator.js +13 -20
- package/dist/utils/chart-utils/original-data-utils/combination-calculator.js +45 -52
- package/dist/utils/chart-utils/original-data-utils/compare-bar-chart-calculator.js +21 -28
- package/dist/utils/chart-utils/original-data-utils/completeness-calculator.js +33 -40
- package/dist/utils/chart-utils/original-data-utils/dashboard-calculator.js +16 -23
- package/dist/utils/chart-utils/original-data-utils/index.js +50 -57
- package/dist/utils/chart-utils/original-data-utils/mirror-calculator.js +19 -26
- package/dist/utils/chart-utils/original-data-utils/pivot-table-calculator.js +90 -96
- package/dist/utils/chart-utils/original-data-utils/scatter-calculator.js +19 -26
- package/dist/utils/chart-utils/original-data-utils/trend-calculator.js +31 -38
- package/dist/utils/chart-utils/sql-statistics-utils.js +229 -237
- package/dist/utils/chart.js +9 -17
- package/dist/utils/collaborator-manager.js +3 -9
- package/dist/utils/collaborator-utils.js +19 -31
- package/dist/utils/collaborator.js +6 -15
- package/dist/utils/color-utils.js +18 -29
- package/dist/utils/column-utils.js +77 -104
- package/dist/utils/common-utils.js +28 -53
- package/dist/utils/concurrency-manager.js +1 -7
- package/dist/utils/contexts.js +5 -12
- package/dist/utils/date-translate.js +12 -20
- package/dist/utils/digital-sign-utils.js +7 -14
- package/dist/utils/event-bus.js +1 -7
- package/dist/utils/hotkey.js +5 -11
- package/dist/utils/index.js +54 -221
- package/dist/utils/key-generator.js +2 -9
- package/dist/utils/map.js +22 -31
- package/dist/utils/object-utils.js +2 -8
- package/dist/utils/options-utils.js +10 -18
- package/dist/utils/row-record-utils.js +166 -178
- package/dist/utils/row-utils.js +27 -38
- package/dist/utils/search.js +24 -32
- package/dist/utils/sql/chart-data-sql.js +106 -112
- package/dist/utils/sql/column-2-sql-column.js +158 -168
- package/dist/utils/sql/index.js +3 -27
- package/dist/utils/trend-utils.js +39 -47
- package/dist/view/index.js +90 -96
- package/dist/view/title/index.js +16 -24
- package/dist/view/wrapper/area-group.js +45 -53
- package/dist/view/wrapper/area.js +43 -51
- package/dist/view/wrapper/bar-compare.js +38 -46
- package/dist/view/wrapper/bar-custom-stack.js +39 -47
- package/dist/view/wrapper/bar-group.js +45 -53
- package/dist/view/wrapper/bar-stack.js +48 -56
- package/dist/view/wrapper/bar.js +40 -48
- package/dist/view/wrapper/basic-number-card.js +26 -34
- package/dist/view/wrapper/chart-component.js +123 -131
- package/dist/view/wrapper/combination.js +55 -63
- package/dist/view/wrapper/completeness-group.js +40 -48
- package/dist/view/wrapper/completeness.js +36 -44
- package/dist/view/wrapper/dashboard.js +39 -44
- package/dist/view/wrapper/funnel.js +40 -43
- package/dist/view/wrapper/heat-map.js +62 -70
- package/dist/view/wrapper/horizontal-bar-group.js +52 -60
- package/dist/view/wrapper/horizontal-bar-stack.js +47 -55
- package/dist/view/wrapper/horizontal-bar.js +41 -49
- package/dist/view/wrapper/index.js +107 -115
- package/dist/view/wrapper/line-group.js +43 -51
- package/dist/view/wrapper/line.js +42 -50
- package/dist/view/wrapper/map-bubble.js +40 -48
- package/dist/view/wrapper/map-world-bubble.js +39 -47
- package/dist/view/wrapper/map-world.js +41 -49
- package/dist/view/wrapper/map.js +42 -50
- package/dist/view/wrapper/mirror.js +41 -49
- package/dist/view/wrapper/pie.js +44 -52
- package/dist/view/wrapper/ring.js +49 -57
- package/dist/view/wrapper/scatter.js +42 -50
- package/dist/view/wrapper/table/index.js +14 -22
- package/dist/view/wrapper/table/one-dimension-table-no-numeric-columns.js +49 -57
- package/dist/view/wrapper/table/one-dimension-table-with-numeric-columns.js +53 -61
- package/dist/view/wrapper/table/pivot-table-display-name.js +82 -90
- package/dist/view/wrapper/table/two-dimension-table.js +85 -93
- package/dist/view/wrapper/table-element/components/dataset-utils.js +23 -36
- package/dist/view/wrapper/table-element/components/formatter.js +90 -99
- package/dist/view/wrapper/table-element/components/formatters/FileFormatter/index.js +23 -32
- package/dist/view/wrapper/table-element/components/formatters/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/formatters/link-formatter.js +90 -97
- package/dist/view/wrapper/table-element/components/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/link-formatter.js +90 -97
- package/dist/view/wrapper/table-element/components/record.js +13 -20
- package/dist/view/wrapper/table-element/components/records-body.js +9 -17
- package/dist/view/wrapper/table-element/components/records-header/index.js +7 -15
- package/dist/view/wrapper/table-element/components/records-header/records-header-cell.js +8 -16
- package/dist/view/wrapper/table-element/components/records.js +25 -33
- package/dist/view/wrapper/table-element/components/resize-column-handle/resize-column-handle.js +5 -12
- package/dist/view/wrapper/table-element/components/utils.js +6 -16
- package/dist/view/wrapper/table-element/components/value-display-utils.js +4 -11
- package/dist/view/wrapper/table-element/components/vertical-scrollbar/index.js +6 -13
- package/dist/view/wrapper/table-element/index.js +18 -26
- package/dist/view/wrapper/treemap.js +38 -46
- package/dist/view/wrapper/trend.js +58 -66
- package/package.json +5 -5
package/dist/model/area-group.js
CHANGED
|
@@ -1,34 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _utils = require("../utils");
|
|
9
|
-
var _constants = require("../constants");
|
|
10
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
11
|
-
class AreaGroup extends _baseModel.default {
|
|
1
|
+
import { isBoolean } from '../utils';
|
|
2
|
+
import { CHART_TYPE, CHART_SUMMARY_TYPE, CHART_LINE_TYPES } from '../constants';
|
|
3
|
+
import BaseModel from './base-model';
|
|
4
|
+
class AreaGroup extends BaseModel {
|
|
12
5
|
constructor(options) {
|
|
13
6
|
super({
|
|
14
7
|
...options,
|
|
15
|
-
type:
|
|
8
|
+
type: CHART_TYPE.AREA_GROUP
|
|
16
9
|
});
|
|
17
10
|
|
|
18
11
|
// x-axis
|
|
19
12
|
this.x_axis_column_key = options.x_axis_column_key;
|
|
20
|
-
this.x_axis_include_empty_cells =
|
|
13
|
+
this.x_axis_include_empty_cells = isBoolean(options.x_axis_include_empty_cells) ? options.x_axis_include_empty_cells : false;
|
|
21
14
|
this.x_axis_date_granularity = options.x_axis_date_granularity;
|
|
22
15
|
this.x_axis_geolocation_granularity = options.x_axis_geolocation_granularity;
|
|
23
|
-
this.x_axis_show_label =
|
|
16
|
+
this.x_axis_show_label = isBoolean(options.x_axis_show_label) ? options.x_axis_show_label : false;
|
|
24
17
|
this.x_axis_label_position = options.x_axis_label_position;
|
|
25
18
|
|
|
26
19
|
// y-axis
|
|
27
20
|
this.y_axis_summary_column_key = options.y_axis_summary_column_key;
|
|
28
|
-
this.y_axis_summary_type = options.y_axis_summary_type ||
|
|
21
|
+
this.y_axis_summary_type = options.y_axis_summary_type || CHART_SUMMARY_TYPE.COUNT;
|
|
29
22
|
this.y_axis_summary_method = options.y_axis_summary_method;
|
|
30
|
-
this.y_axis_show_value =
|
|
31
|
-
this.y_axis_show_label =
|
|
23
|
+
this.y_axis_show_value = isBoolean(options.y_axis_show_value) ? options.y_axis_show_value : false;
|
|
24
|
+
this.y_axis_show_label = isBoolean(options.y_axis_show_label) ? options.y_axis_show_value : false;
|
|
32
25
|
this.y_axis_label_position = options.y_axis_label_position;
|
|
33
26
|
this.y_axis_auto_range = options.y_axis_auto_range;
|
|
34
27
|
this.y_axis_min = options.y_axis_min;
|
|
@@ -44,7 +37,7 @@ class AreaGroup extends _baseModel.default {
|
|
|
44
37
|
this.y_axis_use_stack = options.y_axis_use_stack;
|
|
45
38
|
this.label_font_size = options.label_font_size;
|
|
46
39
|
// default as curve
|
|
47
|
-
this.line_type = options.line_type ||
|
|
40
|
+
this.line_type = options.line_type || CHART_LINE_TYPES[1];
|
|
48
41
|
}
|
|
49
42
|
}
|
|
50
|
-
|
|
43
|
+
export default AreaGroup;
|
package/dist/model/area.js
CHANGED
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _utils = require("../utils");
|
|
9
|
-
var _constants = require("../constants");
|
|
10
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
11
|
-
class Area extends _baseModel.default {
|
|
1
|
+
import { isBoolean } from '../utils';
|
|
2
|
+
import { CHART_TYPE, CHART_SUMMARY_TYPE, CHART_LINE_TYPES } from '../constants';
|
|
3
|
+
import BaseModel from './base-model';
|
|
4
|
+
class Area extends BaseModel {
|
|
12
5
|
constructor(options) {
|
|
13
6
|
super({
|
|
14
7
|
...options,
|
|
15
|
-
type:
|
|
8
|
+
type: CHART_TYPE.AREA
|
|
16
9
|
});
|
|
17
10
|
|
|
18
11
|
// x axis
|
|
19
12
|
this.x_axis_column_key = options.x_axis_column_key;
|
|
20
|
-
this.x_axis_include_empty_cells =
|
|
21
|
-
this.x_axis_show_label =
|
|
13
|
+
this.x_axis_include_empty_cells = isBoolean(options.x_axis_include_empty_cells) ? options.x_axis_include_empty_cells : false;
|
|
14
|
+
this.x_axis_show_label = isBoolean(options.x_axis_show_label) ? options.x_axis_show_label : false;
|
|
22
15
|
this.x_axis_label_position = options.x_axis_label_position;
|
|
23
16
|
|
|
24
17
|
// y axis
|
|
25
18
|
this.y_axis_summary_column_key = options.y_axis_summary_column_key;
|
|
26
|
-
this.y_axis_summary_type = options.y_axis_summary_type ||
|
|
19
|
+
this.y_axis_summary_type = options.y_axis_summary_type || CHART_SUMMARY_TYPE.COUNT;
|
|
27
20
|
this.y_axis_summary_method = options.y_axis_summary_method;
|
|
28
|
-
this.y_axis_show_value =
|
|
29
|
-
this.y_axis_show_label =
|
|
21
|
+
this.y_axis_show_value = isBoolean(options.y_axis_show_value) ? options.y_axis_show_value : false;
|
|
22
|
+
this.y_axis_show_label = isBoolean(options.y_axis_show_label) ? options.y_axis_show_label : false;
|
|
30
23
|
this.y_axis_label_position = options.y_axis_label_position;
|
|
31
24
|
this.y_axis_auto_range = options.y_axis_auto_range;
|
|
32
25
|
this.y_axis_min = options.y_axis_min;
|
|
@@ -34,7 +27,7 @@ class Area extends _baseModel.default {
|
|
|
34
27
|
this.y_axis_label_color = options.y_axis_label_color;
|
|
35
28
|
this.sort_type = options.sort_type;
|
|
36
29
|
this.label_font_size = options.label_font_size;
|
|
37
|
-
this.line_type = options.line_type ||
|
|
30
|
+
this.line_type = options.line_type || CHART_LINE_TYPES[1];
|
|
38
31
|
}
|
|
39
32
|
}
|
|
40
|
-
|
|
33
|
+
export default Area;
|
package/dist/model/bar-custom.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
9
|
-
var _utils = require("../utils");
|
|
10
|
-
var _constants = require("../constants");
|
|
11
|
-
class BarCustom extends _baseModel.default {
|
|
1
|
+
import BaseModel from './base-model';
|
|
2
|
+
import { isBoolean } from '../utils';
|
|
3
|
+
import { CHART_TYPE, CHART_SUMMARY_TYPE } from '../constants';
|
|
4
|
+
class BarCustom extends BaseModel {
|
|
12
5
|
constructor(options) {
|
|
13
6
|
super({
|
|
14
7
|
...options,
|
|
15
|
-
type:
|
|
8
|
+
type: CHART_TYPE.BAR_CUSTOM
|
|
16
9
|
});
|
|
17
10
|
|
|
18
11
|
// x-axis
|
|
@@ -22,17 +15,17 @@ class BarCustom extends _baseModel.default {
|
|
|
22
15
|
this.x_axis_geolocation_granularity = options.x_axis_geolocation_granularity;
|
|
23
16
|
|
|
24
17
|
// x-axis style
|
|
25
|
-
this.x_axis_show_label =
|
|
18
|
+
this.x_axis_show_label = isBoolean(options.x_axis_show_label) ? options.x_axis_show_label : false;
|
|
26
19
|
this.x_axis_label_position = options.x_axis_label_position;
|
|
27
20
|
|
|
28
21
|
// y-axis
|
|
29
22
|
this.y_axis_summary_column_key = options.y_axis_summary_column_key;
|
|
30
|
-
this.y_axis_summary_type = options.y_axis_summary_type ||
|
|
31
|
-
this.y_axis_summary_method = options.y_axis_summary_method ||
|
|
23
|
+
this.y_axis_summary_type = options.y_axis_summary_type || CHART_SUMMARY_TYPE.COUNT;
|
|
24
|
+
this.y_axis_summary_method = options.y_axis_summary_method || CHART_SUMMARY_TYPE.SUM;
|
|
32
25
|
|
|
33
26
|
// y-axis style
|
|
34
|
-
this.y_axis_show_value =
|
|
35
|
-
this.y_axis_show_label =
|
|
27
|
+
this.y_axis_show_value = isBoolean(options.y_axis_show_value) ? options.y_axis_show_value : false;
|
|
28
|
+
this.y_axis_show_label = isBoolean(options.y_axis_show_label) ? options.y_axis_show_label : false;
|
|
36
29
|
this.y_axis_label_position = options.y_axis_label_position;
|
|
37
30
|
this.y_axis_auto_range = options.y_axis_auto_range;
|
|
38
31
|
this.y_axis_min = options.y_axis_min;
|
|
@@ -44,4 +37,4 @@ class BarCustom extends _baseModel.default {
|
|
|
44
37
|
this.label_font_size = options.label_font_size;
|
|
45
38
|
}
|
|
46
39
|
}
|
|
47
|
-
|
|
40
|
+
export default BarCustom;
|
package/dist/model/bar-group.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
9
|
-
var _utils = require("../utils");
|
|
10
|
-
var _constants = require("../constants");
|
|
11
|
-
class BarGroup extends _baseModel.default {
|
|
1
|
+
import BaseModel from './base-model';
|
|
2
|
+
import { isBoolean } from '../utils';
|
|
3
|
+
import { CHART_TYPE, CHART_SUMMARY_TYPE } from '../constants';
|
|
4
|
+
class BarGroup extends BaseModel {
|
|
12
5
|
constructor(options) {
|
|
13
6
|
super({
|
|
14
7
|
...options,
|
|
15
|
-
type:
|
|
8
|
+
type: CHART_TYPE.BAR_GROUP
|
|
16
9
|
});
|
|
17
10
|
|
|
18
11
|
// x-axis
|
|
@@ -22,17 +15,17 @@ class BarGroup extends _baseModel.default {
|
|
|
22
15
|
this.x_axis_geolocation_granularity = options.x_axis_geolocation_granularity;
|
|
23
16
|
|
|
24
17
|
// x-axis style
|
|
25
|
-
this.x_axis_show_label =
|
|
18
|
+
this.x_axis_show_label = isBoolean(options.x_axis_show_label) ? options.x_axis_show_label : false;
|
|
26
19
|
this.x_axis_label_position = options.x_axis_label_position;
|
|
27
20
|
|
|
28
21
|
// y-axis
|
|
29
22
|
this.y_axis_summary_column_key = options.y_axis_summary_column_key;
|
|
30
|
-
this.y_axis_summary_type = options.y_axis_summary_type ||
|
|
31
|
-
this.y_axis_summary_method = options.y_axis_summary_method ||
|
|
23
|
+
this.y_axis_summary_type = options.y_axis_summary_type || CHART_SUMMARY_TYPE.COUNT;
|
|
24
|
+
this.y_axis_summary_method = options.y_axis_summary_method || CHART_SUMMARY_TYPE.SUM;
|
|
32
25
|
|
|
33
26
|
// y axis style
|
|
34
|
-
this.y_axis_show_value =
|
|
35
|
-
this.y_axis_show_label =
|
|
27
|
+
this.y_axis_show_value = isBoolean(options.y_axis_show_value) ? options.y_axis_show_value : false;
|
|
28
|
+
this.y_axis_show_label = isBoolean(options.y_axis_show_label) ? options.y_axis_show_label : false;
|
|
36
29
|
this.y_axis_label_position = options.y_axis_label_position;
|
|
37
30
|
this.y_axis_auto_range = options.y_axis_auto_range;
|
|
38
31
|
this.y_axis_min = options.y_axis_min;
|
|
@@ -43,9 +36,9 @@ class BarGroup extends _baseModel.default {
|
|
|
43
36
|
this.column_groupby_column_key = options.column_groupby_column_key;
|
|
44
37
|
this.column_groupby_date_granularity = options.column_groupby_date_granularity;
|
|
45
38
|
this.column_groupby_geolocation_granularity = options.column_groupby_geolocation_granularity;
|
|
46
|
-
this.column_groupby_multiple_numeric_column =
|
|
39
|
+
this.column_groupby_multiple_numeric_column = isBoolean(options.column_groupby_multiple_numeric_column) ? options.column_groupby_multiple_numeric_column : false;
|
|
47
40
|
this.summary_columns = options.summary_columns;
|
|
48
41
|
this.label_font_size = options.label_font_size;
|
|
49
42
|
}
|
|
50
43
|
}
|
|
51
|
-
|
|
44
|
+
export default BarGroup;
|
package/dist/model/bar-stack.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _utils = require("../utils");
|
|
9
|
-
var _constants = require("../constants");
|
|
10
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
11
|
-
class BarStack extends _baseModel.default {
|
|
1
|
+
import { isBoolean } from '../utils';
|
|
2
|
+
import { CHART_TYPE, CHART_SUMMARY_TYPE } from '../constants';
|
|
3
|
+
import BaseModel from './base-model';
|
|
4
|
+
class BarStack extends BaseModel {
|
|
12
5
|
constructor(options) {
|
|
13
6
|
super({
|
|
14
7
|
...options,
|
|
15
|
-
type:
|
|
8
|
+
type: CHART_TYPE.BAR_STACK
|
|
16
9
|
});
|
|
17
10
|
|
|
18
11
|
// x axis
|
|
@@ -20,15 +13,15 @@ class BarStack extends _baseModel.default {
|
|
|
20
13
|
this.x_axis_include_empty_cells = options.x_axis_include_empty_cells;
|
|
21
14
|
this.x_axis_date_granularity = options.x_axis_date_granularity;
|
|
22
15
|
this.x_axis_geolocation_granularity = options.x_axis_geolocation_granularity;
|
|
23
|
-
this.x_axis_show_label =
|
|
16
|
+
this.x_axis_show_label = isBoolean(options.x_axis_show_label) ? options.x_axis_show_label : false;
|
|
24
17
|
this.x_axis_label_position = options.x_axis_label_position;
|
|
25
18
|
|
|
26
19
|
// y axis
|
|
27
20
|
this.y_axis_summary_column_key = options.y_axis_summary_column_key;
|
|
28
|
-
this.y_axis_summary_type = options.y_axis_summary_type ||
|
|
21
|
+
this.y_axis_summary_type = options.y_axis_summary_type || CHART_SUMMARY_TYPE.COUNT;
|
|
29
22
|
this.y_axis_summary_method = options.y_axis_summary_method;
|
|
30
|
-
this.y_axis_show_value =
|
|
31
|
-
this.y_axis_show_label =
|
|
23
|
+
this.y_axis_show_value = isBoolean(options.y_axis_show_value) ? options.y_axis_show_value : false;
|
|
24
|
+
this.y_axis_show_label = isBoolean(options.y_axis_show_label) ? options.y_axis_show_label : false;
|
|
32
25
|
this.y_axis_label_position = options.y_axis_label_position;
|
|
33
26
|
this.y_axis_auto_range = options.y_axis_auto_range;
|
|
34
27
|
this.y_axis_min = options.y_axis_min;
|
|
@@ -46,4 +39,4 @@ class BarStack extends _baseModel.default {
|
|
|
46
39
|
this.label_font_size = options.label_font_size;
|
|
47
40
|
}
|
|
48
41
|
}
|
|
49
|
-
|
|
42
|
+
export default BarStack;
|
package/dist/model/bar.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _utils = require("../utils");
|
|
9
|
-
var _constants = require("../constants");
|
|
10
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
11
|
-
class Bar extends _baseModel.default {
|
|
1
|
+
import { isBoolean } from '../utils';
|
|
2
|
+
import { CHART_TYPE, CHART_SUMMARY_TYPE } from '../constants';
|
|
3
|
+
import BaseModel from './base-model';
|
|
4
|
+
class Bar extends BaseModel {
|
|
12
5
|
constructor(options) {
|
|
13
6
|
super({
|
|
14
7
|
...options,
|
|
15
|
-
type:
|
|
8
|
+
type: CHART_TYPE.BAR
|
|
16
9
|
});
|
|
17
10
|
|
|
18
11
|
// x-axis
|
|
@@ -22,17 +15,17 @@ class Bar extends _baseModel.default {
|
|
|
22
15
|
this.x_axis_geolocation_granularity = options.x_axis_geolocation_granularity;
|
|
23
16
|
|
|
24
17
|
// x-axis style
|
|
25
|
-
this.x_axis_show_label =
|
|
18
|
+
this.x_axis_show_label = isBoolean(options.x_axis_show_label) ? options.x_axis_show_label : false;
|
|
26
19
|
this.x_axis_label_position = options.x_axis_label_position;
|
|
27
20
|
|
|
28
21
|
// y-axis
|
|
29
22
|
this.y_axis_summary_column_key = options.y_axis_summary_column_key;
|
|
30
|
-
this.y_axis_summary_type = options.y_axis_summary_type ||
|
|
31
|
-
this.y_axis_summary_method = options.y_axis_summary_method ||
|
|
23
|
+
this.y_axis_summary_type = options.y_axis_summary_type || CHART_SUMMARY_TYPE.COUNT;
|
|
24
|
+
this.y_axis_summary_method = options.y_axis_summary_method || CHART_SUMMARY_TYPE.SUM;
|
|
32
25
|
|
|
33
26
|
// y-axis style
|
|
34
|
-
this.y_axis_show_value =
|
|
35
|
-
this.y_axis_show_label =
|
|
27
|
+
this.y_axis_show_value = isBoolean(options.y_axis_show_value) ? options.y_axis_show_value : false;
|
|
28
|
+
this.y_axis_show_label = isBoolean(options.y_axis_show_label) ? options.y_axis_show_label : false;
|
|
36
29
|
this.y_axis_label_position = options.y_axis_label_position;
|
|
37
30
|
this.y_axis_auto_range = options.y_axis_auto_range;
|
|
38
31
|
this.y_axis_min = options.y_axis_min;
|
|
@@ -42,4 +35,4 @@ class Bar extends _baseModel.default {
|
|
|
42
35
|
this.label_font_size = options.label_font_size;
|
|
43
36
|
}
|
|
44
37
|
}
|
|
45
|
-
|
|
38
|
+
export default Bar;
|
package/dist/model/base-model.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _constants = require("../constants");
|
|
8
|
-
class BaseModel {
|
|
1
|
+
import { CHART_TYPE } from '../constants';
|
|
2
|
+
export default class BaseModel {
|
|
9
3
|
constructor(options) {
|
|
10
|
-
this.type = options.type ||
|
|
4
|
+
this.type = options.type || CHART_TYPE.BAR;
|
|
11
5
|
this.table_id = options.table_id || null;
|
|
12
6
|
this.filters = options.filters || [];
|
|
13
7
|
this.filter_conjunction = options.filter_conjunction || 'And';
|
|
@@ -16,5 +10,4 @@ class BaseModel {
|
|
|
16
10
|
// default set to true
|
|
17
11
|
this.drill_down_status = typeof options.drill_down_status === 'boolean' ? options.drill_down_status : true;
|
|
18
12
|
}
|
|
19
|
-
}
|
|
20
|
-
exports.default = BaseModel;
|
|
13
|
+
}
|
|
@@ -1,38 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _dtableUtils = require("dtable-utils");
|
|
9
|
-
var _constants = require("../constants");
|
|
10
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
11
|
-
class BasicNumberCard extends _baseModel.default {
|
|
1
|
+
import { isNumericColumn, getTableById, getTableColumnByKey } from 'dtable-utils';
|
|
2
|
+
import { CHART_SUMMARY_CALCULATION_METHOD, CHART_TYPE, CHART_Y_GROUP_TYPE, HORIZONTAL_ALIGN } from '../constants';
|
|
3
|
+
import BaseModel from './base-model';
|
|
4
|
+
class BasicNumberCard extends BaseModel {
|
|
12
5
|
constructor(options, tables) {
|
|
13
6
|
super({
|
|
14
7
|
...options,
|
|
15
|
-
type:
|
|
8
|
+
type: CHART_TYPE.BASIC_NUMBER_CARD
|
|
16
9
|
});
|
|
17
10
|
this.name = options.name || '';
|
|
18
11
|
this.numeric_column_key = options.x_axis_column_key;
|
|
19
12
|
if (this.numeric_column_key && this.table_id && tables) {
|
|
20
|
-
const table =
|
|
21
|
-
const column =
|
|
22
|
-
if (!column || !
|
|
13
|
+
const table = getTableById(tables, this.table_id);
|
|
14
|
+
const column = getTableColumnByKey(table, this.numeric_column_key);
|
|
15
|
+
if (!column || !isNumericColumn(column)) {
|
|
23
16
|
this.numeric_column_key = null;
|
|
24
17
|
}
|
|
25
18
|
}
|
|
26
|
-
this.summary_type = options.x_axis_summary_type ||
|
|
27
|
-
this.summary_method = options.y_axis_summary_method ||
|
|
19
|
+
this.summary_type = options.x_axis_summary_type || CHART_Y_GROUP_TYPE.COUNT;
|
|
20
|
+
this.summary_method = options.y_axis_summary_method || CHART_SUMMARY_CALCULATION_METHOD[0];
|
|
28
21
|
this.font_size = options.font_size || 34;
|
|
29
22
|
this.font_color = options.font_color;
|
|
30
|
-
this.text_align = options.text_align ||
|
|
23
|
+
this.text_align = options.text_align || HORIZONTAL_ALIGN.LEFT;
|
|
31
24
|
this.font_weight = options.font_weight || 700;
|
|
32
25
|
this.card_label_font_size = options.card_label_font_size || 14;
|
|
33
26
|
this.label_font_color = options.label_font_color;
|
|
34
|
-
this.label_text_align = options.text_align ||
|
|
27
|
+
this.label_text_align = options.text_align || HORIZONTAL_ALIGN.LEFT;
|
|
35
28
|
this.label_font_weight = options.font_weight || 400;
|
|
36
29
|
}
|
|
37
30
|
}
|
|
38
|
-
|
|
31
|
+
export default BasicNumberCard;
|
package/dist/model/chart.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _utils = require("../utils");
|
|
8
|
-
var _constants = require("../constants");
|
|
1
|
+
import { generateChartConfig } from '../utils';
|
|
2
|
+
import { HORIZONTAL_ALIGN, DEFAULT_CHART_FONT_WEIGHT, DEFAULT_CHART_TITLE_FONT_SIZE } from '../constants';
|
|
9
3
|
class ChartModel {
|
|
10
4
|
constructor(options, tables) {
|
|
11
5
|
// id is ChartModel id
|
|
@@ -18,14 +12,14 @@ class ChartModel {
|
|
|
18
12
|
} = options;
|
|
19
13
|
this.id = id;
|
|
20
14
|
this.type = 'statistic';
|
|
21
|
-
this.config =
|
|
15
|
+
this.config = generateChartConfig(options, tables);
|
|
22
16
|
this.config._id = _id;
|
|
23
17
|
this.style_config = style_config || {};
|
|
24
18
|
this.style_config.title = {
|
|
25
19
|
text: '',
|
|
26
|
-
font_size:
|
|
27
|
-
font_weight:
|
|
28
|
-
horizontal_align:
|
|
20
|
+
font_size: DEFAULT_CHART_TITLE_FONT_SIZE,
|
|
21
|
+
font_weight: DEFAULT_CHART_FONT_WEIGHT,
|
|
22
|
+
horizontal_align: HORIZONTAL_ALIGN.LEFT
|
|
29
23
|
};
|
|
30
24
|
let tableList = tables;
|
|
31
25
|
if (!Array.isArray(tables)) {
|
|
@@ -38,4 +32,4 @@ class ChartModel {
|
|
|
38
32
|
}
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
|
-
|
|
35
|
+
export default ChartModel;
|
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _utils = require("../utils");
|
|
9
|
-
var _constants = require("../constants");
|
|
10
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
11
|
-
class Combination extends _baseModel.default {
|
|
1
|
+
import { isBoolean } from '../utils';
|
|
2
|
+
import { CHART_TYPE, CHART_SUMMARY_TYPE, CHART_LINE_TYPES, COMBINATION_DISPLAY_FIELDS } from '../constants';
|
|
3
|
+
import BaseModel from './base-model';
|
|
4
|
+
class Combination extends BaseModel {
|
|
12
5
|
constructor(options) {
|
|
13
6
|
super({
|
|
14
7
|
...options,
|
|
15
|
-
type:
|
|
8
|
+
type: CHART_TYPE.COMBINATION
|
|
16
9
|
});
|
|
17
10
|
this.x_axis_column_key = options.x_axis_column_key;
|
|
18
11
|
this.x_axis_include_empty_cells = options.x_axis_include_empty_cells;
|
|
19
12
|
this.x_axis_date_granularity = options.x_axis_date_granularity;
|
|
20
13
|
this.x_axis_geolocation_granularity = options.x_axis_geolocation_granularity;
|
|
21
|
-
this.y_axis_left_summary_type = options.y_axis_left_summary_type ||
|
|
22
|
-
this.y_axis_right_summary_type = options.y_axis_right_summary_type ||
|
|
23
|
-
this.y_axis_left_summary_method = options.y_axis_left_summary_method ||
|
|
24
|
-
this.y_axis_right_summary_method = options.y_axis_right_summary_method ||
|
|
14
|
+
this.y_axis_left_summary_type = options.y_axis_left_summary_type || CHART_SUMMARY_TYPE.COUNT;
|
|
15
|
+
this.y_axis_right_summary_type = options.y_axis_right_summary_type || CHART_SUMMARY_TYPE.COUNT;
|
|
16
|
+
this.y_axis_left_summary_method = options.y_axis_left_summary_method || CHART_SUMMARY_TYPE.SUM;
|
|
17
|
+
this.y_axis_right_summary_method = options.y_axis_right_summary_method || CHART_SUMMARY_TYPE.SUM;
|
|
25
18
|
this.y_axis_left_summary_column = options.y_axis_left_summary_column;
|
|
26
19
|
this.y_axis_right_summary_column = options.y_axis_right_summary_column;
|
|
27
|
-
this.y_axis_left_group_by_multiple_numeric_column =
|
|
20
|
+
this.y_axis_left_group_by_multiple_numeric_column = isBoolean(options.y_axis_left_group_by_multiple_numeric_column) ? options.y_axis_left_group_by_multiple_numeric_column : false;
|
|
28
21
|
this.y_axis_left_group_by_numeric_columns = options.y_axis_left_group_by_numeric_columns;
|
|
29
|
-
this.x_axis_show_label =
|
|
22
|
+
this.x_axis_show_label = isBoolean(options.x_axis_show_label) ? options.x_axis_show_label : false;
|
|
30
23
|
this.x_axis_label_position = options.x_axis_label_position;
|
|
31
24
|
this.show_y_axis_left_label = options.show_y_axis_left_label;
|
|
32
25
|
this.show_y_axis_right_label = options.show_y_axis_right_label;
|
|
@@ -38,10 +31,10 @@ class Combination extends _baseModel.default {
|
|
|
38
31
|
this.y_axis_auto_range_right = options.y_axis_auto_range_right;
|
|
39
32
|
this.y_axis_min_right = options.y_axis_min_right;
|
|
40
33
|
this.y_axis_max_right = options.y_axis_max_right;
|
|
41
|
-
this.display_data_field = options.display_data_field ||
|
|
42
|
-
this.display_data =
|
|
34
|
+
this.display_data_field = options.display_data_field || COMBINATION_DISPLAY_FIELDS.RIGHT;
|
|
35
|
+
this.display_data = isBoolean(options.y_axis_show_value) ? options.y_axis_show_value : false;
|
|
43
36
|
this.label_font_size = options.label_font_size;
|
|
44
|
-
this.line_type = options.line_type ||
|
|
37
|
+
this.line_type = options.line_type || CHART_LINE_TYPES[1];
|
|
45
38
|
}
|
|
46
39
|
}
|
|
47
|
-
|
|
40
|
+
export default Combination;
|
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _dtableUtils = require("dtable-utils");
|
|
9
|
-
var _utils = require("../utils");
|
|
10
|
-
var _constants = require("../constants");
|
|
11
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
12
|
-
class CompareBar extends _baseModel.default {
|
|
1
|
+
import { isDateColumn, getTableById, getTableColumnByKey } from 'dtable-utils';
|
|
2
|
+
import { isBoolean } from '../utils';
|
|
3
|
+
import { CHART_TYPE } from '../constants';
|
|
4
|
+
import BaseModel from './base-model';
|
|
5
|
+
class CompareBar extends BaseModel {
|
|
13
6
|
constructor(options, tables) {
|
|
14
7
|
super({
|
|
15
8
|
...options,
|
|
16
|
-
type:
|
|
9
|
+
type: CHART_TYPE.COMPARE_BAR
|
|
17
10
|
});
|
|
18
11
|
this.x_axis_column_key = options.x_axis_column_key;
|
|
19
12
|
if (this.x_axis_column_key && this.table_id && tables) {
|
|
20
|
-
const table =
|
|
21
|
-
const column =
|
|
22
|
-
if (!column || !
|
|
13
|
+
const table = getTableById(tables, this.table_id);
|
|
14
|
+
const column = getTableColumnByKey(table, this.x_axis_column_key);
|
|
15
|
+
if (!column || !isDateColumn(column)) {
|
|
23
16
|
this.x_axis_column_key = null;
|
|
24
17
|
}
|
|
25
18
|
}
|
|
@@ -28,8 +21,8 @@ class CompareBar extends _baseModel.default {
|
|
|
28
21
|
this.x_axis_date_range_end = options.x_axis_date_range_end;
|
|
29
22
|
this.x_axis_compared_date_range_start = options.x_axis_compared_date_range_start;
|
|
30
23
|
this.x_axis_compared_date_range_end = options.x_axis_compared_date_range_end;
|
|
31
|
-
this.x_axis_show_label =
|
|
32
|
-
this.y_axis_show_label =
|
|
24
|
+
this.x_axis_show_label = isBoolean(options.x_axis_show_label) ? options.x_axis_show_label : false;
|
|
25
|
+
this.y_axis_show_label = isBoolean(options.y_axis_show_label) ? options.y_axis_show_label : false;
|
|
33
26
|
this.x_axis_label_position = options.x_axis_label_position;
|
|
34
27
|
this.y_axis_label_position = options.y_axis_label_position;
|
|
35
28
|
this.y_axis_compare_label_color = options.y_axis_compare_label_color;
|
|
@@ -37,10 +30,10 @@ class CompareBar extends _baseModel.default {
|
|
|
37
30
|
this.y_axis_summary_column_key = options.y_axis_summary_column_key;
|
|
38
31
|
this.y_axis_summary_type = options.y_axis_summary_type || 'count';
|
|
39
32
|
this.y_axis_summary_method = options.y_axis_summary_method;
|
|
40
|
-
this.display_increase =
|
|
41
|
-
this.display_increase_percentage =
|
|
33
|
+
this.display_increase = isBoolean(options.display_increase) ? options.display_increase : false;
|
|
34
|
+
this.display_increase_percentage = isBoolean(options.display_increase_percentage) ? options.display_increase_percentage : false;
|
|
42
35
|
this.increase_display_color = options.increase_display_color;
|
|
43
36
|
this.label_font_size = options.label_font_size;
|
|
44
37
|
}
|
|
45
38
|
}
|
|
46
|
-
|
|
39
|
+
export default CompareBar;
|
|
@@ -1,37 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _constants = require("../constants");
|
|
9
|
-
var _utils = require("../utils");
|
|
10
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
11
|
-
class CompletenessGroup extends _baseModel.default {
|
|
1
|
+
import { CHART_TYPE, LABEL_COLORS } from '../constants';
|
|
2
|
+
import { isBoolean } from '../utils';
|
|
3
|
+
import BaseModel from './base-model';
|
|
4
|
+
class CompletenessGroup extends BaseModel {
|
|
12
5
|
constructor(options) {
|
|
13
6
|
super({
|
|
14
7
|
...options,
|
|
15
|
-
type:
|
|
8
|
+
type: CHART_TYPE.COMPLETENESS_GROUP
|
|
16
9
|
});
|
|
17
10
|
this.groupby_column_key = options.x_axis_column_key;
|
|
18
11
|
this.completed_column_key = options.completed_column_key;
|
|
19
12
|
this.target_column_key = options.target_column_key;
|
|
20
|
-
this.completed_color = options.completed_color ||
|
|
21
|
-
this.display_percentage =
|
|
13
|
+
this.completed_color = options.completed_color || LABEL_COLORS[0];
|
|
14
|
+
this.display_percentage = isBoolean(options.display_percentage) ? options.display_percentage : true;
|
|
22
15
|
this.label_font_size = options.label_font_size;
|
|
23
16
|
this.column_groupby_column_key = options.column_groupby_column_key;
|
|
24
17
|
this.date_granularity = options.column_groupby_date_granularity;
|
|
25
18
|
this.geolocation_granularity = options.column_groupby_geolocation_granularity;
|
|
26
19
|
|
|
27
20
|
// x_axis is groupby axis
|
|
28
|
-
this.x_axis_include_empty_cells =
|
|
29
|
-
this.show_percentage =
|
|
21
|
+
this.x_axis_include_empty_cells = isBoolean(options.x_axis_include_empty_cells) ? options.x_axis_include_empty_cells : false;
|
|
22
|
+
this.show_percentage = isBoolean(options.show_percentage) ? options.show_percentage : true;
|
|
30
23
|
this.label_font_size = options.label_font_size || 12;
|
|
31
|
-
this.y_axis_auto_range =
|
|
24
|
+
this.y_axis_auto_range = isBoolean(options.y_axis_auto_range) ? options.y_axis_auto_range : true;
|
|
32
25
|
// default to null
|
|
33
26
|
this.y_axis_min = options.y_axis_min;
|
|
34
27
|
this.y_axis_max = options.y_axis_max;
|
|
35
28
|
}
|
|
36
29
|
}
|
|
37
|
-
|
|
30
|
+
export default CompletenessGroup;
|