@visactor/vstory 0.0.5-alpha.4 → 0.0.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.
Files changed (81) hide show
  1. package/cjs/dsl/constant/index.js +1 -1
  2. package/cjs/dsl/story-executor/index.js +0 -2
  3. package/cjs/dsl/story-processor/index.js +1 -1
  4. package/cjs/dsl/story-processor/processor.js +1 -1
  5. package/cjs/dsl/types/Datum.js +1 -1
  6. package/cjs/dsl/types/index.js +1 -1
  7. package/cjs/dsl/utils/datum.js +1 -1
  8. package/cjs/dsl/utils/flicker.js +1 -2
  9. package/cjs/edit/edit-component/base-selection.js +1 -1
  10. package/cjs/edit/edit-component/box-selection.js +1 -1
  11. package/cjs/edit/edit-component/chart-selection.js +1 -1
  12. package/cjs/edit/edit-component/common.js +2 -0
  13. package/cjs/edit/edit-component/image-selection.js +1 -1
  14. package/cjs/edit/edit-component/index.js +1 -1
  15. package/cjs/edit/edit-component/layer-edit.js +2 -0
  16. package/cjs/edit/edit-component/rect-selection.js +1 -1
  17. package/cjs/edit/edit-component/richtext-selection-common.js +1 -1
  18. package/cjs/edit/edit-component/richtext-selection.js +1 -1
  19. package/cjs/edit/edit-component/shape-selection.js +1 -1
  20. package/cjs/edit/edit-component/text-selection.js +2 -1
  21. package/cjs/interface/type.js +2 -1
  22. package/cjs/player/encode.js +2 -0
  23. package/cjs/player/interface/player.js +1 -1
  24. package/cjs/player/interface/scheduler.js +1 -1
  25. package/cjs/player/processor/common-processor.js +0 -2
  26. package/cjs/player/processor/processor-item.js +1 -1
  27. package/cjs/story/character/chart/character.js +2 -2
  28. package/cjs/story/character/chart/character.js.map +1 -1
  29. package/cjs/story/character/chart/graphic/vchart-graphic.d.ts +2 -2
  30. package/cjs/story/character/chart/graphic/vchart-graphic.js +6 -7
  31. package/cjs/story/character/chart/graphic/vchart-graphic.js.map +1 -1
  32. package/cjs/story/interface/runtime-interface.d.ts +0 -1
  33. package/cjs/story/interface/runtime-interface.js.map +1 -1
  34. package/cjs/story/story.d.ts +0 -1
  35. package/cjs/story/story.js +0 -3
  36. package/cjs/story/story.js.map +1 -1
  37. package/cjs/story/utils/chart.d.ts +1 -2
  38. package/cjs/story/utils/chart.js +2 -30
  39. package/cjs/story/utils/chart.js.map +1 -1
  40. package/dist/index.js +134 -188
  41. package/dist/index.min.js +3 -3
  42. package/es/dsl/constant/index.js +1 -1
  43. package/es/dsl/story-executor/index.js +0 -2
  44. package/es/dsl/story-processor/index.js +1 -1
  45. package/es/dsl/story-processor/processor.js +1 -1
  46. package/es/dsl/types/Datum.js +1 -1
  47. package/es/dsl/types/index.js +1 -1
  48. package/es/dsl/utils/datum.js +1 -1
  49. package/es/dsl/utils/flicker.js +1 -2
  50. package/es/edit/edit-component/base-selection.js +1 -1
  51. package/es/edit/edit-component/box-selection.js +1 -1
  52. package/es/edit/edit-component/chart-selection.js +1 -1
  53. package/es/edit/edit-component/common.js +2 -0
  54. package/es/edit/edit-component/image-selection.js +1 -1
  55. package/es/edit/edit-component/index.js +1 -1
  56. package/es/edit/edit-component/layer-edit.js +2 -0
  57. package/es/edit/edit-component/rect-selection.js +1 -1
  58. package/es/edit/edit-component/richtext-selection-common.js +1 -1
  59. package/es/edit/edit-component/richtext-selection.js +1 -1
  60. package/es/edit/edit-component/shape-selection.js +1 -1
  61. package/es/edit/edit-component/text-selection.js +2 -1
  62. package/es/interface/type.js +2 -1
  63. package/es/player/encode.js +2 -0
  64. package/es/player/interface/player.js +1 -1
  65. package/es/player/interface/scheduler.js +1 -1
  66. package/es/player/processor/common-processor.js +0 -2
  67. package/es/player/processor/processor-item.js +1 -1
  68. package/es/story/character/chart/character.js +2 -4
  69. package/es/story/character/chart/character.js.map +1 -1
  70. package/es/story/character/chart/graphic/vchart-graphic.d.ts +2 -2
  71. package/es/story/character/chart/graphic/vchart-graphic.js +5 -9
  72. package/es/story/character/chart/graphic/vchart-graphic.js.map +1 -1
  73. package/es/story/interface/runtime-interface.d.ts +0 -1
  74. package/es/story/interface/runtime-interface.js.map +1 -1
  75. package/es/story/story.d.ts +0 -1
  76. package/es/story/story.js +0 -3
  77. package/es/story/story.js.map +1 -1
  78. package/es/story/utils/chart.d.ts +1 -2
  79. package/es/story/utils/chart.js +1 -29
  80. package/es/story/utils/chart.js.map +1 -1
  81. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -27895,146 +27895,6 @@
27895
27895
  return x <= x2 && x >= x1 && y <= y2 && y >= y1;
27896
27896
  }
27897
27897
 
27898
- const directlyAssignSpecKeys = ['seriesId', 'text'];
27899
- function isModelInfoMatchSpec(info, spec, specKey, index, option = {
27900
- ignoreIdMatch: false
27901
- }) {
27902
- if (!isNil$1(info.id)) {
27903
- const match = info.id === spec.id;
27904
- if (match || option.ignoreIdMatch !== true) {
27905
- return match;
27906
- }
27907
- }
27908
- return info.specKey === specKey && info.specIndex === index;
27909
- }
27910
- function baseMerge(target, source, shallowArray = false) {
27911
- if (source) {
27912
- if (target === source) {
27913
- return;
27914
- }
27915
- if (isValid$1(source) && typeof source === 'object') {
27916
- const iterable = Object(source);
27917
- const props = [];
27918
- for (const key in iterable) {
27919
- props.push(key);
27920
- }
27921
- let { length } = props;
27922
- let propIndex = -1;
27923
- while (length--) {
27924
- const key = props[++propIndex];
27925
- if (isValid$1(iterable[key]) && typeof iterable[key] === 'object') {
27926
- baseMergeDeep(target, source, key, shallowArray);
27927
- }
27928
- else {
27929
- assignMergeValue(target, key, iterable[key]);
27930
- }
27931
- }
27932
- }
27933
- }
27934
- }
27935
- function baseMergeDeep(target, source, key, shallowArray = false) {
27936
- const objValue = target[key];
27937
- const srcValue = source[key];
27938
- let newValue = source[key];
27939
- let isCommon = true;
27940
- if (directlyAssignSpecKeys.includes(key)) {
27941
- isCommon = false;
27942
- }
27943
- else if (isArray$1(srcValue)) {
27944
- if (shallowArray || !objValue) {
27945
- newValue = [];
27946
- }
27947
- else if (isArray$1(objValue)) {
27948
- newValue = objValue;
27949
- }
27950
- else if (isArrayLike$1(objValue) && !isString$1(objValue)) {
27951
- newValue = new Array(objValue.length);
27952
- let index = -1;
27953
- const length = objValue.length;
27954
- while (++index < length) {
27955
- newValue[index] = objValue[index];
27956
- }
27957
- }
27958
- }
27959
- else if (isPlainObject$1(srcValue)) {
27960
- newValue = objValue !== null && objValue !== void 0 ? objValue : {};
27961
- if (typeof objValue === 'function' || typeof objValue !== 'object') {
27962
- newValue = {};
27963
- }
27964
- }
27965
- else {
27966
- isCommon = false;
27967
- }
27968
- if (isCommon) {
27969
- baseMerge(newValue, srcValue, shallowArray);
27970
- }
27971
- assignMergeValue(target, key, newValue);
27972
- }
27973
- function assignMergeValue(target, key, value) {
27974
- if ((value !== undefined && !eq(target[key], value)) || (value === undefined && !(key in target))) {
27975
- target[key] = value;
27976
- }
27977
- }
27978
- function eq(value, other) {
27979
- return value === other || (Number.isNaN(value) && Number.isNaN(other));
27980
- }
27981
- function mergeSpec$1(target, ...sources) {
27982
- let sourceIndex = -1;
27983
- const length = sources.length;
27984
- while (++sourceIndex < length) {
27985
- const source = sources[sourceIndex];
27986
- baseMerge(target, source, false);
27987
- }
27988
- return target;
27989
- }
27990
- function findChartSpec(s, vchartSpec) {
27991
- const chartSpec = vchartSpec[s.specKey];
27992
- if (!chartSpec) {
27993
- return null;
27994
- }
27995
- if (isArray$1(chartSpec)) {
27996
- return chartSpec.find((_s, index) => {
27997
- return isModelInfoMatchSpec(s, _s, s.specKey, index);
27998
- });
27999
- }
28000
- else if (isObject$1(chartSpec)) {
28001
- return isModelInfoMatchSpec(s, chartSpec, s.specKey, 0) ? chartSpec : null;
28002
- }
28003
- return null;
28004
- }
28005
- function mergeChartOption(target, ...sources) {
28006
- const performanceHook = {};
28007
- function pushHookToTemp(hooks) {
28008
- Object.keys(hooks).forEach((k) => {
28009
- if (!performanceHook[k]) {
28010
- performanceHook[k] = [];
28011
- }
28012
- performanceHook[k].push(hooks[k]);
28013
- });
28014
- }
28015
- if (target.performanceHook) {
28016
- pushHookToTemp(target.performanceHook);
28017
- }
28018
- sources.forEach(source => {
28019
- if (!source) {
28020
- return;
28021
- }
28022
- const { performanceHook } = source, rest = __rest$4(source, ["performanceHook"]);
28023
- if (performanceHook) {
28024
- pushHookToTemp(performanceHook);
28025
- }
28026
- merge(target, rest);
28027
- });
28028
- target.performanceHook = {};
28029
- Object.keys(performanceHook).forEach(k => {
28030
- target.performanceHook[k] = (...args) => {
28031
- performanceHook[k].forEach(f => f(...args));
28032
- };
28033
- });
28034
- return target;
28035
- }
28036
-
28037
- const VIEW_BOX_EXPEND = 4;
28038
27898
  const CHART_NUMBER_TYPE = genNumberType();
28039
27899
  class Chart extends Group {
28040
27900
  get vchart() {
@@ -28069,19 +27929,7 @@
28069
27929
  this._boundsChangeTag = true;
28070
27930
  this.numberType = CHART_NUMBER_TYPE;
28071
27931
  if (!params.vchart) {
28072
- params.vchart = this._vchart = new params.ClassType(params.spec, mergeChartOption({
28073
- renderCanvas: params.renderCanvas,
28074
- mode: params.mode,
28075
- modeParams: params.modeParams,
28076
- canvasControled: false,
28077
- dpr: params.dpr,
28078
- interactive: params.interactive,
28079
- animation: false,
28080
- autoFit: false,
28081
- disableTriggerEvent: params.disableTriggerEvent,
28082
- disableDirtyBounds: params.disableDirtyBounds,
28083
- ticker: params.ticker,
28084
- beforeRender: () => {
27932
+ params.vchart = this._vchart = new params.ClassType(params.spec, Object.assign({ renderCanvas: params.renderCanvas, mode: params.mode, modeParams: params.modeParams, canvasControled: false, dpr: params.dpr, interactive: params.interactive, animation: false, autoFit: false, disableTriggerEvent: params.disableTriggerEvent, disableDirtyBounds: params.disableDirtyBounds, ticker: params.ticker, beforeRender: () => {
28085
27933
  var _a;
28086
27934
  if (!this.stage) {
28087
27935
  return;
@@ -28092,8 +27940,7 @@
28092
27940
  (_a = this.stage.dirtyBounds) === null || _a === void 0 ? void 0 : _a.union(this.globalAABBBounds);
28093
27941
  this.stage.renderNextFrame();
28094
27942
  }
28095
- },
28096
- afterRender: () => {
27943
+ }, afterRender: () => {
28097
27944
  if (!this._vchart) {
28098
27945
  return;
28099
27946
  }
@@ -28102,8 +27949,7 @@
28102
27949
  }
28103
27950
  this._vchart.getStage()._editor_needRender = false;
28104
27951
  this._vchart.getStage().stage.resumeRender();
28105
- }
28106
- }, (_a = params.chartInitOptions) !== null && _a !== void 0 ? _a : {}));
27952
+ } }, ((_a = params.chartInitOptions) !== null && _a !== void 0 ? _a : {})));
28107
27953
  }
28108
27954
  else {
28109
27955
  this._vchart = params.vchart;
@@ -28149,11 +27995,8 @@
28149
27995
  return;
28150
27996
  }
28151
27997
  this._boundsChangeTag = true;
28152
- this._vchart.resize(this._globalViewBox.x2 - this._globalViewBox.x1, this._globalViewBox.y2 - this._globalViewBox.y1);
28153
27998
  const rootBounds = this._getVChartRootMarkBounds();
28154
- this._vchart
28155
- .getStage()
28156
- .defaultLayer.translateTo(-rootBounds.x1 + VIEW_BOX_EXPEND, -rootBounds.y1 + VIEW_BOX_EXPEND);
27999
+ this._vchart.getStage().defaultLayer.translateTo(-rootBounds.x1, -rootBounds.y1);
28157
28000
  this._BoundsViewBox = rootBounds;
28158
28001
  const viewBox = Object.assign({}, this._globalViewBox);
28159
28002
  this.setAttributes({
@@ -28170,14 +28013,13 @@
28170
28013
  viewBox.y2 -= viewBox.y1;
28171
28014
  viewBox.x1 = 0;
28172
28015
  viewBox.y1 = 0;
28016
+ this._vchart.resize(viewBox.x2 - viewBox.x1, viewBox.y2 - viewBox.y1);
28173
28017
  this._vchart.updateViewBox(viewBox);
28174
28018
  const renderViewBox = Object.assign({}, rootBounds);
28175
28019
  renderViewBox.x2 -= renderViewBox.x1;
28176
28020
  renderViewBox.y2 -= renderViewBox.y1;
28177
28021
  renderViewBox.x1 = 0;
28178
28022
  renderViewBox.y1 = 0;
28179
- renderViewBox.x2 += VIEW_BOX_EXPEND * 2;
28180
- renderViewBox.y2 += VIEW_BOX_EXPEND * 2;
28181
28023
  this._vchart._compiler._view.renderer.setViewBox(renderViewBox, true);
28182
28024
  }
28183
28025
  release() {
@@ -33190,7 +33032,7 @@
33190
33032
  if (!isNil$3(path)) return get$1(target, path, defaultValue);
33191
33033
  };
33192
33034
 
33193
- function mergeSpec(target) {
33035
+ function mergeSpec$1(target) {
33194
33036
  var sourceIndex = -1;
33195
33037
  var length = arguments.length <= 1 ? 0 : arguments.length - 1;
33196
33038
  for (; ++sourceIndex < length;) {
@@ -33201,12 +33043,12 @@
33201
33043
  }
33202
33044
  function mergeSpecWithFilter(target, filter, spec, forceMerge) {
33203
33045
  Object.keys(target).forEach(function (k) {
33204
- if (isObject$3(filter)) filter.type === k && (isArray$3(target[k]) ? target[k].length >= filter.index && (target[k][filter.index] = forceMerge ? mergeSpec({}, target[k][filter.index], spec) : spec) : target[k] = forceMerge ? mergeSpec({}, target[k], spec) : spec);else if (isArray$3(target[k])) {
33046
+ if (isObject$3(filter)) filter.type === k && (isArray$3(target[k]) ? target[k].length >= filter.index && (target[k][filter.index] = forceMerge ? mergeSpec$1({}, target[k][filter.index], spec) : spec) : target[k] = forceMerge ? mergeSpec$1({}, target[k], spec) : spec);else if (isArray$3(target[k])) {
33205
33047
  var index = target[k].findIndex(function (_s) {
33206
33048
  return _s.id === filter;
33207
33049
  });
33208
- index >= 0 && (target[k][index] = forceMerge ? mergeSpec({}, target[k][index], spec) : spec);
33209
- } else target.id === filter && (target[k] = forceMerge ? mergeSpec({}, target[k], spec) : spec);
33050
+ index >= 0 && (target[k][index] = forceMerge ? mergeSpec$1({}, target[k][index], spec) : spec);
33051
+ } else target.id === filter && (target[k] = forceMerge ? mergeSpec$1({}, target[k], spec) : spec);
33210
33052
  });
33211
33053
  }
33212
33054
 
@@ -33409,7 +33251,7 @@
33409
33251
  for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
33410
33252
  sources[_key - 1] = arguments[_key];
33411
33253
  }
33412
- return mergeSpec.apply(void 0, [transformThemeToMerge(target)].concat(_toConsumableArray(sources.map(transformThemeToMerge))));
33254
+ return mergeSpec$1.apply(void 0, [transformThemeToMerge(target)].concat(_toConsumableArray(sources.map(transformThemeToMerge))));
33413
33255
  }
33414
33256
  function transformThemeToMerge(theme) {
33415
33257
  var _a;
@@ -41273,7 +41115,7 @@
41273
41115
  if (this._shouldMergeThemeToSpec()) {
41274
41116
  var specFromChart = this._getDefaultSpecFromChart(chartSpec),
41275
41117
  merge = function merge(originalSpec) {
41276
- return mergeSpec({}, theme, specFromChart, originalSpec);
41118
+ return mergeSpec$1({}, theme, specFromChart, originalSpec);
41277
41119
  };
41278
41120
  return isArray$3(spec) ? {
41279
41121
  spec: spec.map(function (specItem) {
@@ -43752,7 +43594,7 @@
43752
43594
  referer: void 0
43753
43595
  });
43754
43596
  var attrLevel = null === (_a = stateStyle[state][attr]) || void 0 === _a ? void 0 : _a.level;
43755
- isValid$3(attrLevel) && attrLevel <= level && mergeSpec(stateStyle[state][attr], {
43597
+ isValid$3(attrLevel) && attrLevel <= level && mergeSpec$1(stateStyle[state][attr], {
43756
43598
  style: style,
43757
43599
  level: level
43758
43600
  }), "normal" !== state && attr in this._extensionChannel && this._extensionChannel[attr].forEach(function (key) {
@@ -44204,7 +44046,7 @@
44204
44046
  function VChart(spec, options) {
44205
44047
  var _this = this;
44206
44048
  _classCallCheck(this, VChart);
44207
- var _a, _b, _c, _d, _e, _f, _g, _h;
44049
+ var _a, _b, _c, _d, _e, _f;
44208
44050
  this.id = createID(), this._userEvents = [], this._autoSize = !0, this._option = {
44209
44051
  mode: RenderModeEnum["desktop-browser"],
44210
44052
  onError: function onError(msg) {
@@ -44243,13 +44085,13 @@
44243
44085
  }, this._option = merge$1(this._option, {
44244
44086
  animation: !1 !== spec.animation
44245
44087
  }, options), this._onError = null === (_a = this._option) || void 0 === _a ? void 0 : _a.onError;
44246
- var _j = this._option,
44247
- dom = _j.dom,
44248
- renderCanvas = _j.renderCanvas,
44249
- mode = _j.mode,
44250
- stage = _j.stage,
44251
- poptip = _j.poptip,
44252
- restOptions = __rest$1(_j, ["dom", "renderCanvas", "mode", "stage", "poptip"]),
44088
+ var _g = this._option,
44089
+ dom = _g.dom,
44090
+ renderCanvas = _g.renderCanvas,
44091
+ mode = _g.mode,
44092
+ stage = _g.stage,
44093
+ poptip = _g.poptip,
44094
+ restOptions = __rest$1(_g, ["dom", "renderCanvas", "mode", "stage", "poptip"]),
44253
44095
  isTrueBrowseEnv = isTrueBrowser(mode);
44254
44096
  isTrueBrowseEnv ? registerBrowserEnv() : "node" === mode && registerNodeEnv(), isTrueBrowseEnv && dom && (this._container = isString$3(dom) ? vglobal.getElementById(dom) : dom), renderCanvas && (this._canvas = renderCanvas), stage && (this._stage = stage), "node" === mode || this._container || this._canvas || this._stage ? (this._viewBox = this._option.viewBox, this._currentThemeName = ThemeManager$1.getCurrentThemeName(), this._setNewSpec(spec), this._updateCurrentTheme(), this._currentSize = this.getCurrentSize(), this._compiler = new Compiler({
44255
44097
  dom: null !== (_c = this._container) && void 0 !== _c ? _c : "none",
@@ -44261,7 +44103,7 @@
44261
44103
  }, restOptions), {
44262
44104
  background: this._getBackground(),
44263
44105
  onError: this._onError
44264
- })), this._compiler.setSize(this._currentSize.width, this._currentSize.height), this._eventDispatcher = new EventDispatcher(this, this._compiler), this._event = new Event$1(this._eventDispatcher, mode), this._compiler.initView(), this._setFontFamilyTheme(null === (_d = this._currentTheme) || void 0 === _d ? void 0 : _d.fontFamily), this._initDataSet(this._option.dataSet), this._autoSize = !!isTrueBrowseEnv && (null === (_f = null !== (_e = spec.autoFit) && void 0 !== _e ? _e : this._option.autoFit) || void 0 === _f || _f), this._bindResizeEvent(), this._bindVGrammarViewEvent(), this._initChartPlugin(), InstanceManager.registerInstance(this), null === (_h = null === (_g = this._option.performanceHook) || void 0 === _g ? void 0 : _g.afterCreateVChart) || void 0 === _h || _h.call(_g, this)) : null === (_b = this._option) || void 0 === _b || _b.onError("please specify container or renderCanvas!");
44106
+ })), this._compiler.setSize(this._currentSize.width, this._currentSize.height), this._eventDispatcher = new EventDispatcher(this, this._compiler), this._event = new Event$1(this._eventDispatcher, mode), this._compiler.initView(), this._setFontFamilyTheme(null === (_d = this._currentTheme) || void 0 === _d ? void 0 : _d.fontFamily), this._initDataSet(this._option.dataSet), this._autoSize = !!isTrueBrowseEnv && (null === (_f = null !== (_e = spec.autoFit) && void 0 !== _e ? _e : this._option.autoFit) || void 0 === _f || _f), this._bindResizeEvent(), this._bindVGrammarViewEvent(), this._initChartPlugin(), InstanceManager.registerInstance(this)) : null === (_b = this._option) || void 0 === _b || _b.onError("please specify container or renderCanvas!");
44265
44107
  }
44266
44108
  return _createClass(VChart, [{
44267
44109
  key: "getSpec",
@@ -44281,7 +44123,7 @@
44281
44123
  }, {
44282
44124
  key: "_setNewSpec",
44283
44125
  value: function _setNewSpec(spec, forceMerge) {
44284
- return !!spec && (isString$3(spec) && (spec = JSON.parse(spec)), forceMerge && this._originalSpec && (spec = mergeSpec({}, this._originalSpec, spec)), this._originalSpec = spec, this._spec = this._getSpecFromOriginalSpec(), !0);
44126
+ return !!spec && (isString$3(spec) && (spec = JSON.parse(spec)), forceMerge && this._originalSpec && (spec = mergeSpec$1({}, this._originalSpec, spec)), this._originalSpec = spec, this._spec = this._getSpecFromOriginalSpec(), !0);
44285
44127
  }
44286
44128
  }, {
44287
44129
  key: "_getSpecFromOriginalSpec",
@@ -44426,7 +44268,7 @@
44426
44268
  if (this._chart) return !0;
44427
44269
  var transformSpec = option.transformSpec,
44428
44270
  actionSource = option.actionSource;
44429
- return transformSpec && this._initChartSpec(this._spec, "render"), this._chartPluginApply("onBeforeInitChart", this._spec, actionSource), null === (_b = null === (_a = this._option.performanceHook) || void 0 === _a ? void 0 : _a.beforeInitializeChart) || void 0 === _b || _b.call(_a, this), this._initChart(this._spec), null === (_d = null === (_c = this._option.performanceHook) || void 0 === _c ? void 0 : _c.afterInitializeChart) || void 0 === _d || _d.call(_c, this), !(!this._chart || !this._compiler) && (null === (_f = null === (_e = this._option.performanceHook) || void 0 === _e ? void 0 : _e.beforeCompileToVGrammar) || void 0 === _f || _f.call(_e), this._compiler.compile({
44271
+ return transformSpec && this._initChartSpec(this._spec, "render"), this._chartPluginApply("onBeforeInitChart", this._spec, actionSource), null === (_b = null === (_a = this._option.performanceHook) || void 0 === _a ? void 0 : _a.beforeInitializeChart) || void 0 === _b || _b.call(_a), this._initChart(this._spec), null === (_d = null === (_c = this._option.performanceHook) || void 0 === _c ? void 0 : _c.afterInitializeChart) || void 0 === _d || _d.call(_c), !(!this._chart || !this._compiler) && (null === (_f = null === (_e = this._option.performanceHook) || void 0 === _e ? void 0 : _e.beforeCompileToVGrammar) || void 0 === _f || _f.call(_e), this._compiler.compile({
44430
44272
  chart: this._chart,
44431
44273
  vChart: this
44432
44274
  }, {
@@ -44721,7 +44563,7 @@
44721
44563
  var sync = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
44722
44564
  var forceMerge = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
44723
44565
  var morphConfig = arguments.length > 4 ? arguments[4] : undefined;
44724
- forceMerge && (spec = mergeSpec({}, model.getSpec(), spec));
44566
+ forceMerge && (spec = mergeSpec$1({}, model.getSpec(), spec));
44725
44567
  var result = model.updateSpec(spec);
44726
44568
  return model.reInit(spec), (result.change || result.reCompile || result.reMake || result.reSize || result.reRender) && this._chart.reDataFlow(), this.updateCustomConfigAndRerender(result, sync, {
44727
44569
  morphConfig: morphConfig,
@@ -47350,7 +47192,7 @@
47350
47192
  _initGraphics() {
47351
47193
  var _a, _b;
47352
47194
  const { spec, viewBox } = this._getChartOption();
47353
- this._graphic = new Chart(Object.assign(Object.assign({ renderCanvas: this._option.canvas.getCanvas(), spec, ClassType: VChart, vchart: null, zIndex: this._spec.zIndex, mode: 'desktop-browser', dpr: window.devicePixelRatio, interactive: false, autoRender: false, disableDirtyBounds: true, viewBox, ticker: this._option.canvas.getStage().ticker, visibleAll: false }, ((_a = this._spec.options.panel) !== null && _a !== void 0 ? _a : {})), { chartInitOptions: mergeChartOption({
47195
+ this._graphic = new Chart(Object.assign(Object.assign({ renderCanvas: this._option.canvas.getCanvas(), spec, ClassType: VChart, vchart: null, zIndex: this._spec.zIndex, mode: 'desktop-browser', dpr: window.devicePixelRatio, interactive: false, autoRender: false, disableDirtyBounds: true, viewBox, ticker: this._option.canvas.getStage().ticker, visibleAll: false }, ((_a = this._spec.options.panel) !== null && _a !== void 0 ? _a : {})), { chartInitOptions: merge({
47354
47196
  animation: true,
47355
47197
  disableTriggerEvent: true,
47356
47198
  performanceHook: {
@@ -50508,9 +50350,6 @@
50508
50350
  get player() {
50509
50351
  return this._player;
50510
50352
  }
50511
- get characterTree() {
50512
- return this._characterTree;
50513
- }
50514
50353
  constructor(spec, option) {
50515
50354
  this.id = 'test-mvp_' + Story._id_++;
50516
50355
  this._canvas = new StoryCanvas(this, isString$1(option.dom) ? document.getElementById(option.dom) : option.dom);
@@ -50838,6 +50677,114 @@
50838
50677
  }
50839
50678
  Edit.componentConstructorMap = {};
50840
50679
 
50680
+ const directlyAssignSpecKeys = ['seriesId', 'text'];
50681
+ function isModelInfoMatchSpec(info, spec, specKey, index, option = {
50682
+ ignoreIdMatch: false
50683
+ }) {
50684
+ if (!isNil$1(info.id)) {
50685
+ const match = info.id === spec.id;
50686
+ if (match || option.ignoreIdMatch !== true) {
50687
+ return match;
50688
+ }
50689
+ }
50690
+ return info.specKey === specKey && info.specIndex === index;
50691
+ }
50692
+ function baseMerge(target, source, shallowArray = false) {
50693
+ if (source) {
50694
+ if (target === source) {
50695
+ return;
50696
+ }
50697
+ if (isValid$1(source) && typeof source === 'object') {
50698
+ const iterable = Object(source);
50699
+ const props = [];
50700
+ for (const key in iterable) {
50701
+ props.push(key);
50702
+ }
50703
+ let { length } = props;
50704
+ let propIndex = -1;
50705
+ while (length--) {
50706
+ const key = props[++propIndex];
50707
+ if (isValid$1(iterable[key]) && typeof iterable[key] === 'object') {
50708
+ baseMergeDeep(target, source, key, shallowArray);
50709
+ }
50710
+ else {
50711
+ assignMergeValue(target, key, iterable[key]);
50712
+ }
50713
+ }
50714
+ }
50715
+ }
50716
+ }
50717
+ function baseMergeDeep(target, source, key, shallowArray = false) {
50718
+ const objValue = target[key];
50719
+ const srcValue = source[key];
50720
+ let newValue = source[key];
50721
+ let isCommon = true;
50722
+ if (directlyAssignSpecKeys.includes(key)) {
50723
+ isCommon = false;
50724
+ }
50725
+ else if (isArray$1(srcValue)) {
50726
+ if (shallowArray || !objValue) {
50727
+ newValue = [];
50728
+ }
50729
+ else if (isArray$1(objValue)) {
50730
+ newValue = objValue;
50731
+ }
50732
+ else if (isArrayLike$1(objValue) && !isString$1(objValue)) {
50733
+ newValue = new Array(objValue.length);
50734
+ let index = -1;
50735
+ const length = objValue.length;
50736
+ while (++index < length) {
50737
+ newValue[index] = objValue[index];
50738
+ }
50739
+ }
50740
+ }
50741
+ else if (isPlainObject$1(srcValue)) {
50742
+ newValue = objValue !== null && objValue !== void 0 ? objValue : {};
50743
+ if (typeof objValue === 'function' || typeof objValue !== 'object') {
50744
+ newValue = {};
50745
+ }
50746
+ }
50747
+ else {
50748
+ isCommon = false;
50749
+ }
50750
+ if (isCommon) {
50751
+ baseMerge(newValue, srcValue, shallowArray);
50752
+ }
50753
+ assignMergeValue(target, key, newValue);
50754
+ }
50755
+ function assignMergeValue(target, key, value) {
50756
+ if ((value !== undefined && !eq(target[key], value)) || (value === undefined && !(key in target))) {
50757
+ target[key] = value;
50758
+ }
50759
+ }
50760
+ function eq(value, other) {
50761
+ return value === other || (Number.isNaN(value) && Number.isNaN(other));
50762
+ }
50763
+ function mergeSpec(target, ...sources) {
50764
+ let sourceIndex = -1;
50765
+ const length = sources.length;
50766
+ while (++sourceIndex < length) {
50767
+ const source = sources[sourceIndex];
50768
+ baseMerge(target, source, false);
50769
+ }
50770
+ return target;
50771
+ }
50772
+ function findChartSpec(s, vchartSpec) {
50773
+ const chartSpec = vchartSpec[s.specKey];
50774
+ if (!chartSpec) {
50775
+ return null;
50776
+ }
50777
+ if (isArray$1(chartSpec)) {
50778
+ return chartSpec.find((_s, index) => {
50779
+ return isModelInfoMatchSpec(s, _s, s.specKey, index);
50780
+ });
50781
+ }
50782
+ else if (isObject$1(chartSpec)) {
50783
+ return isModelInfoMatchSpec(s, chartSpec, s.specKey, 0) ? chartSpec : null;
50784
+ }
50785
+ return null;
50786
+ }
50787
+
50841
50788
  registerCharacter();
50842
50789
 
50843
50790
  exports.Edit = Edit;
@@ -50854,8 +50801,7 @@
50854
50801
  exports.isModelInfoMatchSpec = isModelInfoMatchSpec;
50855
50802
  exports.labelMarkPick = labelMarkPick;
50856
50803
  exports.markerMarkPick = markerMarkPick;
50857
- exports.mergeChartOption = mergeChartOption;
50858
- exports.mergeSpec = mergeSpec$1;
50804
+ exports.mergeSpec = mergeSpec;
50859
50805
  exports.registerCharacter = registerCharacter;
50860
50806
  exports.scrollBarMarkPick = scrollBarMarkPick;
50861
50807
  exports.seriesMarkPick = seriesMarkPick;