sea-chart 1.1.1 → 1.1.2-alpha.2

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/context.js CHANGED
@@ -112,9 +112,9 @@ class Context {
112
112
  server,
113
113
  mediaUrl
114
114
  } = this.settings;
115
- return "".concat(server).concat(mediaUrl, "dtable-statistic/img/").concat(name);
115
+ return "".concat(server).concat(mediaUrl, "dtable-statistic/img/").concat(name, "?v=0.0.1");
116
116
  }
117
- return "".concat(DEFAULT_MEDIAURL, "dtable-statistic/img/").concat(name);
117
+ return "".concat(DEFAULT_MEDIAURL, "dtable-statistic/img/").concat(name, "?v=0.0.1");
118
118
  };
119
119
  this.api = null;
120
120
  this.settings = {};
@@ -112,19 +112,37 @@ class View extends React.PureComponent {
112
112
  }
113
113
  componentDidMount() {
114
114
  this.unsubscribeReFreshChart = eventBus.subscribe(CommonEventTypes.REFRESH_CHARTS, this.refreshChart);
115
- this.calculateStatistic();
115
+ const {
116
+ hasUnSaved
117
+ } = this.props;
118
+ if (!hasUnSaved) {
119
+ this.calculateStatistic();
120
+ }
116
121
  }
117
122
  componentWillUnmount() {
118
123
  this.unsubscribeReFreshChart();
119
124
  }
120
125
  UNSAFE_componentWillReceiveProps(nextProps) {
121
126
  const {
122
- chart: oldChart
127
+ chart: oldChart,
128
+ hasUnSaved
123
129
  } = this.props;
124
130
  const {
125
- chart
131
+ chart,
132
+ hasUnSaved: nextUnSaved
126
133
  } = nextProps;
134
+ const {
135
+ data
136
+ } = this.state;
127
137
  context.api = this.props.api;
138
+
139
+ // universal-apps will not trigger calculation of the chart before the chart config saved
140
+ // after saved, hasUnSaved was set to false, then trigger calculation
141
+ const needCalc = hasUnSaved === true && nextUnSaved === false;
142
+ if (needCalc && !data) {
143
+ this.calculateStatistic();
144
+ return;
145
+ }
128
146
  if (shallowEqual(chart, oldChart)) return;
129
147
  this.setState({
130
148
  isCalculated: false
@@ -80,7 +80,7 @@ class Area extends ChartComponent {
80
80
  } = chart.config;
81
81
  const newData = this.getChartGroupData(data);
82
82
  const isSmooth = line_type === CHART_LINE_TYPES[1];
83
- const isMutipleSummary = summary_columns.length;
83
+ const isMultipleSummary = summary_columns && summary_columns.length;
84
84
  const isAreaGroup = chart.config.type === CHART_TYPE.AREA_GROUP;
85
85
  const useSingleSelectColumnColor = (columnGroupbyColumn === null || columnGroupbyColumn === void 0 ? void 0 : columnGroupbyColumn.type) === CellType.SINGLE_SELECT && color_theme === SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
86
86
  let chartBarColor;
@@ -145,7 +145,7 @@ class Area extends ChartComponent {
145
145
  }
146
146
  }).shape(isSmooth ? 'smooth' : 'area').color(chartBarColor, colorCallBack).tooltip('group_name*name*value', (group_name, name, value) => {
147
147
  return {
148
- title: isAreaGroup && isMutipleSummary ? !name && typeof name !== 'number' ? intl.get('Empty') : name : title,
148
+ title: isAreaGroup && isMultipleSummary ? !name && typeof name !== 'number' ? intl.get('Empty') : name : title,
149
149
  value: BaseUtils.getSummaryValueDisplayString(summaryColumn, value, y_axis_summary_method),
150
150
  name: group_name
151
151
  };
@@ -223,8 +223,7 @@ class Compare extends ChartComponent {
223
223
  style: {
224
224
  fontSize: BaseUtils.getLabelFontSize(label_font_size),
225
225
  fill: theme.labelColor,
226
- stroke: '#fff',
227
- lineWidth: 1
226
+ ...this.labelStroke
228
227
  }
229
228
  };
230
229
  }).color(increase_line_color || '#fbd44a').animate({
@@ -180,7 +180,7 @@ export default function Map(props) {
180
180
  // TODO
181
181
  // use data_color temporarily
182
182
  fill: data_color,
183
- ...this.labelStroke
183
+ stroke: '#fff'
184
184
  },
185
185
  align: legendDirection === 'vertical' ? 'right' : 'bottom',
186
186
  formatter: value => {
@@ -213,7 +213,7 @@ function WorldMap(props) {
213
213
  spacing: 2,
214
214
  style: {
215
215
  fill: themeColors.textColor,
216
- ...this.labelStroke
216
+ stroke: '#fff'
217
217
  },
218
218
  align: legendDirection === 'vertical' ? 'right' : 'bottom',
219
219
  formatter: value => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sea-chart",
3
- "version": "1.1.1",
3
+ "version": "1.1.2-alpha.2",
4
4
  "main": "./dist/index.js",
5
5
  "dependencies": {
6
6
  "@antv/data-set": "0.11.8",