@visactor/vrender 0.19.6 → 0.19.7-alpha.0

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 CHANGED
@@ -1,4 +1,4 @@
1
1
  import '@visactor/vrender-core';
2
- export declare const version = "0.19.6";
2
+ export declare const version = "0.19.7-alpha.0";
3
3
  export * from '@visactor/vrender-core';
4
4
  export * from '@visactor/vrender-kits';
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.19.6", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
25
- vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
26
- vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
27
- (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
28
- (0, vrender_kits_2.registerGlyph)(), (0, vrender_kits_2.registerGroup)(), (0, vrender_kits_2.registerImage)(),
29
- (0, vrender_kits_2.registerLine)(), (0, vrender_kits_2.registerPath)(), (0, vrender_kits_2.registerPolygon)(),
30
- (0, vrender_kits_2.registerPyramid3d)(), (0, vrender_kits_2.registerRect)(), (0,
31
- vrender_kits_2.registerRect3d)(), (0, vrender_kits_2.registerRichtext)(), (0, vrender_kits_2.registerShadowRoot)(),
32
- (0, vrender_kits_2.registerSymbol)(), (0, vrender_kits_2.registerText)(), (0, vrender_kits_2.registerWrapText)(),
33
- __exportStar(require("@visactor/vrender-core"), exports), __exportStar(require("@visactor/vrender-kits"), exports);
24
+ exports.version = "0.19.7-alpha.0", (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,QAAQ,CAAC;AAEhC,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.19.6\";\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"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA8F;AAC9F,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;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.19.7-alpha.0\";\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.es.js CHANGED
@@ -7218,18 +7218,22 @@ class StreamLight extends ACustomAnimate {
7218
7218
  this[type] = line, line.pathProxy = new CustomPath2D(), root.add(line);
7219
7219
  }
7220
7220
  onStartRect() {
7221
- var _a;
7221
+ var _a, _b, _c;
7222
7222
  const root = this.target.attachShadow(),
7223
- height = this.target.AABBBounds.height(),
7223
+ isHorizontal = null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.isHorizontal) || void 0 === _b || _b,
7224
+ sizeAttr = isHorizontal ? "height" : "width",
7225
+ otherSizeAttr = isHorizontal ? "width" : "height",
7226
+ size = this.target.AABBBounds[sizeAttr](),
7227
+ y = isHorizontal ? 0 : this.target.AABBBounds.y1,
7224
7228
  rect = application.graphicService.creator.rect(Object.assign(Object.assign({
7225
- height: height,
7229
+ [sizeAttr]: size,
7226
7230
  fill: "#bcdeff",
7227
7231
  shadowBlur: 30,
7228
7232
  shadowColor: "#bcdeff"
7229
- }, null === (_a = this.params) || void 0 === _a ? void 0 : _a.attribute), {
7233
+ }, null === (_c = this.params) || void 0 === _c ? void 0 : _c.attribute), {
7230
7234
  x: 0,
7231
- y: 0,
7232
- width: 0
7235
+ y: y,
7236
+ [otherSizeAttr]: 0
7233
7237
  }));
7234
7238
  this.rect = rect, root.add(rect);
7235
7239
  }
@@ -7241,25 +7245,47 @@ class StreamLight extends ACustomAnimate {
7241
7245
  return this.rect ? this.onUpdateRect(end, ratio, out) : this.line || this.area ? this.onUpdateLineOrArea(end, ratio, out) : void 0;
7242
7246
  }
7243
7247
  onUpdateRect(end, ratio, out) {
7244
- var _a, _b, _c, _d, _e, _f;
7245
- const parentWidth = null !== (_a = this.target.attribute.width) && void 0 !== _a ? _a : 250,
7246
- streamLength = null !== (_c = null === (_b = this.params) || void 0 === _b ? void 0 : _b.streamLength) && void 0 !== _c ? _c : parentWidth,
7247
- maxLength = null !== (_f = null === (_e = null === (_d = this.params) || void 0 === _d ? void 0 : _d.attribute) || void 0 === _e ? void 0 : _e.width) && void 0 !== _f ? _f : 60,
7248
- startX = -maxLength,
7249
- currentX = startX + (streamLength - startX) * ratio,
7250
- x = Math.max(currentX, 0),
7251
- w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX),
7252
- width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
7253
- this.rect.setAttributes({
7254
- x: x,
7255
- width: width
7256
- }, !1, {
7257
- type: AttributeUpdateType.ANIMATE_PLAY,
7258
- animationState: {
7259
- ratio: ratio,
7260
- end: end
7261
- }
7262
- });
7248
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
7249
+ const isHorizontal = null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.isHorizontal) || void 0 === _b || _b,
7250
+ parentAttr = this.target.attribute;
7251
+ if (isHorizontal) {
7252
+ const parentWidth = null !== (_d = null !== (_c = parentAttr.width) && void 0 !== _c ? _c : parentAttr.x1 - parentAttr.x) && void 0 !== _d ? _d : 250,
7253
+ streamLength = null !== (_f = null === (_e = this.params) || void 0 === _e ? void 0 : _e.streamLength) && void 0 !== _f ? _f : parentWidth,
7254
+ maxLength = null !== (_j = null === (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.attribute) || void 0 === _h ? void 0 : _h.width) && void 0 !== _j ? _j : 60,
7255
+ startX = -maxLength,
7256
+ currentX = startX + (streamLength - startX) * ratio,
7257
+ x = Math.max(currentX, 0),
7258
+ w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX),
7259
+ width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
7260
+ this.rect.setAttributes({
7261
+ x: x,
7262
+ width: width
7263
+ }, !1, {
7264
+ type: AttributeUpdateType.ANIMATE_PLAY,
7265
+ animationState: {
7266
+ ratio: ratio,
7267
+ end: end
7268
+ }
7269
+ });
7270
+ } else {
7271
+ const parentHeight = null !== (_l = null !== (_k = parentAttr.height) && void 0 !== _k ? _k : parentAttr.y1 - parentAttr.y) && void 0 !== _l ? _l : 250,
7272
+ streamLength = null !== (_o = null === (_m = this.params) || void 0 === _m ? void 0 : _m.streamLength) && void 0 !== _o ? _o : parentHeight,
7273
+ maxLength = null !== (_r = null === (_q = null === (_p = this.params) || void 0 === _p ? void 0 : _p.attribute) || void 0 === _q ? void 0 : _q.height) && void 0 !== _r ? _r : 60,
7274
+ currentY = parentHeight - (streamLength + maxLength) * ratio;
7275
+ let y = Math.min(currentY, parentHeight);
7276
+ const h = Math.min(parentHeight - currentY, maxLength);
7277
+ let height;
7278
+ y <= 0 ? (height = Math.max(y + h, 0), y = 0) : height = h, this.rect.setAttributes({
7279
+ y: y,
7280
+ height: height
7281
+ }, !1, {
7282
+ type: AttributeUpdateType.ANIMATE_PLAY,
7283
+ animationState: {
7284
+ ratio: ratio,
7285
+ end: end
7286
+ }
7287
+ });
7288
+ }
7263
7289
  }
7264
7290
  onUpdateLineOrArea(end, ratio, out) {
7265
7291
  const target = this.line || this.area;
@@ -28538,7 +28564,7 @@ const registerWrapText = _registerWrapText;
28538
28564
 
28539
28565
  const roughModule = _roughModule;
28540
28566
 
28541
- const version = "0.19.6";
28567
+ const version = "0.19.7-alpha.0";
28542
28568
  preLoadAllModule();
28543
28569
  if (isBrowserEnv()) {
28544
28570
  loadBrowserEnv(container);
package/dist/index.js CHANGED
@@ -7224,18 +7224,22 @@
7224
7224
  this[type] = line, line.pathProxy = new CustomPath2D(), root.add(line);
7225
7225
  }
7226
7226
  onStartRect() {
7227
- var _a;
7227
+ var _a, _b, _c;
7228
7228
  const root = this.target.attachShadow(),
7229
- height = this.target.AABBBounds.height(),
7229
+ isHorizontal = null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.isHorizontal) || void 0 === _b || _b,
7230
+ sizeAttr = isHorizontal ? "height" : "width",
7231
+ otherSizeAttr = isHorizontal ? "width" : "height",
7232
+ size = this.target.AABBBounds[sizeAttr](),
7233
+ y = isHorizontal ? 0 : this.target.AABBBounds.y1,
7230
7234
  rect = application.graphicService.creator.rect(Object.assign(Object.assign({
7231
- height: height,
7235
+ [sizeAttr]: size,
7232
7236
  fill: "#bcdeff",
7233
7237
  shadowBlur: 30,
7234
7238
  shadowColor: "#bcdeff"
7235
- }, null === (_a = this.params) || void 0 === _a ? void 0 : _a.attribute), {
7239
+ }, null === (_c = this.params) || void 0 === _c ? void 0 : _c.attribute), {
7236
7240
  x: 0,
7237
- y: 0,
7238
- width: 0
7241
+ y: y,
7242
+ [otherSizeAttr]: 0
7239
7243
  }));
7240
7244
  this.rect = rect, root.add(rect);
7241
7245
  }
@@ -7247,25 +7251,47 @@
7247
7251
  return this.rect ? this.onUpdateRect(end, ratio, out) : this.line || this.area ? this.onUpdateLineOrArea(end, ratio, out) : void 0;
7248
7252
  }
7249
7253
  onUpdateRect(end, ratio, out) {
7250
- var _a, _b, _c, _d, _e, _f;
7251
- const parentWidth = null !== (_a = this.target.attribute.width) && void 0 !== _a ? _a : 250,
7252
- streamLength = null !== (_c = null === (_b = this.params) || void 0 === _b ? void 0 : _b.streamLength) && void 0 !== _c ? _c : parentWidth,
7253
- maxLength = null !== (_f = null === (_e = null === (_d = this.params) || void 0 === _d ? void 0 : _d.attribute) || void 0 === _e ? void 0 : _e.width) && void 0 !== _f ? _f : 60,
7254
- startX = -maxLength,
7255
- currentX = startX + (streamLength - startX) * ratio,
7256
- x = Math.max(currentX, 0),
7257
- w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX),
7258
- width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
7259
- this.rect.setAttributes({
7260
- x: x,
7261
- width: width
7262
- }, !1, {
7263
- type: exports.AttributeUpdateType.ANIMATE_PLAY,
7264
- animationState: {
7265
- ratio: ratio,
7266
- end: end
7267
- }
7268
- });
7254
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
7255
+ const isHorizontal = null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.isHorizontal) || void 0 === _b || _b,
7256
+ parentAttr = this.target.attribute;
7257
+ if (isHorizontal) {
7258
+ const parentWidth = null !== (_d = null !== (_c = parentAttr.width) && void 0 !== _c ? _c : parentAttr.x1 - parentAttr.x) && void 0 !== _d ? _d : 250,
7259
+ streamLength = null !== (_f = null === (_e = this.params) || void 0 === _e ? void 0 : _e.streamLength) && void 0 !== _f ? _f : parentWidth,
7260
+ maxLength = null !== (_j = null === (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.attribute) || void 0 === _h ? void 0 : _h.width) && void 0 !== _j ? _j : 60,
7261
+ startX = -maxLength,
7262
+ currentX = startX + (streamLength - startX) * ratio,
7263
+ x = Math.max(currentX, 0),
7264
+ w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX),
7265
+ width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
7266
+ this.rect.setAttributes({
7267
+ x: x,
7268
+ width: width
7269
+ }, !1, {
7270
+ type: exports.AttributeUpdateType.ANIMATE_PLAY,
7271
+ animationState: {
7272
+ ratio: ratio,
7273
+ end: end
7274
+ }
7275
+ });
7276
+ } else {
7277
+ const parentHeight = null !== (_l = null !== (_k = parentAttr.height) && void 0 !== _k ? _k : parentAttr.y1 - parentAttr.y) && void 0 !== _l ? _l : 250,
7278
+ streamLength = null !== (_o = null === (_m = this.params) || void 0 === _m ? void 0 : _m.streamLength) && void 0 !== _o ? _o : parentHeight,
7279
+ maxLength = null !== (_r = null === (_q = null === (_p = this.params) || void 0 === _p ? void 0 : _p.attribute) || void 0 === _q ? void 0 : _q.height) && void 0 !== _r ? _r : 60,
7280
+ currentY = parentHeight - (streamLength + maxLength) * ratio;
7281
+ let y = Math.min(currentY, parentHeight);
7282
+ const h = Math.min(parentHeight - currentY, maxLength);
7283
+ let height;
7284
+ y <= 0 ? (height = Math.max(y + h, 0), y = 0) : height = h, this.rect.setAttributes({
7285
+ y: y,
7286
+ height: height
7287
+ }, !1, {
7288
+ type: exports.AttributeUpdateType.ANIMATE_PLAY,
7289
+ animationState: {
7290
+ ratio: ratio,
7291
+ end: end
7292
+ }
7293
+ });
7294
+ }
7269
7295
  }
7270
7296
  onUpdateLineOrArea(end, ratio, out) {
7271
7297
  const target = this.line || this.area;
@@ -28544,7 +28570,7 @@
28544
28570
 
28545
28571
  const roughModule = _roughModule;
28546
28572
 
28547
- const version = "0.19.6";
28573
+ const version = "0.19.7-alpha.0";
28548
28574
  preLoadAllModule();
28549
28575
  if (isBrowserEnv()) {
28550
28576
  loadBrowserEnv(container);