@visactor/vrender 0.17.0-alpha.3 → 0.17.0-alpha.4
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 +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.js +19 -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 +6 -6
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,5 +21,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.17.0-alpha.
|
|
24
|
+
exports.version = "0.17.0-alpha.4", (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container),
|
|
25
25
|
__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,yDAAmD;AACnD,yDAAwD;AAG3C,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;AAE1B,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { loadBrowserEnv } from '@visactor/vrender-kits';\n\n// 导出版本号\nexport const version = \"0.17.0-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAmD;AACnD,yDAAwD;AAG3C,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;AAE1B,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { loadBrowserEnv } from '@visactor/vrender-kits';\n\n// 导出版本号\nexport const version = \"0.17.0-alpha.4\";\n\nloadBrowserEnv(container);\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.js
CHANGED
|
@@ -14642,32 +14642,37 @@
|
|
|
14642
14642
|
}(BaseSymbol);
|
|
14643
14643
|
var close$1 = new CloseSymbol();
|
|
14644
14644
|
|
|
14645
|
-
function
|
|
14645
|
+
function rectSizeArray(ctx, size, x, y) {
|
|
14646
14646
|
return ctx.rect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]), !1;
|
|
14647
14647
|
}
|
|
14648
|
+
function rectSize(ctx, size, x, y) {
|
|
14649
|
+
var w = size,
|
|
14650
|
+
h = size / 2;
|
|
14651
|
+
return ctx.rect(x - w / 2, y - h / 2, w, h), !1;
|
|
14652
|
+
}
|
|
14648
14653
|
var RectSymbol = /*#__PURE__*/function (_BaseSymbol) {
|
|
14649
14654
|
_inherits(RectSymbol, _BaseSymbol);
|
|
14650
14655
|
var _super = _createSuper(RectSymbol);
|
|
14651
14656
|
function RectSymbol() {
|
|
14652
14657
|
var _this;
|
|
14653
14658
|
_classCallCheck(this, RectSymbol);
|
|
14654
|
-
_this = _super.apply(this, arguments), _this.type = "rect", _this.pathStr = "M-0.5,-0.
|
|
14659
|
+
_this = _super.apply(this, arguments), _this.type = "rect", _this.pathStr = "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z";
|
|
14655
14660
|
return _this;
|
|
14656
14661
|
}
|
|
14657
14662
|
_createClass(RectSymbol, [{
|
|
14658
14663
|
key: "draw",
|
|
14659
14664
|
value: function draw(ctx, size, x, y) {
|
|
14660
|
-
return
|
|
14665
|
+
return isNumber$2(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
|
|
14661
14666
|
}
|
|
14662
14667
|
}, {
|
|
14663
14668
|
key: "drawOffset",
|
|
14664
14669
|
value: function drawOffset(ctx, size, x, y, offset) {
|
|
14665
|
-
return
|
|
14670
|
+
return isNumber$2(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
|
|
14666
14671
|
}
|
|
14667
14672
|
}]);
|
|
14668
14673
|
return RectSymbol;
|
|
14669
14674
|
}(BaseSymbol);
|
|
14670
|
-
var rect
|
|
14675
|
+
var rect = new RectSymbol();
|
|
14671
14676
|
|
|
14672
14677
|
var tempBounds = new AABBBounds();
|
|
14673
14678
|
var CustomSymbolClass = /*#__PURE__*/function () {
|
|
@@ -14706,7 +14711,7 @@
|
|
|
14706
14711
|
return CustomSymbolClass;
|
|
14707
14712
|
}();
|
|
14708
14713
|
|
|
14709
|
-
var builtinSymbols = [circle$1, cross$1, diamond$1, square$1, thinTriangle$1, triangle, star$1, arrow$1, wedge$1, stroke$1, wye$1, triangleLeft, triangleRight, triangleUp, triangleDown, arrow2Left$1, arrow2Right$1, arrow2Up$1, arrow2Down$1, rect
|
|
14714
|
+
var builtinSymbols = [circle$1, cross$1, diamond$1, square$1, thinTriangle$1, triangle, star$1, arrow$1, wedge$1, stroke$1, wye$1, triangleLeft, triangleRight, triangleUp, triangleDown, arrow2Left$1, arrow2Right$1, arrow2Up$1, arrow2Down$1, rect, lineV$1, lineH$1, close$1];
|
|
14710
14715
|
var builtinSymbolsMap = {};
|
|
14711
14716
|
builtinSymbols.forEach(function (symbol) {
|
|
14712
14717
|
builtinSymbolsMap[symbol.type] = symbol;
|
|
@@ -14714,7 +14719,6 @@
|
|
|
14714
14719
|
var builtInSymbolStrMap = {
|
|
14715
14720
|
arrowLeft: "M 0.25 -0.5 L -0.25 0 l 0.5 0.5",
|
|
14716
14721
|
arrowRight: "M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",
|
|
14717
|
-
rect: "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z",
|
|
14718
14722
|
rectRound: "M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",
|
|
14719
14723
|
roundLine: "M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"
|
|
14720
14724
|
};
|
|
@@ -15958,7 +15962,8 @@
|
|
|
15958
15962
|
var _this2 = this;
|
|
15959
15963
|
var _a;
|
|
15960
15964
|
var _this$attribute = this.attribute,
|
|
15961
|
-
|
|
15965
|
+
_this$attribute$textC = _this$attribute.textConfig,
|
|
15966
|
+
textConfig = _this$attribute$textC === void 0 ? [] : _this$attribute$textC,
|
|
15962
15967
|
maxWidth = _this$attribute.maxWidth,
|
|
15963
15968
|
maxHeight = _this$attribute.maxHeight,
|
|
15964
15969
|
width = _this$attribute.width,
|
|
@@ -23300,7 +23305,9 @@
|
|
|
23300
23305
|
canvas: params.canvas
|
|
23301
23306
|
}), _this._viewBox = new AABBBounds(), params.viewBox ? _this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2) : _this._viewBox.setValue(0, 0, _this.width, _this.height), _this.state = "normal", _this.renderCount = 0, _this._subView = !(_this._viewBox.width() === _this.width && _this._viewBox.height() === _this.height), _this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, _this.appendChild(_this.layerService.createLayer(_assertThisInitialized(_this), {
|
|
23302
23307
|
main: !0
|
|
23303
|
-
})), _this.nextFrameRenderLayerSet = new Set(), _this.willNextFrameRender = !1, _this.stage = _assertThisInitialized(_this), _this.renderStyle = params.renderStyle, params.autoRender && _this.enableAutoRender(), !1 === params.disableDirtyBounds && _this.enableDirtyBounds(), params.enableHtmlAttribute && _this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && _this.enableLayout(), _this.hooks.beforeRender.tap("constructor", _this.beforeRender), _this.hooks.afterRender.tap("constructor", _this.afterRender), _this._beforeRender = params.beforeRender, _this._afterRender = params.afterRender, _this.ticker = params.ticker || defaultTicker, _this.supportInteractiveLayer = !1 !== params.interactiveLayer, _this.timeline = new DefaultTimeline(), _this.ticker.addTimeline(_this.timeline), _this.timeline.pause(), _this.optmize(params.optimize)
|
|
23308
|
+
})), _this.nextFrameRenderLayerSet = new Set(), _this.willNextFrameRender = !1, _this.stage = _assertThisInitialized(_this), _this.renderStyle = params.renderStyle, params.autoRender && _this.enableAutoRender(), !1 === params.disableDirtyBounds && _this.enableDirtyBounds(), params.enableHtmlAttribute && _this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && _this.enableLayout(), _this.hooks.beforeRender.tap("constructor", _this.beforeRender), _this.hooks.afterRender.tap("constructor", _this.afterRender), _this._beforeRender = params.beforeRender, _this._afterRender = params.afterRender, _this.ticker = params.ticker || defaultTicker, _this.supportInteractiveLayer = !1 !== params.interactiveLayer, _this.timeline = new DefaultTimeline(), _this.ticker.addTimeline(_this.timeline), _this.timeline.pause(), _this.optmize(params.optimize), params.background && isString$1(_this._background) && _this._background.includes("/") && _this.setAttributes({
|
|
23309
|
+
background: _this._background
|
|
23310
|
+
});
|
|
23304
23311
|
return _this;
|
|
23305
23312
|
}
|
|
23306
23313
|
_createClass(Stage, [{
|
|
@@ -28236,7 +28243,7 @@
|
|
|
28236
28243
|
var scaleX, scaleY;
|
|
28237
28244
|
return nativeCanvas && (scaleX = rect.width / nativeCanvas.offsetWidth, scaleY = rect.height / nativeCanvas.offsetHeight), {
|
|
28238
28245
|
x: (x - rect.left) / (isValidNumber$1(scaleX) ? scaleX : 1),
|
|
28239
|
-
y: (y - rect.top) / (isValidNumber$1(scaleY) ?
|
|
28246
|
+
y: (y - rect.top) / (isValidNumber$1(scaleY) ? scaleY : 1)
|
|
28240
28247
|
};
|
|
28241
28248
|
}
|
|
28242
28249
|
return {
|
|
@@ -31166,7 +31173,7 @@
|
|
|
31166
31173
|
width = data.width, height = data.height;
|
|
31167
31174
|
}
|
|
31168
31175
|
var dpr = params.dpr;
|
|
31169
|
-
if (
|
|
31176
|
+
if (null == dpr) {
|
|
31170
31177
|
dpr = null !== (_a = canvas.getContext("2d").pixelRatio) && void 0 !== _a ? _a : canvas.width / width;
|
|
31171
31178
|
}
|
|
31172
31179
|
this.canvas = new BrowserCanvas({
|
|
@@ -33396,7 +33403,7 @@
|
|
|
33396
33403
|
|
|
33397
33404
|
var roughModule = _roughModule;
|
|
33398
33405
|
|
|
33399
|
-
const version = "0.17.0-alpha.
|
|
33406
|
+
const version = "0.17.0-alpha.4";
|
|
33400
33407
|
loadBrowserEnv(container);
|
|
33401
33408
|
|
|
33402
33409
|
exports.ACustomAnimate = ACustomAnimate;
|