@tsingroc/tsingroc-components 5.0.0-alpha.15 → 5.0.0-alpha.17

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.
@@ -224,13 +224,23 @@ export const withSelectable = ECharts => function SelectableECharts(props) {
224
224
  ...inputOption
225
225
  };
226
226
  if (inputSeries) {
227
- if (selectedIndices.size > 0 || mode === "add" && mouseState?.end) {
228
- const series = {
229
- ...inputSeries,
230
- showSymbol: true
231
- };
227
+ const series = {
228
+ ...inputSeries,
229
+ showSymbol: selectedIndices.size > 0,
230
+ markArea: {
231
+ itemStyle: {
232
+ ...DEFAULT_MARK_AREA_STYLE,
233
+ ...markAreaStyle
234
+ },
235
+ emphasis: {
236
+ disabled: true
237
+ },
238
+ data: []
239
+ }
240
+ };
241
+ if (inputSeries.data && (selectedIndices.size > 0 || mode === "add" && mouseState?.end)) {
232
242
  const allSelectedIndices = new Set();
233
- series.data = inputSeries.data?.map((point_1, i_2) => {
243
+ series.data = inputSeries.data.map((point_1, i_2) => {
234
244
  const destructured_1 = destructureLineDataItem(point_1, i_2);
235
245
  if (destructured_1 == null) {
236
246
  return point_1;
@@ -266,39 +276,28 @@ export const withSelectable = ECharts => function SelectableECharts(props) {
266
276
  if (markArea) {
267
277
  debugAssert(markAreaWidth !== undefined, "when markArea === true, markAreaWidth is guaranteed to be defined at the beginning of this function");
268
278
  const markAreas = [];
269
- if (inputSeries.data) {
270
- for (const i_3 of allSelectedIndices) {
271
- const destructured_2 = destructureLineDataItem(inputSeries.data[i_3], i_3);
272
- if (destructured_2 == null) {
273
- continue;
274
- }
275
- const [t6] = destructured_2;
276
- const [xValue] = t6;
277
- if (typeof xValue !== "number") {
278
- continue;
279
- }
280
- markAreas.push([{
281
- coord: [xValue - markAreaWidth / 2]
282
- }, {
283
- coord: [xValue + markAreaWidth / 2]
284
- }]);
279
+ for (const i_3 of allSelectedIndices) {
280
+ const destructured_2 = destructureLineDataItem(inputSeries.data[i_3], i_3);
281
+ if (destructured_2 == null) {
282
+ continue;
283
+ }
284
+ const [t6] = destructured_2;
285
+ const [xValue] = t6;
286
+ if (typeof xValue !== "number") {
287
+ continue;
285
288
  }
289
+ markAreas.push([{
290
+ coord: [xValue - markAreaWidth / 2]
291
+ }, {
292
+ coord: [xValue + markAreaWidth / 2]
293
+ }]);
286
294
  }
287
- series.markArea = {
288
- itemStyle: {
289
- ...DEFAULT_MARK_AREA_STYLE,
290
- ...markAreaStyle
291
- },
292
- emphasis: {
293
- disabled: true
294
- },
295
- data: markAreas
296
- };
295
+ series.markArea.data = markAreas;
297
296
  }
298
- const seriesArray = [...inputSeriesArray];
299
- seriesArray[seriesArray.indexOf(inputSeries)] = series;
300
- option.series = seriesArray;
301
297
  }
298
+ const seriesArray = [...inputSeriesArray];
299
+ seriesArray[seriesArray.indexOf(inputSeries)] = series;
300
+ option.series = seriesArray;
302
301
  }
303
302
  let t6;
304
303
  if ($[17] !== selectionBoxStyle) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsingroc/tsingroc-components",
3
- "version": "5.0.0-alpha.15",
3
+ "version": "5.0.0-alpha.17",
4
4
  "author": "",
5
5
  "license": "ISC",
6
6
  "description": "",