@visactor/vchart 1.4.0 → 1.4.1-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/build/index.js CHANGED
@@ -40315,9 +40315,9 @@
40315
40315
  });
40316
40316
  (null === (_b = viewOptions.options3d) || void 0 === _b ? void 0 : _b.enable) && stage.set3dOptions(viewOptions.options3d), stage.enableIncrementalAutoRender(), this._viewBox = viewOptions.viewBox, this._view.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_STAGE), this._view.emit(HOOK_EVENT.BEFORE_CREATE_VRENDER_LAYER);
40317
40317
  const layer = null !== (_c = viewOptions.layer) && void 0 !== _c ? _c : stage.defaultLayer;
40318
- if (this._view.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_LAYER), (null === (_d = this._eventConfig) || void 0 === _d ? void 0 : _d.drag) && (this._dragController = new DragNDrop(layer)), null === (_e = this._eventConfig) || void 0 === _e ? void 0 : _e.gesture) {
40318
+ if (this._view.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_LAYER), (null === (_d = this._eventConfig) || void 0 === _d ? void 0 : _d.drag) && (this._dragController = new DragNDrop(stage)), null === (_e = this._eventConfig) || void 0 === _e ? void 0 : _e.gesture) {
40319
40319
  const gestureConfig = isObject$g(this._eventConfig.gesture) ? this._eventConfig.gesture : {};
40320
- this._gestureController = new Gesture(layer, gestureConfig);
40320
+ this._gestureController = new Gesture(stage, gestureConfig);
40321
40321
  }
40322
40322
  return {
40323
40323
  stage: stage,
@@ -53995,8 +53995,11 @@
53995
53995
  const generateLabelAttributes = (marks, groupSize, encoder, labelStyle, parameters, theme) => {
53996
53996
  var _a;
53997
53997
  const labelTheme = null === (_a = null == theme ? void 0 : theme.components) || void 0 === _a ? void 0 : _a.dataLabel,
53998
- dataLabels = marks.map(mark => {
53998
+ dataLabels = marks.map((mark, index) => {
53999
53999
  var _a, _b, _c, _d, _e, _f;
54000
+ const labelParameters = Object.assign(Object.assign({}, parameters), {
54001
+ labelIndex: index
54002
+ });
54000
54003
  let currentTheme = {};
54001
54004
  switch (mark.markType) {
54002
54005
  case GrammarMarkType.line:
@@ -54024,12 +54027,12 @@
54024
54027
  mark.elements.forEach(element => {
54025
54028
  var _a, _b;
54026
54029
  if ("willRelease" !== element.getGraphicItem().releaseStatus) {
54027
- const attributes = invokeEncoder(encoder, element.getDatum(), element, parameters),
54030
+ const attributes = invokeEncoder(encoder, element.getDatum(), element, labelParameters),
54028
54031
  datum = merge$1({}, null !== (_b = null === (_a = null == currentTheme ? void 0 : currentTheme.data) || void 0 === _a ? void 0 : _a[0]) && void 0 !== _b ? _b : {}, attributes);
54029
54032
  data.push(datum);
54030
54033
  }
54031
54034
  });
54032
- const addition = invokeFunctionType(labelStyle, parameters, mark),
54035
+ const addition = invokeFunctionType(labelStyle, labelParameters, mark),
54033
54036
  graphicItemName = null === (_f = mark.graphicItem) || void 0 === _f ? void 0 : _f.name;
54034
54037
  return merge$1({}, currentTheme, {
54035
54038
  data: data,
@@ -63462,7 +63465,7 @@
63462
63465
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
63463
63466
  Factory.registerRegion('region', Region);
63464
63467
  Factory.registerLayout('base', Layout);
63465
- const version = "1.4.0";
63468
+ const version = "1.4.1-alpha.0";
63466
63469
  Logger.getInstance(LoggerLevel.Error);
63467
63470
 
63468
63471
  const WordCloud3dAnimation = (params) => {
@@ -68071,7 +68074,18 @@
68071
68074
  this.getAllModels().forEach(model => model.onDataUpdate());
68072
68075
  }
68073
68076
  updateFullData(data, updateGlobalScale = true) {
68074
- this._chartData.updateData(data);
68077
+ array(data).forEach(d => {
68078
+ const dv = this._dataSet.getDataView(d.id);
68079
+ if (dv) {
68080
+ dv.markRunning();
68081
+ }
68082
+ });
68083
+ array(data).forEach(d => {
68084
+ const dv = this._dataSet.getDataView(d.id);
68085
+ if (dv) {
68086
+ updateDataViewInData(dv, d, true);
68087
+ }
68088
+ });
68075
68089
  if (updateGlobalScale) {
68076
68090
  this.updateGlobalScaleDomain();
68077
68091
  }
@@ -94274,40 +94288,49 @@
94274
94288
  });
94275
94289
  }
94276
94290
  _updateMultiLabelAttribute(labelInfo, labelComponent) {
94277
- this._updateLabelComponentAttribute(labelComponent.getProduct(), labelInfo.map(({ baseMark }) => baseMark.getProduct()), labelInfo[0]);
94291
+ this._updateLabelComponentAttribute(labelComponent.getProduct(), labelInfo.map(({ baseMark }) => baseMark.getProduct()), labelInfo);
94278
94292
  }
94279
94293
  _updateSingleLabelAttribute(labelInfo, labelComponent) {
94280
94294
  const { baseMark } = labelInfo;
94281
- this._updateLabelComponentAttribute(labelComponent.getProduct(), baseMark.getProduct(), labelInfo);
94295
+ this._updateLabelComponentAttribute(labelComponent.getProduct(), baseMark.getProduct(), [labelInfo]);
94282
94296
  }
94283
- _updateLabelComponentAttribute(component, target, labelInfo) {
94284
- const { baseMark, labelSpec, series, labelMark } = labelInfo;
94297
+ _updateLabelComponentAttribute(component, target, labelInfos) {
94285
94298
  const dependCmp = this._option.getAllComponents().filter(cmp => cmp.type === 'totalLabel');
94286
94299
  component
94287
94300
  .target(target)
94288
94301
  .configure({ interactive: false })
94289
94302
  .depend(dependCmp.map(cmp => cmp.getMarks()[0].getProduct()))
94290
- .labelStyle(() => {
94303
+ .labelStyle((mark, params) => {
94291
94304
  var _a, _b, _c;
94292
- const rule = labelMark.getRule() || baseMark.type;
94293
- const configFunc = (_a = labelRuleMap[rule]) !== null && _a !== void 0 ? _a : labelRuleMap.point;
94294
- const interactive = this._interactiveConfig(labelSpec);
94295
- const passiveLabelSpec = pickWithout(labelSpec, ['position', 'style', 'state']);
94296
- const centerOffset = (_c = (_b = this._spec) === null || _b === void 0 ? void 0 : _b.centerOffset) !== null && _c !== void 0 ? _c : 0;
94297
- return mergeSpec({
94298
- textStyle: Object.assign({ pickable: labelSpec.interactive === true }, labelSpec.style),
94299
- overlap: {
94300
- avoidMarks: this._option
94301
- .getAllComponents()
94302
- .filter(cmp => cmp.type === 'totalLabel')
94303
- .map(cmp => cmp.getMarks()[0].getProductId())
94304
- }
94305
- }, configFunc(labelInfo), Object.assign(Object.assign(Object.assign({}, passiveLabelSpec), interactive), { centerOffset }));
94305
+ const labelInfo = labelInfos[params.labelIndex];
94306
+ if (labelInfo) {
94307
+ const { baseMark, labelSpec, labelMark } = labelInfo;
94308
+ const rule = labelMark.getRule() || baseMark.type;
94309
+ const configFunc = (_a = labelRuleMap[rule]) !== null && _a !== void 0 ? _a : labelRuleMap.point;
94310
+ const interactive = this._interactiveConfig(labelSpec);
94311
+ const passiveLabelSpec = pickWithout(labelSpec, ['position', 'style', 'state']);
94312
+ const centerOffset = (_c = (_b = this._spec) === null || _b === void 0 ? void 0 : _b.centerOffset) !== null && _c !== void 0 ? _c : 0;
94313
+ return mergeSpec({
94314
+ textStyle: Object.assign({ pickable: labelSpec.interactive === true }, labelSpec.style),
94315
+ overlap: {
94316
+ avoidMarks: this._option
94317
+ .getAllComponents()
94318
+ .filter(cmp => cmp.type === 'totalLabel')
94319
+ .map(cmp => cmp.getMarks()[0].getProductId())
94320
+ }
94321
+ }, configFunc(labelInfo), Object.assign(Object.assign(Object.assign({}, passiveLabelSpec), interactive), { centerOffset }));
94322
+ }
94306
94323
  })
94307
- .encode(datum => {
94308
- return labelMark.skipEncode ? { data: datum } : textAttribute(labelInfo, datum, labelSpec.formatMethod);
94324
+ .encode((datum, element, params) => {
94325
+ const labelInfo = labelInfos[params.labelIndex];
94326
+ if (labelInfo) {
94327
+ const { labelSpec, labelMark } = labelInfos[params.labelIndex];
94328
+ return labelMark.skipEncode
94329
+ ? { data: datum }
94330
+ : textAttribute(labelInfos[params.labelIndex], datum, labelSpec.formatMethod);
94331
+ }
94309
94332
  })
94310
- .size(() => series.getRegion().getLayoutRect());
94333
+ .size(() => labelInfos[0].series.getRegion().getLayoutRect());
94311
94334
  }
94312
94335
  compileMarks() {
94313
94336
  this.getMarks().forEach(m => {