@visactor/vrender 1.0.32 → 1.0.33

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";
2
+ export declare const version = "1.0.33";
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", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
24
+ exports.version = "1.0.33", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
25
25
  vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
26
26
  vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
27
27
  (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
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,QAAQ,CAAC;AAEhC,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\";\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,QAAQ,CAAC;AAEhC,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\";\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;
@@ -32151,7 +32155,7 @@ class AnimateExecutor {
32151
32155
  from = effect.from;
32152
32156
  props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from);
32153
32157
  const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
32154
- customType = effect.customType;
32158
+ customType = effect.custom ? effect.customType : getCustomType(custom);
32155
32159
  this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
32156
32160
  }), delayAfterValue > 0 && animate.wait(delayAfterValue);
32157
32161
  }
@@ -41158,7 +41162,31 @@ class CircleAxis extends AxisBase {
41158
41162
  separation: autoHideSeparation
41159
41163
  }));
41160
41164
  }
41161
- afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {}
41165
+ afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
41166
+ var _a;
41167
+ const {
41168
+ layoutRect: layoutRect,
41169
+ autoLabelMaxWidth: autoLabelMaxWidth
41170
+ } = this.attribute;
41171
+ if (!autoLabelMaxWidth || !layoutRect || !labelShapes || 0 === labelShapes.length) return;
41172
+ const rectRight = 0 + layoutRect.width;
41173
+ for (let i = 0; i < labelShapes.length; i++) {
41174
+ const label = labelShapes[i],
41175
+ x = label.attribute.x,
41176
+ align = null !== (_a = label.attribute.textAlign) && void 0 !== _a ? _a : "center";
41177
+ let maxWidth = 0;
41178
+ if ("left" === align) maxWidth = rectRight - x;else if ("right" === align) maxWidth = x - 0;else {
41179
+ const leftDist = x - 0,
41180
+ rightDist = rectRight - x;
41181
+ maxWidth = 2 * Math.max(0, Math.min(leftDist, rightDist));
41182
+ }
41183
+ maxWidth > 0 ? label.setAttributes({
41184
+ maxLineWidth: maxWidth
41185
+ }) : label.setAttributes({
41186
+ maxLineWidth: 0
41187
+ });
41188
+ }
41189
+ }
41162
41190
  getTextBaseline(vector) {
41163
41191
  return Math.abs(vector[1] / vector[0]) < .3 ? "middle" : vector[1] < 0 ? "bottom" : vector[1] > 0 ? "top" : "middle";
41164
41192
  }
@@ -52973,7 +53001,7 @@ TableSeriesNumber.defaultAttributes = {
52973
53001
  select: !0
52974
53002
  };
52975
53003
 
52976
- const version = "1.0.32";
53004
+ const version = "1.0.33";
52977
53005
  preLoadAllModule();
52978
53006
  if (isBrowserEnv()) {
52979
53007
  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;
@@ -32157,7 +32161,7 @@
32157
32161
  from = effect.from;
32158
32162
  props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from);
32159
32163
  const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
32160
- customType = effect.customType;
32164
+ customType = effect.custom ? effect.customType : getCustomType(custom);
32161
32165
  this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
32162
32166
  }), delayAfterValue > 0 && animate.wait(delayAfterValue);
32163
32167
  }
@@ -41164,7 +41168,31 @@
41164
41168
  separation: autoHideSeparation
41165
41169
  }));
41166
41170
  }
41167
- afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {}
41171
+ afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
41172
+ var _a;
41173
+ const {
41174
+ layoutRect: layoutRect,
41175
+ autoLabelMaxWidth: autoLabelMaxWidth
41176
+ } = this.attribute;
41177
+ if (!autoLabelMaxWidth || !layoutRect || !labelShapes || 0 === labelShapes.length) return;
41178
+ const rectRight = 0 + layoutRect.width;
41179
+ for (let i = 0; i < labelShapes.length; i++) {
41180
+ const label = labelShapes[i],
41181
+ x = label.attribute.x,
41182
+ align = null !== (_a = label.attribute.textAlign) && void 0 !== _a ? _a : "center";
41183
+ let maxWidth = 0;
41184
+ if ("left" === align) maxWidth = rectRight - x;else if ("right" === align) maxWidth = x - 0;else {
41185
+ const leftDist = x - 0,
41186
+ rightDist = rectRight - x;
41187
+ maxWidth = 2 * Math.max(0, Math.min(leftDist, rightDist));
41188
+ }
41189
+ maxWidth > 0 ? label.setAttributes({
41190
+ maxLineWidth: maxWidth
41191
+ }) : label.setAttributes({
41192
+ maxLineWidth: 0
41193
+ });
41194
+ }
41195
+ }
41168
41196
  getTextBaseline(vector) {
41169
41197
  return Math.abs(vector[1] / vector[0]) < .3 ? "middle" : vector[1] < 0 ? "bottom" : vector[1] > 0 ? "top" : "middle";
41170
41198
  }
@@ -52979,7 +53007,7 @@
52979
53007
  select: !0
52980
53008
  };
52981
53009
 
52982
- const version = "1.0.32";
53010
+ const version = "1.0.33";
52983
53011
  preLoadAllModule();
52984
53012
  if (isBrowserEnv()) {
52985
53013
  loadBrowserEnv(container);