sea-chart 2.0.48 → 2.0.50
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/settings/advance-bar-settings/style-settings.js +1 -1
- package/dist/settings/pie-settings/style-settings.js +1 -1
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +1 -1
- package/dist/utils/column-utils.js +1 -1
- package/dist/view/wrapper/area-group.js +1 -1
- package/dist/view/wrapper/bar-group.js +1 -1
- package/dist/view/wrapper/bar-stack.js +1 -1
- package/dist/view/wrapper/horizontal-bar-group.js +1 -1
- package/dist/view/wrapper/horizontal-bar-stack.js +1 -1
- package/dist/view/wrapper/line-group.js +1 -1
- package/dist/view/wrapper/table-element/css/index.css +9 -0
- package/package.json +2 -2
|
@@ -66,7 +66,7 @@ const StyleSettings = _ref => {
|
|
|
66
66
|
const table = tables.find(table => table._id === table_id);
|
|
67
67
|
const columns = (table === null || table === void 0 ? void 0 : table.columns) || [];
|
|
68
68
|
const column = (0, _utils.getColumnByKey)(column_groupby_column_key, columns);
|
|
69
|
-
const isGroupBySingleSelectColumn = (column === null || column === void 0 ? void 0 : column.type) === _dtableUtils.CellType.SINGLE_SELECT;
|
|
69
|
+
const isGroupBySingleSelectColumn = (column === null || column === void 0 ? void 0 : column.type) === _dtableUtils.CellType.SINGLE_SELECT || (column === null || column === void 0 ? void 0 : column.type) === _dtableUtils.CellType.MULTIPLE_SELECT;
|
|
70
70
|
const defaultColorTheme = _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.DEFAULT;
|
|
71
71
|
const [currYaxisTitle, setCurrYaxisTitle] = (0, _react.useState)(title_name || '');
|
|
72
72
|
const xAxisLabelOptions = (0, _react.useMemo)(() => {
|
|
@@ -122,7 +122,7 @@ const StyleSettings = _ref => {
|
|
|
122
122
|
} = config;
|
|
123
123
|
const table = tables.find(table => table._id === table_id);
|
|
124
124
|
const column = (0, _utils.getColumnByKey)(groupby_column_key, table.columns);
|
|
125
|
-
const isGroupBySingleSelectColumn = (column === null || column === void 0 ? void 0 : column.type) === _dtableUtils.CellType.SINGLE_SELECT;
|
|
125
|
+
const isGroupBySingleSelectColumn = (column === null || column === void 0 ? void 0 : column.type) === _dtableUtils.CellType.SINGLE_SELECT || (column === null || column === void 0 ? void 0 : column.type) === _dtableUtils.CellType.MULTIPLE_SELECT;
|
|
126
126
|
const defaultColorTheme = _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.DEFAULT;
|
|
127
127
|
const selectedLabelOption = labelPositionOptions.find(item => item.value === label_position);
|
|
128
128
|
const selectedLabelFormat = labelFormatOptions.find(item => item.value === label_format) || labelFormatOptions[0];
|
|
@@ -362,7 +362,7 @@ function getGroupbyOneColumnChartResults(rows, formulaRows, groupbyColumn, inclu
|
|
|
362
362
|
let formattedResult = {
|
|
363
363
|
...result
|
|
364
364
|
};
|
|
365
|
-
if (columnGroupByColumn.type === _dtableUtils.CellType.SINGLE_SELECT) {
|
|
365
|
+
if (columnGroupByColumn.type === _dtableUtils.CellType.SINGLE_SELECT || columnGroupByColumn.type === _dtableUtils.CellType.MULTIPLE_SELECT) {
|
|
366
366
|
formattedResult.color = (0, _columnUtils.getColorFromSingleSelectColumn)(columnGroupByColumn, groupName);
|
|
367
367
|
}
|
|
368
368
|
formattedResult.group_name = (0, _rowUtils.getFormattedLabel)(columnGroupByColumn, groupName, value.collaborators);
|
|
@@ -250,7 +250,7 @@ const getColorFromSingleSelectColumn = (column, target) => {
|
|
|
250
250
|
type: columnType,
|
|
251
251
|
data: columnData
|
|
252
252
|
} = column;
|
|
253
|
-
if (columnType !== _dtableUtils.CellType.SINGLE_SELECT) return null;
|
|
253
|
+
if (columnType !== _dtableUtils.CellType.SINGLE_SELECT && columnType !== _dtableUtils.CellType.MULTIPLE_SELECT) return null;
|
|
254
254
|
const options = columnData ? columnData.options : [];
|
|
255
255
|
const selectedOption = options.find(option => {
|
|
256
256
|
let id = target;
|
|
@@ -84,7 +84,7 @@ class AreaGroup extends _chartComponent.default {
|
|
|
84
84
|
insertPadding,
|
|
85
85
|
marginTop
|
|
86
86
|
} = this.chartBoundingClientRect;
|
|
87
|
-
const useSingleSelectColumnColor = (columnGroupbyColumn === null || columnGroupbyColumn === void 0 ? void 0 : columnGroupbyColumn.type) === _dtableUtils.CellType.SINGLE_SELECT && color_theme === _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
87
|
+
const useSingleSelectColumnColor = ((columnGroupbyColumn === null || columnGroupbyColumn === void 0 ? void 0 : columnGroupbyColumn.type) === _dtableUtils.CellType.SINGLE_SELECT || (columnGroupbyColumn === null || columnGroupbyColumn === void 0 ? void 0 : columnGroupbyColumn.type) === _dtableUtils.CellType.MULTIPLE_SELECT) && color_theme === _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
88
88
|
useSingleSelectColumnColor ? this.setSingleSelectColorMap(fullData) : this.setColorMap(fullData, chartColorTheme, 'group_name', columnGroupbyColumn, chart);
|
|
89
89
|
const tooltipTitle = this.getTitle(tables, table_id, y_axis_summary_type, y_axis_column_key || y_axis_summary_column_key);
|
|
90
90
|
|
|
@@ -91,7 +91,7 @@ class BarGroup extends _chartComponent.default {
|
|
|
91
91
|
} = chart.config;
|
|
92
92
|
const theme = _constants.CHART_THEME_COLOR[globalTheme];
|
|
93
93
|
const column_groupby_column = this.getColumn(tables, table_id, column_groupby_column_key);
|
|
94
|
-
const useSingleSelectColumnColor = (column_groupby_column === null || column_groupby_column === void 0 ? void 0 : column_groupby_column.type) === _dtableUtils.CellType.SINGLE_SELECT && color_theme === _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
94
|
+
const useSingleSelectColumnColor = ((column_groupby_column === null || column_groupby_column === void 0 ? void 0 : column_groupby_column.type) === _dtableUtils.CellType.SINGLE_SELECT || (column_groupby_column === null || column_groupby_column === void 0 ? void 0 : column_groupby_column.type) === _dtableUtils.CellType.MULTIPLE_SELECT) && color_theme === _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
95
95
|
useSingleSelectColumnColor ? this.setSingleSelectColorMap(fullData) : this.setColorMap(fullData, chartColorTheme, 'group_name', columnGroupbyColumn, chart); // use single select column color
|
|
96
96
|
|
|
97
97
|
const y = d3.scaleLinear().domain(y_axis_auto_range ? [0, d3.max(data, d => d.value)] : [y_axis_min, y_axis_max]).range([chartHeight - insertPadding, insertPadding + marginTop]);
|
|
@@ -86,7 +86,7 @@ class BarStack extends _chartComponent.default {
|
|
|
86
86
|
} = chart.config;
|
|
87
87
|
const theme = _constants.CHART_THEME_COLOR[globalTheme];
|
|
88
88
|
const column_groupby_column = this.getColumn(tables, table_id, column_groupby_column_key);
|
|
89
|
-
const useSingleSelectColumnColor = (column_groupby_column === null || column_groupby_column === void 0 ? void 0 : column_groupby_column.type) === _dtableUtils.CellType.SINGLE_SELECT && color_theme === _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
89
|
+
const useSingleSelectColumnColor = ((column_groupby_column === null || column_groupby_column === void 0 ? void 0 : column_groupby_column.type) === _dtableUtils.CellType.SINGLE_SELECT || (column_groupby_column === null || column_groupby_column === void 0 ? void 0 : column_groupby_column.type) === _dtableUtils.CellType.MULTIPLE_SELECT) && color_theme === _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
90
90
|
// use single select column color
|
|
91
91
|
useSingleSelectColumnColor ? this.setSingleSelectColorMap(fullData) : this.setColorMap(fullData, chartColorTheme, 'group_name', columnGroupbyColumn, chart);
|
|
92
92
|
const {
|
|
@@ -107,7 +107,7 @@ class HorizontalBarGroup extends _chartComponent.default {
|
|
|
107
107
|
}
|
|
108
108
|
const fullData = data;
|
|
109
109
|
data = this.getVisibleLegendData(data, 'group_name');
|
|
110
|
-
const useSingleSelectColumnColor = (groupByColumn === null || groupByColumn === void 0 ? void 0 : groupByColumn.type) === _dtableUtils.CellType.SINGLE_SELECT && color_theme === _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
110
|
+
const useSingleSelectColumnColor = ((groupByColumn === null || groupByColumn === void 0 ? void 0 : groupByColumn.type) === _dtableUtils.CellType.SINGLE_SELECT || (groupByColumn === null || groupByColumn === void 0 ? void 0 : groupByColumn.type) === _dtableUtils.CellType.MULTIPLE_SELECT) && color_theme === _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
111
111
|
useSingleSelectColumnColor ? this.setSingleSelectColorMap(fullData) : this.setColorMap(fullData, chartColorTheme);
|
|
112
112
|
const fy = d3.scaleBand().domain(new Set(data.map(d => d.name))).range([chartHeight - insertPadding, insertPadding]).paddingInner(0.3).paddingOuter(0.1);
|
|
113
113
|
const sortedData = _utils.BaseUtils.sortDataByGroupName((0, _lodashEs.cloneDeep)(data), 'group_name', columnGroupbyColumn, chart);
|
|
@@ -85,7 +85,7 @@ class HorizontalBarStack extends _chartComponent.default {
|
|
|
85
85
|
insertPadding
|
|
86
86
|
} = this.chartBoundingClientRect;
|
|
87
87
|
const groupByColumn = this.getColumn(tables, table_id, column_groupby_column_key);
|
|
88
|
-
const useSingleSelectColumnColor = (groupByColumn === null || groupByColumn === void 0 ? void 0 : groupByColumn.type) === _dtableUtils.CellType.SINGLE_SELECT && color_theme === _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
88
|
+
const useSingleSelectColumnColor = ((groupByColumn === null || groupByColumn === void 0 ? void 0 : groupByColumn.type) === _dtableUtils.CellType.SINGLE_SELECT || (groupByColumn === null || groupByColumn === void 0 ? void 0 : groupByColumn.type) === _dtableUtils.CellType.MULTIPLE_SELECT) && color_theme === _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
89
89
|
useSingleSelectColumnColor ? this.setSingleSelectColorMap(fullData) : this.setColorMap(fullData, chartColorTheme, 'group_name', columnGroupbyColumn, chart);
|
|
90
90
|
const sortedData = _utils.BaseUtils.sortDataByGroupName((0, _lodashEs.cloneDeep)(data), 'group_name', columnGroupbyColumn, chart);
|
|
91
91
|
const series = d3.stack().keys(d3.union(sortedData.map(d => d.group_name))).value((_ref, key) => {
|
|
@@ -160,7 +160,7 @@ class LineGroup extends _chartComponent.default {
|
|
|
160
160
|
insertPadding,
|
|
161
161
|
marginTop
|
|
162
162
|
} = this.chartBoundingClientRect;
|
|
163
|
-
const useSingleSelectColumnColor = (columnGroupbyColumn === null || columnGroupbyColumn === void 0 ? void 0 : columnGroupbyColumn.type) === _dtableUtils.CellType.SINGLE_SELECT && color_theme === _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
163
|
+
const useSingleSelectColumnColor = ((columnGroupbyColumn === null || columnGroupbyColumn === void 0 ? void 0 : columnGroupbyColumn.type) === _dtableUtils.CellType.SINGLE_SELECT || (columnGroupbyColumn === null || columnGroupbyColumn === void 0 ? void 0 : columnGroupbyColumn.type) === _dtableUtils.CellType.MULTIPLE_SELECT) && color_theme === _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
164
164
|
useSingleSelectColumnColor ? this.setSingleSelectColorMap(fullData) : this.setColorMap(fullData, chartColorTheme, 'group_name', columnGroupbyColumn, chart);
|
|
165
165
|
|
|
166
166
|
// Y axis
|
|
@@ -160,6 +160,11 @@
|
|
|
160
160
|
line-height: 1;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
.table-element-result-table-cell .multiple-select-formatter {
|
|
164
|
+
display: inline-flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
}
|
|
167
|
+
|
|
163
168
|
.table-element-result-table-cell .table-element-button-formatter.cell-formatter-container {
|
|
164
169
|
margin: -3px auto;
|
|
165
170
|
text-align: center;
|
|
@@ -318,6 +323,10 @@
|
|
|
318
323
|
flex-shrink: 0;
|
|
319
324
|
}
|
|
320
325
|
|
|
326
|
+
.table-element-result-table-cell .dtable-ui.dtable-ui-select-item {
|
|
327
|
+
margin: 0 10px 0 0;
|
|
328
|
+
}
|
|
329
|
+
|
|
321
330
|
/* records count */
|
|
322
331
|
.table-element-result.success .table-element-result-count {
|
|
323
332
|
height: 32px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sea-chart",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.50",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@dnd-kit/core": "^6.1.0",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"dotenv": "6.2.0",
|
|
103
103
|
"dotenv-expand": "5.1.0",
|
|
104
104
|
"dtable-store": "~6.0.11",
|
|
105
|
-
"dtable-ui-component": "
|
|
105
|
+
"dtable-ui-component": "7.0.6",
|
|
106
106
|
"ejs": "3.1.10",
|
|
107
107
|
"eslint": "^6.8.0",
|
|
108
108
|
"eslint-config-react-app": "^5.0.2",
|