sea-chart 0.0.41-beta.5 → 0.0.41-beta.6
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 +3 -0
- package/dist/context.js +15 -6
- package/package.json +1 -1
package/dist/constants/index.js
CHANGED
|
@@ -236,6 +236,9 @@ export const TYPE_DISPLAY_COLOR_USING = {
|
|
|
236
236
|
// default grid size, grid distance for heat map chart
|
|
237
237
|
export const DEFAULT_GRID_SIZE = 12;
|
|
238
238
|
export const DEFAULT_GRID_DISTANCE = 4;
|
|
239
|
+
|
|
240
|
+
// default mediaUrl
|
|
241
|
+
export const DEFAULT_MEDIAURL = 'https://dev.seatable.cn/media/';
|
|
239
242
|
export const MONTH_MIRROR = {
|
|
240
243
|
'0': 'Jan',
|
|
241
244
|
'1': 'Feb',
|
package/dist/context.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getTableById } from 'dtable-utils';
|
|
2
2
|
import CollaboratorManager from './utils/collaborator-manager';
|
|
3
3
|
import { ChartDataSQL } from './utils';
|
|
4
|
-
import { CHART_TYPE, CHART_TYPE_IMAGE } from './constants';
|
|
4
|
+
import { CHART_TYPE, CHART_TYPE_IMAGE, DEFAULT_MEDIAURL } from './constants';
|
|
5
5
|
class Context {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.queryChartResult = async _ref => {
|
|
@@ -103,11 +103,20 @@ class Context {
|
|
|
103
103
|
};
|
|
104
104
|
this.getChartImageUrl = type => {
|
|
105
105
|
const name = CHART_TYPE_IMAGE[type];
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
if (this.settings) {
|
|
107
|
+
const {
|
|
108
|
+
server,
|
|
109
|
+
mediaUrl
|
|
110
|
+
} = this.settings;
|
|
111
|
+
return "".concat(server).concat(mediaUrl, "dtable-statistic/img/").concat(name);
|
|
112
|
+
}
|
|
113
|
+
if (window.dtable) {
|
|
114
|
+
const {
|
|
115
|
+
mediaUrl
|
|
116
|
+
} = window.dtable;
|
|
117
|
+
return "".concat(mediaUrl, "dtable-statistic/img/").concat(name);
|
|
118
|
+
}
|
|
119
|
+
return "".concat(DEFAULT_MEDIAURL, "dtable-statistic/img/").concat(name);
|
|
111
120
|
};
|
|
112
121
|
this.api = null;
|
|
113
122
|
this.settings = {};
|