@visactor/vrender 1.0.40 → 1.0.41-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 +36 -12
- package/dist/index.js +36 -12
- 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.41-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.41-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
|
@@ -15994,9 +15994,10 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
|
|
|
15994
15994
|
}), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
15995
15995
|
} else {
|
|
15996
15996
|
const {
|
|
15997
|
-
backgroundCornerRadius: backgroundCornerRadius
|
|
15997
|
+
backgroundCornerRadius: backgroundCornerRadius,
|
|
15998
|
+
backgroundOpacity = 1
|
|
15998
15999
|
} = graphic.attribute;
|
|
15999
|
-
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
16000
|
+
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.globalAlpha = backgroundOpacity, context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
16000
16001
|
}
|
|
16001
16002
|
shouldReCalBounds && boundsAllocate.free(b), restore();
|
|
16002
16003
|
}
|
|
@@ -39920,17 +39921,21 @@ class AxisBase extends AnimateComponent {
|
|
|
39920
39921
|
} = this.attribute.label;
|
|
39921
39922
|
textStyle = isFunction$1(textStyle) ? merge({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer)) : textStyle;
|
|
39922
39923
|
const labelAlign = this.getLabelAlign(vector, inside, textStyle.angle);
|
|
39923
|
-
|
|
39924
|
+
textStyle = merge(labelAlign, textStyle), isFunction$1(textStyle.text) && (textStyle.text = textStyle.text({
|
|
39924
39925
|
label: tickDatum.label,
|
|
39925
39926
|
value: tickDatum.rawValue,
|
|
39926
39927
|
index: tickDatum.index,
|
|
39927
39928
|
layer: layer
|
|
39928
|
-
}))
|
|
39929
|
+
}));
|
|
39930
|
+
let reactStyle = textStyle.react;
|
|
39931
|
+
return isFunction$1(reactStyle) && (reactStyle = reactStyle(tickDatum, index, tickData, layer)), Object.assign(Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector, textContent, textStyle)), {
|
|
39929
39932
|
text: null != text ? text : textContent,
|
|
39930
39933
|
_originText: tickDatum.label,
|
|
39931
39934
|
lineHeight: null == textStyle ? void 0 : textStyle.fontSize,
|
|
39932
39935
|
type: type
|
|
39933
|
-
}), textStyle)
|
|
39936
|
+
}), textStyle), {
|
|
39937
|
+
react: reactStyle
|
|
39938
|
+
});
|
|
39934
39939
|
}
|
|
39935
39940
|
getLabelPosition(point, vector, text, style) {
|
|
39936
39941
|
return point;
|
|
@@ -43519,8 +43524,9 @@ class LabelBase extends AnimateComponent {
|
|
|
43519
43524
|
const label = labels[i];
|
|
43520
43525
|
if (!label) continue;
|
|
43521
43526
|
const baseMark = this.getRelatedGraphic(label.attribute);
|
|
43522
|
-
let backgroundColor = baseMark.getAttributes(!0).fill
|
|
43523
|
-
|
|
43527
|
+
let backgroundColor = baseMark.getAttributes(!0).fill;
|
|
43528
|
+
const backgroundOpacity = baseMark.getAttributes(!0).fillOpacity;
|
|
43529
|
+
let foregroundColor = label.attribute.fill;
|
|
43524
43530
|
if (isObject$1(backgroundColor) && backgroundColor.gradient) {
|
|
43525
43531
|
const firstStopColor = null === (_g = null === (_f = backgroundColor.stops) || void 0 === _f ? void 0 : _f[0]) || void 0 === _g ? void 0 : _g.color;
|
|
43526
43532
|
firstStopColor && (backgroundColor = firstStopColor, foregroundColor = firstStopColor);
|
|
@@ -43534,11 +43540,26 @@ class LabelBase extends AnimateComponent {
|
|
|
43534
43540
|
if (fill && label.setAttributes({
|
|
43535
43541
|
fill: fill
|
|
43536
43542
|
}), 0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
|
|
43537
|
-
|
|
43538
|
-
|
|
43539
|
-
|
|
43540
|
-
|
|
43543
|
+
if ("background" === interactInvertType) label.setAttributes({
|
|
43544
|
+
stroke: !1
|
|
43545
|
+
});else {
|
|
43546
|
+
const stroke = smartInvertStrategy(strokeStrategy, backgroundColor, invertColor, similarColor);
|
|
43547
|
+
stroke && label.setAttributes({
|
|
43548
|
+
stroke: stroke
|
|
43549
|
+
});
|
|
43550
|
+
}
|
|
43541
43551
|
} else if (isIntersect && "none" !== interactInvertType) {
|
|
43552
|
+
if ("background" === interactInvertType) {
|
|
43553
|
+
const fill = smartInvertStrategy(fillStrategy, backgroundColor, invertColor, similarColor);
|
|
43554
|
+
fill && label.setAttributes({
|
|
43555
|
+
fill: fill
|
|
43556
|
+
}), label.setAttributes({
|
|
43557
|
+
stroke: !1,
|
|
43558
|
+
background: backgroundColor,
|
|
43559
|
+
backgroundOpacity: backgroundOpacity
|
|
43560
|
+
});
|
|
43561
|
+
continue;
|
|
43562
|
+
}
|
|
43542
43563
|
if (0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
|
|
43543
43564
|
if (label.attribute.stroke) {
|
|
43544
43565
|
label.setAttributes({
|
|
@@ -43555,6 +43576,9 @@ class LabelBase extends AnimateComponent {
|
|
|
43555
43576
|
stroke: stroke
|
|
43556
43577
|
});
|
|
43557
43578
|
}
|
|
43579
|
+
!1 === isInside && "background" === interactInvertType && label.setAttributes({
|
|
43580
|
+
background: null
|
|
43581
|
+
});
|
|
43558
43582
|
}
|
|
43559
43583
|
}
|
|
43560
43584
|
_canPlaceInside(textBound, shapeBound) {
|
|
@@ -53053,7 +53077,7 @@ TableSeriesNumber.defaultAttributes = {
|
|
|
53053
53077
|
select: !0
|
|
53054
53078
|
};
|
|
53055
53079
|
|
|
53056
|
-
const version = "1.0.
|
|
53080
|
+
const version = "1.0.41-alpha.1";
|
|
53057
53081
|
preLoadAllModule();
|
|
53058
53082
|
if (isBrowserEnv()) {
|
|
53059
53083
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -16000,9 +16000,10 @@
|
|
|
16000
16000
|
}), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
16001
16001
|
} else {
|
|
16002
16002
|
const {
|
|
16003
|
-
backgroundCornerRadius: backgroundCornerRadius
|
|
16003
|
+
backgroundCornerRadius: backgroundCornerRadius,
|
|
16004
|
+
backgroundOpacity = 1
|
|
16004
16005
|
} = graphic.attribute;
|
|
16005
|
-
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
16006
|
+
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.globalAlpha = backgroundOpacity, context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
16006
16007
|
}
|
|
16007
16008
|
shouldReCalBounds && boundsAllocate.free(b), restore();
|
|
16008
16009
|
}
|
|
@@ -39926,17 +39927,21 @@
|
|
|
39926
39927
|
} = this.attribute.label;
|
|
39927
39928
|
textStyle = isFunction$1(textStyle) ? merge({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer)) : textStyle;
|
|
39928
39929
|
const labelAlign = this.getLabelAlign(vector, inside, textStyle.angle);
|
|
39929
|
-
|
|
39930
|
+
textStyle = merge(labelAlign, textStyle), isFunction$1(textStyle.text) && (textStyle.text = textStyle.text({
|
|
39930
39931
|
label: tickDatum.label,
|
|
39931
39932
|
value: tickDatum.rawValue,
|
|
39932
39933
|
index: tickDatum.index,
|
|
39933
39934
|
layer: layer
|
|
39934
|
-
}))
|
|
39935
|
+
}));
|
|
39936
|
+
let reactStyle = textStyle.react;
|
|
39937
|
+
return isFunction$1(reactStyle) && (reactStyle = reactStyle(tickDatum, index, tickData, layer)), Object.assign(Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector, textContent, textStyle)), {
|
|
39935
39938
|
text: null != text ? text : textContent,
|
|
39936
39939
|
_originText: tickDatum.label,
|
|
39937
39940
|
lineHeight: null == textStyle ? void 0 : textStyle.fontSize,
|
|
39938
39941
|
type: type
|
|
39939
|
-
}), textStyle)
|
|
39942
|
+
}), textStyle), {
|
|
39943
|
+
react: reactStyle
|
|
39944
|
+
});
|
|
39940
39945
|
}
|
|
39941
39946
|
getLabelPosition(point, vector, text, style) {
|
|
39942
39947
|
return point;
|
|
@@ -43525,8 +43530,9 @@
|
|
|
43525
43530
|
const label = labels[i];
|
|
43526
43531
|
if (!label) continue;
|
|
43527
43532
|
const baseMark = this.getRelatedGraphic(label.attribute);
|
|
43528
|
-
let backgroundColor = baseMark.getAttributes(!0).fill
|
|
43529
|
-
|
|
43533
|
+
let backgroundColor = baseMark.getAttributes(!0).fill;
|
|
43534
|
+
const backgroundOpacity = baseMark.getAttributes(!0).fillOpacity;
|
|
43535
|
+
let foregroundColor = label.attribute.fill;
|
|
43530
43536
|
if (isObject$1(backgroundColor) && backgroundColor.gradient) {
|
|
43531
43537
|
const firstStopColor = null === (_g = null === (_f = backgroundColor.stops) || void 0 === _f ? void 0 : _f[0]) || void 0 === _g ? void 0 : _g.color;
|
|
43532
43538
|
firstStopColor && (backgroundColor = firstStopColor, foregroundColor = firstStopColor);
|
|
@@ -43540,11 +43546,26 @@
|
|
|
43540
43546
|
if (fill && label.setAttributes({
|
|
43541
43547
|
fill: fill
|
|
43542
43548
|
}), 0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
|
|
43543
|
-
|
|
43544
|
-
|
|
43545
|
-
|
|
43546
|
-
|
|
43549
|
+
if ("background" === interactInvertType) label.setAttributes({
|
|
43550
|
+
stroke: !1
|
|
43551
|
+
});else {
|
|
43552
|
+
const stroke = smartInvertStrategy(strokeStrategy, backgroundColor, invertColor, similarColor);
|
|
43553
|
+
stroke && label.setAttributes({
|
|
43554
|
+
stroke: stroke
|
|
43555
|
+
});
|
|
43556
|
+
}
|
|
43547
43557
|
} else if (isIntersect && "none" !== interactInvertType) {
|
|
43558
|
+
if ("background" === interactInvertType) {
|
|
43559
|
+
const fill = smartInvertStrategy(fillStrategy, backgroundColor, invertColor, similarColor);
|
|
43560
|
+
fill && label.setAttributes({
|
|
43561
|
+
fill: fill
|
|
43562
|
+
}), label.setAttributes({
|
|
43563
|
+
stroke: !1,
|
|
43564
|
+
background: backgroundColor,
|
|
43565
|
+
backgroundOpacity: backgroundOpacity
|
|
43566
|
+
});
|
|
43567
|
+
continue;
|
|
43568
|
+
}
|
|
43548
43569
|
if (0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
|
|
43549
43570
|
if (label.attribute.stroke) {
|
|
43550
43571
|
label.setAttributes({
|
|
@@ -43561,6 +43582,9 @@
|
|
|
43561
43582
|
stroke: stroke
|
|
43562
43583
|
});
|
|
43563
43584
|
}
|
|
43585
|
+
!1 === isInside && "background" === interactInvertType && label.setAttributes({
|
|
43586
|
+
background: null
|
|
43587
|
+
});
|
|
43564
43588
|
}
|
|
43565
43589
|
}
|
|
43566
43590
|
_canPlaceInside(textBound, shapeBound) {
|
|
@@ -53059,7 +53083,7 @@
|
|
|
53059
53083
|
select: !0
|
|
53060
53084
|
};
|
|
53061
53085
|
|
|
53062
|
-
const version = "1.0.
|
|
53086
|
+
const version = "1.0.41-alpha.1";
|
|
53063
53087
|
preLoadAllModule();
|
|
53064
53088
|
if (isBrowserEnv()) {
|
|
53065
53089
|
loadBrowserEnv(container);
|