sea-chart 1.1.49 → 1.1.51
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/constants/index.js +8 -2
- package/dist/locale/lang/de.js +26 -22
- package/dist/locale/lang/en.js +6 -2
- package/dist/locale/lang/es.js +6 -2
- package/dist/locale/lang/fr.js +25 -21
- package/dist/locale/lang/pt.js +6 -2
- package/dist/locale/lang/ru.js +6 -2
- package/dist/locale/lang/zh_CN.js +9 -5
- package/dist/model/combination.js +2 -1
- package/dist/settings/combination-settings/style-settings.js +48 -11
- package/dist/settings/index.css +4 -0
- package/dist/settings/widgets/time-picker.js +1 -3
- package/dist/utils/chart-utils/base-utils.js +36 -0
- package/dist/utils/chart-utils/sql-statistics-utils.js +36 -5
- package/dist/view/wrapper/combination.js +19 -1
- package/package.json +1 -1
package/dist/constants/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CellType, DEFAULT_NUMBER_FORMAT
|
|
1
|
+
import { CellType, DEFAULT_NUMBER_FORMAT } from 'dtable-utils';
|
|
2
2
|
import { GEOLOCATION_FORMAT_CITY, GEOLOCATION_FORMAT_MAP, GEOLOCATION_GRANULARITY, GEOLOCATION_GRANULARITY_LIST, MAP_LEVEL, MUNICIPALITIES } from './geolocation';
|
|
3
3
|
import { CHART_KEY, GENERIC_KEY, GENERIC_KEY_2_SIMILAR_KEYS } from './model';
|
|
4
4
|
import { STYLE_COLORS, HORIZONTAL_ALIGN, HORIZONTAL_ALIGNS, HORIZONTAL_ALIGN_SHOW } from './style';
|
|
@@ -6,6 +6,12 @@ import { CHART_TYPE, CHART_TYPE_SHOW, CHART_TYPES } from './type';
|
|
|
6
6
|
import { CHART_TYPE_IMAGE } from './type-image';
|
|
7
7
|
import { regions } from './regions';
|
|
8
8
|
import { TABLE_DIMENSIONS } from './table';
|
|
9
|
+
export const COMBINATION_DISPLAY_FIELDS = {
|
|
10
|
+
LEFT: 'Y_axis_(lift_side)',
|
|
11
|
+
RIGHT: 'Y_axis_(right_side)',
|
|
12
|
+
ALL: 'All'
|
|
13
|
+
};
|
|
14
|
+
export const COMBINATION_DISPLAY_FIELDS_LIST = [COMBINATION_DISPLAY_FIELDS.RIGHT, COMBINATION_DISPLAY_FIELDS.LEFT, COMBINATION_DISPLAY_FIELDS.ALL];
|
|
9
15
|
export const SETTING_DEFAULT_FONT_SIZE = 12;
|
|
10
16
|
export const DEFAULT_LANG = 'en';
|
|
11
17
|
export const FUNNEL_LABEL_FORMAT = {
|
|
@@ -85,7 +91,7 @@ export const CHART_SUMMARY_CALCULATION_METHOD = ['Sum', 'Max', 'Min', 'Mean', 'D
|
|
|
85
91
|
export const BASIC_NUMBER_CARD_CALCULATION_METHOD = 'Row_count';
|
|
86
92
|
export const CHART_DATE_SUMMARY_CALCULATION_METHOD = ['Max', 'Min', 'Distinct_values'];
|
|
87
93
|
export const CHART_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];
|
|
88
|
-
export const CHART_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];
|
|
94
|
+
export const CHART_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, CellType.COLLABORATOR];
|
|
89
95
|
export const LABEL_COLORS = ['#2a67d1', '#4ecccb', '#59cb74', '#fbd44a', '#f4667c', '#9860e5', '#9f8cf1', '#dc82d2', '#eaa775', '#addf84', '#85e0be', '#89d2ea'];
|
|
90
96
|
export const TIME_COLUMN_LIST = [CellType.CTIME, CellType.MTIME, CellType.DATE];
|
|
91
97
|
export const DATE_GRANULATES = [CHART_SUMMARY_TYPE.DAY, CHART_SUMMARY_TYPE.WEEK, CHART_SUMMARY_TYPE.MONTH, CHART_SUMMARY_TYPE.QUARTER, CHART_SUMMARY_TYPE.YEAR];
|
package/dist/locale/lang/de.js
CHANGED
|
@@ -42,7 +42,7 @@ const de = {
|
|
|
42
42
|
"Label": "Beschriftung",
|
|
43
43
|
"Y-axis(left side)": "Y-Achse (primär)",
|
|
44
44
|
"Y-axis(right side)": "Y-Achse (sekundär)",
|
|
45
|
-
"Display_title": "
|
|
45
|
+
"Display_title": "Titel anzeigen",
|
|
46
46
|
"Current_value_field": "Feld für aktuellen Wert",
|
|
47
47
|
"Total_value_field": "Feld für Gesamtwert",
|
|
48
48
|
"Group_by": "Gruppieren nach",
|
|
@@ -146,7 +146,7 @@ const de = {
|
|
|
146
146
|
"Permission_denied": "Zugriff verweigert",
|
|
147
147
|
"Execution_time_of_the_query_exceeds_the_limit": "Le temps d'exécution de la requête dépasse la limite. Les données ne peuvent pas être chargées.",
|
|
148
148
|
"There_are_some_problems_with_the_filters": "Die Filterbedingungen sind abnormal. Bitte setzen sie die Filterbedingungen in den Ansichtseinstellungen zurück.",
|
|
149
|
-
"Please_complete_the_chart_configuration_first": "
|
|
149
|
+
"Please_complete_the_chart_configuration_first": "Configure chart in element settings",
|
|
150
150
|
"Not_used": "Nicht verwendet",
|
|
151
151
|
"Select_field": "Feld auswählen",
|
|
152
152
|
"Display_total": "Gesamtwert anzeigen",
|
|
@@ -265,30 +265,34 @@ const de = {
|
|
|
265
265
|
"Show_overall_rate": "Gesamtpreisbeschriftung anzeigen",
|
|
266
266
|
"Percentage": "Prozentsatz",
|
|
267
267
|
"Number_and_percentage": "Anzahl und Prozentsatz",
|
|
268
|
-
"No_record": "
|
|
268
|
+
"No_record": "Kein Eintrag",
|
|
269
269
|
"Drill_down_settings": "Drilldown-Einstellungen",
|
|
270
270
|
"Enable_drill_down_feature": "Aktivieren Sie die Drilldown-Funktion",
|
|
271
271
|
"Field_settings": "Feldeinstellungen",
|
|
272
272
|
"Select_all": "Alles auswählen",
|
|
273
273
|
"Visible": "Sichtbar",
|
|
274
|
-
"Goal_line": "
|
|
275
|
-
"Display_goal_line": "
|
|
276
|
-
"Goal_value": "
|
|
277
|
-
"Goal_label": "
|
|
278
|
-
"Table_element": "
|
|
279
|
-
"Sort": "
|
|
280
|
-
"1_Sort": "1
|
|
281
|
-
"Sorts": "
|
|
282
|
-
"hide_columns": "
|
|
283
|
-
"Hidden_columns": "
|
|
284
|
-
"1_hidden_column": "1
|
|
285
|
-
"No_sorts": "
|
|
286
|
-
"Add_sort": "
|
|
287
|
-
"Search_column": "
|
|
288
|
-
"up": "
|
|
289
|
-
"down": "
|
|
290
|
-
"Equal": "
|
|
291
|
-
"Hide_all": "
|
|
292
|
-
"Show_all": "
|
|
274
|
+
"Goal_line": "Horizontale Linie",
|
|
275
|
+
"Display_goal_line": "Horizontale Linie anzeigen",
|
|
276
|
+
"Goal_value": "Wert",
|
|
277
|
+
"Goal_label": "Bezeichnung",
|
|
278
|
+
"Table_element": "Table",
|
|
279
|
+
"Sort": "Sort",
|
|
280
|
+
"1_Sort": "1 sort",
|
|
281
|
+
"Sorts": "sorts",
|
|
282
|
+
"hide_columns": "Hide columns",
|
|
283
|
+
"Hidden_columns": "Hidden columns",
|
|
284
|
+
"1_hidden_column": "1 Hidden column",
|
|
285
|
+
"No_sorts": "No sorts",
|
|
286
|
+
"Add_sort": "Add sort",
|
|
287
|
+
"Search_column": "Search column",
|
|
288
|
+
"up": "Up",
|
|
289
|
+
"down": "Down",
|
|
290
|
+
"Equal": "Equal",
|
|
291
|
+
"Hide_all": "Hide all",
|
|
292
|
+
"Show_all": "Show all",
|
|
293
|
+
"Y_axis_(lift_side)": "Y-Achse (linke Seite)",
|
|
294
|
+
"Y_axis_(right_side)": "Y-Achse (rechte Seite)",
|
|
295
|
+
"All": "Alle",
|
|
296
|
+
"Label_value": "Etikettenwert"
|
|
293
297
|
};
|
|
294
298
|
export default de;
|
package/dist/locale/lang/en.js
CHANGED
|
@@ -146,7 +146,7 @@ const en = {
|
|
|
146
146
|
"Permission_denied": "Permission denied",
|
|
147
147
|
"Execution_time_of_the_query_exceeds_the_limit": "Execution time of the query exceeds the limit. Data cannot be loaded.",
|
|
148
148
|
"There_are_some_problems_with_the_filters": "There are some problems with the filters.",
|
|
149
|
-
"Please_complete_the_chart_configuration_first": "
|
|
149
|
+
"Please_complete_the_chart_configuration_first": "Configure chart in element settings",
|
|
150
150
|
"Not_used": "Not used",
|
|
151
151
|
"Select_field": "Select field",
|
|
152
152
|
"Display_total": "Display total",
|
|
@@ -289,6 +289,10 @@ const en = {
|
|
|
289
289
|
"down": "Down",
|
|
290
290
|
"Equal": "Equal",
|
|
291
291
|
"Hide_all": "Hide all",
|
|
292
|
-
"Show_all": "Show all"
|
|
292
|
+
"Show_all": "Show all",
|
|
293
|
+
"Y_axis_(lift_side)": "Y axis (left side)",
|
|
294
|
+
"Y_axis_(right_side)": "Y axis (right side)",
|
|
295
|
+
"All": "All",
|
|
296
|
+
"Label_value": "Label value"
|
|
293
297
|
};
|
|
294
298
|
export default en;
|
package/dist/locale/lang/es.js
CHANGED
|
@@ -146,7 +146,7 @@ const es = {
|
|
|
146
146
|
"Permission_denied": "Permission denied",
|
|
147
147
|
"Execution_time_of_the_query_exceeds_the_limit": "Execution time of the query exceeds the limit. Data cannot be loaded.",
|
|
148
148
|
"There_are_some_problems_with_the_filters": "There are some problems with the filters.",
|
|
149
|
-
"Please_complete_the_chart_configuration_first": "
|
|
149
|
+
"Please_complete_the_chart_configuration_first": "Configure chart in element settings",
|
|
150
150
|
"Not_used": "Not used",
|
|
151
151
|
"Select_field": "Select field",
|
|
152
152
|
"Display_total": "Display total",
|
|
@@ -289,6 +289,10 @@ const es = {
|
|
|
289
289
|
"down": "Down",
|
|
290
290
|
"Equal": "Equal",
|
|
291
291
|
"Hide_all": "Hide all",
|
|
292
|
-
"Show_all": "Show all"
|
|
292
|
+
"Show_all": "Show all",
|
|
293
|
+
"Y_axis_(lift_side)": "Y axis (left side)",
|
|
294
|
+
"Y_axis_(right_side)": "Y axis (right side)",
|
|
295
|
+
"All": "All",
|
|
296
|
+
"Label_value": "Label value"
|
|
293
297
|
};
|
|
294
298
|
export default es;
|
package/dist/locale/lang/fr.js
CHANGED
|
@@ -42,7 +42,7 @@ const fr = {
|
|
|
42
42
|
"Label": "Étiquette",
|
|
43
43
|
"Y-axis(left side)": "Axe des y (primaire)",
|
|
44
44
|
"Y-axis(right side)": "Axe des y (secondaire)",
|
|
45
|
-
"Display_title": "
|
|
45
|
+
"Display_title": "Afficher le titre",
|
|
46
46
|
"Current_value_field": "Champ de valeur actuel",
|
|
47
47
|
"Total_value_field": "Champ de valeur total",
|
|
48
48
|
"Group_by": "Groupé par",
|
|
@@ -146,7 +146,7 @@ const fr = {
|
|
|
146
146
|
"Permission_denied": "Permission refusée",
|
|
147
147
|
"Execution_time_of_the_query_exceeds_the_limit": "Le temps d'exécution de la requête dépasse la limite. Les données ne peuvent pas être chargées.",
|
|
148
148
|
"There_are_some_problems_with_the_filters": "Les conditions de filtrage sont anormales. Veuillez réinitialiser les conditions de filtrage dans les paramètres de vue.",
|
|
149
|
-
"Please_complete_the_chart_configuration_first": "
|
|
149
|
+
"Please_complete_the_chart_configuration_first": "Configure chart in element settings",
|
|
150
150
|
"Not_used": "Ne pas utilisé",
|
|
151
151
|
"Select_field": "Sélectionner un champ",
|
|
152
152
|
"Display_total": "Afficher le total",
|
|
@@ -271,24 +271,28 @@ const fr = {
|
|
|
271
271
|
"Field_settings": "Paramètres de champ",
|
|
272
272
|
"Select_all": "Tout sélectionner",
|
|
273
273
|
"Visible": "Visible",
|
|
274
|
-
"Goal_line": "Ligne
|
|
275
|
-
"Display_goal_line": "Afficher la ligne
|
|
276
|
-
"Goal_value": "Valeur
|
|
277
|
-
"Goal_label": "Étiquette
|
|
278
|
-
"Table_element": "
|
|
279
|
-
"Sort": "
|
|
280
|
-
"1_Sort": "1
|
|
281
|
-
"Sorts": "
|
|
282
|
-
"hide_columns": "
|
|
283
|
-
"Hidden_columns": "
|
|
284
|
-
"1_hidden_column": "1
|
|
285
|
-
"No_sorts": "
|
|
286
|
-
"Add_sort": "
|
|
287
|
-
"Search_column": "
|
|
288
|
-
"up": "
|
|
289
|
-
"down": "
|
|
290
|
-
"Equal": "
|
|
291
|
-
"Hide_all": "
|
|
292
|
-
"Show_all": "
|
|
274
|
+
"Goal_line": "Ligne horizontale",
|
|
275
|
+
"Display_goal_line": "Afficher la ligne horizontale",
|
|
276
|
+
"Goal_value": "Valeur",
|
|
277
|
+
"Goal_label": "Étiquette",
|
|
278
|
+
"Table_element": "Table",
|
|
279
|
+
"Sort": "Sort",
|
|
280
|
+
"1_Sort": "1 sort",
|
|
281
|
+
"Sorts": "sorts",
|
|
282
|
+
"hide_columns": "Hide columns",
|
|
283
|
+
"Hidden_columns": "Hidden columns",
|
|
284
|
+
"1_hidden_column": "1 Hidden column",
|
|
285
|
+
"No_sorts": "No sorts",
|
|
286
|
+
"Add_sort": "Add sort",
|
|
287
|
+
"Search_column": "Search column",
|
|
288
|
+
"up": "Up",
|
|
289
|
+
"down": "Down",
|
|
290
|
+
"Equal": "Equal",
|
|
291
|
+
"Hide_all": "Hide all",
|
|
292
|
+
"Show_all": "Show all",
|
|
293
|
+
"Y_axis_(lift_side)": "Y axis (left side)",
|
|
294
|
+
"Y_axis_(right_side)": "Y axis (right side)",
|
|
295
|
+
"All": "All",
|
|
296
|
+
"Label_value": "Label value"
|
|
293
297
|
};
|
|
294
298
|
export default fr;
|
package/dist/locale/lang/pt.js
CHANGED
|
@@ -146,7 +146,7 @@ const pt = {
|
|
|
146
146
|
"Permission_denied": "Permission denied",
|
|
147
147
|
"Execution_time_of_the_query_exceeds_the_limit": "Execution time of the query exceeds the limit. Data cannot be loaded.",
|
|
148
148
|
"There_are_some_problems_with_the_filters": "There are some problems with the filters.",
|
|
149
|
-
"Please_complete_the_chart_configuration_first": "
|
|
149
|
+
"Please_complete_the_chart_configuration_first": "Configure chart in element settings",
|
|
150
150
|
"Not_used": "Not used",
|
|
151
151
|
"Select_field": "Select field",
|
|
152
152
|
"Display_total": "Display total",
|
|
@@ -289,6 +289,10 @@ const pt = {
|
|
|
289
289
|
"down": "Down",
|
|
290
290
|
"Equal": "Equal",
|
|
291
291
|
"Hide_all": "Hide all",
|
|
292
|
-
"Show_all": "Show all"
|
|
292
|
+
"Show_all": "Show all",
|
|
293
|
+
"Y_axis_(lift_side)": "Y axis (left side)",
|
|
294
|
+
"Y_axis_(right_side)": "Y axis (right side)",
|
|
295
|
+
"All": "All",
|
|
296
|
+
"Label_value": "Label value"
|
|
293
297
|
};
|
|
294
298
|
export default pt;
|
package/dist/locale/lang/ru.js
CHANGED
|
@@ -146,7 +146,7 @@ const ru = {
|
|
|
146
146
|
"Permission_denied": "Permission denied",
|
|
147
147
|
"Execution_time_of_the_query_exceeds_the_limit": "Execution time of the query exceeds the limit. Data cannot be loaded.",
|
|
148
148
|
"There_are_some_problems_with_the_filters": "There are some problems with the filters.",
|
|
149
|
-
"Please_complete_the_chart_configuration_first": "
|
|
149
|
+
"Please_complete_the_chart_configuration_first": "Configure chart in element settings",
|
|
150
150
|
"Not_used": "Not used",
|
|
151
151
|
"Select_field": "Select field",
|
|
152
152
|
"Display_total": "Display total",
|
|
@@ -289,6 +289,10 @@ const ru = {
|
|
|
289
289
|
"down": "Down",
|
|
290
290
|
"Equal": "Equal",
|
|
291
291
|
"Hide_all": "Hide all",
|
|
292
|
-
"Show_all": "Show all"
|
|
292
|
+
"Show_all": "Show all",
|
|
293
|
+
"Y_axis_(lift_side)": "Y axis (left side)",
|
|
294
|
+
"Y_axis_(right_side)": "Y axis (right side)",
|
|
295
|
+
"All": "All",
|
|
296
|
+
"Label_value": "Label value"
|
|
293
297
|
};
|
|
294
298
|
export default ru;
|
|
@@ -146,7 +146,7 @@ const zh_CN = {
|
|
|
146
146
|
"Permission_denied": "权限错误",
|
|
147
147
|
"Execution_time_of_the_query_exceeds_the_limit": "查询的执行时间超出限制。无法加载数据。",
|
|
148
148
|
"There_are_some_problems_with_the_filters": "过滤器有一些问题。",
|
|
149
|
-
"Please_complete_the_chart_configuration_first": "
|
|
149
|
+
"Please_complete_the_chart_configuration_first": "在元素设置中配置图表",
|
|
150
150
|
"Not_used": "不使用",
|
|
151
151
|
"Select_field": "选择字段",
|
|
152
152
|
"Display_total": "显示总计",
|
|
@@ -275,20 +275,24 @@ const zh_CN = {
|
|
|
275
275
|
"Display_goal_line": "显示目标线",
|
|
276
276
|
"Goal_value": "目标值",
|
|
277
277
|
"Goal_label": "目标值标签",
|
|
278
|
-
"Table_element": "
|
|
278
|
+
"Table_element": "子表",
|
|
279
279
|
"Sort": "排序",
|
|
280
280
|
"1_Sort": "1 个排序",
|
|
281
|
-
"Sorts": "
|
|
281
|
+
"Sorts": "排序",
|
|
282
282
|
"hide_columns": "隐藏列",
|
|
283
283
|
"Hidden_columns": "个隐藏列",
|
|
284
284
|
"1_hidden_column": "1 个隐藏列",
|
|
285
285
|
"No_sorts": "没有排序",
|
|
286
|
-
"Add_sort": "
|
|
286
|
+
"Add_sort": "增加排序",
|
|
287
287
|
"Search_column": "搜索列",
|
|
288
288
|
"up": "升序",
|
|
289
289
|
"down": "降序",
|
|
290
290
|
"Equal": "相等",
|
|
291
291
|
"Hide_all": "隐藏全部",
|
|
292
|
-
"Show_all": "
|
|
292
|
+
"Show_all": "显示全部",
|
|
293
|
+
"Y_axis_(lift_side)": "Y轴(主轴)",
|
|
294
|
+
"Y_axis_(right_side)": "Y轴(次轴)",
|
|
295
|
+
"All": "全部",
|
|
296
|
+
"Label_value": "显示标签值"
|
|
293
297
|
};
|
|
294
298
|
export default zh_CN;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isBoolean } from '../utils';
|
|
2
|
-
import { CHART_TYPE, CHART_SUMMARY_TYPE, CHART_LINE_TYPES } from '../constants';
|
|
2
|
+
import { CHART_TYPE, CHART_SUMMARY_TYPE, CHART_LINE_TYPES, COMBINATION_DISPLAY_FIELDS } from '../constants';
|
|
3
3
|
import BaseModel from './base-model';
|
|
4
4
|
class Combination extends BaseModel {
|
|
5
5
|
constructor(options) {
|
|
@@ -31,6 +31,7 @@ class Combination extends BaseModel {
|
|
|
31
31
|
this.y_axis_auto_range_right = options.y_axis_auto_range_right;
|
|
32
32
|
this.y_axis_min_right = options.y_axis_min_right;
|
|
33
33
|
this.y_axis_max_right = options.y_axis_max_right;
|
|
34
|
+
this.display_data_field = options.display_data_field || COMBINATION_DISPLAY_FIELDS.RIGHT;
|
|
34
35
|
this.display_data = isBoolean(options.y_axis_show_value) ? options.y_axis_show_value : false;
|
|
35
36
|
this.label_font_size = options.label_font_size;
|
|
36
37
|
this.line_type = options.line_type || CHART_LINE_TYPES[1];
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import _DTableCustomizeSelect from "dtable-ui-component/lib/DTableCustomizeSelect";
|
|
1
2
|
import _CollapsibleSettingLayout from "dtable-ui-component/lib/CollapsibleSettingLayout";
|
|
2
3
|
import _DTableRadioGroup from "dtable-ui-component/lib/DTableRadioGroup";
|
|
3
4
|
import _DTableSwitch from "dtable-ui-component/lib/DTableSwitch";
|
|
4
5
|
import React, { useCallback } from 'react';
|
|
5
|
-
import { Label, Row } from 'reactstrap';
|
|
6
|
+
import { FormGroup, Label, Row } from 'reactstrap';
|
|
6
7
|
import Divider from '../widgets/divider';
|
|
7
8
|
import MinMaxSetting from '../widgets/min-max-setting';
|
|
8
|
-
import
|
|
9
|
-
import { X_LABEL_POSITIONS, Y_LABEL_POSITIONS, LABEL_POSITION_TYPE_SHOW, SUPPORT_GOAL_LINE_CHART_TYPES } from '../../constants';
|
|
9
|
+
import { X_LABEL_POSITIONS, Y_LABEL_POSITIONS, LABEL_POSITION_TYPE_SHOW, SUPPORT_GOAL_LINE_CHART_TYPES, COMBINATION_DISPLAY_FIELDS_LIST } from '../../constants';
|
|
10
10
|
import intl from '../../intl';
|
|
11
11
|
import SelectLineType from '../widgets/select-line-type';
|
|
12
12
|
import GoalLineSetting from '../../components/goal-line-setting';
|
|
13
|
+
import { FontSizeSettings } from '../widgets/font-settings';
|
|
13
14
|
const StyleSettings = _ref => {
|
|
14
15
|
let {
|
|
15
16
|
chart,
|
|
@@ -19,6 +20,12 @@ const StyleSettings = _ref => {
|
|
|
19
20
|
} = _ref;
|
|
20
21
|
const xAxisLabelOptions = X_LABEL_POSITIONS;
|
|
21
22
|
const yAxisLabelOptions = Y_LABEL_POSITIONS;
|
|
23
|
+
const displayFieldOptions = COMBINATION_DISPLAY_FIELDS_LIST.map(field => {
|
|
24
|
+
return {
|
|
25
|
+
label: /*#__PURE__*/React.createElement("span", null, intl.get(field)),
|
|
26
|
+
value: field
|
|
27
|
+
};
|
|
28
|
+
});
|
|
22
29
|
const onAxisLabelShowChange = useCallback(labelKey => {
|
|
23
30
|
const {
|
|
24
31
|
config
|
|
@@ -63,8 +70,21 @@ const StyleSettings = _ref => {
|
|
|
63
70
|
};
|
|
64
71
|
onChange && onChange(update);
|
|
65
72
|
}, [onChange]);
|
|
66
|
-
const onDisplayValueChange = useCallback(
|
|
67
|
-
|
|
73
|
+
const onDisplayValueChange = useCallback(() => {
|
|
74
|
+
var _chart$config;
|
|
75
|
+
onChange && onChange({
|
|
76
|
+
display_data: !((_chart$config = chart.config) === null || _chart$config === void 0 ? void 0 : _chart$config.display_data)
|
|
77
|
+
});
|
|
78
|
+
}, [chart.config.display_data, onChange]);
|
|
79
|
+
const onFontSizeChange = useCallback(value => {
|
|
80
|
+
onChange && onChange({
|
|
81
|
+
label_font_size: value
|
|
82
|
+
});
|
|
83
|
+
}, [onChange]);
|
|
84
|
+
const onDisplayFieldChange = useCallback(value => {
|
|
85
|
+
onChange && onChange({
|
|
86
|
+
display_data_field: value
|
|
87
|
+
});
|
|
68
88
|
}, [onChange]);
|
|
69
89
|
const getLabelOptionsDisplay = options => {
|
|
70
90
|
return options.reduce((optionDisplayMap, position) => {
|
|
@@ -97,10 +117,12 @@ const StyleSettings = _ref => {
|
|
|
97
117
|
y_axis_min_right,
|
|
98
118
|
y_axis_max_right,
|
|
99
119
|
display_data,
|
|
120
|
+
display_data_field,
|
|
100
121
|
label_font_size,
|
|
101
122
|
line_type,
|
|
102
123
|
type
|
|
103
124
|
} = config;
|
|
125
|
+
const selectedDisplayFieldOption = displayFieldOptions.find(option => option.value === display_data_field) || displayFieldOptions[0];
|
|
104
126
|
const xAxisLabelPosition = x_axis_label_position || xAxisLabelOptions[0];
|
|
105
127
|
const yLeftAxisLabelPosition = y_axis_left_label_position || yAxisLabelOptions[0];
|
|
106
128
|
const yRightAxisLabelPosition = y_axis_right_label_position || yAxisLabelOptions[0];
|
|
@@ -183,13 +205,28 @@ const StyleSettings = _ref => {
|
|
|
183
205
|
goalLabel: goal_label,
|
|
184
206
|
goalValue: goal_value,
|
|
185
207
|
onChange: onStyleChange
|
|
186
|
-
}), /*#__PURE__*/React.createElement(Divider, null)), /*#__PURE__*/React.createElement(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
208
|
+
}), /*#__PURE__*/React.createElement(Divider, null)), /*#__PURE__*/React.createElement(_CollapsibleSettingLayout, {
|
|
209
|
+
title: intl.get('Label')
|
|
210
|
+
}, /*#__PURE__*/React.createElement(FormGroup, {
|
|
211
|
+
className: "sea-chart-parameter-item"
|
|
212
|
+
}, /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
213
|
+
switchClassName: "display-value-settings",
|
|
214
|
+
checked: display_data,
|
|
215
|
+
disabled: false,
|
|
216
|
+
placeholder: intl.get('Display_value'),
|
|
191
217
|
onChange: onDisplayValueChange
|
|
192
|
-
})
|
|
218
|
+
}), display_data && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
219
|
+
className: "combination-label-value-setting"
|
|
220
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Label_value')), /*#__PURE__*/React.createElement(_DTableCustomizeSelect, {
|
|
221
|
+
value: selectedDisplayFieldOption,
|
|
222
|
+
options: displayFieldOptions,
|
|
223
|
+
onSelectOption: onDisplayFieldChange
|
|
224
|
+
})), /*#__PURE__*/React.createElement(FontSizeSettings, {
|
|
225
|
+
title: intl.get('Label_font_size'),
|
|
226
|
+
fontSize: label_font_size,
|
|
227
|
+
defaultFontSize: 12,
|
|
228
|
+
modifyFontSize: onFontSizeChange
|
|
229
|
+
})))));
|
|
193
230
|
};
|
|
194
231
|
StyleSettings.defaultProps = {
|
|
195
232
|
xLabel: 'X_axis'
|
package/dist/settings/index.css
CHANGED
|
@@ -27,6 +27,33 @@ export function findIfColumnDataIsArray(column) {
|
|
|
27
27
|
}
|
|
28
28
|
class BaseUtils {}
|
|
29
29
|
_BaseUtils = BaseUtils;
|
|
30
|
+
BaseUtils.updateSummaryValuePrecision = (result, summaryColumn, summaryValueKey) => {
|
|
31
|
+
if (!result || !summaryColumn) return;
|
|
32
|
+
const {
|
|
33
|
+
data
|
|
34
|
+
} = summaryColumn;
|
|
35
|
+
if (!data) return;
|
|
36
|
+
const {
|
|
37
|
+
enable_precision,
|
|
38
|
+
precision,
|
|
39
|
+
format
|
|
40
|
+
} = data;
|
|
41
|
+
if (enable_precision) {
|
|
42
|
+
result.forEach(item => {
|
|
43
|
+
if (format === 'percent') {
|
|
44
|
+
item[summaryValueKey] = parseFloat(getPrecisionNumber(item[summaryValueKey] * 100, {
|
|
45
|
+
enable_precision,
|
|
46
|
+
precision
|
|
47
|
+
})) / 100;
|
|
48
|
+
} else {
|
|
49
|
+
item[summaryValueKey] = parseFloat(getPrecisionNumber(item[summaryValueKey], {
|
|
50
|
+
enable_precision,
|
|
51
|
+
precision
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
30
57
|
BaseUtils.isCollaborator = column => {
|
|
31
58
|
return column.type === CellType.COLLABORATOR;
|
|
32
59
|
};
|
|
@@ -226,6 +253,15 @@ BaseUtils.getSummaryColumn = (table, chart) => {
|
|
|
226
253
|
{
|
|
227
254
|
return getTableColumnByKey(table, config.y_axis_column_key);
|
|
228
255
|
}
|
|
256
|
+
case CHART_TYPE.COMBINATION:
|
|
257
|
+
{
|
|
258
|
+
const summaryColumnLeft = getTableColumnByKey(table, config.y_axis_left_summary_column);
|
|
259
|
+
const summaryColumnRight = getTableColumnByKey(table, config.y_axis_right_summary_column);
|
|
260
|
+
return {
|
|
261
|
+
summaryColumnLeft,
|
|
262
|
+
summaryColumnRight
|
|
263
|
+
};
|
|
264
|
+
}
|
|
229
265
|
default:
|
|
230
266
|
{
|
|
231
267
|
return getTableColumnByKey(table, summary_column_key);
|
|
@@ -649,7 +649,8 @@ SQLStatisticsUtils.basicChartSQLResult2JavaScript = async (chart, sqlRows, chart
|
|
|
649
649
|
groupby_include_empty_cells
|
|
650
650
|
} = config;
|
|
651
651
|
const {
|
|
652
|
-
groupbyColumn
|
|
652
|
+
groupbyColumn,
|
|
653
|
+
summaryColumn
|
|
653
654
|
} = columnMap;
|
|
654
655
|
const isGroupbyColumnDataAsAnArray = findIfColumnDataIsArray(groupbyColumn);
|
|
655
656
|
const {
|
|
@@ -724,6 +725,7 @@ SQLStatisticsUtils.basicChartSQLResult2JavaScript = async (chart, sqlRows, chart
|
|
|
724
725
|
}
|
|
725
726
|
BaseUtils.sortCharts(result, groupbyColumn, 'name');
|
|
726
727
|
BaseUtils.updateTableViewList(result, groupbyColumn, 'name', 'color', false, true);
|
|
728
|
+
BaseUtils.updateSummaryValuePrecision(result, summaryColumn, 'value');
|
|
727
729
|
if (SUPPORT_DATA_SORT_CHART_TYPES.includes(type) && sort_type) {
|
|
728
730
|
BaseUtils.sortChartData(result, sort_type);
|
|
729
731
|
return result;
|
|
@@ -751,7 +753,8 @@ SQLStatisticsUtils.customChartSQLResult2JavaScript = async (chart, sqlRows, char
|
|
|
751
753
|
y_axises
|
|
752
754
|
} = chart.config;
|
|
753
755
|
const {
|
|
754
|
-
groupbyColumn
|
|
756
|
+
groupbyColumn,
|
|
757
|
+
summaryColumn
|
|
755
758
|
} = columnMap;
|
|
756
759
|
const table = getTableById(tables, table_id);
|
|
757
760
|
const stack = y_axises[index];
|
|
@@ -844,6 +847,7 @@ SQLStatisticsUtils.customChartSQLResult2JavaScript = async (chart, sqlRows, char
|
|
|
844
847
|
}
|
|
845
848
|
BaseUtils.sortCharts(result, groupbyColumn, 'name');
|
|
846
849
|
BaseUtils.updateTableViewList(result, groupbyColumn, 'name', '', false, true);
|
|
850
|
+
BaseUtils.updateSummaryValuePrecision(result, summaryColumn, 'value');
|
|
847
851
|
return result;
|
|
848
852
|
};
|
|
849
853
|
SQLStatisticsUtils.compareSQLResult2Javascript = async (chart, sqlRows, chartSQLMap, columnMap, tables) => {
|
|
@@ -973,6 +977,8 @@ SQLStatisticsUtils.compareSQLResult2Javascript = async (chart, sqlRows, chartSQL
|
|
|
973
977
|
if (comparedResult.length > rangeResult.length) {
|
|
974
978
|
comparedResult = comparedResult.slice(0, rangeResult.length);
|
|
975
979
|
}
|
|
980
|
+
BaseUtils.updateSummaryValuePrecision(comparedResult, summaryColumn, 'value');
|
|
981
|
+
BaseUtils.updateSummaryValuePrecision(rangeResult, summaryColumn, 'value');
|
|
976
982
|
return [...comparedResult, ...rangeResult];
|
|
977
983
|
};
|
|
978
984
|
SQLStatisticsUtils.combinationSQLResult2Javascript = async (chart, sqlRows, chartSQLMap, columnMap, tables) => {
|
|
@@ -991,8 +997,13 @@ SQLStatisticsUtils.combinationSQLResult2Javascript = async (chart, sqlRows, char
|
|
|
991
997
|
} = config;
|
|
992
998
|
const table = getTableById(tables, table_id);
|
|
993
999
|
const {
|
|
994
|
-
groupbyColumn
|
|
1000
|
+
groupbyColumn,
|
|
1001
|
+
summaryColumn
|
|
995
1002
|
} = columnMap;
|
|
1003
|
+
const {
|
|
1004
|
+
summaryColumnLeft,
|
|
1005
|
+
summaryColumnRight
|
|
1006
|
+
} = summaryColumn;
|
|
996
1007
|
const {
|
|
997
1008
|
sqlGroupbyColumnKey,
|
|
998
1009
|
sqlRightSummaryColumnKey,
|
|
@@ -1169,6 +1180,8 @@ SQLStatisticsUtils.combinationSQLResult2Javascript = async (chart, sqlRows, char
|
|
|
1169
1180
|
}
|
|
1170
1181
|
BaseUtils.updateTableViewList(result, groupbyColumn, 'name', '', false, true);
|
|
1171
1182
|
BaseUtils.sortCharts(result, groupbyColumn, 'name');
|
|
1183
|
+
BaseUtils.updateSummaryValuePrecision(result, summaryColumnLeft, 'value_left');
|
|
1184
|
+
BaseUtils.updateSummaryValuePrecision(result, summaryColumnRight, 'value_right');
|
|
1172
1185
|
return result;
|
|
1173
1186
|
};
|
|
1174
1187
|
SQLStatisticsUtils.dashboardSQLResult2JavaScript = (chart, sqlRows, chartSQLMap, columnMap, tables) => {
|
|
@@ -1237,7 +1250,8 @@ SQLStatisticsUtils.updateGroupingChartRows = (results, name, row, count, isColum
|
|
|
1237
1250
|
SQLStatisticsUtils.groupingTwoDimensionChartSQLResult2JavaScript = async (chart, sqlRows, chartSQLMap, columnMap, tables) => {
|
|
1238
1251
|
const {
|
|
1239
1252
|
groupbyColumn,
|
|
1240
|
-
columnGroupbyColumn
|
|
1253
|
+
columnGroupbyColumn,
|
|
1254
|
+
summaryColumn
|
|
1241
1255
|
} = columnMap;
|
|
1242
1256
|
const {
|
|
1243
1257
|
x_axis_include_empty_cells: includeEmpty
|
|
@@ -1273,6 +1287,7 @@ SQLStatisticsUtils.groupingTwoDimensionChartSQLResult2JavaScript = async (chart,
|
|
|
1273
1287
|
BaseUtils.sortCharts(result, groupbyColumn, 'name');
|
|
1274
1288
|
BaseUtils.updateTableViewList(result, groupbyColumn, 'name', 'color', false, true);
|
|
1275
1289
|
BaseUtils.updateTableViewList(result, columnGroupbyColumn, 'group_name', 'group_color', false, false);
|
|
1290
|
+
BaseUtils.updateSummaryValuePrecision(result, summaryColumn, 'value');
|
|
1276
1291
|
return result;
|
|
1277
1292
|
};
|
|
1278
1293
|
SQLStatisticsUtils.groupingChartSQLResult2JavaScript = async (chart, sqlRows, chartSQLMap, columnMap, tables) => {
|
|
@@ -1287,7 +1302,9 @@ SQLStatisticsUtils.groupingChartSQLResult2JavaScript = async (chart, sqlRows, ch
|
|
|
1287
1302
|
}
|
|
1288
1303
|
const {
|
|
1289
1304
|
groupbyColumn,
|
|
1290
|
-
columnGroupbyColumn
|
|
1305
|
+
columnGroupbyColumn,
|
|
1306
|
+
summaryColumn,
|
|
1307
|
+
summaryColumnsWithMethod
|
|
1291
1308
|
} = columnMap;
|
|
1292
1309
|
if (y_axis_summary_type === CHART_SUMMARY_TYPE.COUNT) {
|
|
1293
1310
|
if (!columnGroupbyColumn) return await _SQLStatisticsUtils.basicChartSQLResult2JavaScript(chart, sqlRows, chartSQLMap, columnMap, tables);
|
|
@@ -1328,6 +1345,20 @@ SQLStatisticsUtils.groupingChartSQLResult2JavaScript = async (chart, sqlRows, ch
|
|
|
1328
1345
|
}
|
|
1329
1346
|
BaseUtils.sortCharts(result, groupbyColumn, 'name');
|
|
1330
1347
|
BaseUtils.updateTableViewList(result, groupbyColumn, 'name', 'color', false, true);
|
|
1348
|
+
const allSummaryColumns = [summaryColumn].concat(summaryColumnsWithMethod.map(item => item.column));
|
|
1349
|
+
|
|
1350
|
+
// format precision of enabled precision columns
|
|
1351
|
+
let columnNameResultMap = {};
|
|
1352
|
+
result.forEach(item => {
|
|
1353
|
+
if (!columnNameResultMap[item.group_name]) {
|
|
1354
|
+
columnNameResultMap[item.group_name] = [];
|
|
1355
|
+
}
|
|
1356
|
+
columnNameResultMap[item.group_name].push(item);
|
|
1357
|
+
});
|
|
1358
|
+
Object.values(columnNameResultMap).forEach(items => {
|
|
1359
|
+
const targetColumn = allSummaryColumns.find(column => column.name === items[0].group_name);
|
|
1360
|
+
BaseUtils.updateSummaryValuePrecision(items, targetColumn, 'value');
|
|
1361
|
+
});
|
|
1331
1362
|
return result;
|
|
1332
1363
|
}
|
|
1333
1364
|
if (!columnGroupbyColumn) {
|
|
@@ -8,6 +8,10 @@ import { BaseUtils, isFunction } from '../../utils';
|
|
|
8
8
|
import { CHART_SUMMARY_TYPE, CHART_SUMMARY_SHOW, LABEL_POSITION_TYPE, EMPTY_NAME, CHART_LINE_TYPES, CHART_STYLE_COLORS, CHART_THEME_COLOR } from '../../constants';
|
|
9
9
|
import intl from '../../intl';
|
|
10
10
|
import ChartComponent from './chart-component';
|
|
11
|
+
const valueFieldMap = {
|
|
12
|
+
value_left: ['Y_axis_(lift_side)', 'All'],
|
|
13
|
+
value_right: ['Y_axis_(right_side)', 'All']
|
|
14
|
+
};
|
|
11
15
|
class Combination extends ChartComponent {
|
|
12
16
|
constructor(props) {
|
|
13
17
|
super(props);
|
|
@@ -48,6 +52,7 @@ class Combination extends ChartComponent {
|
|
|
48
52
|
y_axis_min_right,
|
|
49
53
|
y_axis_max_right,
|
|
50
54
|
display_data,
|
|
55
|
+
display_data_field,
|
|
51
56
|
label_font_size,
|
|
52
57
|
line_type
|
|
53
58
|
} = chart.config;
|
|
@@ -64,6 +69,12 @@ class Combination extends ChartComponent {
|
|
|
64
69
|
appendPadding: [display_data ? 17 : 0, 0, 0, 0]
|
|
65
70
|
});
|
|
66
71
|
const isSmooth = line_type === CHART_LINE_TYPES[1] || !line_type;
|
|
72
|
+
const showLeftValue = display_data && valueFieldMap['value_left'].includes(display_data_field);
|
|
73
|
+
let showRightValue = display_data && valueFieldMap['value_right'].includes(display_data_field);
|
|
74
|
+
// if display_data is open, default show right value
|
|
75
|
+
if (display_data && !display_data_field) {
|
|
76
|
+
showRightValue = true;
|
|
77
|
+
}
|
|
67
78
|
|
|
68
79
|
// y-axis label width:6 + 10
|
|
69
80
|
const chartWidth = this.chart.width - 6 - 10; // 10 is y-axis number width and 6 is gap between number and y axis line
|
|
@@ -253,6 +264,13 @@ class Combination extends ChartComponent {
|
|
|
253
264
|
}).style({
|
|
254
265
|
fillOpacity: 1,
|
|
255
266
|
radius: [singleBarRadius, singleBarRadius, 0, 0]
|
|
267
|
+
}).label(showLeftValue ? 'value_left' : false, {
|
|
268
|
+
style: {
|
|
269
|
+
fontSize: BaseUtils.getLabelFontSize(label_font_size),
|
|
270
|
+
fill: theme.labelColor,
|
|
271
|
+
stroke: '#fff',
|
|
272
|
+
lineWidth: 1
|
|
273
|
+
}
|
|
256
274
|
});
|
|
257
275
|
this.formatDataByName(data);
|
|
258
276
|
if (!y_axis_left_group_by_multiple_numeric_column) {
|
|
@@ -273,7 +291,7 @@ class Combination extends ChartComponent {
|
|
|
273
291
|
}).shape('circle').size(3).style({
|
|
274
292
|
stroke: 0,
|
|
275
293
|
fillOpacity: 1
|
|
276
|
-
}).label(
|
|
294
|
+
}).label(showRightValue ? 'value_right' : false, {
|
|
277
295
|
style: {
|
|
278
296
|
fontSize: BaseUtils.getLabelFontSize(label_font_size),
|
|
279
297
|
fill: theme.labelColor,
|