@visactor/vrender 0.22.3 → 0.22.5-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 +28 -7
- package/dist/index.js +28 -7
- 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 +5 -5
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");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.22.
|
|
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 = "0.22.5-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_core_1.registerFlexLayoutPlugin)(), (0, vrender_core_1.registerViewTransform3dPlugin)(),
|
|
34
35
|
(0, vrender_core_1.registerHtmlAttributePlugin)(), (0, vrender_core_1.registerReactAttributePlugin)(),
|
|
35
36
|
(0, vrender_core_1.registerDirectionalLight)(), (0, vrender_core_1.registerOrthoCamera)(),
|
|
36
37
|
__exportStar(require("@visactor/vrender-core"), exports), __exportStar(require("@visactor/vrender-kits"), exports);
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,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;AAEnB,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;AACtB,yDAAuC;AACvC,yDAAuC","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 } 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';\n// 导出版本号\nexport const version = \"0.22.5-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();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -15622,6 +15622,7 @@ class DefaultBaseTextureRenderContribution {
|
|
|
15622
15622
|
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
15623
15623
|
}
|
|
15624
15624
|
drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
|
|
15625
|
+
var _a;
|
|
15625
15626
|
const {
|
|
15626
15627
|
textureRatio = graphicAttribute.textureRatio,
|
|
15627
15628
|
textureOptions = null
|
|
@@ -15653,12 +15654,32 @@ class DefaultBaseTextureRenderContribution {
|
|
|
15653
15654
|
pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
|
|
15654
15655
|
}
|
|
15655
15656
|
if (textureOptions && textureOptions.dynamicTexture) {
|
|
15656
|
-
context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
|
|
15657
15657
|
const {
|
|
15658
|
-
gridConfig = {}
|
|
15658
|
+
gridConfig = {},
|
|
15659
|
+
useNewCanvas: useNewCanvas
|
|
15659
15660
|
} = textureOptions,
|
|
15660
|
-
b = graphic.AABBBounds
|
|
15661
|
-
|
|
15661
|
+
b = graphic.AABBBounds;
|
|
15662
|
+
x = b.x1, y = b.y1;
|
|
15663
|
+
const originalContext = context;
|
|
15664
|
+
let newCanvas;
|
|
15665
|
+
if (useNewCanvas) {
|
|
15666
|
+
newCanvas = canvasAllocate.allocate({
|
|
15667
|
+
width: b.width(),
|
|
15668
|
+
height: b.height(),
|
|
15669
|
+
dpr: context.dpr
|
|
15670
|
+
});
|
|
15671
|
+
const ctx = newCanvas.getContext("2d");
|
|
15672
|
+
ctx.clearRect(0, 0, b.width(), b.height()), x = 0, y = 0, context = ctx;
|
|
15673
|
+
}
|
|
15674
|
+
if (originalContext.save(), graphic.parent && !graphic.transMatrix.onlyTranslate()) {
|
|
15675
|
+
const {
|
|
15676
|
+
scrollX = 0,
|
|
15677
|
+
scrollY = 0
|
|
15678
|
+
} = graphic.parent.attribute;
|
|
15679
|
+
originalContext.setTransformFromMatrix(graphic.parent.globalTransMatrix), originalContext.translate(scrollX, scrollY, !0);
|
|
15680
|
+
}
|
|
15681
|
+
originalContext.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), originalContext.clip();
|
|
15682
|
+
const width = b.width(),
|
|
15662
15683
|
height = b.height(),
|
|
15663
15684
|
padding = texturePadding,
|
|
15664
15685
|
cellSize = textureSize,
|
|
@@ -15677,9 +15698,9 @@ class DefaultBaseTextureRenderContribution {
|
|
|
15677
15698
|
for (let i = 0; i < gridRows; i++) for (let j = 0; j < gridColumns; j++) {
|
|
15678
15699
|
const _x = x + cellSize / 2 + j * cellSize,
|
|
15679
15700
|
_y = y + cellSize / 2 + i * cellSize;
|
|
15680
|
-
context.beginPath(), !1 === parsedPath.draw(context, Math.min(sizeW - gutterColumn, sizeH - gutterRow), _x, _y, 0) && context.closePath(), context.fillStyle = textureColor, textureOptions.dynamicTexture(context, i, j, gridRows, gridColumns, textureRatio, graphic);
|
|
15701
|
+
null === (_a = textureOptions.beforeDynamicTexture) || void 0 === _a || _a.call(textureOptions, context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height()), context.beginPath(), !1 === parsedPath.draw(context, Math.min(sizeW - gutterColumn, sizeH - gutterRow), _x, _y, 0) && context.closePath(), context.fillStyle = textureColor, textureOptions.dynamicTexture(context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height());
|
|
15681
15702
|
}
|
|
15682
|
-
|
|
15703
|
+
useNewCanvas && (originalContext.globalAlpha = 1, originalContext.drawImage(newCanvas.nativeCanvas, 0, 0, newCanvas.nativeCanvas.width, newCanvas.nativeCanvas.height, b.x1, b.y1, b.width() * originalContext.dpr, b.height() * originalContext.dpr)), originalContext.restore();
|
|
15683
15704
|
} else if (pattern) context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore();else if ("wave" === texture) {
|
|
15684
15705
|
context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
|
|
15685
15706
|
const b = graphic.AABBBounds;
|
|
@@ -31613,7 +31634,7 @@ function particleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic)
|
|
|
31613
31634
|
|
|
31614
31635
|
const roughModule = _roughModule;
|
|
31615
31636
|
|
|
31616
|
-
const version = "0.22.
|
|
31637
|
+
const version = "0.22.5-alpha.1";
|
|
31617
31638
|
preLoadAllModule();
|
|
31618
31639
|
if (isBrowserEnv()) {
|
|
31619
31640
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -15628,6 +15628,7 @@
|
|
|
15628
15628
|
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
15629
15629
|
}
|
|
15630
15630
|
drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
|
|
15631
|
+
var _a;
|
|
15631
15632
|
const {
|
|
15632
15633
|
textureRatio = graphicAttribute.textureRatio,
|
|
15633
15634
|
textureOptions = null
|
|
@@ -15659,12 +15660,32 @@
|
|
|
15659
15660
|
pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
|
|
15660
15661
|
}
|
|
15661
15662
|
if (textureOptions && textureOptions.dynamicTexture) {
|
|
15662
|
-
context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
|
|
15663
15663
|
const {
|
|
15664
|
-
gridConfig = {}
|
|
15664
|
+
gridConfig = {},
|
|
15665
|
+
useNewCanvas: useNewCanvas
|
|
15665
15666
|
} = textureOptions,
|
|
15666
|
-
b = graphic.AABBBounds
|
|
15667
|
-
|
|
15667
|
+
b = graphic.AABBBounds;
|
|
15668
|
+
x = b.x1, y = b.y1;
|
|
15669
|
+
const originalContext = context;
|
|
15670
|
+
let newCanvas;
|
|
15671
|
+
if (useNewCanvas) {
|
|
15672
|
+
newCanvas = canvasAllocate.allocate({
|
|
15673
|
+
width: b.width(),
|
|
15674
|
+
height: b.height(),
|
|
15675
|
+
dpr: context.dpr
|
|
15676
|
+
});
|
|
15677
|
+
const ctx = newCanvas.getContext("2d");
|
|
15678
|
+
ctx.clearRect(0, 0, b.width(), b.height()), x = 0, y = 0, context = ctx;
|
|
15679
|
+
}
|
|
15680
|
+
if (originalContext.save(), graphic.parent && !graphic.transMatrix.onlyTranslate()) {
|
|
15681
|
+
const {
|
|
15682
|
+
scrollX = 0,
|
|
15683
|
+
scrollY = 0
|
|
15684
|
+
} = graphic.parent.attribute;
|
|
15685
|
+
originalContext.setTransformFromMatrix(graphic.parent.globalTransMatrix), originalContext.translate(scrollX, scrollY, !0);
|
|
15686
|
+
}
|
|
15687
|
+
originalContext.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), originalContext.clip();
|
|
15688
|
+
const width = b.width(),
|
|
15668
15689
|
height = b.height(),
|
|
15669
15690
|
padding = texturePadding,
|
|
15670
15691
|
cellSize = textureSize,
|
|
@@ -15683,9 +15704,9 @@
|
|
|
15683
15704
|
for (let i = 0; i < gridRows; i++) for (let j = 0; j < gridColumns; j++) {
|
|
15684
15705
|
const _x = x + cellSize / 2 + j * cellSize,
|
|
15685
15706
|
_y = y + cellSize / 2 + i * cellSize;
|
|
15686
|
-
context.beginPath(), !1 === parsedPath.draw(context, Math.min(sizeW - gutterColumn, sizeH - gutterRow), _x, _y, 0) && context.closePath(), context.fillStyle = textureColor, textureOptions.dynamicTexture(context, i, j, gridRows, gridColumns, textureRatio, graphic);
|
|
15707
|
+
null === (_a = textureOptions.beforeDynamicTexture) || void 0 === _a || _a.call(textureOptions, context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height()), context.beginPath(), !1 === parsedPath.draw(context, Math.min(sizeW - gutterColumn, sizeH - gutterRow), _x, _y, 0) && context.closePath(), context.fillStyle = textureColor, textureOptions.dynamicTexture(context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height());
|
|
15687
15708
|
}
|
|
15688
|
-
|
|
15709
|
+
useNewCanvas && (originalContext.globalAlpha = 1, originalContext.drawImage(newCanvas.nativeCanvas, 0, 0, newCanvas.nativeCanvas.width, newCanvas.nativeCanvas.height, b.x1, b.y1, b.width() * originalContext.dpr, b.height() * originalContext.dpr)), originalContext.restore();
|
|
15689
15710
|
} else if (pattern) context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore();else if ("wave" === texture) {
|
|
15690
15711
|
context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
|
|
15691
15712
|
const b = graphic.AABBBounds;
|
|
@@ -31619,7 +31640,7 @@
|
|
|
31619
31640
|
|
|
31620
31641
|
const roughModule = _roughModule;
|
|
31621
31642
|
|
|
31622
|
-
const version = "0.22.
|
|
31643
|
+
const version = "0.22.5-alpha.1";
|
|
31623
31644
|
preLoadAllModule();
|
|
31624
31645
|
if (isBrowserEnv()) {
|
|
31625
31646
|
loadBrowserEnv(container);
|