@visactor/vrender 1.0.32 → 1.0.33-alpha.1
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 +1 -1
- package/cjs/index.js +11 -10
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +42 -5
- package/dist/index.js +42 -5
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +7 -7
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,16 +21,17 @@ 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.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0, vrender_kits_2.
|
|
28
|
-
(0, vrender_kits_2.
|
|
29
|
-
(0, vrender_kits_2.
|
|
30
|
-
(0, vrender_kits_2.
|
|
31
|
-
vrender_kits_2.
|
|
32
|
-
(0, vrender_kits_2.
|
|
33
|
-
(0,
|
|
24
|
+
exports.version = "1.0.33-alpha.1", (0, vrender_core_1.preLoadAllModule)(), (0,
|
|
25
|
+
vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
|
|
26
|
+
vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
|
|
27
|
+
(0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
|
|
28
|
+
(0, vrender_kits_2.registerCircle)(), (0, vrender_kits_2.registerGlyph)(), (0, vrender_kits_2.registerGroup)(),
|
|
29
|
+
(0, vrender_kits_2.registerImage)(), (0, vrender_kits_2.registerLine)(), (0, vrender_kits_2.registerPath)(),
|
|
30
|
+
(0, vrender_kits_2.registerPolygon)(), (0, vrender_kits_2.registerPyramid3d)(),
|
|
31
|
+
(0, vrender_kits_2.registerRect)(), (0, vrender_kits_2.registerRect3d)(), (0, vrender_kits_2.registerRichtext)(),
|
|
32
|
+
(0, vrender_kits_2.registerShadowRoot)(), (0, vrender_kits_2.registerSymbol)(),
|
|
33
|
+
(0, vrender_kits_2.registerText)(), (0, vrender_kits_2.registerWrapText)(), (0,
|
|
34
|
+
vrender_kits_1.registerStar)(), (0, vrender_core_1.registerFlexLayoutPlugin)(),
|
|
34
35
|
(0, vrender_core_1.registerViewTransform3dPlugin)(), (0, vrender_core_1.registerHtmlAttributePlugin)(),
|
|
35
36
|
(0, vrender_core_1.registerReactAttributePlugin)(), (0, vrender_core_1.registerDirectionalLight)(),
|
|
36
37
|
(0, vrender_core_1.registerOrthoCamera)(), (0, vrender_animate_1.registerCustomAnimate)(),
|
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,
|
|
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.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"]}
|
package/dist/index.es.js
CHANGED
|
@@ -31944,6 +31944,18 @@ class AnimationTransitionRegistry {
|
|
|
31944
31944
|
}
|
|
31945
31945
|
const transitionRegistry = AnimationTransitionRegistry.getInstance();
|
|
31946
31946
|
|
|
31947
|
+
function getCustomType(custom) {
|
|
31948
|
+
if (!custom || !isFunction$1(custom)) return 0;
|
|
31949
|
+
const functionStr = Function.prototype.toString.call(custom);
|
|
31950
|
+
if (/^class\s/.test(functionStr)) return 1;
|
|
31951
|
+
if (!custom.prototype) return 2;
|
|
31952
|
+
if (custom.prototype.constructor === custom) {
|
|
31953
|
+
const descriptor = Object.getOwnPropertyDescriptor(custom, "prototype");
|
|
31954
|
+
if (descriptor && !descriptor.writable) return 1;
|
|
31955
|
+
}
|
|
31956
|
+
return 2;
|
|
31957
|
+
}
|
|
31958
|
+
|
|
31947
31959
|
class AnimateExecutor {
|
|
31948
31960
|
static registerBuiltInAnimate(name, animate) {
|
|
31949
31961
|
AnimateExecutor.builtInAnimateMap[name] = animate;
|
|
@@ -32008,7 +32020,7 @@ class AnimateExecutor {
|
|
|
32008
32020
|
effects: effects.map(effect => {
|
|
32009
32021
|
var _a, _b;
|
|
32010
32022
|
const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[null !== (_b = effect.type) && void 0 !== _b ? _b : "fromTo"],
|
|
32011
|
-
customType =
|
|
32023
|
+
customType = getCustomType(custom);
|
|
32012
32024
|
return Object.assign(Object.assign({}, effect), {
|
|
32013
32025
|
custom: custom,
|
|
32014
32026
|
customType: customType
|
|
@@ -32022,7 +32034,7 @@ class AnimateExecutor {
|
|
|
32022
32034
|
duration = this.resolveValue(params.duration, child, 300);
|
|
32023
32035
|
let oneByOneDelay = 0;
|
|
32024
32036
|
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 =
|
|
32037
|
+
const customType = getCustomType(parsedParams.custom);
|
|
32026
32038
|
if (parsedParams.customType = customType, totalTime) {
|
|
32027
32039
|
const _totalTime = delay + delayAfter + duration + oneByOneDelay * (this._target.count - 2),
|
|
32028
32040
|
scale = totalTime ? totalTime / _totalTime : 1;
|
|
@@ -32096,6 +32108,7 @@ class AnimateExecutor {
|
|
|
32096
32108
|
_handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
|
|
32097
32109
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
32098
32110
|
if (custom && customType) {
|
|
32111
|
+
customType = getCustomType(custom);
|
|
32099
32112
|
let customParams = this.resolveValue(customParameters, graphic);
|
|
32100
32113
|
"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
32114
|
width: (null === (_c = graphic.stage) || void 0 === _c ? void 0 : _c.width) || 0,
|
|
@@ -32151,7 +32164,7 @@ class AnimateExecutor {
|
|
|
32151
32164
|
from = effect.from;
|
|
32152
32165
|
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from);
|
|
32153
32166
|
const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
|
|
32154
|
-
customType = effect.customType;
|
|
32167
|
+
customType = effect.custom ? effect.customType : getCustomType(custom);
|
|
32155
32168
|
this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
|
|
32156
32169
|
}), delayAfterValue > 0 && animate.wait(delayAfterValue);
|
|
32157
32170
|
}
|
|
@@ -41158,7 +41171,31 @@ class CircleAxis extends AxisBase {
|
|
|
41158
41171
|
separation: autoHideSeparation
|
|
41159
41172
|
}));
|
|
41160
41173
|
}
|
|
41161
|
-
afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
|
|
41174
|
+
afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
|
|
41175
|
+
var _a;
|
|
41176
|
+
const {
|
|
41177
|
+
layoutRect: layoutRect,
|
|
41178
|
+
autoLabelMaxWidth: autoLabelMaxWidth
|
|
41179
|
+
} = this.attribute;
|
|
41180
|
+
if (!autoLabelMaxWidth || !layoutRect || !labelShapes || 0 === labelShapes.length) return;
|
|
41181
|
+
const rectRight = 0 + layoutRect.width;
|
|
41182
|
+
for (let i = 0; i < labelShapes.length; i++) {
|
|
41183
|
+
const label = labelShapes[i],
|
|
41184
|
+
x = label.attribute.x,
|
|
41185
|
+
align = null !== (_a = label.attribute.textAlign) && void 0 !== _a ? _a : "center";
|
|
41186
|
+
let maxWidth = 0;
|
|
41187
|
+
if ("left" === align) maxWidth = rectRight - x;else if ("right" === align) maxWidth = x - 0;else {
|
|
41188
|
+
const leftDist = x - 0,
|
|
41189
|
+
rightDist = rectRight - x;
|
|
41190
|
+
maxWidth = 2 * Math.max(0, Math.min(leftDist, rightDist));
|
|
41191
|
+
}
|
|
41192
|
+
maxWidth > 0 ? label.setAttributes({
|
|
41193
|
+
maxLineWidth: maxWidth
|
|
41194
|
+
}) : label.setAttributes({
|
|
41195
|
+
maxLineWidth: 0
|
|
41196
|
+
});
|
|
41197
|
+
}
|
|
41198
|
+
}
|
|
41162
41199
|
getTextBaseline(vector) {
|
|
41163
41200
|
return Math.abs(vector[1] / vector[0]) < .3 ? "middle" : vector[1] < 0 ? "bottom" : vector[1] > 0 ? "top" : "middle";
|
|
41164
41201
|
}
|
|
@@ -52973,7 +53010,7 @@ TableSeriesNumber.defaultAttributes = {
|
|
|
52973
53010
|
select: !0
|
|
52974
53011
|
};
|
|
52975
53012
|
|
|
52976
|
-
const version = "1.0.
|
|
53013
|
+
const version = "1.0.33-alpha.1";
|
|
52977
53014
|
preLoadAllModule();
|
|
52978
53015
|
if (isBrowserEnv()) {
|
|
52979
53016
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -31950,6 +31950,18 @@
|
|
|
31950
31950
|
}
|
|
31951
31951
|
const transitionRegistry = AnimationTransitionRegistry.getInstance();
|
|
31952
31952
|
|
|
31953
|
+
function getCustomType(custom) {
|
|
31954
|
+
if (!custom || !isFunction$1(custom)) return 0;
|
|
31955
|
+
const functionStr = Function.prototype.toString.call(custom);
|
|
31956
|
+
if (/^class\s/.test(functionStr)) return 1;
|
|
31957
|
+
if (!custom.prototype) return 2;
|
|
31958
|
+
if (custom.prototype.constructor === custom) {
|
|
31959
|
+
const descriptor = Object.getOwnPropertyDescriptor(custom, "prototype");
|
|
31960
|
+
if (descriptor && !descriptor.writable) return 1;
|
|
31961
|
+
}
|
|
31962
|
+
return 2;
|
|
31963
|
+
}
|
|
31964
|
+
|
|
31953
31965
|
class AnimateExecutor {
|
|
31954
31966
|
static registerBuiltInAnimate(name, animate) {
|
|
31955
31967
|
AnimateExecutor.builtInAnimateMap[name] = animate;
|
|
@@ -32014,7 +32026,7 @@
|
|
|
32014
32026
|
effects: effects.map(effect => {
|
|
32015
32027
|
var _a, _b;
|
|
32016
32028
|
const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[null !== (_b = effect.type) && void 0 !== _b ? _b : "fromTo"],
|
|
32017
|
-
customType =
|
|
32029
|
+
customType = getCustomType(custom);
|
|
32018
32030
|
return Object.assign(Object.assign({}, effect), {
|
|
32019
32031
|
custom: custom,
|
|
32020
32032
|
customType: customType
|
|
@@ -32028,7 +32040,7 @@
|
|
|
32028
32040
|
duration = this.resolveValue(params.duration, child, 300);
|
|
32029
32041
|
let oneByOneDelay = 0;
|
|
32030
32042
|
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 =
|
|
32043
|
+
const customType = getCustomType(parsedParams.custom);
|
|
32032
32044
|
if (parsedParams.customType = customType, totalTime) {
|
|
32033
32045
|
const _totalTime = delay + delayAfter + duration + oneByOneDelay * (this._target.count - 2),
|
|
32034
32046
|
scale = totalTime ? totalTime / _totalTime : 1;
|
|
@@ -32102,6 +32114,7 @@
|
|
|
32102
32114
|
_handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
|
|
32103
32115
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
32104
32116
|
if (custom && customType) {
|
|
32117
|
+
customType = getCustomType(custom);
|
|
32105
32118
|
let customParams = this.resolveValue(customParameters, graphic);
|
|
32106
32119
|
"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
32120
|
width: (null === (_c = graphic.stage) || void 0 === _c ? void 0 : _c.width) || 0,
|
|
@@ -32157,7 +32170,7 @@
|
|
|
32157
32170
|
from = effect.from;
|
|
32158
32171
|
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from);
|
|
32159
32172
|
const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
|
|
32160
|
-
customType = effect.customType;
|
|
32173
|
+
customType = effect.custom ? effect.customType : getCustomType(custom);
|
|
32161
32174
|
this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
|
|
32162
32175
|
}), delayAfterValue > 0 && animate.wait(delayAfterValue);
|
|
32163
32176
|
}
|
|
@@ -41164,7 +41177,31 @@
|
|
|
41164
41177
|
separation: autoHideSeparation
|
|
41165
41178
|
}));
|
|
41166
41179
|
}
|
|
41167
|
-
afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
|
|
41180
|
+
afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
|
|
41181
|
+
var _a;
|
|
41182
|
+
const {
|
|
41183
|
+
layoutRect: layoutRect,
|
|
41184
|
+
autoLabelMaxWidth: autoLabelMaxWidth
|
|
41185
|
+
} = this.attribute;
|
|
41186
|
+
if (!autoLabelMaxWidth || !layoutRect || !labelShapes || 0 === labelShapes.length) return;
|
|
41187
|
+
const rectRight = 0 + layoutRect.width;
|
|
41188
|
+
for (let i = 0; i < labelShapes.length; i++) {
|
|
41189
|
+
const label = labelShapes[i],
|
|
41190
|
+
x = label.attribute.x,
|
|
41191
|
+
align = null !== (_a = label.attribute.textAlign) && void 0 !== _a ? _a : "center";
|
|
41192
|
+
let maxWidth = 0;
|
|
41193
|
+
if ("left" === align) maxWidth = rectRight - x;else if ("right" === align) maxWidth = x - 0;else {
|
|
41194
|
+
const leftDist = x - 0,
|
|
41195
|
+
rightDist = rectRight - x;
|
|
41196
|
+
maxWidth = 2 * Math.max(0, Math.min(leftDist, rightDist));
|
|
41197
|
+
}
|
|
41198
|
+
maxWidth > 0 ? label.setAttributes({
|
|
41199
|
+
maxLineWidth: maxWidth
|
|
41200
|
+
}) : label.setAttributes({
|
|
41201
|
+
maxLineWidth: 0
|
|
41202
|
+
});
|
|
41203
|
+
}
|
|
41204
|
+
}
|
|
41168
41205
|
getTextBaseline(vector) {
|
|
41169
41206
|
return Math.abs(vector[1] / vector[0]) < .3 ? "middle" : vector[1] < 0 ? "bottom" : vector[1] > 0 ? "top" : "middle";
|
|
41170
41207
|
}
|
|
@@ -52979,7 +53016,7 @@
|
|
|
52979
53016
|
select: !0
|
|
52980
53017
|
};
|
|
52981
53018
|
|
|
52982
|
-
const version = "1.0.
|
|
53019
|
+
const version = "1.0.33-alpha.1";
|
|
52983
53020
|
preLoadAllModule();
|
|
52984
53021
|
if (isBrowserEnv()) {
|
|
52985
53022
|
loadBrowserEnv(container);
|