@visactor/vrender 0.18.9 → 0.18.10-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.js +24 -50
- 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,13 +21,14 @@ 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.18.
|
|
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
|
-
|
|
24
|
+
exports.version = "0.18.10-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)(), __exportStar(require("@visactor/vrender-core"), exports),
|
|
34
|
+
__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,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,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,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } 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.18.10-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();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.js
CHANGED
|
@@ -7989,16 +7989,12 @@
|
|
|
7989
7989
|
}, {
|
|
7990
7990
|
key: "mapToCanvasPoint",
|
|
7991
7991
|
value: function mapToCanvasPoint(nativeEvent) {
|
|
7992
|
-
var _a
|
|
7992
|
+
var _a;
|
|
7993
7993
|
var point = null === (_a = this.globalObj) || void 0 === _a ? void 0 : _a.mapToCanvasPoint(nativeEvent, this.domElement);
|
|
7994
7994
|
if (point) return point;
|
|
7995
|
-
var x =
|
|
7996
|
-
y =
|
|
7997
|
-
|
|
7998
|
-
var data = null !== (_b = nativeEvent.changedTouches[0]) && void 0 !== _b ? _b : {};
|
|
7999
|
-
x = data.clientX || 0, y = data.clientY || 0;
|
|
8000
|
-
} else x = nativeEvent.clientX || 0, y = nativeEvent.clientY || 0;
|
|
8001
|
-
var rect = this.domElement.getBoundingClientRect();
|
|
7995
|
+
var x = nativeEvent.clientX,
|
|
7996
|
+
y = nativeEvent.clientY,
|
|
7997
|
+
rect = this.domElement.getBoundingClientRect();
|
|
8002
7998
|
return {
|
|
8003
7999
|
x: x - rect.left,
|
|
8004
8000
|
y: y - rect.top
|
|
@@ -11476,7 +11472,6 @@
|
|
|
11476
11472
|
}, {
|
|
11477
11473
|
key: "loading",
|
|
11478
11474
|
value: function loading() {
|
|
11479
|
-
var _this = this;
|
|
11480
11475
|
setTimeout(function () {
|
|
11481
11476
|
if (!ResourceLoader.isLoading && ResourceLoader.toLoadAueue.length) {
|
|
11482
11477
|
ResourceLoader.isLoading = !0;
|
|
@@ -11502,13 +11497,9 @@
|
|
|
11502
11497
|
return mark.imageLoadFail(url);
|
|
11503
11498
|
});
|
|
11504
11499
|
}), Promise.all(promises).then(function () {
|
|
11505
|
-
ResourceLoader.isLoading = !1,
|
|
11506
|
-
return cb();
|
|
11507
|
-
}), ResourceLoader.loading();
|
|
11500
|
+
ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
11508
11501
|
})["catch"](function (error) {
|
|
11509
|
-
console.error(error), ResourceLoader.isLoading = !1,
|
|
11510
|
-
return cb();
|
|
11511
|
-
}), ResourceLoader.loading();
|
|
11502
|
+
console.error(error), ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
11512
11503
|
});
|
|
11513
11504
|
}
|
|
11514
11505
|
}, 0);
|
|
@@ -11532,11 +11523,6 @@
|
|
|
11532
11523
|
ResourceLoader.toLoadAueue.unshift(elememt[0]);
|
|
11533
11524
|
}
|
|
11534
11525
|
}
|
|
11535
|
-
}, {
|
|
11536
|
-
key: "onLoadSuccess",
|
|
11537
|
-
value: function onLoadSuccess(cb) {
|
|
11538
|
-
this.onLoadSuccessCb.push(cb);
|
|
11539
|
-
}
|
|
11540
11526
|
}]);
|
|
11541
11527
|
return ResourceLoader;
|
|
11542
11528
|
}();
|
|
@@ -11544,7 +11530,7 @@
|
|
|
11544
11530
|
for (var i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
|
|
11545
11531
|
return -1;
|
|
11546
11532
|
}
|
|
11547
|
-
ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = []
|
|
11533
|
+
ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
|
|
11548
11534
|
|
|
11549
11535
|
var tempMatrix = new Matrix(),
|
|
11550
11536
|
tempBounds$1 = new AABBBounds();
|
|
@@ -11677,7 +11663,7 @@
|
|
|
11677
11663
|
key: "tryUpdateGlobalAABBBounds",
|
|
11678
11664
|
value: function tryUpdateGlobalAABBBounds() {
|
|
11679
11665
|
var b = this.AABBBounds;
|
|
11680
|
-
return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this.
|
|
11666
|
+
return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
|
|
11681
11667
|
}
|
|
11682
11668
|
}, {
|
|
11683
11669
|
key: "tryUpdateGlobalTransMatrix",
|
|
@@ -13385,10 +13371,6 @@
|
|
|
13385
13371
|
strokeOpacity = _graphic$attribute$st2 === void 0 ? themeAttributes.strokeOpacity : _graphic$attribute$st2,
|
|
13386
13372
|
_graphic$attribute$vi = _graphic$attribute.visible,
|
|
13387
13373
|
visible = _graphic$attribute$vi === void 0 ? themeAttributes.visible : _graphic$attribute$vi,
|
|
13388
|
-
_graphic$attribute$x = _graphic$attribute.x,
|
|
13389
|
-
originX = _graphic$attribute$x === void 0 ? themeAttributes.x : _graphic$attribute$x,
|
|
13390
|
-
_graphic$attribute$y = _graphic$attribute.y,
|
|
13391
|
-
originY = _graphic$attribute$y === void 0 ? themeAttributes.y : _graphic$attribute$y,
|
|
13392
13374
|
fVisible = fillVisible(opacity, fillOpacity, fill),
|
|
13393
13375
|
sVisible = strokeVisible(opacity, strokeOpacity),
|
|
13394
13376
|
doFill = runFill(fill),
|
|
@@ -13398,7 +13380,7 @@
|
|
|
13398
13380
|
if (!(fVisible || sVisible || fillCb || strokeCb)) return !0;
|
|
13399
13381
|
context.beginPath();
|
|
13400
13382
|
var path = "function" == typeof graphic.pathProxy ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
|
|
13401
|
-
return renderCommandList(path.commandList, context, x, y), context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes), doStroke && (strokeCb ? strokeCb(context, graphic.attribute, themeAttributes) : sVisible && (context.setStrokeStyle(graphic, graphic.attribute, x
|
|
13383
|
+
return renderCommandList(path.commandList, context, x, y), context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes), doStroke && (strokeCb ? strokeCb(context, graphic.attribute, themeAttributes) : sVisible && (context.setStrokeStyle(graphic, graphic.attribute, x, y, themeAttributes), context.stroke())), doFill && (fillCb ? fillCb(context, graphic.attribute, themeAttributes) : fVisible && (context.setCommonStyle(graphic, graphic.attribute, x, y, themeAttributes), context.fill())), !0;
|
|
13402
13384
|
}
|
|
13403
13385
|
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
|
13404
13386
|
var x10 = x1 - x0,
|
|
@@ -20591,9 +20573,7 @@
|
|
|
20591
20573
|
var endSeg = segments[segments.length - 1];
|
|
20592
20574
|
startP = segments[0].points[0], endP = endSeg.points[endSeg.points.length - 1];
|
|
20593
20575
|
} else startP = points[0], endP = points[points.length - 1];
|
|
20594
|
-
|
|
20595
|
-
yTotalLength = abs(endP.y - startP.y);
|
|
20596
|
-
direction = Number.isFinite(xTotalLength + yTotalLength) ? xTotalLength > yTotalLength ? exports.Direction.ROW : exports.Direction.COLUMN : exports.Direction.ROW, drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {
|
|
20576
|
+
direction = abs(endP.x - startP.x) > abs(endP.y - startP.y) ? exports.Direction.ROW : exports.Direction.COLUMN, drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {
|
|
20597
20577
|
offsetX: offsetX,
|
|
20598
20578
|
offsetY: offsetY,
|
|
20599
20579
|
offsetZ: offsetZ,
|
|
@@ -21046,7 +21026,7 @@
|
|
|
21046
21026
|
doStroke && (strokeCb ? strokeCb(context, text.attribute, textAttribute) : sVisible && (context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute), multilineLayout.lines.forEach(function (line) {
|
|
21047
21027
|
context.strokeText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
|
|
21048
21028
|
}))), doFill && (fillCb ? fillCb(context, text.attribute, textAttribute) : fVisible && (context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute), multilineLayout.lines.forEach(function (line) {
|
|
21049
|
-
context.fillText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z), _this2.drawMultiUnderLine(underline, lineThrough, text, (line.leftOffset || 0) +
|
|
21029
|
+
context.fillText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z), _this2.drawMultiUnderLine(underline, lineThrough, text, (line.leftOffset || 0) + x, (line.topOffset || 0) + yOffset + y - textDrawOffsetY("bottom", fontSize) - .05 * fontSize, z, line.width, textAttribute, context);
|
|
21050
21030
|
})));
|
|
21051
21031
|
} else {
|
|
21052
21032
|
text.tryUpdateAABBBounds();
|
|
@@ -21158,6 +21138,8 @@
|
|
|
21158
21138
|
value: function drawMultiUnderLine(underline, lineThrough, text, x, y, z, w, textAttribute, context) {
|
|
21159
21139
|
if (lineThrough + underline <= 0) return;
|
|
21160
21140
|
var _text$attribute4 = text.attribute,
|
|
21141
|
+
_text$attribute4$text = _text$attribute4.textAlign,
|
|
21142
|
+
textAlign = _text$attribute4$text === void 0 ? textAttribute.textAlign : _text$attribute4$text,
|
|
21161
21143
|
_text$attribute4$font = _text$attribute4.fontSize,
|
|
21162
21144
|
fontSize = _text$attribute4$font === void 0 ? textAttribute.fontSize : _text$attribute4$font,
|
|
21163
21145
|
_text$attribute4$fill = _text$attribute4.fill,
|
|
@@ -21170,6 +21152,7 @@
|
|
|
21170
21152
|
underlineDash = _text$attribute4$unde2 === void 0 ? textAttribute.underlineDash : _text$attribute4$unde2,
|
|
21171
21153
|
_text$attribute4$fill2 = _text$attribute4.fillOpacity,
|
|
21172
21154
|
fillOpacity = _text$attribute4$fill2 === void 0 ? textAttribute.fillOpacity : _text$attribute4$fill2,
|
|
21155
|
+
offsetX = textDrawOffsetX(textAlign, w),
|
|
21173
21156
|
offsetY = textLayoutOffsetY("alphabetic", fontSize, fontSize),
|
|
21174
21157
|
attribute = {
|
|
21175
21158
|
lineWidth: 0,
|
|
@@ -21181,12 +21164,12 @@
|
|
|
21181
21164
|
if (underline) {
|
|
21182
21165
|
attribute.lineWidth = underline, context.setStrokeStyle(text, attribute, x, y, textAttribute), context.setLineDash(underlineDash), context.beginPath();
|
|
21183
21166
|
var dy = y + offsetY + fontSize + deltaY + underlineOffset;
|
|
21184
|
-
context.moveTo(x +
|
|
21167
|
+
context.moveTo(x + offsetX, dy, z), context.lineTo(x + offsetX + w, dy, z), context.stroke();
|
|
21185
21168
|
}
|
|
21186
21169
|
if (deltaY = -1, lineThrough) {
|
|
21187
21170
|
attribute.lineWidth = lineThrough, context.setStrokeStyle(text, attribute, x, y, textAttribute), context.beginPath();
|
|
21188
21171
|
var _dy2 = y + offsetY + fontSize / 2 + deltaY;
|
|
21189
|
-
context.moveTo(x +
|
|
21172
|
+
context.moveTo(x + offsetX, _dy2, z), context.lineTo(x + offsetX + w, _dy2, z), context.stroke();
|
|
21190
21173
|
}
|
|
21191
21174
|
}
|
|
21192
21175
|
}]);
|
|
@@ -30865,8 +30848,7 @@
|
|
|
30865
30848
|
}, {
|
|
30866
30849
|
key: "getStyle",
|
|
30867
30850
|
value: function getStyle() {
|
|
30868
|
-
|
|
30869
|
-
return null !== (_a = this.canvas.nativeCanvas.style) && void 0 !== _a ? _a : {};
|
|
30851
|
+
return this.canvas.nativeCanvas.style;
|
|
30870
30852
|
}
|
|
30871
30853
|
}, {
|
|
30872
30854
|
key: "setStyle",
|
|
@@ -31011,20 +30993,12 @@
|
|
|
31011
30993
|
_createClass(BrowserEnvContribution, [{
|
|
31012
30994
|
key: "mapToCanvasPoint",
|
|
31013
30995
|
value: function mapToCanvasPoint(nativeEvent, domElement) {
|
|
31014
|
-
var _a
|
|
31015
|
-
var clientX = 0,
|
|
31016
|
-
clientY = 0,
|
|
31017
|
-
offsetX = 0,
|
|
31018
|
-
offsetY = 0;
|
|
31019
|
-
if (nativeEvent.changedTouches) {
|
|
31020
|
-
var data = null !== (_a = nativeEvent.changedTouches[0]) && void 0 !== _a ? _a : {};
|
|
31021
|
-
clientX = data.clientX || 0, clientY = data.clientY || 0, offsetX = clientX, offsetY = clientY;
|
|
31022
|
-
} else clientX = nativeEvent.clientX || 0, clientY = nativeEvent.clientY || 0, offsetX = nativeEvent.offsetX || 0, offsetY = nativeEvent.offsetY || 0;
|
|
30996
|
+
var _a;
|
|
31023
30997
|
if (domElement) {
|
|
31024
|
-
var x = clientX,
|
|
31025
|
-
y = clientY,
|
|
30998
|
+
var x = nativeEvent.clientX,
|
|
30999
|
+
y = nativeEvent.clientY,
|
|
31026
31000
|
rect = domElement.getBoundingClientRect(),
|
|
31027
|
-
nativeCanvas = null === (
|
|
31001
|
+
nativeCanvas = null === (_a = domElement.getNativeHandler) || void 0 === _a ? void 0 : _a.call(domElement).nativeCanvas;
|
|
31028
31002
|
var scaleX, scaleY;
|
|
31029
31003
|
return nativeCanvas && (scaleX = rect.width / nativeCanvas.offsetWidth, scaleY = rect.height / nativeCanvas.offsetHeight), {
|
|
31030
31004
|
x: (x - rect.left) / (isValidNumber$1(scaleX) ? scaleX : 1),
|
|
@@ -31032,8 +31006,8 @@
|
|
|
31032
31006
|
};
|
|
31033
31007
|
}
|
|
31034
31008
|
return {
|
|
31035
|
-
x: offsetX,
|
|
31036
|
-
y: offsetY
|
|
31009
|
+
x: nativeEvent.offsetX,
|
|
31010
|
+
y: nativeEvent.offsetY
|
|
31037
31011
|
};
|
|
31038
31012
|
}
|
|
31039
31013
|
}, {
|
|
@@ -35362,7 +35336,7 @@
|
|
|
35362
35336
|
|
|
35363
35337
|
var roughModule = _roughModule;
|
|
35364
35338
|
|
|
35365
|
-
const version = "0.18.
|
|
35339
|
+
const version = "0.18.10-alpha.1";
|
|
35366
35340
|
preLoadAllModule();
|
|
35367
35341
|
if (isBrowserEnv()) {
|
|
35368
35342
|
loadBrowserEnv(container);
|