@visactor/vrender 1.0.32-alpha.1 → 1.0.33-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/cjs/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import '@visactor/vrender-core';
2
- export declare const version = "1.0.32-alpha.1";
2
+ export declare const version = "1.0.33-alpha.0";
3
3
  export * from '@visactor/vrender-core';
4
4
  export * from '@visactor/vrender-kits';
5
5
  export * from '@visactor/vrender-animate';
package/cjs/index.js CHANGED
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", {
21
21
 
22
22
  const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits"), vrender_animate_1 = require("@visactor/vrender-animate");
23
23
 
24
- exports.version = "1.0.32-alpha.1", (0, vrender_core_1.preLoadAllModule)(), (0,
24
+ exports.version = "1.0.33-alpha.0", (0, vrender_core_1.preLoadAllModule)(), (0,
25
25
  vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
26
26
  vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
27
27
  (0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAmF;AACnF,yDAmBgC;AAChC,+DAAmF;AAEtE,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,2BAAY,GAAE,CAAC;AAEf,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AAEtB,IAAA,uCAAqB,GAAE,CAAC;AACxB,IAAA,iCAAe,GAAE,CAAC;AAElB,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C;AAC1C,+DAA6C;AAG7C,6DAAkD;AAAzC,wGAAA,KAAK,OAAA;AACd,uDAAmD;AAA1C,yGAAA,SAAS,OAAA","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv, registerStar } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\nimport { registerCustomAnimate, registerAnimate } from '@visactor/vrender-animate';\n// 导出版本号\nexport const version = \"1.0.32-alpha.1\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nregisterStar();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\n\nregisterCustomAnimate();\nregisterAnimate();\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-animate';\nexport * from '@visactor/vrender-components';\n\n// avoid naming conflicts with 'State' & 'Direction' in '@visactor/vrender-components'\nexport { State } from '@visactor/vrender-animate';\nexport { Direction } from '@visactor/vrender-core';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAmF;AACnF,yDAmBgC;AAChC,+DAAmF;AAEtE,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,2BAAY,GAAE,CAAC;AAEf,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AAEtB,IAAA,uCAAqB,GAAE,CAAC;AACxB,IAAA,iCAAe,GAAE,CAAC;AAElB,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C;AAC1C,+DAA6C;AAG7C,6DAAkD;AAAzC,wGAAA,KAAK,OAAA;AACd,uDAAmD;AAA1C,yGAAA,SAAS,OAAA","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv, registerStar } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\nimport { registerCustomAnimate, registerAnimate } from '@visactor/vrender-animate';\n// 导出版本号\nexport const version = \"1.0.33-alpha.0\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nregisterStar();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\n\nregisterCustomAnimate();\nregisterAnimate();\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-animate';\nexport * from '@visactor/vrender-components';\n\n// avoid naming conflicts with 'State' & 'Direction' in '@visactor/vrender-components'\nexport { State } from '@visactor/vrender-animate';\nexport { Direction } from '@visactor/vrender-core';\n"]}
package/dist/index.es.js CHANGED
@@ -31944,6 +31944,10 @@ class AnimationTransitionRegistry {
31944
31944
  }
31945
31945
  const transitionRegistry = AnimationTransitionRegistry.getInstance();
31946
31946
 
31947
+ function getCustomType(custom) {
31948
+ return custom && isFunction$1(custom) ? /^class\s/.test(Function.prototype.toString.call(custom)) ? 1 : 2 : 0;
31949
+ }
31950
+
31947
31951
  class AnimateExecutor {
31948
31952
  static registerBuiltInAnimate(name, animate) {
31949
31953
  AnimateExecutor.builtInAnimateMap[name] = animate;
@@ -32008,7 +32012,7 @@ class AnimateExecutor {
32008
32012
  effects: effects.map(effect => {
32009
32013
  var _a, _b;
32010
32014
  const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[null !== (_b = effect.type) && void 0 !== _b ? _b : "fromTo"],
32011
- customType = custom && isFunction$1(custom) ? /^class\s/.test(Function.prototype.toString.call(custom)) ? 1 : 2 : 0;
32015
+ customType = getCustomType(custom);
32012
32016
  return Object.assign(Object.assign({}, effect), {
32013
32017
  custom: custom,
32014
32018
  customType: customType
@@ -32022,7 +32026,7 @@ class AnimateExecutor {
32022
32026
  duration = this.resolveValue(params.duration, child, 300);
32023
32027
  let oneByOneDelay = 0;
32024
32028
  oneByOne && (oneByOneDelay = "number" == typeof oneByOne ? oneByOne : oneByOne ? delay + delayAfter + duration : 0), parsedParams.oneByOneDelay = oneByOneDelay, parsedParams.custom = null !== (_a = params.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[null !== (_b = params.type) && void 0 !== _b ? _b : "fromTo"];
32025
- const customType = parsedParams.custom && isFunction$1(parsedParams.custom) ? /^class\s/.test(Function.prototype.toString.call(parsedParams.custom)) ? 1 : 2 : 0;
32029
+ const customType = getCustomType(parsedParams.custom);
32026
32030
  if (parsedParams.customType = customType, totalTime) {
32027
32031
  const _totalTime = delay + delayAfter + duration + oneByOneDelay * (this._target.count - 2),
32028
32032
  scale = totalTime ? totalTime / _totalTime : 1;
@@ -32096,6 +32100,7 @@ class AnimateExecutor {
32096
32100
  _handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
32097
32101
  var _a, _b, _c, _d, _e, _f, _g, _h;
32098
32102
  if (custom && customType) {
32103
+ customType = getCustomType(custom);
32099
32104
  let customParams = this.resolveValue(customParameters, graphic);
32100
32105
  "function" == typeof customParams && (customParams = customParams(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {})), customParams = Object.assign({
32101
32106
  width: (null === (_c = graphic.stage) || void 0 === _c ? void 0 : _c.width) || 0,
@@ -32151,7 +32156,7 @@ class AnimateExecutor {
32151
32156
  from = effect.from;
32152
32157
  props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from);
32153
32158
  const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
32154
- customType = effect.customType;
32159
+ customType = effect.custom ? effect.customType : getCustomType(custom);
32155
32160
  this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
32156
32161
  }), delayAfterValue > 0 && animate.wait(delayAfterValue);
32157
32162
  }
@@ -41158,7 +41163,31 @@ class CircleAxis extends AxisBase {
41158
41163
  separation: autoHideSeparation
41159
41164
  }));
41160
41165
  }
41161
- afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {}
41166
+ afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
41167
+ var _a;
41168
+ const {
41169
+ layoutRect: layoutRect,
41170
+ autoLabelMaxWidth: autoLabelMaxWidth
41171
+ } = this.attribute;
41172
+ if (!autoLabelMaxWidth || !layoutRect || !labelShapes || 0 === labelShapes.length) return;
41173
+ const rectRight = 0 + layoutRect.width;
41174
+ for (let i = 0; i < labelShapes.length; i++) {
41175
+ const label = labelShapes[i],
41176
+ x = label.attribute.x,
41177
+ align = null !== (_a = label.attribute.textAlign) && void 0 !== _a ? _a : "center";
41178
+ let maxWidth = 0;
41179
+ if ("left" === align) maxWidth = rectRight - x;else if ("right" === align) maxWidth = x - 0;else {
41180
+ const leftDist = x - 0,
41181
+ rightDist = rectRight - x;
41182
+ maxWidth = 2 * Math.max(0, Math.min(leftDist, rightDist));
41183
+ }
41184
+ maxWidth > 0 ? label.setAttributes({
41185
+ maxLineWidth: maxWidth
41186
+ }) : label.setAttributes({
41187
+ maxLineWidth: 0
41188
+ });
41189
+ }
41190
+ }
41162
41191
  getTextBaseline(vector) {
41163
41192
  return Math.abs(vector[1] / vector[0]) < .3 ? "middle" : vector[1] < 0 ? "bottom" : vector[1] > 0 ? "top" : "middle";
41164
41193
  }
@@ -52973,7 +53002,7 @@ TableSeriesNumber.defaultAttributes = {
52973
53002
  select: !0
52974
53003
  };
52975
53004
 
52976
- const version = "1.0.32-alpha.1";
53005
+ const version = "1.0.33-alpha.0";
52977
53006
  preLoadAllModule();
52978
53007
  if (isBrowserEnv()) {
52979
53008
  loadBrowserEnv(container);
package/dist/index.js CHANGED
@@ -31950,6 +31950,10 @@
31950
31950
  }
31951
31951
  const transitionRegistry = AnimationTransitionRegistry.getInstance();
31952
31952
 
31953
+ function getCustomType(custom) {
31954
+ return custom && isFunction$1(custom) ? /^class\s/.test(Function.prototype.toString.call(custom)) ? 1 : 2 : 0;
31955
+ }
31956
+
31953
31957
  class AnimateExecutor {
31954
31958
  static registerBuiltInAnimate(name, animate) {
31955
31959
  AnimateExecutor.builtInAnimateMap[name] = animate;
@@ -32014,7 +32018,7 @@
32014
32018
  effects: effects.map(effect => {
32015
32019
  var _a, _b;
32016
32020
  const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[null !== (_b = effect.type) && void 0 !== _b ? _b : "fromTo"],
32017
- customType = custom && isFunction$1(custom) ? /^class\s/.test(Function.prototype.toString.call(custom)) ? 1 : 2 : 0;
32021
+ customType = getCustomType(custom);
32018
32022
  return Object.assign(Object.assign({}, effect), {
32019
32023
  custom: custom,
32020
32024
  customType: customType
@@ -32028,7 +32032,7 @@
32028
32032
  duration = this.resolveValue(params.duration, child, 300);
32029
32033
  let oneByOneDelay = 0;
32030
32034
  oneByOne && (oneByOneDelay = "number" == typeof oneByOne ? oneByOne : oneByOne ? delay + delayAfter + duration : 0), parsedParams.oneByOneDelay = oneByOneDelay, parsedParams.custom = null !== (_a = params.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[null !== (_b = params.type) && void 0 !== _b ? _b : "fromTo"];
32031
- const customType = parsedParams.custom && isFunction$1(parsedParams.custom) ? /^class\s/.test(Function.prototype.toString.call(parsedParams.custom)) ? 1 : 2 : 0;
32035
+ const customType = getCustomType(parsedParams.custom);
32032
32036
  if (parsedParams.customType = customType, totalTime) {
32033
32037
  const _totalTime = delay + delayAfter + duration + oneByOneDelay * (this._target.count - 2),
32034
32038
  scale = totalTime ? totalTime / _totalTime : 1;
@@ -32102,6 +32106,7 @@
32102
32106
  _handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
32103
32107
  var _a, _b, _c, _d, _e, _f, _g, _h;
32104
32108
  if (custom && customType) {
32109
+ customType = getCustomType(custom);
32105
32110
  let customParams = this.resolveValue(customParameters, graphic);
32106
32111
  "function" == typeof customParams && (customParams = customParams(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {})), customParams = Object.assign({
32107
32112
  width: (null === (_c = graphic.stage) || void 0 === _c ? void 0 : _c.width) || 0,
@@ -32157,7 +32162,7 @@
32157
32162
  from = effect.from;
32158
32163
  props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from);
32159
32164
  const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
32160
- customType = effect.customType;
32165
+ customType = effect.custom ? effect.customType : getCustomType(custom);
32161
32166
  this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
32162
32167
  }), delayAfterValue > 0 && animate.wait(delayAfterValue);
32163
32168
  }
@@ -41164,7 +41169,31 @@
41164
41169
  separation: autoHideSeparation
41165
41170
  }));
41166
41171
  }
41167
- afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {}
41172
+ afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
41173
+ var _a;
41174
+ const {
41175
+ layoutRect: layoutRect,
41176
+ autoLabelMaxWidth: autoLabelMaxWidth
41177
+ } = this.attribute;
41178
+ if (!autoLabelMaxWidth || !layoutRect || !labelShapes || 0 === labelShapes.length) return;
41179
+ const rectRight = 0 + layoutRect.width;
41180
+ for (let i = 0; i < labelShapes.length; i++) {
41181
+ const label = labelShapes[i],
41182
+ x = label.attribute.x,
41183
+ align = null !== (_a = label.attribute.textAlign) && void 0 !== _a ? _a : "center";
41184
+ let maxWidth = 0;
41185
+ if ("left" === align) maxWidth = rectRight - x;else if ("right" === align) maxWidth = x - 0;else {
41186
+ const leftDist = x - 0,
41187
+ rightDist = rectRight - x;
41188
+ maxWidth = 2 * Math.max(0, Math.min(leftDist, rightDist));
41189
+ }
41190
+ maxWidth > 0 ? label.setAttributes({
41191
+ maxLineWidth: maxWidth
41192
+ }) : label.setAttributes({
41193
+ maxLineWidth: 0
41194
+ });
41195
+ }
41196
+ }
41168
41197
  getTextBaseline(vector) {
41169
41198
  return Math.abs(vector[1] / vector[0]) < .3 ? "middle" : vector[1] < 0 ? "bottom" : vector[1] > 0 ? "top" : "middle";
41170
41199
  }
@@ -52979,7 +53008,7 @@
52979
53008
  select: !0
52980
53009
  };
52981
53010
 
52982
- const version = "1.0.32-alpha.1";
53011
+ const version = "1.0.33-alpha.0";
52983
53012
  preLoadAllModule();
52984
53013
  if (isBrowserEnv()) {
52985
53014
  loadBrowserEnv(container);