sea-chart 1.1.6 → 1.1.7
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
CHANGED
|
@@ -26,6 +26,9 @@ export const CHART_STYLE_COLORS = ['#5B8FF9', '#5AD8A6', '#5D7092', '#F6BD16', '
|
|
|
26
26
|
export const ONLY_NEED_NUMBER_OPTIONS_CHART_TYPE = [CHART_TYPE.COMPLETENESS, CHART_TYPE.COMPLETENESS_GROUP, CHART_TYPE.SCATTER];
|
|
27
27
|
export const COMPLETENESS_GROUPBY_SUPPORTED_COLUMN_TYPE = [CellType.COLLABORATOR, CellType.TEXT, CellType.SINGLE_SELECT];
|
|
28
28
|
export const NUMBERIC_COLUMN_TYPE = [CellType.RATE, CellType.NUMBER];
|
|
29
|
+
|
|
30
|
+
// chart supports groupby
|
|
31
|
+
export const SUPPORT_GROUP_BY_CHART_TYPES = [CHART_TYPE.BAR_GROUP, CHART_TYPE.BAR_STACK, CHART_TYPE.AREA_GROUP, CHART_TYPE.LINE_GROUP, CHART_TYPE.COMPLETENESS_GROUP, CHART_TYPE.HORIZONTAL_GROUP_BAR, CHART_TYPE.STACKED_HORIZONTAL_BAR, CHART_TYPE.SCATTER];
|
|
29
32
|
export const ZH_CN_SUPPORT_CHARTS = [CHART_TYPE.MAP, CHART_TYPE.MAP_BUBBLE];
|
|
30
33
|
export const SUPPORT_DATA_SORT_CHART_TYPES = [CHART_TYPE.BAR, CHART_TYPE.BAR_STACK, CHART_TYPE.LINE, CHART_TYPE.PIE, CHART_TYPE.RING, CHART_TYPE.HORIZONTAL_BAR, CHART_TYPE.STACKED_HORIZONTAL_BAR, CHART_TYPE.AREA, CHART_TYPE.TREE_MAP];
|
|
31
34
|
export const SUPPORT_STACK_VALUE_CHART_TYPES = [CHART_TYPE.BAR_STACK, CHART_TYPE.BAR_CUSTOM];
|
|
@@ -27,6 +27,10 @@ const ChartType = _ref => {
|
|
|
27
27
|
type: oldType
|
|
28
28
|
} = config;
|
|
29
29
|
if (type === oldType) return;
|
|
30
|
+
|
|
31
|
+
// reset these two configs to preventing new type getting into the wrong calculator
|
|
32
|
+
config.column_groupby_column_key = null;
|
|
33
|
+
config.column_groupby_multiple_numeric_column = null;
|
|
30
34
|
const convertedChart = generateChartConfig({
|
|
31
35
|
...config,
|
|
32
36
|
type
|
|
@@ -529,7 +529,8 @@ function calculator(chart, value, _ref5) {
|
|
|
529
529
|
column_groupby_column_key,
|
|
530
530
|
column_groupby_multiple_numeric_column
|
|
531
531
|
} = chart;
|
|
532
|
-
|
|
532
|
+
const notGroupBy = !column_groupby_column_key && !column_groupby_multiple_numeric_column;
|
|
533
|
+
if (notGroupBy) {
|
|
533
534
|
return calculateBasicChart(chart, value, {
|
|
534
535
|
getViewRows,
|
|
535
536
|
getTableFormulaResults
|