@antv/g-lite 1.3.0-next.12 → 1.3.0-next.13

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.
@@ -1,5 +1,5 @@
1
1
  import type { CurveArray, PathArray } from '@antv/util';
2
2
  import type { ParsedPathStyleProps } from '../../display-objects';
3
3
  import type { IElement } from '../../dom';
4
- export declare function parsePath(path: string | PathArray): ParsedPathStyleProps['path'];
5
- export declare function mergePaths(left: ParsedPathStyleProps['path'], right: ParsedPathStyleProps['path'], object?: IElement): [CurveArray, CurveArray, (b: CurveArray) => CurveArray];
4
+ export declare function parsePath(path: string | PathArray): ParsedPathStyleProps['d'];
5
+ export declare function mergePaths(left: ParsedPathStyleProps['d'], right: ParsedPathStyleProps['d'], object?: IElement): [CurveArray, CurveArray, (b: CurveArray) => CurveArray];
@@ -3,13 +3,13 @@ import type { ParsedPathStyleProps } from '../../display-objects';
3
3
  import { Rectangle } from '../../shapes';
4
4
  import type { CSSProperty } from '../CSSProperty';
5
5
  import { mergePaths, parsePath } from '../parser/path';
6
- export declare class CSSPropertyPath implements Partial<CSSProperty<ParsedPathStyleProps['path'], ParsedPathStyleProps['path']>> {
6
+ export declare class CSSPropertyPath implements Partial<CSSProperty<ParsedPathStyleProps['d'], ParsedPathStyleProps['d']>> {
7
7
  /**
8
8
  * path2Curve
9
9
  */
10
10
  parser: typeof parsePath;
11
11
  parserWithCSSDisabled: typeof parsePath;
12
- calculator(name: string, oldParsed: ParsedPathStyleProps['path'], parsed: ParsedPathStyleProps['path']): {
12
+ calculator(name: string, oldParsed: ParsedPathStyleProps['d'], parsed: ParsedPathStyleProps['d']): {
13
13
  absolutePath: AbsoluteArray;
14
14
  hasArc: boolean;
15
15
  segments: import("../../display-objects").PathSegment[];
@@ -5,7 +5,6 @@ export interface ImageStyleProps extends BaseStyleProps {
5
5
  x?: number | string;
6
6
  y?: number | string;
7
7
  z?: number;
8
- img?: string | HTMLImageElement;
9
8
  src?: string | HTMLImageElement;
10
9
  width?: number | string;
11
10
  height?: number | string;
@@ -30,7 +29,6 @@ export interface ParsedImageStyleProps extends ParsedBaseStyleProps {
30
29
  x: number;
31
30
  y: number;
32
31
  z?: number;
33
- img?: string | HTMLImageElement;
34
32
  src?: string | HTMLImageElement;
35
33
  width?: number;
36
34
  height?: number;
@@ -5,7 +5,6 @@ import { Rectangle } from '../shapes/Rectangle';
5
5
  import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
6
6
  import { DisplayObject } from './DisplayObject';
7
7
  export interface PathStyleProps extends BaseStyleProps {
8
- path?: string | PathArray;
9
8
  d?: string | PathArray;
10
9
  /**
11
10
  * marker will be positioned at the first point
@@ -69,17 +68,7 @@ export interface PathArcParams {
69
68
  sweepFlag: number;
70
69
  }
71
70
  export interface ParsedPathStyleProps extends ParsedBaseStyleProps {
72
- path: {
73
- absolutePath: AbsoluteArray;
74
- hasArc: boolean;
75
- segments: PathSegment[];
76
- polygons: [number, number][][];
77
- polylines: [number, number][][];
78
- curve: CurveArray;
79
- totalLength: number;
80
- rect: Rectangle;
81
- };
82
- d?: {
71
+ d: {
83
72
  absolutePath: AbsoluteArray;
84
73
  hasArc: boolean;
85
74
  segments: PathSegment[];
package/dist/index.esm.js CHANGED
@@ -4220,10 +4220,10 @@ function mergeNumberLists(left, right) {
4220
4220
  }
4221
4221
 
4222
4222
  function getOrCalculatePathTotalLength(path) {
4223
- if (path.parsedStyle.path.totalLength === 0) {
4224
- path.parsedStyle.path.totalLength = getTotalLength(path.parsedStyle.path.absolutePath);
4223
+ if (path.parsedStyle.d.totalLength === 0) {
4224
+ path.parsedStyle.d.totalLength = getTotalLength(path.parsedStyle.d.absolutePath);
4225
4225
  }
4226
- return path.parsedStyle.path.totalLength;
4226
+ return path.parsedStyle.d.totalLength;
4227
4227
  }
4228
4228
  function removeRedundantMCommand(path) {
4229
4229
  for (var i = 0; i < path.length; i++) {
@@ -4933,7 +4933,7 @@ function convertToPath(object, transform) {
4933
4933
  }));
4934
4934
  break;
4935
4935
  case Shape.PATH:
4936
- var absolutePath = object.parsedStyle.path.absolutePath;
4936
+ var absolutePath = object.parsedStyle.d.absolutePath;
4937
4937
  commands = __spreadArray([], __read(absolutePath), false);
4938
4938
  break;
4939
4939
  }
@@ -6373,11 +6373,10 @@ var BUILT_IN_PROPERTIES = [
6373
6373
  },
6374
6374
  // Path
6375
6375
  {
6376
- n: 'path',
6376
+ n: 'd',
6377
6377
  int: true,
6378
6378
  l: true,
6379
6379
  d: '',
6380
- a: ['d'],
6381
6380
  syntax: PropertySyntax.PATH,
6382
6381
  p: 50,
6383
6382
  },
@@ -6544,7 +6543,7 @@ var BUILT_IN_PROPERTIES = [
6544
6543
  d: '0',
6545
6544
  },
6546
6545
  ];
6547
- BUILT_IN_PROPERTIES.filter(function (n) { return !!n.l; }).map(function (n) { return n.n; });
6546
+ var GEOMETRY_ATTRIBUTE_NAMES = BUILT_IN_PROPERTIES.filter(function (n) { return !!n.l; }).map(function (n) { return n.n; });
6548
6547
  var propertyMetadataCache = {};
6549
6548
  var unresolvedProperties = new WeakMap();
6550
6549
  // const uniqueAttributeSet = new Set<string>();
@@ -6607,14 +6606,14 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
6607
6606
  var oldOffsetPath = object.parsedStyle.offsetPath;
6608
6607
  object.parsedStyle = Object.assign(object.parsedStyle, attributes);
6609
6608
  var needUpdateGeometry = !!options.forceUpdateGeometry;
6610
- // if (!needUpdateGeometry) {
6611
- // for (let i = 0; i < GEOMETRY_ATTRIBUTE_NAMES.length; i++) {
6612
- // if (GEOMETRY_ATTRIBUTE_NAMES[i] in attributes) {
6613
- // needUpdateGeometry = true;
6614
- // break;
6615
- // }
6616
- // }
6617
- // }
6609
+ if (!needUpdateGeometry) {
6610
+ for (var i = 0; i < GEOMETRY_ATTRIBUTE_NAMES.length; i++) {
6611
+ if (GEOMETRY_ATTRIBUTE_NAMES[i] in attributes) {
6612
+ needUpdateGeometry = true;
6613
+ break;
6614
+ }
6615
+ }
6616
+ }
6618
6617
  if (attributes.fill) {
6619
6618
  object.parsedStyle.fill = parseColor(attributes.fill);
6620
6619
  }
@@ -6646,14 +6645,14 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
6646
6645
  }
6647
6646
  // Path
6648
6647
  // @ts-ignore
6649
- if (attributes.path === '') {
6650
- object.parsedStyle.path = __assign({}, EMPTY_PARSED_PATH);
6648
+ if (attributes.d === '') {
6649
+ object.parsedStyle.d = __assign({}, EMPTY_PARSED_PATH);
6651
6650
  }
6652
6651
  // @ts-ignore
6653
- if (attributes.path) {
6654
- object.parsedStyle.path = parsePath(
6652
+ if (attributes.d) {
6653
+ object.parsedStyle.d = parsePath(
6655
6654
  // @ts-ignore
6656
- attributes.path);
6655
+ attributes.d);
6657
6656
  }
6658
6657
  // Text
6659
6658
  if (attributes.textTransform) {
@@ -6705,10 +6704,13 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
6705
6704
  if (attributes.transform) {
6706
6705
  this.runtime.CSSPropertySyntaxFactory['<transform>'].postProcessor(object, attributeNames);
6707
6706
  }
6707
+ if (attributes.transformOrigin) {
6708
+ this.runtime.CSSPropertySyntaxFactory['<transform-origin>'].postProcessor(object, attributeNames);
6709
+ }
6708
6710
  if (needUpdateGeometry) {
6709
6711
  object.geometry.dirty = true;
6710
- // FIXME setOrigin may have already dirtified to root.
6711
- // this.runtime.sceneGraphService.dirtifyToRoot(object);
6712
+ object.renderable.boundsDirty = true;
6713
+ object.renderable.renderBoundsDirty = true;
6712
6714
  }
6713
6715
  }
6714
6716
  else {
@@ -6768,8 +6770,8 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
6768
6770
  // update geometry
6769
6771
  if (needUpdateGeometry_1) {
6770
6772
  object.geometry.dirty = true;
6771
- // FIXME setOrigin may have already dirtified to root.
6772
- this.runtime.sceneGraphService.dirtifyToRoot(object);
6773
+ object.renderable.boundsDirty = true;
6774
+ object.renderable.renderBoundsDirty = true;
6773
6775
  }
6774
6776
  attributeNames_1.forEach(function (name) {
6775
6777
  if (name in object.parsedStyle) {
@@ -6981,11 +6983,15 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
6981
6983
  // depth / 2,
6982
6984
  // );
6983
6985
  // anchor is center by default, don't account for lineWidth here
6984
- var _h = parsedStyle, stroke = _h.stroke, lineWidth = _h.lineWidth,
6986
+ var _h = parsedStyle, stroke = _h.stroke, _j = _h.lineWidth, lineWidth = _j === void 0 ? 1 : _j,
6987
+ // lineCap,
6988
+ // lineJoin,
6989
+ // miterLimit,
6990
+ _k = _h.increasedLineWidthForHitTesting,
6985
6991
  // lineCap,
6986
6992
  // lineJoin,
6987
6993
  // miterLimit,
6988
- increasedLineWidthForHitTesting = _h.increasedLineWidthForHitTesting, shadowType = _h.shadowType, shadowColor = _h.shadowColor, _j = _h.filter, filter = _j === void 0 ? [] : _j, transformOrigin = _h.transformOrigin;
6994
+ increasedLineWidthForHitTesting = _k === void 0 ? 0 : _k, shadowType = _h.shadowType, shadowColor = _h.shadowColor, _l = _h.filter, filter = _l === void 0 ? [] : _l, transformOrigin = _h.transformOrigin;
6989
6995
  var center = [cx, cy, cz];
6990
6996
  // update geometry's AABB
6991
6997
  geometry_1.contentBounds.update(center, halfExtents);
@@ -7019,8 +7025,8 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
7019
7025
  geometry_1.renderBounds.update(center, halfExtents);
7020
7026
  // account for shadow, only support constant value now
7021
7027
  if (shadowColor && shadowType && shadowType !== 'inner') {
7022
- var _k = geometry_1.renderBounds, min = _k.min, max = _k.max;
7023
- var _l = parsedStyle, shadowBlur = _l.shadowBlur, shadowOffsetX = _l.shadowOffsetX, shadowOffsetY = _l.shadowOffsetY;
7028
+ var _m = geometry_1.renderBounds, min = _m.min, max = _m.max;
7029
+ var _o = parsedStyle, shadowBlur = _o.shadowBlur, shadowOffsetX = _o.shadowOffsetX, shadowOffsetY = _o.shadowOffsetY;
7024
7030
  var shadowBlurInPixels = shadowBlur || 0;
7025
7031
  var shadowOffsetXInPixels = shadowOffsetX || 0;
7026
7032
  var shadowOffsetYInPixels = shadowOffsetY || 0;
@@ -7391,6 +7397,7 @@ var CSSPropertyPath = /** @class */ (function () {
7391
7397
  rect: new Rectangle(0, 0, 0, 0),
7392
7398
  };
7393
7399
  }
7400
+ console.log('parsed', parsed);
7394
7401
  return parsed;
7395
7402
  };
7396
7403
  return CSSPropertyPath;
@@ -7790,7 +7797,7 @@ var genericFontFamilies = [
7790
7797
  ];
7791
7798
  var stringRegExp = /([\"\'])[^\'\"]+\1/;
7792
7799
  function toFontString(attributes) {
7793
- var fontSize = attributes.fontSize, fontFamily = attributes.fontFamily, fontStyle = attributes.fontStyle, fontVariant = attributes.fontVariant, fontWeight = attributes.fontWeight;
7800
+ var _a = attributes.fontSize, fontSize = _a === void 0 ? 16 : _a, _b = attributes.fontFamily, fontFamily = _b === void 0 ? 'sans-serif' : _b, _c = attributes.fontStyle, fontStyle = _c === void 0 ? 'normal' : _c, _d = attributes.fontVariant, fontVariant = _d === void 0 ? 'normal' : _d, _e = attributes.fontWeight, fontWeight = _e === void 0 ? 'normal' : _e;
7794
7801
  // build canvas api font setting from individual components. Convert a numeric this.fontSize to px
7795
7802
  // const fontSizeString: string = isNumber(fontSize) ? `${fontSize}px` : fontSize.toString();
7796
7803
  var fontSizeString = (isNumber(fontSize) && "".concat(fontSize, "px")) || '16px';
@@ -8086,8 +8093,8 @@ var PathUpdater = /** @class */ (function () {
8086
8093
  function PathUpdater() {
8087
8094
  }
8088
8095
  PathUpdater.prototype.update = function (parsedStyle) {
8089
- var path = parsedStyle.path;
8090
- var _a = path.rect, x = _a.x, y = _a.y, width = _a.width, height = _a.height;
8096
+ var d = parsedStyle.d;
8097
+ var _a = d.rect, x = _a.x, y = _a.y, width = _a.width, height = _a.height;
8091
8098
  var hwidth = width / 2;
8092
8099
  var hheight = height / 2;
8093
8100
  return {
@@ -8136,17 +8143,17 @@ var RectUpdater = /** @class */ (function () {
8136
8143
  function RectUpdater() {
8137
8144
  }
8138
8145
  RectUpdater.prototype.update = function (parsedStyle, object) {
8139
- var _a = parsedStyle.x, x = _a === void 0 ? 0 : _a, _b = parsedStyle.y, y = _b === void 0 ? 0 : _b, img = parsedStyle.img, _c = parsedStyle.width, width = _c === void 0 ? 0 : _c, _d = parsedStyle.height, height = _d === void 0 ? 0 : _d;
8146
+ var _a = parsedStyle.x, x = _a === void 0 ? 0 : _a, _b = parsedStyle.y, y = _b === void 0 ? 0 : _b, src = parsedStyle.src, _c = parsedStyle.width, width = _c === void 0 ? 0 : _c, _d = parsedStyle.height, height = _d === void 0 ? 0 : _d;
8140
8147
  var contentWidth = width;
8141
8148
  var contentHeight = height;
8142
8149
  // resize with HTMLImageElement's size
8143
- if (img && !isString(img)) {
8150
+ if (src && !isString(src)) {
8144
8151
  if (!contentWidth) {
8145
- contentWidth = img.width;
8152
+ contentWidth = src.width;
8146
8153
  parsedStyle.width = contentWidth;
8147
8154
  }
8148
8155
  if (!contentHeight) {
8149
- contentHeight = img.height;
8156
+ contentHeight = src.height;
8150
8157
  parsedStyle.height = contentHeight;
8151
8158
  }
8152
8159
  }
@@ -8166,18 +8173,20 @@ var TextUpdater = /** @class */ (function () {
8166
8173
  }
8167
8174
  TextUpdater.prototype.isReadyToMeasure = function (parsedStyle, object) {
8168
8175
  var text = parsedStyle.text, textAlign = parsedStyle.textAlign, textBaseline = parsedStyle.textBaseline, fontSize = parsedStyle.fontSize, fontStyle = parsedStyle.fontStyle, fontWeight = parsedStyle.fontWeight, fontVariant = parsedStyle.fontVariant, lineWidth = parsedStyle.lineWidth;
8169
- return (text &&
8170
- fontSize &&
8171
- fontStyle &&
8172
- fontWeight &&
8173
- fontVariant &&
8174
- textAlign &&
8175
- textBaseline &&
8176
- !isNil(lineWidth));
8176
+ return runtime.enableCSSParsing
8177
+ ? text &&
8178
+ fontSize &&
8179
+ fontStyle &&
8180
+ fontWeight &&
8181
+ fontVariant &&
8182
+ textAlign &&
8183
+ textBaseline &&
8184
+ !isNil(lineWidth)
8185
+ : text;
8177
8186
  };
8178
8187
  TextUpdater.prototype.update = function (parsedStyle, object) {
8179
8188
  var _a, _b;
8180
- var text = parsedStyle.text, textAlign = parsedStyle.textAlign, lineWidth = parsedStyle.lineWidth, textBaseline = parsedStyle.textBaseline, dx = parsedStyle.dx, dy = parsedStyle.dy, _c = parsedStyle.x, x = _c === void 0 ? 0 : _c, _d = parsedStyle.y, y = _d === void 0 ? 0 : _d;
8189
+ var text = parsedStyle.text, _c = parsedStyle.textAlign, textAlign = _c === void 0 ? 'start' : _c, _d = parsedStyle.lineWidth, lineWidth = _d === void 0 ? 1 : _d, _e = parsedStyle.textBaseline, textBaseline = _e === void 0 ? 'alphabetic' : _e, _f = parsedStyle.dx, dx = _f === void 0 ? 0 : _f, _g = parsedStyle.dy, dy = _g === void 0 ? 0 : _g, _h = parsedStyle.x, x = _h === void 0 ? 0 : _h, _j = parsedStyle.y, y = _j === void 0 ? 0 : _j;
8181
8190
  if (!this.isReadyToMeasure(parsedStyle, object)) {
8182
8191
  parsedStyle.metrics = {
8183
8192
  font: '',
@@ -11277,13 +11286,13 @@ var TextService = /** @class */ (function () {
11277
11286
  return properties;
11278
11287
  };
11279
11288
  TextService.prototype.measureText = function (text, parsedStyle, offscreenCanvas) {
11280
- var fontSize = parsedStyle.fontSize, wordWrap = parsedStyle.wordWrap, strokeHeight = parsedStyle.lineHeight, lineWidth = parsedStyle.lineWidth, textBaseline = parsedStyle.textBaseline, textAlign = parsedStyle.textAlign, letterSpacing = parsedStyle.letterSpacing, textPath = parsedStyle.textPath; parsedStyle.textPathSide; parsedStyle.textPathStartOffset;
11289
+ var _a = parsedStyle.fontSize, fontSize = _a === void 0 ? 16 : _a, _b = parsedStyle.wordWrap, wordWrap = _b === void 0 ? false : _b, strokeHeight = parsedStyle.lineHeight, _c = parsedStyle.lineWidth, lineWidth = _c === void 0 ? 1 : _c, _d = parsedStyle.textBaseline, textBaseline = _d === void 0 ? 'alphabetic' : _d, _e = parsedStyle.textAlign, textAlign = _e === void 0 ? 'start' : _e, _f = parsedStyle.letterSpacing, letterSpacing = _f === void 0 ? 0 : _f, textPath = parsedStyle.textPath; parsedStyle.textPathSide; parsedStyle.textPathStartOffset;
11281
11290
  var // dropShadow = 0,
11282
11291
  // dropShadowDistance = 0,
11283
- _a = parsedStyle.leading,
11292
+ _g = parsedStyle.leading,
11284
11293
  // dropShadow = 0,
11285
11294
  // dropShadowDistance = 0,
11286
- leading = _a === void 0 ? 0 : _a;
11295
+ leading = _g === void 0 ? 0 : _g;
11287
11296
  var font = toFontString(parsedStyle);
11288
11297
  // if (runtime.enableCSSParsing) {
11289
11298
  var fontProperties = this.measureFont(font, offscreenCanvas);
@@ -11395,7 +11404,7 @@ var TextService = /** @class */ (function () {
11395
11404
  TextService.prototype.setGraphemeOnPath = function () { };
11396
11405
  TextService.prototype.wordWrap = function (text, parsedStyle, offscreenCanvas) {
11397
11406
  var _this = this;
11398
- var _a = parsedStyle.wordWrapWidth, wordWrapWidth = _a === void 0 ? 0 : _a, letterSpacing = parsedStyle.letterSpacing, _b = parsedStyle.maxLines, maxLines = _b === void 0 ? Infinity : _b, textOverflow = parsedStyle.textOverflow;
11407
+ var _a = parsedStyle.wordWrapWidth, wordWrapWidth = _a === void 0 ? 0 : _a, _b = parsedStyle.letterSpacing, letterSpacing = _b === void 0 ? 0 : _b, _c = parsedStyle.maxLines, maxLines = _c === void 0 ? Infinity : _c, textOverflow = parsedStyle.textOverflow;
11399
11408
  var context = this.runtime.offscreenCanvasCreator.getOrCreateContext(offscreenCanvas);
11400
11409
  var maxWidth = wordWrapWidth + letterSpacing;
11401
11410
  var ellipsis = '';
@@ -12254,20 +12263,7 @@ var DEFAULT_PARSED_STYLE_PROPS = {
12254
12263
  shadowType: 'outer',
12255
12264
  miterLimit: 10,
12256
12265
  };
12257
- // const DEFAULT_PARSED_STYLE_PROPS_CSS_DISABLED = {
12258
- // ...DEFAULT_PARSED_STYLE_PROPS,
12259
- // opacity: 1,
12260
- // fillOpacity: 1,
12261
- // strokeOpacity: 1,
12262
- // visibility: 'visible',
12263
- // pointerEvents: 'auto',
12264
- // lineWidth: 1,
12265
- // lineCap: 'butt',
12266
- // lineJoin: 'miter',
12267
- // increasedLineWidthForHitTesting: 0,
12268
- // fillRule: 'nonzero',
12269
- // // TODO: transformOrigin
12270
- // };
12266
+ __assign(__assign({}, DEFAULT_PARSED_STYLE_PROPS), { opacity: 1, fillOpacity: 1, strokeOpacity: 1, visibility: 'visible', pointerEvents: 'auto', lineWidth: 1, lineCap: 'butt', lineJoin: 'miter', increasedLineWidthForHitTesting: 0, fillRule: 'nonzero' });
12271
12267
  var INHERITABLE_BASE_STYLE_PROPS = [
12272
12268
  'opacity',
12273
12269
  'fillOpacity',
@@ -12333,6 +12329,11 @@ var DisplayObject = /** @class */ (function (_super) {
12333
12329
  Object.assign(_this.attributes, DEFAULT_STYLE_PROPS);
12334
12330
  Object.assign(_this.parsedStyle, DEFAULT_PARSED_STYLE_PROPS, _this.config.initialParsedStyle);
12335
12331
  }
12332
+ else if (_this.config.initialParsedStyle) {
12333
+ Object.assign(_this.parsedStyle,
12334
+ // DEFAULT_PARSED_STYLE_PROPS_CSS_DISABLED,
12335
+ _this.config.initialParsedStyle);
12336
+ }
12336
12337
  // start to process attributes
12337
12338
  _this.initAttributes(_this.config.style);
12338
12339
  if (runtime.enableDataset) {
@@ -13236,11 +13237,11 @@ var Path = /** @class */ (function (_super) {
13236
13237
  var _this = this;
13237
13238
  var style = _a.style, rest = __rest(_a, ["style"]);
13238
13239
  _this = _super.call(this, __assign({ type: Shape.PATH, style: runtime.enableCSSParsing
13239
- ? __assign({ path: '', miterLimit: '' }, style) : __assign({}, style), initialParsedStyle: runtime.enableCSSParsing
13240
+ ? __assign({ d: '', miterLimit: '' }, style) : __assign({}, style), initialParsedStyle: runtime.enableCSSParsing
13240
13241
  ? null
13241
13242
  : {
13242
13243
  miterLimit: 4,
13243
- path: __assign({}, EMPTY_PARSED_PATH),
13244
+ d: __assign({}, EMPTY_PARSED_PATH),
13244
13245
  } }, rest)) || this;
13245
13246
  _this.markerStartAngle = 0;
13246
13247
  _this.markerEndAngle = 0;
@@ -13265,7 +13266,7 @@ var Path = /** @class */ (function (_super) {
13265
13266
  return _this;
13266
13267
  }
13267
13268
  Path.prototype.attributeChangedCallback = function (attrName, oldValue, newValue, prevParsedValue, newParsedValue) {
13268
- if (attrName === 'path') {
13269
+ if (attrName === 'd') {
13269
13270
  // recalc markers
13270
13271
  this.transformMarker(true);
13271
13272
  this.transformMarker(false);
@@ -13340,7 +13341,7 @@ var Path = /** @class */ (function (_super) {
13340
13341
  marker.setLocalPosition(ox + Math.cos(rad) * offset, oy + Math.sin(rad) * offset);
13341
13342
  };
13342
13343
  Path.prototype.placeMarkerMid = function (marker) {
13343
- var segments = this.parsedStyle.path.segments;
13344
+ var segments = this.parsedStyle.d.segments;
13344
13345
  // clear all existed markers
13345
13346
  this.markerMidList.forEach(function (marker) {
13346
13347
  marker.remove();
@@ -13369,7 +13370,7 @@ var Path = /** @class */ (function (_super) {
13369
13370
  */
13370
13371
  Path.prototype.getPointAtLength = function (distance, inWorldSpace) {
13371
13372
  if (inWorldSpace === void 0) { inWorldSpace = false; }
13372
- var absolutePath = this.parsedStyle.path.absolutePath;
13373
+ var absolutePath = this.parsedStyle.d.absolutePath;
13373
13374
  var _a = getPointAtLength(absolutePath, distance), x = _a.x, y = _a.y;
13374
13375
  var transformed = vec3.transformMat4(vec3.create(), vec3.fromValues(x, y, 0), inWorldSpace ? this.getWorldTransform() : this.getLocalTransform());
13375
13376
  // apply local transformation
@@ -13386,7 +13387,7 @@ var Path = /** @class */ (function (_super) {
13386
13387
  * Get start tangent vector
13387
13388
  */
13388
13389
  Path.prototype.getStartTangent = function () {
13389
- var segments = this.parsedStyle.path.segments;
13390
+ var segments = this.parsedStyle.d.segments;
13390
13391
  var result = [];
13391
13392
  if (segments.length > 1) {
13392
13393
  var startPoint = segments[0].currentPoint;
@@ -13408,7 +13409,7 @@ var Path = /** @class */ (function (_super) {
13408
13409
  * Get end tangent vector
13409
13410
  */
13410
13411
  Path.prototype.getEndTangent = function () {
13411
- var segments = this.parsedStyle.path.segments;
13412
+ var segments = this.parsedStyle.d.segments;
13412
13413
  var length = segments.length;
13413
13414
  var result = [];
13414
13415
  if (length > 1) {
@@ -13664,26 +13665,7 @@ var Text = /** @class */ (function (_super) {
13664
13665
  return _super.call(this, __assign({ type: Shape.TEXT, style: runtime.enableCSSParsing
13665
13666
  ? __assign({ x: '', y: '', text: '', fontSize: '', fontFamily: '', fontStyle: '', fontWeight: '', fontVariant: '', textAlign: '', textBaseline: '', textTransform: '', fill: 'black', letterSpacing: '', lineHeight: '', miterLimit: '',
13666
13667
  // whiteSpace: 'pre',
13667
- wordWrap: false, wordWrapWidth: 0, leading: 0, dx: '', dy: '' }, style) : __assign({ fill: 'black' }, style), initialParsedStyle: runtime.enableCSSParsing
13668
- ? {}
13669
- : {
13670
- x: 0,
13671
- y: 0,
13672
- fontSize: 16,
13673
- fontFamily: 'sans-serif',
13674
- fontStyle: 'normal',
13675
- fontWeight: 'normal',
13676
- fontVariant: 'normal',
13677
- lineHeight: 0,
13678
- letterSpacing: 0,
13679
- textBaseline: 'alphabetic',
13680
- textAlign: 'start',
13681
- wordWrap: false,
13682
- wordWrapWidth: 0,
13683
- leading: 0,
13684
- dx: 0,
13685
- dy: 0,
13686
- } }, rest)) || this;
13668
+ wordWrap: false, wordWrapWidth: 0, leading: 0, dx: '', dy: '' }, style) : __assign({ fill: 'black' }, style) }, rest)) || this;
13687
13669
  }
13688
13670
  // lengthAdjust: SVGAnimatedEnumeration;
13689
13671
  // textLength: SVGAnimatedLength;
@@ -14703,7 +14685,7 @@ var PrepareRendererPlugin = /** @class */ (function () {
14703
14685
  * sync to RBush later
14704
14686
  */
14705
14687
  this.toSync = new Set();
14706
- // private isFirstTimeRendering = true;
14688
+ this.isFirstTimeRendering = true;
14707
14689
  this.syncing = false;
14708
14690
  }
14709
14691
  PrepareRendererPlugin.prototype.apply = function (context) {
@@ -14767,14 +14749,22 @@ var PrepareRendererPlugin = /** @class */ (function () {
14767
14749
  _this.toSync.clear();
14768
14750
  });
14769
14751
  renderingService.hooks.endFrame.tap(PrepareRendererPlugin.tag, function () {
14770
- requestIdleCallback(function () {
14752
+ if (_this.isFirstTimeRendering) {
14753
+ _this.isFirstTimeRendering = false;
14754
+ _this.syncing = true;
14755
+ requestIdleCallback(function () {
14756
+ _this.syncRTree(true);
14757
+ });
14758
+ }
14759
+ else {
14771
14760
  _this.syncRTree();
14772
- });
14761
+ }
14773
14762
  });
14774
14763
  };
14775
- PrepareRendererPlugin.prototype.syncRTree = function () {
14764
+ PrepareRendererPlugin.prototype.syncRTree = function (force) {
14776
14765
  var _this = this;
14777
- if (this.syncing || this.toSync.size === 0) {
14766
+ if (force === void 0) { force = false; }
14767
+ if (!force && (this.syncing || this.toSync.size === 0)) {
14778
14768
  return;
14779
14769
  }
14780
14770
  this.syncing = true;