sea-chart 0.0.50 → 0.0.51-alpha.0
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/utils/chart-utils/base-utils.js +1 -1
- package/dist/utils/row-utils.js +1 -1
- package/dist/view/wrapper/heat-map.js +10 -7
- package/dist/view/wrapper/table/one-dimension-table-no-numeric-columns.js +2 -1
- package/dist/view/wrapper/table/one-dimension-table-with-numeric-columns.js +2 -1
- package/dist/view/wrapper/table/pivot-table-display-name.js +11 -1
- package/dist/view/wrapper/table/two-dimension-table.js +4 -2
- package/package.json +1 -2
|
@@ -267,7 +267,7 @@ BaseUtils.getSummaryValueDisplayString = function (summaryColumn, summaryValue)
|
|
|
267
267
|
let summaryMethod = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'count';
|
|
268
268
|
if (!summaryColumn) return summaryValue;
|
|
269
269
|
if (!summaryValue && summaryValue !== 0) return summaryValue;
|
|
270
|
-
if (summaryMethod.toUpperCase() === 'DISTINCT_VALUES') return summaryValue;
|
|
270
|
+
if ((summaryMethod === null || summaryMethod === void 0 ? void 0 : summaryMethod.toUpperCase()) === 'DISTINCT_VALUES') return summaryValue;
|
|
271
271
|
const {
|
|
272
272
|
data
|
|
273
273
|
} = summaryColumn;
|
package/dist/utils/row-utils.js
CHANGED
|
@@ -19,7 +19,7 @@ export const isValidRow = (row, formulaRow, column, includeEmpty) => {
|
|
|
19
19
|
if (columnType === CellType.GEOLOCATION) {
|
|
20
20
|
const {
|
|
21
21
|
geo_format
|
|
22
|
-
} = column.data;
|
|
22
|
+
} = column.data || {};
|
|
23
23
|
return isEmptyGeolocationCell(row[columnKey], geo_format);
|
|
24
24
|
}
|
|
25
25
|
let cellValue = row[columnKey];
|
|
@@ -44,13 +44,16 @@ class HeatMap extends ChartComponent {
|
|
|
44
44
|
});
|
|
45
45
|
};
|
|
46
46
|
this.transformData = statData => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
if (statData.length !== 0) {
|
|
48
|
+
let data = {};
|
|
49
|
+
let yearFirstDate = dayjs(statData[0].name);
|
|
50
|
+
this.firstDate = yearFirstDate.year() + '-01-01';
|
|
51
|
+
statData.forEach(item => {
|
|
52
|
+
data[item.name] = data[item.name] ? data[item.name] + item.value : item.value;
|
|
53
|
+
});
|
|
54
|
+
return data;
|
|
55
|
+
}
|
|
56
|
+
return [];
|
|
54
57
|
};
|
|
55
58
|
this.generateBackgroundGridData = statData => {
|
|
56
59
|
let momentDate = dayjs(this.firstDate);
|
|
@@ -105,7 +105,8 @@ class OneDimensionTableNoNumericColumns extends PureComponent {
|
|
|
105
105
|
})
|
|
106
106
|
}, /*#__PURE__*/React.createElement(PivotTableDisplayName, {
|
|
107
107
|
value: name,
|
|
108
|
-
column: groupbyColumn
|
|
108
|
+
column: groupbyColumn,
|
|
109
|
+
rowData: rowItem
|
|
109
110
|
})), display_total && /*#__PURE__*/React.createElement("td", {
|
|
110
111
|
className: classnames('pivot-cell', {
|
|
111
112
|
'pivot-empty-cell': !isValidTotalDisplayValue,
|
|
@@ -124,7 +124,8 @@ class OneDimensionTableWithNumericColumns extends PureComponent {
|
|
|
124
124
|
})
|
|
125
125
|
}, /*#__PURE__*/React.createElement(PivotTableDisplayName, {
|
|
126
126
|
value: name,
|
|
127
|
-
column: groupbyColumn
|
|
127
|
+
column: groupbyColumn,
|
|
128
|
+
rowData: rowItem
|
|
128
129
|
})), Array.isArray(pivot_columns) && pivot_columns.map((columnMap, cellIdx) => {
|
|
129
130
|
const isSelectedCell = selectRowIdx === rowIdx && selectedCellIdx === cellIdx;
|
|
130
131
|
const isSelectedCellTop = selectRowIdx - 1 === rowIdx && selectedCellIdx === cellIdx;
|
|
@@ -128,7 +128,17 @@ class PivotTableDisplayName extends React.Component {
|
|
|
128
128
|
}
|
|
129
129
|
case CellType.COLLABORATOR:
|
|
130
130
|
{
|
|
131
|
-
const
|
|
131
|
+
const {
|
|
132
|
+
rowData
|
|
133
|
+
} = this.props;
|
|
134
|
+
const {
|
|
135
|
+
original_name
|
|
136
|
+
} = rowData || {};
|
|
137
|
+
let validValue = Array.isArray(value) && value.length !== 0 ? value : [];
|
|
138
|
+
if (original_name) {
|
|
139
|
+
const collaborator = collaborators.find(item => item.email === original_name);
|
|
140
|
+
validValue = [collaborator];
|
|
141
|
+
}
|
|
132
142
|
const unknowEmails = validValue.filter(email => !getCollaborator(collaborators, email));
|
|
133
143
|
|
|
134
144
|
// if need to query unknowEmails
|
|
@@ -78,7 +78,8 @@ class TwoDimensionTable extends PureComponent {
|
|
|
78
78
|
key: "pivot-column-".concat(index)
|
|
79
79
|
}, /*#__PURE__*/React.createElement(PivotTableDisplayName, {
|
|
80
80
|
value: original_key,
|
|
81
|
-
column: columnGroupbyColumn || {}
|
|
81
|
+
column: columnGroupbyColumn || {},
|
|
82
|
+
rowData: item
|
|
82
83
|
}));
|
|
83
84
|
}), display_total && /*#__PURE__*/React.createElement("th", {
|
|
84
85
|
className: classnames('pivot-table-header', {
|
|
@@ -186,7 +187,8 @@ class TwoDimensionTable extends PureComponent {
|
|
|
186
187
|
})
|
|
187
188
|
}, /*#__PURE__*/React.createElement(PivotTableDisplayName, {
|
|
188
189
|
value: name,
|
|
189
|
-
column: groupbyColumn
|
|
190
|
+
column: groupbyColumn,
|
|
191
|
+
rowData: rowItem
|
|
190
192
|
})), Array.isArray(cells) && cells.map((c, cellIdx) => {
|
|
191
193
|
const isSelectedCell = selectRowIdx === rowIdx && selectedCellIdx === cellIdx;
|
|
192
194
|
const isSelectedCellTop = selectRowIdx - 1 === rowIdx && selectedCellIdx === cellIdx;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sea-chart",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.51-alpha.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@antv/data-set": "0.11.8",
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@antv/scale": "0.3.14",
|
|
24
|
-
"babel-plugin-on-demand-loading": "^0.0.9",
|
|
25
24
|
"dtable-ui-component": "~5.0.2",
|
|
26
25
|
"dtable-utils": "~4.4.*",
|
|
27
26
|
"prop-types": "15.8.1",
|