@visactor/vrender-core 0.16.12-alpha.2 → 0.16.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.
@@ -8,6 +8,7 @@ export declare class IncreaseCount extends ACustomAnimate<{
8
8
  valid: boolean;
9
9
  private fromNumber;
10
10
  private toNumber;
11
+ private decimalLength;
11
12
  constructor(from: {
12
13
  text: string | number;
13
14
  }, to: {
@@ -16,19 +16,16 @@ class IncreaseCount extends animate_1.ACustomAnimate {
16
16
  };
17
17
  }
18
18
  onBind() {
19
- var _a, _b, _c, _d, _e, _f;
19
+ var _a, _b, _c, _d, _e, _f, _g, _h;
20
20
  this.fromNumber = (0, vutils_1.isNumber)(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text),
21
21
  this.toNumber = (0, vutils_1.isNumber)(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text),
22
- Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1);
22
+ Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1),
23
+ !1 !== this.valid && (this.decimalLength = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.fixed) && void 0 !== _h ? _h : Math.max((0,
24
+ vutils_1.getDecimalPlaces)(this.fromNumber), (0, vutils_1.getDecimalPlaces)(this.toNumber)));
23
25
  }
24
26
  onEnd() {}
25
27
  onUpdate(end, ratio, out) {
26
- var _a;
27
- if (!1 !== this.valid) if (end) out.text = this.toNumber; else {
28
- let outText = this.fromNumber + (this.toNumber - this.fromNumber) * ratio;
29
- (null === (_a = this.params) || void 0 === _a ? void 0 : _a.fixed) >= 0 && (outText = outText.toFixed(this.params.fixed)),
30
- out.text = outText;
31
- }
28
+ !1 !== this.valid && (out.text = end ? this.toNumber : (this.fromNumber + (this.toNumber - this.fromNumber) * ratio).toFixed(this.decimalLength));
32
29
  }
33
30
  }
34
31
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/animate/custom-animate.ts"],"names":[],"mappings":";;;AACA,6CAAqE;AACrE,gDAA6C;AAC7C,2CAAsD;AAatD,uCAA2C;AAC3C,qCAAkC;AAClC,2CAAqD;AAErD,MAAa,aAAc,SAAQ,wBAAyC;IAM1E,YACE,IAA+B,EAC/B,EAA6B,EAC7B,QAAgB,EAChB,MAAkB,EAClB,MAA4B;QAE5B,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,WAAW;QACT,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;YACxB,OAAO,EAAE,CAAC;SACX;QACD,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,EAAE;SACd,CAAC;IACJ,CAAC;IAED,MAAM;;QACJ,IAAI,CAAC,UAAU,GAAG,IAAA,iBAAQ,EAAC,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,CAAC,CAAC;QACnG,IAAI,CAAC,QAAQ,GAAG,IAAA,iBAAQ,EAAC,MAAA,IAAI,CAAC,EAAE,0CAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,EAAE,0CAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,MAAA,IAAI,CAAC,EAAE,0CAAE,IAAI,CAAC,CAAC;QAC3F,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,C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O;IACT,CAAC;CACF;AAtDD,sCAsDC","file":"custom-animate.js","sourcesContent":["import type { IPoint, IPointLike } from '@visactor/vutils';\nimport { isArray, isNumber, pi, pi2, Point } from '@visactor/vutils';\nimport { application } from '../application';\nimport { AttributeUpdateType } from '../common/enums';\nimport type { CustomPath2D } from '../common/custom-path2d';\nimport type {\n EasingType,\n IArcGraphicAttribute,\n IGraphic,\n IGroup,\n ILinearGradient,\n IRect,\n IRectAttribute,\n IRectGraphicAttribute,\n IShadowRoot\n} from '../interface';\nimport { ACustomAnimate } from './animate';\nimport { Easing } from './easing';\nimport { pointInterpolation } from '../common/utils';\n\nexport class IncreaseCount extends ACustomAnimate<{ text: string | number }> {\n declare valid: boolean;\n\n private fromNumber: number;\n private toNumber: number;\n\n constructor(\n from: { text: string | number },\n to: { text: string | number },\n duration: number,\n easing: EasingType,\n params?: { fixed?: boolean }\n ) {\n super(from, to, duration, easing, params);\n }\n\n getEndProps(): Record<string, any> | void {\n if (this.valid === false) {\n return {};\n }\n return {\n text: this.to\n };\n }\n\n onBind(): void {\n this.fromNumber = isNumber(this.from?.text) ? this.from?.text : Number.parseFloat(this.from?.text);\n this.toNumber = isNumber(this.to?.text) ? this.to?.text : Number.parseFloat(this.to?.text);\n if (!Number.isFinite(this.toNumber)) {\n this.fromNumber = 0;\n }\n if (!Number.isFinite(this.toNumber)) {\n this.valid = false;\n }\n }\n\n onEnd(): void {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.valid === false) {\n return;\n }\n if (end) {\n out.text = this.toNumber;\n } else {\n let outText: string | number = this.fromNumber + (this.toNumber - this.fromNumber) * ratio;\n if (this.params?.fixed >= 0) {\n outText = outText.toFixed(this.params.fixed);\n }\n out.text = outText;\n }\n }\n}\n\nenum Direction {\n LEFT_TO_RIGHT = 0,\n RIGHT_TO_LEFT = 1,\n TOP_TO_BOTTOM = 2,\n BOTTOM_TO_TOP = 3,\n STROKE = 4\n}\nexport class FadeInPlus extends ACustomAnimate<any> {\n declare direction: number;\n declare toFill: string;\n declare toStroke: string;\n declare fillGradient: ILinearGradient;\n declare strokeGradient: ILinearGradient;\n declare fill: boolean;\n declare stroke: boolean;\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params?: { direction?: number; fill?: boolean; stroke?: boolean }\n ) {\n super(from, to, duration, easing, params);\n const { direction = Direction.LEFT_TO_RIGHT, fill = true, stroke = true } = params || {};\n this.direction = direction;\n this.fill = fill;\n this.stroke = stroke;\n this.fillGradient = {\n gradient: 'linear',\n stops: []\n };\n this.strokeGradient = {\n gradient: 'linear',\n stops: []\n };\n }\n\n getEndProps(): Record<string, any> {\n return {\n fill: this.toFill,\n stroke: this.toStroke\n };\n }\n\n onBind(): void {\n // this.to = parseFloat(this.target.getAnimatePropByName('text'));\n this.toFill = this.target.getComputedAttribute('fill');\n this.toStroke = this.target.getComputedAttribute('stroke');\n }\n\n onEnd(): void {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this.toFill) {\n return;\n }\n if (!this.toStroke) {\n return;\n }\n switch (this.direction) {\n case Direction.RIGHT_TO_LEFT:\n this.rightToLeft(end, ratio, out);\n break;\n case Direction.TOP_TO_BOTTOM:\n this.topToBottom(end, ratio, out);\n break;\n case Direction.BOTTOM_TO_TOP:\n this.bottomToTop(end, ratio, out);\n break;\n case Direction.STROKE:\n this.strokePath(end, ratio, out);\n break;\n default:\n this.leftToRight(end, ratio, out);\n break;\n }\n }\n\n leftToRight(end: boolean, ratio: number, out: Record<string, any>) {\n if (this.fill) {\n const toFillColor = this.toFill;\n this.fillGradient.x0 = 0;\n this.fillGradient.y0 = 0;\n this.fillGradient.x1 = 1;\n this.fillGradient.y1 = 0;\n this.fillGradient.stops = [\n { offset: 0, color: toFillColor },\n { offset: ratio, color: toFillColor },\n { offset: Math.min(1, ratio * 2), color: 'transparent' }\n ];\n out.fill = this.fillGradient;\n }\n if (this.stroke) {\n const toStrokeColor = this.toStroke;\n this.strokeGradient.x0 = 0;\n this.strokeGradient.y0 = 0;\n this.strokeGradient.x1 = 1;\n this.strokeGradient.y1 = 0;\n this.strokeGradient.stops = [\n { offset: 0, color: toStrokeColor },\n { offset: ratio, color: toStrokeColor },\n { offset: Math.min(1, ratio * 6), color: 'transparent' }\n ];\n out.stroke = this.strokeGradient;\n // const dashLen = 300;\n // const offset = ratio * dashLen;\n // out.lineDash = [offset, dashLen - offset];\n }\n return;\n }\n\n strokePath(end: boolean, ratio: number, out: Record<string, any>) {\n if (this.fill) {\n const toFillColor = this.toFill;\n this.fillGradient.x0 = 0;\n this.fillGradient.y0 = 0;\n this.fillGradient.x1 = 1;\n this.fillGradient.y1 = 0;\n this.fillGradient.stops = [\n { offset: 0, color: toFillColor },\n { offset: ratio, color: toFillColor },\n { offset: Math.min(1, ratio * 2), color: 'transparent' }\n ];\n out.fill = this.fillGradient;\n }\n if (this.stroke) {\n const dashLen = 300;\n const offset = ratio * dashLen;\n out.lineDash = [offset, dashLen - offset];\n }\n return;\n }\n rightToLeft(end: boolean, ratio: number, out: Record<string, any>) {\n return;\n }\n topToBottom(end: boolean, ratio: number, out: Record<string, any>) {\n return;\n }\n bottomToTop(end: boolean, ratio: number, out: Record<string, any>) {\n return;\n }\n}\n\nexport class InputText extends ACustomAnimate<{ text: string }> {\n declare valid: boolean;\n declare target: IGraphic;\n\n private fromText: string = '';\n private toText: string = '';\n\n getEndProps(): Record<string, any> {\n if (this.valid === false) {\n return {};\n }\n return {\n text: this.to\n };\n }\n\n onBind(): void {\n this.fromText = this.from?.text ?? '';\n this.toText = this.to?.text ?? '';\n if (!this.toText || isArray(this.toText)) {\n this.valid = false;\n } else {\n this.toText = this.toText.toString();\n const root = this.target.attachShadow();\n const line = application.graphicService.creator.line({\n x: 0,\n y: 0,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: this.target.getComputedAttribute('fontSize') }\n ],\n stroke: 'black',\n lineWidth: 1\n });\n root.add(line);\n }\n }\n\n onEnd(): void {\n this.target.detachShadow();\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.valid === false) {\n return;\n }\n // update text\n const fromCount = this.fromText.length;\n const toCount = this.toText.length;\n const count = Math.ceil(fromCount + (toCount - fromCount) * ratio);\n\n out.text = this.toText.substr(0, count);\n\n // update line position\n const line = this.target.shadowRoot?.at(0) as IGraphic;\n const endX = (this.target as any).clipedWidth + 2;\n line.setAttribute('x', endX);\n }\n}\n\nexport class StreamLight extends ACustomAnimate<any> {\n declare valid: boolean;\n declare target: IGraphic;\n\n declare rect: IRect;\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params?: { attribute?: Partial<IRectAttribute>; streamLength?: number }\n ) {\n super(from, to, duration, easing, params);\n }\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onStart(): void {\n const root = this.target.attachShadow();\n\n const height = this.target.AABBBounds.height();\n\n const rect = application.graphicService.creator.rect({\n height: height,\n fill: '#bcdeff',\n shadowBlur: 30,\n shadowColor: '#bcdeff',\n ...this.params?.attribute,\n x: 0,\n y: 0,\n width: 0\n });\n this.rect = rect;\n root.add(rect);\n }\n\n onBind(): void {\n return;\n }\n\n onEnd(): void {\n this.target.detachShadow();\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const parentWidth = (this.target as any).attribute.width ?? 250;\n const streamLength = this.params?.streamLength ?? parentWidth;\n const maxLength = this.params?.attribute?.width ?? 60;\n const startX = -maxLength;\n const currentX = startX + (streamLength - startX) * ratio;\n const x = Math.max(currentX, 0);\n const w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX);\n const width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;\n this.rect.setAttributes(\n {\n x,\n width\n } as any,\n false,\n {\n type: AttributeUpdateType.ANIMATE_PLAY,\n animationState: {\n ratio,\n end\n }\n }\n );\n }\n}\n\nexport class Meteor extends ACustomAnimate<any> {\n declare size: number;\n declare target: IGraphic;\n declare root: IShadowRoot;\n declare posList: IPoint[];\n\n get lastPos(): IPoint {\n return this.posList[this.posList.length - 1];\n }\n\n constructor(size: number, duration: number, easing: EasingType, params?: any) {\n super(null, null, duration, easing, params);\n this.size = size;\n this.posList = [];\n }\n\n onBind(): void {\n const root = this.target.attachShadow();\n this.root = root;\n for (let i = 0; i < this.size; i++) {\n const g = this.target.clone();\n const scale = Math.min(((this.size - i) / this.size) * 3, 1);\n const opacity = Math.min(0.2 + 0.7 / this.size);\n g.setAttributes({ x: 0, y: 0, dx: 0, dy: 0, scaleX: scale, scaleY: scale, opacity }, false, {\n type: AttributeUpdateType.ANIMATE_BIND\n });\n root.add(g);\n }\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (end) {\n this.target.detachShadow();\n this.posList.length = 0;\n return;\n }\n\n const x = this.target.getComputedAttribute('x');\n const y = this.target.getComputedAttribute('y');\n\n const nextPos = new Point(x, y);\n if (!this.posList.length) {\n this.posList.push(nextPos);\n return;\n }\n\n this.target.shadowRoot.forEachChildren((g: IGraphic, i) => {\n const pos = this.posList[Math.max(this.posList.length - i - 1, 0)];\n g.setAttributes(\n {\n x: pos.x - x,\n y: pos.y - y\n },\n false\n );\n });\n\n this.posList.push(nextPos);\n }\n}\n\nexport class MotionPath extends ACustomAnimate<any> {\n declare valid: boolean;\n declare pathLength: number;\n declare path: CustomPath2D;\n declare distance: number;\n declare initAngle: number;\n declare changeAngle: boolean;\n declare cb?: (from: any, to: any, ratio: number, target: IGraphic) => void;\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params?: {\n path: CustomPath2D;\n distance: number;\n cb?: (from: any, to: any, ratio: number, target: IGraphic) => void;\n initAngle?: number;\n changeAngle?: boolean;\n }\n ) {\n super(from, to, duration, easing, params);\n if (params) {\n this.pathLength = params.path.getLength();\n this.path = params.path;\n this.distance = params.distance;\n this.to = params.distance * this.pathLength;\n this.initAngle = params.initAngle ?? 0;\n this.changeAngle = !!params.changeAngle;\n this.cb = params.cb;\n }\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 计算位置\n const at = this.to * ratio;\n const { pos, angle } = this.path.getAttrAt(at);\n out.x = pos.x;\n out.y = pos.y;\n if (this.changeAngle) {\n out.angle = angle + this.initAngle;\n }\n this.cb && this.cb(this.from, this.to, ratio, this.target as IGraphic);\n // out.angle = angle + this.initAngle;\n }\n}\n\nexport class TagPointsUpdate extends ACustomAnimate<{ points: IPointLike[] }> {\n protected fromPoints: IPointLike[];\n protected toPoints: IPointLike[];\n protected points: IPointLike[];\n protected interpolatePoints: [IPointLike, IPointLike][];\n protected newPointAnimateType: 'grow' | 'appear';\n\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params?: { newPointAnimateType?: 'grow' | 'appear' }\n ) {\n super(from, to, duration, easing, params);\n this.newPointAnimateType = params?.newPointAnimateType === 'appear' ? 'appear' : 'grow';\n }\n\n onBind(): void {\n const originFromPoints = this.from?.points;\n const originToPoints = this.to?.points;\n this.fromPoints = !originFromPoints ? [] : !Array.isArray(originFromPoints) ? [originFromPoints] : originFromPoints;\n this.toPoints = !originToPoints ? [] : !Array.isArray(originToPoints) ? [originToPoints] : originToPoints;\n\n const tagMap = new Map<string, IPointLike>();\n this.fromPoints.forEach(point => {\n if (point.context) {\n tagMap.set(point.context, point);\n }\n });\n let firstMatchedIndex = Infinity;\n let lastMatchedIndex = -Infinity;\n let firstMatchedPoint: IPointLike;\n let lastMatchedPoint: IPointLike;\n for (let i = 0; i < this.toPoints.length; i += 1) {\n if (tagMap.has(this.toPoints[i].context)) {\n firstMatchedIndex = i;\n firstMatchedPoint = tagMap.get(this.toPoints[i].context);\n break;\n }\n }\n for (let i = this.toPoints.length - 1; i >= 0; i -= 1) {\n if (tagMap.has(this.toPoints[i].context)) {\n lastMatchedIndex = i;\n lastMatchedPoint = tagMap.get(this.toPoints[i].context);\n break;\n }\n }\n // TODO: shrink removed points\n // if no point is matched, animation should start from toPoint[0]\n let prevMatchedPoint = this.toPoints[0];\n this.interpolatePoints = this.toPoints.map((point, index) => {\n const matchedPoint = tagMap.get(point.context);\n if (matchedPoint) {\n prevMatchedPoint = matchedPoint;\n return [matchedPoint, point];\n }\n // appear new point\n if (this.newPointAnimateType === 'appear') {\n return [point, point];\n }\n // grow new point\n if (index < firstMatchedIndex && firstMatchedPoint) {\n return [firstMatchedPoint, point];\n } else if (index > lastMatchedIndex && lastMatchedPoint) {\n return [lastMatchedPoint, point];\n }\n return [prevMatchedPoint, point];\n });\n this.points = this.interpolatePoints.map(interpolate => {\n const fromPoint = interpolate[0];\n const toPoint = interpolate[1];\n const newPoint = new Point(fromPoint.x, fromPoint.y, fromPoint.x1, fromPoint.y1);\n newPoint.defined = toPoint.defined;\n newPoint.context = toPoint.context;\n return newPoint;\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // if not create new points, multi points animation might not work well.\n this.points = this.points.map((point, index) => {\n const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);\n newPoint.context = point.context;\n return newPoint;\n });\n out.points = this.points;\n }\n}\n\nexport class GraphicAnimate extends ACustomAnimate<any> {\n graphic: IGraphic;\n\n constructor(from: any, to: any, duration: number, easing: EasingType, params?: { graphic: IGraphic }) {\n super(from, to, duration, easing, params);\n this.graphic = params?.graphic;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this.graphic) {\n return;\n }\n Object.keys(this.from).forEach(k => {\n out[k] = this.from[k] + (this.to[k] - this.from[k]) * ratio;\n });\n }\n}\n\nexport class ClipGraphicAnimate extends ACustomAnimate<any> {\n private _group?: IGroup;\n private _clipGraphic?: IGraphic;\n protected clipFromAttribute?: any;\n protected clipToAttribute?: any;\n\n private _lastClip?: boolean;\n private _lastPath?: IGraphic[];\n\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: { group: IGroup; clipGraphic: IGraphic }\n ) {\n super(null, null, duration, easing, params);\n this.clipFromAttribute = from;\n this.clipToAttribute = to;\n this._group = params?.group;\n this._clipGraphic = params?.clipGraphic;\n }\n\n onBind() {\n if (this._group && this._clipGraphic) {\n this._lastClip = this._group.attribute.clip;\n this._lastPath = this._group.attribute.path;\n this._group.setAttributes(\n {\n clip: true,\n path: [this._clipGraphic]\n },\n false,\n { type: AttributeUpdateType.ANIMATE_BIND }\n );\n }\n }\n\n onEnd() {\n if (this._group) {\n this._group.setAttributes(\n {\n clip: this._lastClip,\n path: this._lastPath\n },\n false,\n { type: AttributeUpdateType.ANIMATE_END }\n );\n }\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this._clipGraphic) {\n return;\n }\n const res: any = {};\n Object.keys(this.clipFromAttribute).forEach(k => {\n res[k] = this.clipFromAttribute[k] + (this.clipToAttribute[k] - this.clipFromAttribute[k]) * ratio;\n });\n this._clipGraphic.setAttributes(res, false, {\n type: AttributeUpdateType.ANIMATE_UPDATE,\n animationState: { ratio, end }\n });\n }\n}\n\nexport class ClipAngleAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n center?: { x: number; y: number };\n startAngle?: number;\n radius?: number;\n orient?: 'clockwise' | 'anticlockwise';\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = groupAttribute.width ?? 0;\n const height = groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const startAngle = params?.startAngle ?? 0;\n const orient = params?.orient ?? 'clockwise';\n\n let arcStartAngle = 0;\n let arcEndAngle = 0;\n if (orient === 'anticlockwise') {\n arcEndAngle = animationType === 'in' ? startAngle + Math.PI * 2 : startAngle;\n arcEndAngle = startAngle + Math.PI * 2;\n } else {\n arcStartAngle = startAngle;\n arcEndAngle = animationType === 'out' ? startAngle + Math.PI * 2 : startAngle;\n }\n const arc = application.graphicService.creator.arc({\n x: params?.center?.x ?? width / 2,\n y: params?.center?.y ?? height / 2,\n outerRadius: params?.radius ?? (width + height) / 2,\n innerRadius: 0,\n startAngle: arcStartAngle,\n endAngle: arcEndAngle,\n fill: true\n });\n let fromAttributes: Partial<IArcGraphicAttribute>;\n let toAttributes: Partial<IArcGraphicAttribute>;\n if (orient === 'anticlockwise') {\n fromAttributes = { startAngle: startAngle + Math.PI * 2 };\n toAttributes = { startAngle: startAngle };\n } else {\n fromAttributes = { endAngle: startAngle };\n toAttributes = { endAngle: startAngle + Math.PI * 2 };\n }\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: arc }\n );\n }\n}\n\nexport class ClipRadiusAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n center?: { x: number; y: number };\n startRadius?: number;\n endRadius?: number;\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = groupAttribute.width ?? 0;\n const height = groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const startRadius = params?.startRadius ?? 0;\n const endRadius = params?.endRadius ?? Math.sqrt((width / 2) ** 2 + (height / 2) ** 2);\n\n const arc = application.graphicService.creator.arc({\n x: params?.center?.x ?? width / 2,\n y: params?.center?.y ?? height / 2,\n outerRadius: animationType === 'out' ? endRadius : startRadius,\n innerRadius: 0,\n startAngle: 0,\n endAngle: Math.PI * 2,\n fill: true\n });\n const fromAttributes: Partial<IArcGraphicAttribute> = { outerRadius: startRadius };\n const toAttributes: Partial<IArcGraphicAttribute> = { outerRadius: endRadius };\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: arc }\n );\n }\n}\n\nexport class ClipDirectionAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n direction?: 'x' | 'y';\n orient?: 'positive' | 'negative';\n width?: number;\n height?: number;\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = params?.width ?? groupAttribute.width ?? 0;\n const height = params?.height ?? groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const direction = params?.direction ?? 'x';\n const orient = params?.orient ?? 'positive';\n\n const rect = application.graphicService.creator.rect({\n x: 0,\n y: 0,\n width: animationType === 'in' && direction === 'x' ? 0 : width,\n height: animationType === 'in' && direction === 'y' ? 0 : height,\n fill: true\n });\n let fromAttributes: Partial<IRectGraphicAttribute> = {};\n let toAttributes: Partial<IRectGraphicAttribute> = {};\n if (direction === 'y') {\n if (orient === 'negative') {\n fromAttributes = { y: height, height: 0 };\n toAttributes = { y: 0, height: height };\n } else {\n fromAttributes = { height: 0 };\n toAttributes = { height: height };\n }\n } else {\n if (orient === 'negative') {\n fromAttributes = { x: width, width: 0 };\n toAttributes = { x: 0, width: width };\n } else {\n fromAttributes = { width: 0 };\n toAttributes = { width: width };\n }\n }\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: rect }\n );\n }\n}\n\ntype RotateSphereParams =\n | {\n center: { x: number; y: number; z: number };\n r: number;\n }\n | (() => any);\n\nexport class RotateBySphereAnimate extends ACustomAnimate<any> {\n declare params: RotateSphereParams;\n declare theta: number;\n declare phi: number;\n\n onStart(): void {\n const { center, r } = typeof this.params === 'function' ? this.params() : this.params;\n const startX = this.target.getComputedAttribute('x');\n const startY = this.target.getComputedAttribute('y');\n const startZ = this.target.getComputedAttribute('z');\n const phi = Math.acos((startY - center.y) / r);\n let theta = Math.acos((startX - center.x) / r / Math.sin(phi));\n if (startZ - center.z < 0) {\n theta = pi2 - theta;\n }\n this.theta = theta;\n this.phi = phi;\n }\n\n onBind() {\n return;\n }\n\n onEnd() {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.phi == null || this.theta == null) {\n return;\n }\n const { center, r } = typeof this.params === 'function' ? this.params() : this.params;\n const deltaAngle = Math.PI * 2 * ratio;\n const theta = this.theta + deltaAngle;\n const phi = this.phi;\n const x = r * Math.sin(phi) * Math.cos(theta) + center.x;\n const y = r * Math.cos(phi) + center.y;\n const z = r * Math.sin(phi) * Math.sin(theta) + center.z;\n out.x = x;\n out.y = y;\n out.z = z;\n // out.beta = phi;\n out.alpha = theta + pi / 2;\n while (out.alpha > pi2) {\n out.alpha -= pi2;\n }\n out.alpha = pi2 - out.alpha;\n\n out.zIndex = out.z * -10000;\n }\n}\n\nexport class GroupFadeIn extends ACustomAnimate<any> {\n declare target: IGroup;\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n this.target.setTheme({\n common: {\n opacity: 0\n }\n });\n return;\n }\n\n onEnd(): void {\n this.target.setTheme({\n common: {\n opacity: 1\n }\n });\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.target.setTheme({\n common: {\n opacity: ratio\n }\n });\n }\n}\n\nexport class GroupFadeOut extends ACustomAnimate<any> {\n declare target: IGroup;\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n this.target.setTheme({\n common: {\n opacity: 1\n }\n });\n return;\n }\n\n onEnd(): void {\n this.target.setTheme({\n common: {\n opacity: 0\n }\n });\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.target.setTheme({\n common: {\n opacity: 1 - ratio\n }\n });\n }\n}\n\nexport class AttributeAnimate extends ACustomAnimate<any> {\n declare target: IGroup;\n\n constructor(to: Record<string, any>, duration: number, easing: EasingType) {\n super({}, to, duration, easing);\n }\n\n getEndProps(): Record<string, any> {\n return this.to;\n }\n\n onBind(): void {\n Object.keys(this.to).forEach(k => {\n this.from[k] = this.target.getComputedAttribute(k);\n });\n return;\n }\n\n onEnd(): void {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.target.stepInterpolate(\n this.subAnimate,\n this.subAnimate.animate,\n out,\n this.step,\n ratio,\n end,\n this.to,\n this.from\n );\n }\n}\n\nexport class AnimateGroup extends ACustomAnimate<any> {\n declare customAnimates: ACustomAnimate<any>[];\n declare updating: boolean;\n\n constructor(duration: number, customAnimates: ACustomAnimate<any>[]) {\n super(null, null, duration, 'linear');\n this.customAnimates = customAnimates;\n }\n\n initAnimates() {\n this.customAnimates.forEach(a => {\n a.step = this.step;\n a.subAnimate = this.subAnimate;\n a.target = this.target;\n });\n }\n\n getEndProps(): Record<string, any> {\n const props = {};\n this.customAnimates.forEach(a => {\n Object.assign(props, a.getEndProps());\n });\n return props;\n }\n\n onBind(): void {\n this.initAnimates();\n this.customAnimates.forEach(a => {\n a.onBind();\n });\n return;\n }\n\n onEnd(): void {\n this.customAnimates.forEach(a => {\n a.onEnd();\n });\n return;\n }\n\n onStart(): void {\n this.customAnimates.forEach(a => {\n a.onStart();\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.updating) {\n return;\n }\n this.updating = true;\n this.customAnimates.forEach(a => {\n const easing = a.easing;\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n ratio = easingFunc(ratio);\n a.onUpdate(end, ratio, out);\n });\n this.updating = false;\n return;\n }\n}\n\nexport class AnimateGroup1 extends ACustomAnimate<any> {\n declare customAnimates: ACustomAnimate<any>[];\n declare updating: boolean;\n\n constructor(duration: number, customAnimates: ACustomAnimate<any>[]) {\n super(null, null, duration, 'linear');\n this.customAnimates = customAnimates;\n }\n\n initAnimates() {\n this.customAnimates.forEach(a => {\n a.step = this.step;\n a.subAnimate = this.subAnimate;\n a.target = this.target;\n });\n }\n\n getEndProps(): Record<string, any> {\n const props = {};\n this.customAnimates.forEach(a => {\n Object.assign(props, a.getEndProps());\n });\n return props;\n }\n\n onBind(): void {\n this.initAnimates();\n this.customAnimates.forEach(a => {\n a.onBind();\n });\n return;\n }\n\n onEnd(): void {\n this.customAnimates.forEach(a => {\n a.onEnd();\n });\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.updating) {\n return;\n }\n this.updating = true;\n this.customAnimates.forEach(a => {\n const easing = a.easing;\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n ratio = easingFunc(ratio);\n a.onUpdate(end, ratio, out);\n });\n this.updating = false;\n return;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/animate/custom-animate.ts"],"names":[],"mappings":";;;AACA,6CAAuF;AACvF,gDAA6C;AAC7C,2CAAsD;AAatD,uCAA2C;AAC3C,qCAAkC;AAClC,2CAAqD;AAErD,MAAa,aAAc,SAAQ,wBAAyC;IAO1E,YACE,IAA+B,EAC/B,EAA6B,EAC7B,QAAgB,EAChB,MAAkB,EAClB,MAA4B;QAE5B,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,WAAW;QACT,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;YACxB,OAAO,EAAE,CAAC;SACX;QACD,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,EAAE;SACd,CAAC;IACJ,CAAC;IAED,MAAM;;QACJ,IAAI,CAAC,UAAU,GAAG,IAAA,iBAAQ,EAAC,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,CAAC,CAAC;QACnG,IAAI,CAAC,QAAQ,GAAG,IAAA,iBAAQ,EAAC,MAAA,IAAI,CAAC,EAAE,0CAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,EAAE,0CAAE,IAAI,CAAC,CAAC,CAAC,MAAM,C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AAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YACxE,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;YAC1B,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,OAAO;IACT,CAAC;CACF;AAtDD,sCAsDC","file":"custom-animate.js","sourcesContent":["import type { IPoint, IPointLike } from '@visactor/vutils';\nimport { getDecimalPlaces, isArray, isNumber, pi, pi2, Point } from '@visactor/vutils';\nimport { application } from '../application';\nimport { AttributeUpdateType } from '../common/enums';\nimport type { CustomPath2D } from '../common/custom-path2d';\nimport type {\n EasingType,\n IArcGraphicAttribute,\n IGraphic,\n IGroup,\n ILinearGradient,\n IRect,\n IRectAttribute,\n IRectGraphicAttribute,\n IShadowRoot\n} from '../interface';\nimport { ACustomAnimate } from './animate';\nimport { Easing } from './easing';\nimport { pointInterpolation } from '../common/utils';\n\nexport class IncreaseCount extends ACustomAnimate<{ text: string | number }> {\n declare valid: boolean;\n\n private fromNumber: number;\n private toNumber: number;\n private decimalLength: number;\n\n constructor(\n from: { text: string | number },\n to: { text: string | number },\n duration: number,\n easing: EasingType,\n params?: { fixed?: boolean }\n ) {\n super(from, to, duration, easing, params);\n }\n\n getEndProps(): Record<string, any> | void {\n if (this.valid === false) {\n return {};\n }\n return {\n text: this.to\n };\n }\n\n onBind(): void {\n this.fromNumber = isNumber(this.from?.text) ? this.from?.text : Number.parseFloat(this.from?.text);\n this.toNumber = isNumber(this.to?.text) ? this.to?.text : Number.parseFloat(this.to?.text);\n if (!Number.isFinite(this.toNumber)) {\n this.fromNumber = 0;\n }\n if (!Number.isFinite(this.toNumber)) {\n this.valid = false;\n }\n if (this.valid !== false) {\n this.decimalLength =\n this.params?.fixed ?? Math.max(getDecimalPlaces(this.fromNumber), getDecimalPlaces(this.toNumber));\n }\n }\n\n onEnd(): void {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.valid === false) {\n return;\n }\n if (end) {\n out.text = this.toNumber;\n } else {\n out.text = (this.fromNumber + (this.toNumber - this.fromNumber) * ratio).toFixed(this.decimalLength);\n }\n }\n}\n\nenum Direction {\n LEFT_TO_RIGHT = 0,\n RIGHT_TO_LEFT = 1,\n TOP_TO_BOTTOM = 2,\n BOTTOM_TO_TOP = 3,\n STROKE = 4\n}\nexport class FadeInPlus extends ACustomAnimate<any> {\n declare direction: number;\n declare toFill: string;\n declare toStroke: string;\n declare fillGradient: ILinearGradient;\n declare strokeGradient: ILinearGradient;\n declare fill: boolean;\n declare stroke: boolean;\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params?: { direction?: number; fill?: boolean; stroke?: boolean }\n ) {\n super(from, to, duration, easing, params);\n const { direction = Direction.LEFT_TO_RIGHT, fill = true, stroke = true } = params || {};\n this.direction = direction;\n this.fill = fill;\n this.stroke = stroke;\n this.fillGradient = {\n gradient: 'linear',\n stops: []\n };\n this.strokeGradient = {\n gradient: 'linear',\n stops: []\n };\n }\n\n getEndProps(): Record<string, any> {\n return {\n fill: this.toFill,\n stroke: this.toStroke\n };\n }\n\n onBind(): void {\n // this.to = parseFloat(this.target.getAnimatePropByName('text'));\n this.toFill = this.target.getComputedAttribute('fill');\n this.toStroke = this.target.getComputedAttribute('stroke');\n }\n\n onEnd(): void {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this.toFill) {\n return;\n }\n if (!this.toStroke) {\n return;\n }\n switch (this.direction) {\n case Direction.RIGHT_TO_LEFT:\n this.rightToLeft(end, ratio, out);\n break;\n case Direction.TOP_TO_BOTTOM:\n this.topToBottom(end, ratio, out);\n break;\n case Direction.BOTTOM_TO_TOP:\n this.bottomToTop(end, ratio, out);\n break;\n case Direction.STROKE:\n this.strokePath(end, ratio, out);\n break;\n default:\n this.leftToRight(end, ratio, out);\n break;\n }\n }\n\n leftToRight(end: boolean, ratio: number, out: Record<string, any>) {\n if (this.fill) {\n const toFillColor = this.toFill;\n this.fillGradient.x0 = 0;\n this.fillGradient.y0 = 0;\n this.fillGradient.x1 = 1;\n this.fillGradient.y1 = 0;\n this.fillGradient.stops = [\n { offset: 0, color: toFillColor },\n { offset: ratio, color: toFillColor },\n { offset: Math.min(1, ratio * 2), color: 'transparent' }\n ];\n out.fill = this.fillGradient;\n }\n if (this.stroke) {\n const toStrokeColor = this.toStroke;\n this.strokeGradient.x0 = 0;\n this.strokeGradient.y0 = 0;\n this.strokeGradient.x1 = 1;\n this.strokeGradient.y1 = 0;\n this.strokeGradient.stops = [\n { offset: 0, color: toStrokeColor },\n { offset: ratio, color: toStrokeColor },\n { offset: Math.min(1, ratio * 6), color: 'transparent' }\n ];\n out.stroke = this.strokeGradient;\n // const dashLen = 300;\n // const offset = ratio * dashLen;\n // out.lineDash = [offset, dashLen - offset];\n }\n return;\n }\n\n strokePath(end: boolean, ratio: number, out: Record<string, any>) {\n if (this.fill) {\n const toFillColor = this.toFill;\n this.fillGradient.x0 = 0;\n this.fillGradient.y0 = 0;\n this.fillGradient.x1 = 1;\n this.fillGradient.y1 = 0;\n this.fillGradient.stops = [\n { offset: 0, color: toFillColor },\n { offset: ratio, color: toFillColor },\n { offset: Math.min(1, ratio * 2), color: 'transparent' }\n ];\n out.fill = this.fillGradient;\n }\n if (this.stroke) {\n const dashLen = 300;\n const offset = ratio * dashLen;\n out.lineDash = [offset, dashLen - offset];\n }\n return;\n }\n rightToLeft(end: boolean, ratio: number, out: Record<string, any>) {\n return;\n }\n topToBottom(end: boolean, ratio: number, out: Record<string, any>) {\n return;\n }\n bottomToTop(end: boolean, ratio: number, out: Record<string, any>) {\n return;\n }\n}\n\nexport class InputText extends ACustomAnimate<{ text: string }> {\n declare valid: boolean;\n declare target: IGraphic;\n\n private fromText: string = '';\n private toText: string = '';\n\n getEndProps(): Record<string, any> {\n if (this.valid === false) {\n return {};\n }\n return {\n text: this.to\n };\n }\n\n onBind(): void {\n this.fromText = this.from?.text ?? '';\n this.toText = this.to?.text ?? '';\n if (!this.toText || isArray(this.toText)) {\n this.valid = false;\n } else {\n this.toText = this.toText.toString();\n const root = this.target.attachShadow();\n const line = application.graphicService.creator.line({\n x: 0,\n y: 0,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: this.target.getComputedAttribute('fontSize') }\n ],\n stroke: 'black',\n lineWidth: 1\n });\n root.add(line);\n }\n }\n\n onEnd(): void {\n this.target.detachShadow();\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.valid === false) {\n return;\n }\n // update text\n const fromCount = this.fromText.length;\n const toCount = this.toText.length;\n const count = Math.ceil(fromCount + (toCount - fromCount) * ratio);\n\n out.text = this.toText.substr(0, count);\n\n // update line position\n const line = this.target.shadowRoot?.at(0) as IGraphic;\n const endX = (this.target as any).clipedWidth + 2;\n line.setAttribute('x', endX);\n }\n}\n\nexport class StreamLight extends ACustomAnimate<any> {\n declare valid: boolean;\n declare target: IGraphic;\n\n declare rect: IRect;\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params?: { attribute?: Partial<IRectAttribute>; streamLength?: number }\n ) {\n super(from, to, duration, easing, params);\n }\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onStart(): void {\n const root = this.target.attachShadow();\n\n const height = this.target.AABBBounds.height();\n\n const rect = application.graphicService.creator.rect({\n height: height,\n fill: '#bcdeff',\n shadowBlur: 30,\n shadowColor: '#bcdeff',\n ...this.params?.attribute,\n x: 0,\n y: 0,\n width: 0\n });\n this.rect = rect;\n root.add(rect);\n }\n\n onBind(): void {\n return;\n }\n\n onEnd(): void {\n this.target.detachShadow();\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const parentWidth = (this.target as any).attribute.width ?? 250;\n const streamLength = this.params?.streamLength ?? parentWidth;\n const maxLength = this.params?.attribute?.width ?? 60;\n const startX = -maxLength;\n const currentX = startX + (streamLength - startX) * ratio;\n const x = Math.max(currentX, 0);\n const w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX);\n const width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;\n this.rect.setAttributes(\n {\n x,\n width\n } as any,\n false,\n {\n type: AttributeUpdateType.ANIMATE_PLAY,\n animationState: {\n ratio,\n end\n }\n }\n );\n }\n}\n\nexport class Meteor extends ACustomAnimate<any> {\n declare size: number;\n declare target: IGraphic;\n declare root: IShadowRoot;\n declare posList: IPoint[];\n\n get lastPos(): IPoint {\n return this.posList[this.posList.length - 1];\n }\n\n constructor(size: number, duration: number, easing: EasingType, params?: any) {\n super(null, null, duration, easing, params);\n this.size = size;\n this.posList = [];\n }\n\n onBind(): void {\n const root = this.target.attachShadow();\n this.root = root;\n for (let i = 0; i < this.size; i++) {\n const g = this.target.clone();\n const scale = Math.min(((this.size - i) / this.size) * 3, 1);\n const opacity = Math.min(0.2 + 0.7 / this.size);\n g.setAttributes({ x: 0, y: 0, dx: 0, dy: 0, scaleX: scale, scaleY: scale, opacity }, false, {\n type: AttributeUpdateType.ANIMATE_BIND\n });\n root.add(g);\n }\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (end) {\n this.target.detachShadow();\n this.posList.length = 0;\n return;\n }\n\n const x = this.target.getComputedAttribute('x');\n const y = this.target.getComputedAttribute('y');\n\n const nextPos = new Point(x, y);\n if (!this.posList.length) {\n this.posList.push(nextPos);\n return;\n }\n\n this.target.shadowRoot.forEachChildren((g: IGraphic, i) => {\n const pos = this.posList[Math.max(this.posList.length - i - 1, 0)];\n g.setAttributes(\n {\n x: pos.x - x,\n y: pos.y - y\n },\n false\n );\n });\n\n this.posList.push(nextPos);\n }\n}\n\nexport class MotionPath extends ACustomAnimate<any> {\n declare valid: boolean;\n declare pathLength: number;\n declare path: CustomPath2D;\n declare distance: number;\n declare initAngle: number;\n declare changeAngle: boolean;\n declare cb?: (from: any, to: any, ratio: number, target: IGraphic) => void;\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params?: {\n path: CustomPath2D;\n distance: number;\n cb?: (from: any, to: any, ratio: number, target: IGraphic) => void;\n initAngle?: number;\n changeAngle?: boolean;\n }\n ) {\n super(from, to, duration, easing, params);\n if (params) {\n this.pathLength = params.path.getLength();\n this.path = params.path;\n this.distance = params.distance;\n this.to = params.distance * this.pathLength;\n this.initAngle = params.initAngle ?? 0;\n this.changeAngle = !!params.changeAngle;\n this.cb = params.cb;\n }\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 计算位置\n const at = this.to * ratio;\n const { pos, angle } = this.path.getAttrAt(at);\n out.x = pos.x;\n out.y = pos.y;\n if (this.changeAngle) {\n out.angle = angle + this.initAngle;\n }\n this.cb && this.cb(this.from, this.to, ratio, this.target as IGraphic);\n // out.angle = angle + this.initAngle;\n }\n}\n\nexport class TagPointsUpdate extends ACustomAnimate<{ points: IPointLike[] }> {\n protected fromPoints: IPointLike[];\n protected toPoints: IPointLike[];\n protected points: IPointLike[];\n protected interpolatePoints: [IPointLike, IPointLike][];\n protected newPointAnimateType: 'grow' | 'appear';\n\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params?: { newPointAnimateType?: 'grow' | 'appear' }\n ) {\n super(from, to, duration, easing, params);\n this.newPointAnimateType = params?.newPointAnimateType === 'appear' ? 'appear' : 'grow';\n }\n\n onBind(): void {\n const originFromPoints = this.from?.points;\n const originToPoints = this.to?.points;\n this.fromPoints = !originFromPoints ? [] : !Array.isArray(originFromPoints) ? [originFromPoints] : originFromPoints;\n this.toPoints = !originToPoints ? [] : !Array.isArray(originToPoints) ? [originToPoints] : originToPoints;\n\n const tagMap = new Map<string, IPointLike>();\n this.fromPoints.forEach(point => {\n if (point.context) {\n tagMap.set(point.context, point);\n }\n });\n let firstMatchedIndex = Infinity;\n let lastMatchedIndex = -Infinity;\n let firstMatchedPoint: IPointLike;\n let lastMatchedPoint: IPointLike;\n for (let i = 0; i < this.toPoints.length; i += 1) {\n if (tagMap.has(this.toPoints[i].context)) {\n firstMatchedIndex = i;\n firstMatchedPoint = tagMap.get(this.toPoints[i].context);\n break;\n }\n }\n for (let i = this.toPoints.length - 1; i >= 0; i -= 1) {\n if (tagMap.has(this.toPoints[i].context)) {\n lastMatchedIndex = i;\n lastMatchedPoint = tagMap.get(this.toPoints[i].context);\n break;\n }\n }\n // TODO: shrink removed points\n // if no point is matched, animation should start from toPoint[0]\n let prevMatchedPoint = this.toPoints[0];\n this.interpolatePoints = this.toPoints.map((point, index) => {\n const matchedPoint = tagMap.get(point.context);\n if (matchedPoint) {\n prevMatchedPoint = matchedPoint;\n return [matchedPoint, point];\n }\n // appear new point\n if (this.newPointAnimateType === 'appear') {\n return [point, point];\n }\n // grow new point\n if (index < firstMatchedIndex && firstMatchedPoint) {\n return [firstMatchedPoint, point];\n } else if (index > lastMatchedIndex && lastMatchedPoint) {\n return [lastMatchedPoint, point];\n }\n return [prevMatchedPoint, point];\n });\n this.points = this.interpolatePoints.map(interpolate => {\n const fromPoint = interpolate[0];\n const toPoint = interpolate[1];\n const newPoint = new Point(fromPoint.x, fromPoint.y, fromPoint.x1, fromPoint.y1);\n newPoint.defined = toPoint.defined;\n newPoint.context = toPoint.context;\n return newPoint;\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // if not create new points, multi points animation might not work well.\n this.points = this.points.map((point, index) => {\n const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);\n newPoint.context = point.context;\n return newPoint;\n });\n out.points = this.points;\n }\n}\n\nexport class GraphicAnimate extends ACustomAnimate<any> {\n graphic: IGraphic;\n\n constructor(from: any, to: any, duration: number, easing: EasingType, params?: { graphic: IGraphic }) {\n super(from, to, duration, easing, params);\n this.graphic = params?.graphic;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this.graphic) {\n return;\n }\n Object.keys(this.from).forEach(k => {\n out[k] = this.from[k] + (this.to[k] - this.from[k]) * ratio;\n });\n }\n}\n\nexport class ClipGraphicAnimate extends ACustomAnimate<any> {\n private _group?: IGroup;\n private _clipGraphic?: IGraphic;\n protected clipFromAttribute?: any;\n protected clipToAttribute?: any;\n\n private _lastClip?: boolean;\n private _lastPath?: IGraphic[];\n\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: { group: IGroup; clipGraphic: IGraphic }\n ) {\n super(null, null, duration, easing, params);\n this.clipFromAttribute = from;\n this.clipToAttribute = to;\n this._group = params?.group;\n this._clipGraphic = params?.clipGraphic;\n }\n\n onBind() {\n if (this._group && this._clipGraphic) {\n this._lastClip = this._group.attribute.clip;\n this._lastPath = this._group.attribute.path;\n this._group.setAttributes(\n {\n clip: true,\n path: [this._clipGraphic]\n },\n false,\n { type: AttributeUpdateType.ANIMATE_BIND }\n );\n }\n }\n\n onEnd() {\n if (this._group) {\n this._group.setAttributes(\n {\n clip: this._lastClip,\n path: this._lastPath\n },\n false,\n { type: AttributeUpdateType.ANIMATE_END }\n );\n }\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this._clipGraphic) {\n return;\n }\n const res: any = {};\n Object.keys(this.clipFromAttribute).forEach(k => {\n res[k] = this.clipFromAttribute[k] + (this.clipToAttribute[k] - this.clipFromAttribute[k]) * ratio;\n });\n this._clipGraphic.setAttributes(res, false, {\n type: AttributeUpdateType.ANIMATE_UPDATE,\n animationState: { ratio, end }\n });\n }\n}\n\nexport class ClipAngleAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n center?: { x: number; y: number };\n startAngle?: number;\n radius?: number;\n orient?: 'clockwise' | 'anticlockwise';\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = groupAttribute.width ?? 0;\n const height = groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const startAngle = params?.startAngle ?? 0;\n const orient = params?.orient ?? 'clockwise';\n\n let arcStartAngle = 0;\n let arcEndAngle = 0;\n if (orient === 'anticlockwise') {\n arcEndAngle = animationType === 'in' ? startAngle + Math.PI * 2 : startAngle;\n arcEndAngle = startAngle + Math.PI * 2;\n } else {\n arcStartAngle = startAngle;\n arcEndAngle = animationType === 'out' ? startAngle + Math.PI * 2 : startAngle;\n }\n const arc = application.graphicService.creator.arc({\n x: params?.center?.x ?? width / 2,\n y: params?.center?.y ?? height / 2,\n outerRadius: params?.radius ?? (width + height) / 2,\n innerRadius: 0,\n startAngle: arcStartAngle,\n endAngle: arcEndAngle,\n fill: true\n });\n let fromAttributes: Partial<IArcGraphicAttribute>;\n let toAttributes: Partial<IArcGraphicAttribute>;\n if (orient === 'anticlockwise') {\n fromAttributes = { startAngle: startAngle + Math.PI * 2 };\n toAttributes = { startAngle: startAngle };\n } else {\n fromAttributes = { endAngle: startAngle };\n toAttributes = { endAngle: startAngle + Math.PI * 2 };\n }\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: arc }\n );\n }\n}\n\nexport class ClipRadiusAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n center?: { x: number; y: number };\n startRadius?: number;\n endRadius?: number;\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = groupAttribute.width ?? 0;\n const height = groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const startRadius = params?.startRadius ?? 0;\n const endRadius = params?.endRadius ?? Math.sqrt((width / 2) ** 2 + (height / 2) ** 2);\n\n const arc = application.graphicService.creator.arc({\n x: params?.center?.x ?? width / 2,\n y: params?.center?.y ?? height / 2,\n outerRadius: animationType === 'out' ? endRadius : startRadius,\n innerRadius: 0,\n startAngle: 0,\n endAngle: Math.PI * 2,\n fill: true\n });\n const fromAttributes: Partial<IArcGraphicAttribute> = { outerRadius: startRadius };\n const toAttributes: Partial<IArcGraphicAttribute> = { outerRadius: endRadius };\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: arc }\n );\n }\n}\n\nexport class ClipDirectionAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n direction?: 'x' | 'y';\n orient?: 'positive' | 'negative';\n width?: number;\n height?: number;\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = params?.width ?? groupAttribute.width ?? 0;\n const height = params?.height ?? groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const direction = params?.direction ?? 'x';\n const orient = params?.orient ?? 'positive';\n\n const rect = application.graphicService.creator.rect({\n x: 0,\n y: 0,\n width: animationType === 'in' && direction === 'x' ? 0 : width,\n height: animationType === 'in' && direction === 'y' ? 0 : height,\n fill: true\n });\n let fromAttributes: Partial<IRectGraphicAttribute> = {};\n let toAttributes: Partial<IRectGraphicAttribute> = {};\n if (direction === 'y') {\n if (orient === 'negative') {\n fromAttributes = { y: height, height: 0 };\n toAttributes = { y: 0, height: height };\n } else {\n fromAttributes = { height: 0 };\n toAttributes = { height: height };\n }\n } else {\n if (orient === 'negative') {\n fromAttributes = { x: width, width: 0 };\n toAttributes = { x: 0, width: width };\n } else {\n fromAttributes = { width: 0 };\n toAttributes = { width: width };\n }\n }\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: rect }\n );\n }\n}\n\ntype RotateSphereParams =\n | {\n center: { x: number; y: number; z: number };\n r: number;\n }\n | (() => any);\n\nexport class RotateBySphereAnimate extends ACustomAnimate<any> {\n declare params: RotateSphereParams;\n declare theta: number;\n declare phi: number;\n\n onStart(): void {\n const { center, r } = typeof this.params === 'function' ? this.params() : this.params;\n const startX = this.target.getComputedAttribute('x');\n const startY = this.target.getComputedAttribute('y');\n const startZ = this.target.getComputedAttribute('z');\n const phi = Math.acos((startY - center.y) / r);\n let theta = Math.acos((startX - center.x) / r / Math.sin(phi));\n if (startZ - center.z < 0) {\n theta = pi2 - theta;\n }\n this.theta = theta;\n this.phi = phi;\n }\n\n onBind() {\n return;\n }\n\n onEnd() {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.phi == null || this.theta == null) {\n return;\n }\n const { center, r } = typeof this.params === 'function' ? this.params() : this.params;\n const deltaAngle = Math.PI * 2 * ratio;\n const theta = this.theta + deltaAngle;\n const phi = this.phi;\n const x = r * Math.sin(phi) * Math.cos(theta) + center.x;\n const y = r * Math.cos(phi) + center.y;\n const z = r * Math.sin(phi) * Math.sin(theta) + center.z;\n out.x = x;\n out.y = y;\n out.z = z;\n // out.beta = phi;\n out.alpha = theta + pi / 2;\n while (out.alpha > pi2) {\n out.alpha -= pi2;\n }\n out.alpha = pi2 - out.alpha;\n\n out.zIndex = out.z * -10000;\n }\n}\n\nexport class GroupFadeIn extends ACustomAnimate<any> {\n declare target: IGroup;\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n this.target.setTheme({\n common: {\n opacity: 0\n }\n });\n return;\n }\n\n onEnd(): void {\n this.target.setTheme({\n common: {\n opacity: 1\n }\n });\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.target.setTheme({\n common: {\n opacity: ratio\n }\n });\n }\n}\n\nexport class GroupFadeOut extends ACustomAnimate<any> {\n declare target: IGroup;\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n this.target.setTheme({\n common: {\n opacity: 1\n }\n });\n return;\n }\n\n onEnd(): void {\n this.target.setTheme({\n common: {\n opacity: 0\n }\n });\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.target.setTheme({\n common: {\n opacity: 1 - ratio\n }\n });\n }\n}\n\nexport class AttributeAnimate extends ACustomAnimate<any> {\n declare target: IGroup;\n\n constructor(to: Record<string, any>, duration: number, easing: EasingType) {\n super({}, to, duration, easing);\n }\n\n getEndProps(): Record<string, any> {\n return this.to;\n }\n\n onBind(): void {\n Object.keys(this.to).forEach(k => {\n this.from[k] = this.target.getComputedAttribute(k);\n });\n return;\n }\n\n onEnd(): void {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.target.stepInterpolate(\n this.subAnimate,\n this.subAnimate.animate,\n out,\n this.step,\n ratio,\n end,\n this.to,\n this.from\n );\n }\n}\n\nexport class AnimateGroup extends ACustomAnimate<any> {\n declare customAnimates: ACustomAnimate<any>[];\n declare updating: boolean;\n\n constructor(duration: number, customAnimates: ACustomAnimate<any>[]) {\n super(null, null, duration, 'linear');\n this.customAnimates = customAnimates;\n }\n\n initAnimates() {\n this.customAnimates.forEach(a => {\n a.step = this.step;\n a.subAnimate = this.subAnimate;\n a.target = this.target;\n });\n }\n\n getEndProps(): Record<string, any> {\n const props = {};\n this.customAnimates.forEach(a => {\n Object.assign(props, a.getEndProps());\n });\n return props;\n }\n\n onBind(): void {\n this.initAnimates();\n this.customAnimates.forEach(a => {\n a.onBind();\n });\n return;\n }\n\n onEnd(): void {\n this.customAnimates.forEach(a => {\n a.onEnd();\n });\n return;\n }\n\n onStart(): void {\n this.customAnimates.forEach(a => {\n a.onStart();\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.updating) {\n return;\n }\n this.updating = true;\n this.customAnimates.forEach(a => {\n const easing = a.easing;\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n ratio = easingFunc(ratio);\n a.onUpdate(end, ratio, out);\n });\n this.updating = false;\n return;\n }\n}\n\nexport class AnimateGroup1 extends ACustomAnimate<any> {\n declare customAnimates: ACustomAnimate<any>[];\n declare updating: boolean;\n\n constructor(duration: number, customAnimates: ACustomAnimate<any>[]) {\n super(null, null, duration, 'linear');\n this.customAnimates = customAnimates;\n }\n\n initAnimates() {\n this.customAnimates.forEach(a => {\n a.step = this.step;\n a.subAnimate = this.subAnimate;\n a.target = this.target;\n });\n }\n\n getEndProps(): Record<string, any> {\n const props = {};\n this.customAnimates.forEach(a => {\n Object.assign(props, a.getEndProps());\n });\n return props;\n }\n\n onBind(): void {\n this.initAnimates();\n this.customAnimates.forEach(a => {\n a.onBind();\n });\n return;\n }\n\n onEnd(): void {\n this.customAnimates.forEach(a => {\n a.onEnd();\n });\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.updating) {\n return;\n }\n this.updating = true;\n this.customAnimates.forEach(a => {\n const easing = a.easing;\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n ratio = easingFunc(ratio);\n a.onUpdate(end, ratio, out);\n });\n this.updating = false;\n return;\n }\n}\n"]}
@@ -65,6 +65,7 @@ export declare class Stage extends Group implements IStage {
65
65
  protected timeline: ITimeline;
66
66
  params: Partial<IStageParams>;
67
67
  constructor(params: Partial<IStageParams>);
68
+ preventRender(prevent: boolean): void;
68
69
  optmize(params?: IOptimizeType): void;
69
70
  protected optmizeRender(skipRenderWithOutRange?: boolean): void;
70
71
  getTimeline(): ITimeline;
package/cjs/core/stage.js CHANGED
@@ -132,13 +132,17 @@ class Stage extends graphic_1.Group {
132
132
  background: this._background
133
133
  });
134
134
  }
135
+ preventRender(prevent) {
136
+ prevent ? this._skipRender = -1 / 0 : this.params && this.params.optimize && !1 !== this.params.optimize.skipRenderWithOutRange ? this._skipRender = this.window.isVisible() ? 0 : 1 : this._skipRender = 0;
137
+ }
135
138
  optmize(params) {
136
139
  this.optmizeRender(null == params ? void 0 : params.skipRenderWithOutRange);
137
140
  }
138
141
  optmizeRender(skipRenderWithOutRange = !0) {
139
- skipRenderWithOutRange && (this._skipRender = this.window.isVisible() ? 0 : 1, this.window.onVisibleChange((visible => {
140
- visible ? (this.dirtyBounds && this.dirtyBounds.setValue(0, 0, this._viewBox.width(), this._viewBox.height()),
141
- this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0) : this._skipRender = 1;
142
+ skipRenderWithOutRange && (this._skipRender = this._skipRender < 0 ? this._skipRender : this.window.isVisible() ? 0 : 1,
143
+ this.window.onVisibleChange((visible => {
144
+ this._skipRender < 0 || (visible ? (this.dirtyBounds && this.dirtyBounds.setValue(0, 0, this._viewBox.width(), this._viewBox.height()),
145
+ this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0) : this._skipRender = 1);
142
146
  })));
143
147
  }
144
148
  getTimeline() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/stage.ts"],"names":[],"mappings":";;;AACA,6CAAuE;AA6BvE,qCAAmC;AAEnC,oCAAuC;AACvC,4CAAyC;AACzC,sCAA0C;AAC1C,wCAA0C;AAC1C,mDAAoD;AACpD,oDAAqD;AACrD,qFAAgF;AAChF,gGAA0F;AAC1F,6GAAuG;AACvG,2FAAsF;AACtF,uFAAkF;AAClF,qFAAgF;AAChF,8DAA0D;AAC1D,wCAAsC;AACtC,mCAA2C;AAC3C,qCAAuC;AACvC,4CAAuC;AACvC,2CAA2C;AAC3C,wCAA6C;AAE7C,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,UAAU,EAAE,OAAO;CACpB,CAAC;AAeF,MAAa,KAAM,SAAQ,eAAK;IAuB9B,IAAI,OAAO,CAAC,CAAc;QACxB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;IACD,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;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CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpB,CAAC;YACD,CAAC;YACD,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK;YAC1C,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM;SAC7C,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,QAAQ,CAAC,YAAqB,IAAI,EAAE,OAAqB;QACvD,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1D,MAAM,CAAC,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QACpC,IAAI,CAAC,CAAC,YAAY,EAAE;YAClB,OAAO,CAAC,CAAC,YAAY,CAAC;SACvB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,IAAa;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAt0BD,sBAs0BC","file":"stage.js","sourcesContent":["import type { IAABBBounds, IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';\nimport { AABBBounds, Bounds, Point, isString } from '@visactor/vutils';\nimport type {\n IGraphic,\n IGroup,\n IExportType,\n IStage,\n IStageParams,\n ILayer,\n IColor,\n IGlobal,\n IOption3D,\n ICamera,\n vec3,\n IDirectionLight,\n ITicker,\n IRenderService,\n IPickerService,\n IPluginService,\n ISyncHook,\n IDrawContext,\n IWindow,\n IPlugin,\n IContributionProvider,\n ILayerService,\n ITimeline,\n IOptimizeType,\n LayerMode,\n PickResult\n} from '../interface';\nimport { VWindow } from './window';\nimport type { Layer } from './layer';\nimport { EventSystem } from '../event';\nimport { container } from '../container';\nimport { RenderService } from '../render';\nimport { Group, Theme } from '../graphic';\nimport { PickerService } from '../picker/constants';\nimport { PluginService } from '../plugins/constants';\nimport { AutoRenderPlugin } from '../plugins/builtin-plugin/auto-render-plugin';\nimport { ViewTransform3dPlugin } from '../plugins/builtin-plugin/3dview-transform-plugin';\nimport { IncrementalAutoRenderPlugin } from '../plugins/builtin-plugin/incremental-auto-render-plugin';\nimport { HtmlAttributePlugin } from '../plugins/builtin-plugin/html-attribute-plugin';\nimport { DirtyBoundsPlugin } from '../plugins/builtin-plugin/dirty-bounds-plugin';\nimport { FlexLayoutPlugin } from '../plugins/builtin-plugin/flex-layout-plugin';\nimport { defaultTicker } from '../animate/default-ticker';\nimport { SyncHook } from '../tapable';\nimport { DirectionalLight } from './light';\nimport { OrthoCamera } from './camera';\nimport { VGlobal } from '../constants';\nimport { LayerService } from './constants';\nimport { DefaultTimeline } from '../animate';\n\nconst DefaultConfig = {\n WIDTH: 500,\n HEIGHT: 500,\n X: 0,\n Y: 0,\n BACKGROUND: 'white'\n};\n\ntype IStageState = 'rendering' | 'normal';\n\n/**\n * Stage是一个舞台或一个视口,并不直接对应一个或多个Canvas,逻辑上和Canvas无关\n *\n * 1. Stage对应一个Canvas的整体,Stage的宽高即为Canvas的宽高\n * 2. Stage小于Canvas,Stage作为Canvas某个区域的视口,只管理这个区域\n * 3. 多图层时Stage的多个图层对应多个Canvas\n *\n * 原生环境下Stage可以拥有一个Window或者使用Window的一块区域\n *\n * 【注】如果希望获取完整的Canvas或窗口或者调整窗口信息,请使用Window模块\n */\nexport class Stage extends Group implements IStage {\n declare parent: IStage | null;\n\n declare state: IStageState;\n\n protected _viewBox: AABBBounds;\n private _background: string | IColor;\n private _subView: boolean; // 是否是存在子视图\n protected nextFrameRenderLayerSet: Set<Layer>;\n protected willNextFrameRender: boolean;\n protected _cursor: string;\n renderCount: number;\n dirtyBounds: IBounds | null;\n option3d?: IOption3D;\n declare light?: IDirectionLight;\n declare camera?: ICamera;\n declare renderStyle?: string;\n\n declare hooks: {\n beforeRender: ISyncHook<[IStage]>;\n afterRender: ISyncHook<[IStage]>;\n };\n\n set viewBox(b: IBoundsLike) {\n this._viewBox.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n get viewBox(): AABBBounds {\n return this._viewBox;\n }\n\n get x(): number {\n return this._viewBox.x1;\n }\n set x(x: number) {\n this._viewBox.translate(x - this._viewBox.x1, 0);\n }\n get y(): number {\n return this._viewBox.y1;\n }\n set y(y: number) {\n this._viewBox.translate(0, y - this._viewBox.y1);\n }\n get width(): number {\n return this.window.width;\n }\n set width(w: number) {\n this.resize(w, this.height);\n }\n get viewWidth(): number {\n return this._viewBox.width();\n }\n set viewWidth(w: number) {\n this.resizeView(w, this.viewHeight);\n }\n get viewHeight(): number {\n return this._viewBox.height();\n }\n set viewHeight(h: number) {\n this.resizeView(this.viewWidth, h);\n }\n get height(): number {\n return this.window.height;\n }\n set height(h: number) {\n this.resize(this.width, h);\n }\n get dpr(): number {\n return this.window.dpr;\n }\n set dpr(r: number) {\n this.setDpr(r);\n }\n get background(): string | IColor {\n return this._background ?? DefaultConfig.BACKGROUND;\n }\n set background(b: string | IColor) {\n this._background = b;\n }\n get defaultLayer(): ILayer {\n return this.at(0) as unknown as ILayer;\n }\n\n ticker: ITicker;\n\n autoRender: boolean;\n _enableLayout: boolean;\n htmlAttribute: boolean | string | any;\n increaseAutoRender: boolean;\n view3dTranform: boolean;\n readonly window: IWindow;\n private readonly global: IGlobal;\n readonly renderService: IRenderService;\n readonly pickerService: IPickerService;\n readonly pluginService: IPluginService;\n readonly layerService: ILayerService;\n private readonly eventSystem?: EventSystem;\n\n protected _beforeRender?: (stage: IStage) => void;\n protected _afterRender?: (stage: IStage) => void;\n protected _skipRender?: number;\n protected _afterNextRenderCbs?: ((stage: IStage) => void)[];\n protected lastRenderparams?: Partial<IDrawContext>;\n\n protected interactiveLayer?: ILayer;\n protected supportInteractiveLayer: boolean;\n protected timeline: ITimeline;\n\n declare params: Partial<IStageParams>;\n\n /**\n * 所有属性都具有默认值。\n * Canvas为字符串或者Canvas元素,那么默认图层就会绑定到这个Canvas上\n * 如果不传入Canvas,那么会新建一个Canvas,用户可以通过Window模块管理这个Canvas\n * 1. 如果没有传入宽高,那么默认为canvas宽高,如果传入了宽高则stage使用传入宽高作为视口宽高\n * @param params\n */\n constructor(params: Partial<IStageParams>) {\n super({});\n this.params = params;\n this.theme = new Theme();\n this.hooks = {\n beforeRender: new SyncHook(['stage']),\n afterRender: new SyncHook(['stage'])\n };\n this.global = container.get<IGlobal>(VGlobal);\n this.window = container.get<IWindow>(VWindow);\n this.renderService = container.get<IRenderService>(RenderService);\n this.pickerService = container.get<IPickerService>(PickerService);\n this.pluginService = container.get<IPluginService>(PluginService);\n this.layerService = container.get<ILayerService>(LayerService);\n this.pluginService.active(this, params);\n\n this.window.create({\n width: params.width,\n height: params.height,\n container: params.container,\n dpr: params.dpr || this.global.devicePixelRatio,\n canvasControled: params.canvasControled !== false,\n title: params.title || '',\n canvas: params.canvas\n });\n\n this._viewBox = new AABBBounds();\n if (params.viewBox) {\n this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2);\n } else {\n this._viewBox.setValue(0, 0, this.width, this.height);\n }\n\n this.state = 'normal';\n this.renderCount = 0;\n\n // // 没有传入xy就默认为0\n // this._x = params.x ?? DefaultConfig.X;\n // this._y = params.y ?? DefaultConfig.Y;\n // // 没有传入view的宽高则默认为window的宽高\n // this._viewWidth = params.viewWidth ?? this.window.width;\n // this._viewHeight = params.viewHeight ?? this.window.height;\n this._subView = !(this._viewBox.width() === this.width && this._viewBox.height() === this.height);\n // this._AABBBounds.set(this._x, this._y, this._viewWidth + this._x, this._viewHeight + this._y);\n // 背景色默认为纯白色\n this._background = params.background ?? DefaultConfig.BACKGROUND;\n\n // 创建一个默认layer图层\n // this.appendChild(new Layer(this, this.global, this.window, { main: true }));\n this.appendChild(\n this.layerService.createLayer(\n this,\n // 如果传入的canvas是string的id,就传入,避免被判定要使用离屏canvas\n params.canvas && isString(params.canvas) ? { main: true, canvasId: params.canvas } : { main: true }\n )\n );\n\n this.nextFrameRenderLayerSet = new Set();\n this.willNextFrameRender = false;\n this.stage = this;\n this.renderStyle = params.renderStyle;\n\n if (this.global.supportEvent) {\n this.eventSystem = new EventSystem({\n targetElement: this.window,\n resolution: this.window.dpr || this.global.devicePixelRatio,\n rootNode: this as any,\n global: this.global,\n viewport: {\n viewBox: this._viewBox,\n get x(): number {\n return this.viewBox.x1;\n },\n get y(): number {\n return this.viewBox.y1;\n },\n get width(): number {\n return this.viewBox.width();\n },\n get height(): number {\n return this.viewBox.height();\n }\n }\n });\n }\n\n // this.autoRender = params.autoRender;\n if (params.autoRender) {\n this.enableAutoRender();\n }\n // 默认不开启dirtyBounds\n if (params.disableDirtyBounds === false) {\n this.enableDirtyBounds();\n }\n\n if (params.enableHtmlAttribute) {\n this.enableHtmlAttribute(params.enableHtmlAttribute);\n }\n\n params.enableLayout && this.enableLayout();\n this.hooks.beforeRender.tap('constructor', this.beforeRender);\n this.hooks.afterRender.tap('constructor', this.afterRender);\n this._beforeRender = params.beforeRender;\n this._afterRender = params.afterRender;\n this.ticker = params.ticker || defaultTicker;\n this.supportInteractiveLayer = params.interactiveLayer !== false;\n this.timeline = new DefaultTimeline();\n this.ticker.addTimeline(this.timeline);\n this.timeline.pause();\n this.optmize(params.optimize);\n if (this._background && isString(this._background)) {\n this.setAttributes({ background: this._background });\n }\n }\n\n // 优化策略\n optmize(params?: IOptimizeType) {\n this.optmizeRender(params?.skipRenderWithOutRange);\n }\n\n // 优化渲染\n protected optmizeRender(skipRenderWithOutRange: boolean = true) {\n if (!skipRenderWithOutRange) {\n return;\n }\n // 不在视口内的时候,跳过渲染\n this._skipRender = this.window.isVisible() ? 0 : 1;\n this.window.onVisibleChange(visible => {\n if (visible) {\n if (this.dirtyBounds) {\n this.dirtyBounds.setValue(0, 0, this._viewBox.width(), this._viewBox.height());\n }\n if (this._skipRender > 1) {\n this.renderNextFrame();\n }\n this._skipRender = 0;\n } else {\n this._skipRender = 1;\n }\n });\n }\n\n getTimeline() {\n return this.timeline;\n }\n\n get3dOptions(options: IOption3D) {\n const {\n center = { x: this.width / 2, y: this.height / 2, z: 0, dx: 0, dy: 0, dz: 0 },\n light = {},\n alpha = 0,\n beta = 0,\n camera,\n fieldRatio = 1,\n fieldDepth\n } = options;\n\n return {\n ...options,\n center,\n light,\n alpha,\n beta,\n camera,\n fieldRatio,\n fieldDepth\n };\n }\n\n set3dOptions(options: IOption3D) {\n this.option3d = options;\n const options3d = this.get3dOptions(options);\n const { light, center, camera, alpha, beta, fieldRatio, fieldDepth } = options3d;\n const { dir = [1, 1, -1], color = 'white', ambient } = light;\n\n const centerX = (center.x ?? this.width / 2) + (center.dx ?? 0);\n const centerY = (center.y ?? this.height / 2) + (center.dy ?? 0);\n const centerZ = (center.z ?? 0) + (center.dz ?? 0);\n const centerVec3: vec3 = [centerX, centerY, centerZ];\n const z = 1;\n let cameraX = 0;\n let cameraY = 0;\n let cameraZ = 0;\n if (!camera) {\n cameraX = Math.sin(alpha) + centerX;\n cameraY = Math.sin(beta) + centerY;\n cameraZ = Math.cos(alpha) * Math.cos(beta) * z;\n }\n\n this.light = new DirectionalLight(dir, color, ambient);\n const cameraParams = {\n left: 0,\n right: this.width,\n top: 0,\n bottom: this.height,\n fieldRatio: fieldRatio,\n fieldDepth,\n viewParams: {\n pos: [cameraX, cameraY, cameraZ] as vec3,\n center: centerVec3,\n up: [0, 1, 0] as vec3\n }\n };\n if (this.camera) {\n this.camera.params = cameraParams;\n } else {\n this.camera = new OrthoCamera(cameraParams);\n }\n\n if (options.enableView3dTransform) {\n this.enableView3dTransform();\n }\n }\n\n protected beforeRender = (stage: IStage) => {\n this._beforeRender && this._beforeRender(stage);\n };\n\n protected afterRender = (stage: IStage) => {\n this.renderCount++;\n this._afterRender && this._afterRender(stage);\n this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage));\n this._afterNextRenderCbs = null;\n };\n\n setBeforeRender(cb: (stage: IStage) => void) {\n this._beforeRender = cb;\n }\n\n setAfterRender(cb: (stage: IStage) => void) {\n this._afterRender = cb;\n }\n\n afterNextRender(cb: (stage: IStage) => void) {\n if (!this._afterNextRenderCbs) {\n this._afterNextRenderCbs = [];\n }\n this._afterNextRenderCbs.push(cb);\n }\n\n enableView3dTransform() {\n if (this.view3dTranform) {\n return;\n }\n this.view3dTranform = true;\n this.pluginService.register(new ViewTransform3dPlugin());\n }\n\n disableView3dTranform() {\n if (!this.view3dTranform) {\n return;\n }\n this.view3dTranform = false;\n this.pluginService.findPluginsByName('ViewTransform3dPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n\n enableAutoRender() {\n if (this.autoRender) {\n return;\n }\n this.autoRender = true;\n this.pluginService.register(new AutoRenderPlugin());\n }\n disableAutoRender() {\n if (!this.autoRender) {\n return;\n }\n this.autoRender = false;\n this.pluginService.findPluginsByName('AutoRenderPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableIncrementalAutoRender() {\n if (this.increaseAutoRender) {\n return;\n }\n this.increaseAutoRender = true;\n this.pluginService.register(new IncrementalAutoRenderPlugin());\n }\n disableIncrementalAutoRender() {\n if (!this.increaseAutoRender) {\n return;\n }\n this.increaseAutoRender = false;\n this.pluginService.findPluginsByName('IncrementalAutoRenderPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableDirtyBounds() {\n if (this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = new Bounds();\n let plugin = this.pluginService.findPluginsByName('DirtyBoundsPlugin')[0];\n if (!plugin) {\n plugin = new DirtyBoundsPlugin();\n this.pluginService.register(plugin);\n }\n plugin.activate(this.pluginService);\n }\n disableDirtyBounds() {\n if (!this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = null;\n this.pluginService.findPluginsByName('DirtyBoundsPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableLayout() {\n if (this._enableLayout) {\n return;\n }\n this._enableLayout = true;\n this.pluginService.register(new FlexLayoutPlugin());\n }\n disableLayout() {\n if (!this._enableLayout) {\n return;\n }\n this._enableLayout = false;\n this.pluginService.findPluginsByName('FlexLayoutPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableHtmlAttribute(container?: any) {\n if (this.htmlAttribute) {\n return;\n }\n this.htmlAttribute = container;\n this.pluginService.register(new HtmlAttributePlugin());\n }\n disableHtmlAttribute() {\n if (!this.htmlAttribute) {\n return;\n }\n this.htmlAttribute = false;\n this.pluginService.findPluginsByName('HtmlAttributePlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n\n // /**\n // * stage的appendChild,add\n // * @param node\n // * @returns\n // */\n // appendChild<T extends Node>(node: T): T | null {\n // const layer = this.at(0);\n // if (!layer) {\n // return null;\n // }\n // return layer.appendChild<T>(node);\n // }\n\n protected tryUpdateAABBBounds(): AABBBounds {\n const viewBox = this._viewBox;\n this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2);\n return this._AABBBounds;\n }\n\n combineLayer(ILayer1: ILayer, ILayer2: ILayer): ILayer {\n throw new Error('暂不支持');\n }\n // 如果传入CanvasId,如果存在相同Id,说明这两个图层使用相同的Canvas绘制\n // 但需要注意的是依然是两个图层(用于解决Table嵌入ChartSpace不影响Table的绘制)\n createLayer(canvasId?: string, layerMode?: LayerMode): ILayer {\n // 创建一个默认layer图层\n const layer = this.layerService.createLayer(this, {\n main: false,\n layerMode,\n canvasId\n });\n this.appendChild(layer);\n return layer;\n // const layer = new Layer(this, this.global, this.window, {\n // main: false,\n // canvasId\n // });\n // this.appendChild(layer);\n // return layer;\n }\n sortLayer(cb: (ILayer1: ILayer, layer2: ILayer) => number): void {\n const children = this.children;\n children.sort(cb);\n this.removeAllChild();\n children.forEach(c => {\n this.appendChild(c);\n });\n }\n removeLayer(ILayerId: number): ILayer | false {\n return this.removeChild(this.findChildByUid(ILayerId) as IGraphic) as ILayer;\n }\n tryInitInteractiveLayer() {\n // TODO:顺序可能会存在问题\n // 支持交互层,且没有创建过,那就创建\n if (this.supportInteractiveLayer && !this.interactiveLayer) {\n this.interactiveLayer = this.createLayer();\n this.interactiveLayer.name = '_builtin_interactive';\n this.nextFrameRenderLayerSet.add(this.interactiveLayer as any); // to be fixed\n }\n // this.interactiveLayer.afterDraw(l => {\n // l.removeAllChild();\n // });\n }\n\n clearViewBox(color?: string) {\n this.window.clearViewBox(this._viewBox, color);\n }\n\n render(layers?: ILayer[], params?: Partial<IDrawContext>): void {\n this.ticker.start();\n this.timeline.resume();\n const state = this.state;\n this.state = 'rendering';\n this.layerService.prepareStageLayer(this);\n if (!this._skipRender) {\n this.lastRenderparams = params;\n this.hooks.beforeRender.call(this);\n this.renderLayerList(this.children as ILayer[]);\n this.combineLayersToWindow();\n this.nextFrameRenderLayerSet.clear();\n this.hooks.afterRender.call(this);\n }\n this.state = state;\n this._skipRender && this._skipRender++;\n }\n\n protected combineLayersToWindow() {\n return;\n // this.forEach<ILayer>((layer, i) => {\n // layer.combineTo(this.window, {\n // clear: i === 0,\n // x: this.x,\n // y: this.y,\n // width: this.viewWidth,\n // height: this.viewHeight,\n // renderService: this.renderService,\n // background: layer === this.defaultLayer ? this.background : undefined,\n // updateBounds: !!this.dirtyBounds\n // });\n // });\n }\n\n renderNextFrame(layers?: ILayer[], force?: boolean): void {\n // render状态中调用的不会触发nextFrame,避免loop\n // if (this.state === 'rendering' && !force) {\n // console.log('abc');\n // return;\n // }\n // 性能优化,避免重复add\n if (this.nextFrameRenderLayerSet.size !== this.childrenCount) {\n (layers || this).forEach<ILayer>((layer: any) => {\n this.nextFrameRenderLayerSet.add(layer);\n });\n }\n if (!this.willNextFrameRender) {\n this.willNextFrameRender = true;\n this.global.getRequestAnimationFrame()(() => {\n this._doRenderInThisFrame(), (this.willNextFrameRender = false);\n });\n }\n }\n\n _doRenderInThisFrame() {\n this.timeline.resume();\n this.ticker.start();\n const state = this.state;\n this.state = 'rendering';\n this.layerService.prepareStageLayer(this);\n if (this.nextFrameRenderLayerSet.size && !this._skipRender) {\n this.hooks.beforeRender.call(this);\n this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {});\n this.combineLayersToWindow();\n this.hooks.afterRender.call(this);\n this.nextFrameRenderLayerSet.clear();\n }\n this.state = state;\n this._skipRender && this._skipRender++;\n }\n\n protected renderLayerList(layerList: ILayer[], params?: Partial<IDrawContext>) {\n const list: ILayer[] = [];\n // 只需要render main layer即可\n for (let i = 0; i < layerList.length; i++) {\n let l = layerList[i];\n if (l.layerMode === 'virtual') {\n l = l.getNativeHandler().mainHandler.layer;\n }\n if (!list.includes(l)) {\n list.push(l);\n }\n }\n list.forEach(layer => {\n // 记录当前的stamp,避免重复绘制layer(如果存在virtual layer)\n if (layer.renderCount > this.renderCount) {\n return;\n }\n layer.renderCount = this.renderCount + 1;\n\n layer.render(\n {\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n },\n { renderStyle: this.renderStyle, ...params }\n );\n });\n\n // 添加交互层渲染\n if (this.interactiveLayer && !layerList.includes(this.interactiveLayer)) {\n this.interactiveLayer.render(\n {\n renderService: this.renderService,\n updateBounds: !!this.dirtyBounds\n },\n { renderStyle: this.renderStyle, ...params }\n );\n }\n }\n\n resizeWindow(w: number, h: number, rerender: boolean = true) {\n this.window.resize(w, h);\n rerender && this.render();\n }\n\n /**\n * 语法糖,如果viewBox和window宽高一样的话,那么会同时缩放window和viewBox\n * @param w\n * @param h\n * @param rerender\n */\n resize(w: number, h: number, rerender: boolean = true): void {\n this.window.resize(w, h);\n this.forEachChildren<ILayer>(c => {\n c.resize(w, h);\n });\n // 如果不是子图的stage,那么认为用户也想要resize view\n if (!this._subView) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n }\n // 设置camera\n // this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });\n this.camera && this.option3d && this.set3dOptions(this.option3d);\n rerender && this.render();\n }\n resizeView(w: number, h: number, rerender: boolean = true) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n this.forEachChildren<ILayer>(c => {\n c.resizeView(w, h);\n });\n // 设置camera\n this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });\n rerender && this.render();\n }\n setViewBox(viewBox: IBoundsLike, rerender: boolean): void;\n setViewBox(x: number, y: number, w: number, h: number, rerender: boolean): void;\n setViewBox(x: number | IBoundsLike, y: number | boolean, w?: number, h?: number, rerender?: boolean): void {\n let isRerender: boolean = true;\n\n if (typeof x === 'object') {\n this.viewBox.setValue(x.x1, x.y1, x.x2, x.y2);\n if (y === false) {\n isRerender = false;\n }\n } else {\n this.viewBox.setValue(x, y as number, x + w, (y as number) + h);\n\n if (rerender === false) {\n isRerender = false;\n }\n }\n\n this.forEachChildren<ILayer>(c => {\n c.resizeView(this.viewBox.width(), this.viewBox.height());\n });\n isRerender && this.render();\n }\n setDpr(dpr: number, rerender: boolean = true): void {\n // this.window.setDpr(dpr);\n this.forEachChildren<ILayer>(c => {\n c.setDpr(dpr);\n });\n\n rerender && this.render();\n }\n setOrigin(x: number, y: number): void {\n throw new Error('暂不支持');\n }\n export(type: IExportType): HTMLCanvasElement | ImageData {\n throw new Error('暂不支持');\n }\n pick(x: number, y: number): PickResult | false {\n // 暂时不提供layer的pick\n const result = this.pickerService.pick(this.children as unknown as IGraphic[], new Point(x, y), {\n bounds: this.AABBBounds\n });\n if (result?.graphic || result?.group) {\n return result;\n }\n return false;\n }\n\n // 动画相关\n startAnimate(t: number): void {\n throw new Error('暂不支持');\n }\n setToFrame(t: number): void {\n throw new Error('暂不支持');\n }\n\n release() {\n super.release();\n this.eventSystem && this.eventSystem.release();\n this.pluginService.release();\n this.forEach(layer => {\n layer.release();\n });\n this.interactiveLayer && this.interactiveLayer.release();\n this.window.release();\n }\n\n setStage(stage?: IStage) {\n return;\n // this.stage = this;\n // this.forEachChildren(item => {\n // (item as Layer).setStage(this);\n // });\n }\n\n /**\n * 添加dirty区域,会修改参数b\n * @param b\n * @param matrix\n */\n dirty(b: IBounds, matrix?: IMatrix) {\n if (matrix) {\n b.transformWithMatrix(matrix);\n }\n if (this.dirtyBounds.empty()) {\n this.dirtyBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n this.dirtyBounds.union(b);\n }\n\n getLayer(name: string): undefined | ILayer {\n const layer = this.children.filter(layer => layer.name === name);\n return layer[0] as ILayer;\n }\n\n renderTo(window: IWindow, params: { x: number; y: number; width: number; height: number }) {\n this.forEachChildren<ILayer>((layer, i) => {\n layer.drawTo(window, {\n ...params,\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n clear: i === 0, // 第一个layer需要clear\n updateBounds: !!this.dirtyBounds\n });\n });\n }\n\n /**\n * 渲染到新的window上去\n * @param fullImage 是否是全量的image,因为可能之前的window有一部分场景树超过window的帧缓冲了\n * @returns\n */\n renderToNewWindow(fullImage: boolean = true, viewBox?: IAABBBounds): IWindow {\n const window = container.get<IWindow>(VWindow);\n if (fullImage) {\n window.create({\n width: this.viewWidth,\n height: this.viewHeight,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n } else {\n const width = viewBox ? viewBox.width() : Math.min(this.viewWidth, this.window.width - this.x);\n const height = viewBox ? viewBox.height() : Math.min(this.viewHeight, this.window.height - this.y);\n window.create({\n width,\n height,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n }\n\n const x = viewBox ? -viewBox.x1 : 0;\n const y = viewBox ? -viewBox.y1 : 0;\n this.renderTo(window, {\n x,\n y,\n width: viewBox ? viewBox.x2 : window.width,\n height: viewBox ? viewBox.y2 : window.height\n });\n return window;\n }\n\n toCanvas(fullImage: boolean = true, viewBox?: IAABBBounds): HTMLCanvasElement | null {\n const window = this.renderToNewWindow(fullImage, viewBox);\n const c = window.getNativeHandler();\n if (c.nativeCanvas) {\n return c.nativeCanvas;\n }\n return null;\n }\n\n setCursor(mode?: string): void {\n this._cursor = mode;\n this.eventSystem.setCursor(mode);\n }\n\n getCursor() {\n return this._cursor;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/stage.ts"],"names":[],"mappings":";;;AACA,6CAAuE;AA6BvE,qCAAmC;AAEnC,oCAAuC;AACvC,4CAAyC;AACzC,sCAA0C;AAC1C,wCAA0C;AAC1C,mDAAoD;AACpD,oDAAqD;AACrD,qFAAgF;AAChF,gGAA0F;AAC1F,6GAAuG;AACvG,2FAAsF;AACtF,uFAAkF;AAClF,qFAAgF;AAChF,8DAA0D;AAC1D,wCAAsC;AACtC,mCAA2C;AAC3C,qCAAuC;AACvC,4CAAuC;AACvC,2CAA2C;AAC3C,wCAA6C;AAE7C,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,UAAU,EAAE,OAAO;CACpB,CAAC;AAeF,MAAa,KAAM,SAAQ,eAAK;IAuB9B,IAAI,OAAO,CAAC,CAAc;QACxB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;IACD,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,CAAC;QACH,OAAO,IAAI,CAA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AO,CAAC,CAAC,YAAY,CAAC;SACvB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,IAAa;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAv1BD,sBAu1BC","file":"stage.js","sourcesContent":["import type { IAABBBounds, IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';\nimport { AABBBounds, Bounds, Point, isString } from '@visactor/vutils';\nimport type {\n IGraphic,\n IGroup,\n IExportType,\n IStage,\n IStageParams,\n ILayer,\n IColor,\n IGlobal,\n IOption3D,\n ICamera,\n vec3,\n IDirectionLight,\n ITicker,\n IRenderService,\n IPickerService,\n IPluginService,\n ISyncHook,\n IDrawContext,\n IWindow,\n IPlugin,\n IContributionProvider,\n ILayerService,\n ITimeline,\n IOptimizeType,\n LayerMode,\n PickResult\n} from '../interface';\nimport { VWindow } from './window';\nimport type { Layer } from './layer';\nimport { EventSystem } from '../event';\nimport { container } from '../container';\nimport { RenderService } from '../render';\nimport { Group, Theme } from '../graphic';\nimport { PickerService } from '../picker/constants';\nimport { PluginService } from '../plugins/constants';\nimport { AutoRenderPlugin } from '../plugins/builtin-plugin/auto-render-plugin';\nimport { ViewTransform3dPlugin } from '../plugins/builtin-plugin/3dview-transform-plugin';\nimport { IncrementalAutoRenderPlugin } from '../plugins/builtin-plugin/incremental-auto-render-plugin';\nimport { HtmlAttributePlugin } from '../plugins/builtin-plugin/html-attribute-plugin';\nimport { DirtyBoundsPlugin } from '../plugins/builtin-plugin/dirty-bounds-plugin';\nimport { FlexLayoutPlugin } from '../plugins/builtin-plugin/flex-layout-plugin';\nimport { defaultTicker } from '../animate/default-ticker';\nimport { SyncHook } from '../tapable';\nimport { DirectionalLight } from './light';\nimport { OrthoCamera } from './camera';\nimport { VGlobal } from '../constants';\nimport { LayerService } from './constants';\nimport { DefaultTimeline } from '../animate';\n\nconst DefaultConfig = {\n WIDTH: 500,\n HEIGHT: 500,\n X: 0,\n Y: 0,\n BACKGROUND: 'white'\n};\n\ntype IStageState = 'rendering' | 'normal';\n\n/**\n * Stage是一个舞台或一个视口,并不直接对应一个或多个Canvas,逻辑上和Canvas无关\n *\n * 1. Stage对应一个Canvas的整体,Stage的宽高即为Canvas的宽高\n * 2. Stage小于Canvas,Stage作为Canvas某个区域的视口,只管理这个区域\n * 3. 多图层时Stage的多个图层对应多个Canvas\n *\n * 原生环境下Stage可以拥有一个Window或者使用Window的一块区域\n *\n * 【注】如果希望获取完整的Canvas或窗口或者调整窗口信息,请使用Window模块\n */\nexport class Stage extends Group implements IStage {\n declare parent: IStage | null;\n\n declare state: IStageState;\n\n protected _viewBox: AABBBounds;\n private _background: string | IColor;\n private _subView: boolean; // 是否是存在子视图\n protected nextFrameRenderLayerSet: Set<Layer>;\n protected willNextFrameRender: boolean;\n protected _cursor: string;\n renderCount: number;\n dirtyBounds: IBounds | null;\n option3d?: IOption3D;\n declare light?: IDirectionLight;\n declare camera?: ICamera;\n declare renderStyle?: string;\n\n declare hooks: {\n beforeRender: ISyncHook<[IStage]>;\n afterRender: ISyncHook<[IStage]>;\n };\n\n set viewBox(b: IBoundsLike) {\n this._viewBox.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n get viewBox(): AABBBounds {\n return this._viewBox;\n }\n\n get x(): number {\n return this._viewBox.x1;\n }\n set x(x: number) {\n this._viewBox.translate(x - this._viewBox.x1, 0);\n }\n get y(): number {\n return this._viewBox.y1;\n }\n set y(y: number) {\n this._viewBox.translate(0, y - this._viewBox.y1);\n }\n get width(): number {\n return this.window.width;\n }\n set width(w: number) {\n this.resize(w, this.height);\n }\n get viewWidth(): number {\n return this._viewBox.width();\n }\n set viewWidth(w: number) {\n this.resizeView(w, this.viewHeight);\n }\n get viewHeight(): number {\n return this._viewBox.height();\n }\n set viewHeight(h: number) {\n this.resizeView(this.viewWidth, h);\n }\n get height(): number {\n return this.window.height;\n }\n set height(h: number) {\n this.resize(this.width, h);\n }\n get dpr(): number {\n return this.window.dpr;\n }\n set dpr(r: number) {\n this.setDpr(r);\n }\n get background(): string | IColor {\n return this._background ?? DefaultConfig.BACKGROUND;\n }\n set background(b: string | IColor) {\n this._background = b;\n }\n get defaultLayer(): ILayer {\n return this.at(0) as unknown as ILayer;\n }\n\n ticker: ITicker;\n\n autoRender: boolean;\n _enableLayout: boolean;\n htmlAttribute: boolean | string | any;\n increaseAutoRender: boolean;\n view3dTranform: boolean;\n readonly window: IWindow;\n private readonly global: IGlobal;\n readonly renderService: IRenderService;\n readonly pickerService: IPickerService;\n readonly pluginService: IPluginService;\n readonly layerService: ILayerService;\n private readonly eventSystem?: EventSystem;\n\n protected _beforeRender?: (stage: IStage) => void;\n protected _afterRender?: (stage: IStage) => void;\n // 0: 正常渲染, > 0: 跳过隐藏canvas的渲染, < 0: 禁止渲染\n protected _skipRender?: number;\n protected _afterNextRenderCbs?: ((stage: IStage) => void)[];\n protected lastRenderparams?: Partial<IDrawContext>;\n\n protected interactiveLayer?: ILayer;\n protected supportInteractiveLayer: boolean;\n protected timeline: ITimeline;\n\n declare params: Partial<IStageParams>;\n\n /**\n * 所有属性都具有默认值。\n * Canvas为字符串或者Canvas元素,那么默认图层就会绑定到这个Canvas上\n * 如果不传入Canvas,那么会新建一个Canvas,用户可以通过Window模块管理这个Canvas\n * 1. 如果没有传入宽高,那么默认为canvas宽高,如果传入了宽高则stage使用传入宽高作为视口宽高\n * @param params\n */\n constructor(params: Partial<IStageParams>) {\n super({});\n this.params = params;\n this.theme = new Theme();\n this.hooks = {\n beforeRender: new SyncHook(['stage']),\n afterRender: new SyncHook(['stage'])\n };\n this.global = container.get<IGlobal>(VGlobal);\n this.window = container.get<IWindow>(VWindow);\n this.renderService = container.get<IRenderService>(RenderService);\n this.pickerService = container.get<IPickerService>(PickerService);\n this.pluginService = container.get<IPluginService>(PluginService);\n this.layerService = container.get<ILayerService>(LayerService);\n this.pluginService.active(this, params);\n\n this.window.create({\n width: params.width,\n height: params.height,\n container: params.container,\n dpr: params.dpr || this.global.devicePixelRatio,\n canvasControled: params.canvasControled !== false,\n title: params.title || '',\n canvas: params.canvas\n });\n\n this._viewBox = new AABBBounds();\n if (params.viewBox) {\n this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2);\n } else {\n this._viewBox.setValue(0, 0, this.width, this.height);\n }\n\n this.state = 'normal';\n this.renderCount = 0;\n\n // // 没有传入xy就默认为0\n // this._x = params.x ?? DefaultConfig.X;\n // this._y = params.y ?? DefaultConfig.Y;\n // // 没有传入view的宽高则默认为window的宽高\n // this._viewWidth = params.viewWidth ?? this.window.width;\n // this._viewHeight = params.viewHeight ?? this.window.height;\n this._subView = !(this._viewBox.width() === this.width && this._viewBox.height() === this.height);\n // this._AABBBounds.set(this._x, this._y, this._viewWidth + this._x, this._viewHeight + this._y);\n // 背景色默认为纯白色\n this._background = params.background ?? DefaultConfig.BACKGROUND;\n\n // 创建一个默认layer图层\n // this.appendChild(new Layer(this, this.global, this.window, { main: true }));\n this.appendChild(\n this.layerService.createLayer(\n this,\n // 如果传入的canvas是string的id,就传入,避免被判定要使用离屏canvas\n params.canvas && isString(params.canvas) ? { main: true, canvasId: params.canvas } : { main: true }\n )\n );\n\n this.nextFrameRenderLayerSet = new Set();\n this.willNextFrameRender = false;\n this.stage = this;\n this.renderStyle = params.renderStyle;\n\n if (this.global.supportEvent) {\n this.eventSystem = new EventSystem({\n targetElement: this.window,\n resolution: this.window.dpr || this.global.devicePixelRatio,\n rootNode: this as any,\n global: this.global,\n viewport: {\n viewBox: this._viewBox,\n get x(): number {\n return this.viewBox.x1;\n },\n get y(): number {\n return this.viewBox.y1;\n },\n get width(): number {\n return this.viewBox.width();\n },\n get height(): number {\n return this.viewBox.height();\n }\n }\n });\n }\n\n // this.autoRender = params.autoRender;\n if (params.autoRender) {\n this.enableAutoRender();\n }\n // 默认不开启dirtyBounds\n if (params.disableDirtyBounds === false) {\n this.enableDirtyBounds();\n }\n\n if (params.enableHtmlAttribute) {\n this.enableHtmlAttribute(params.enableHtmlAttribute);\n }\n\n params.enableLayout && this.enableLayout();\n this.hooks.beforeRender.tap('constructor', this.beforeRender);\n this.hooks.afterRender.tap('constructor', this.afterRender);\n this._beforeRender = params.beforeRender;\n this._afterRender = params.afterRender;\n this.ticker = params.ticker || defaultTicker;\n this.supportInteractiveLayer = params.interactiveLayer !== false;\n this.timeline = new DefaultTimeline();\n this.ticker.addTimeline(this.timeline);\n this.timeline.pause();\n this.optmize(params.optimize);\n if (this._background && isString(this._background)) {\n this.setAttributes({ background: this._background });\n }\n }\n\n preventRender(prevent: boolean) {\n if (prevent) {\n this._skipRender = -Infinity;\n } else {\n // 判断是否需要outRange优化\n if (this.params && this.params.optimize && this.params.optimize.skipRenderWithOutRange !== false) {\n this._skipRender = this.window.isVisible() ? 0 : 1;\n } else {\n this._skipRender = 0;\n }\n }\n }\n\n // 优化策略\n optmize(params?: IOptimizeType) {\n this.optmizeRender(params?.skipRenderWithOutRange);\n }\n\n // 优化渲染\n protected optmizeRender(skipRenderWithOutRange: boolean = true) {\n if (!skipRenderWithOutRange) {\n return;\n }\n // 不在视口内的时候,跳过渲染\n this._skipRender = this._skipRender < 0 ? this._skipRender : this.window.isVisible() ? 0 : 1;\n this.window.onVisibleChange(visible => {\n if (this._skipRender < 0) {\n return;\n }\n if (visible) {\n if (this.dirtyBounds) {\n this.dirtyBounds.setValue(0, 0, this._viewBox.width(), this._viewBox.height());\n }\n if (this._skipRender > 1) {\n this.renderNextFrame();\n }\n this._skipRender = 0;\n } else {\n this._skipRender = 1;\n }\n });\n }\n\n getTimeline() {\n return this.timeline;\n }\n\n get3dOptions(options: IOption3D) {\n const {\n center = { x: this.width / 2, y: this.height / 2, z: 0, dx: 0, dy: 0, dz: 0 },\n light = {},\n alpha = 0,\n beta = 0,\n camera,\n fieldRatio = 1,\n fieldDepth\n } = options;\n\n return {\n ...options,\n center,\n light,\n alpha,\n beta,\n camera,\n fieldRatio,\n fieldDepth\n };\n }\n\n set3dOptions(options: IOption3D) {\n this.option3d = options;\n const options3d = this.get3dOptions(options);\n const { light, center, camera, alpha, beta, fieldRatio, fieldDepth } = options3d;\n const { dir = [1, 1, -1], color = 'white', ambient } = light;\n\n const centerX = (center.x ?? this.width / 2) + (center.dx ?? 0);\n const centerY = (center.y ?? this.height / 2) + (center.dy ?? 0);\n const centerZ = (center.z ?? 0) + (center.dz ?? 0);\n const centerVec3: vec3 = [centerX, centerY, centerZ];\n const z = 1;\n let cameraX = 0;\n let cameraY = 0;\n let cameraZ = 0;\n if (!camera) {\n cameraX = Math.sin(alpha) + centerX;\n cameraY = Math.sin(beta) + centerY;\n cameraZ = Math.cos(alpha) * Math.cos(beta) * z;\n }\n\n this.light = new DirectionalLight(dir, color, ambient);\n const cameraParams = {\n left: 0,\n right: this.width,\n top: 0,\n bottom: this.height,\n fieldRatio: fieldRatio,\n fieldDepth,\n viewParams: {\n pos: [cameraX, cameraY, cameraZ] as vec3,\n center: centerVec3,\n up: [0, 1, 0] as vec3\n }\n };\n if (this.camera) {\n this.camera.params = cameraParams;\n } else {\n this.camera = new OrthoCamera(cameraParams);\n }\n\n if (options.enableView3dTransform) {\n this.enableView3dTransform();\n }\n }\n\n protected beforeRender = (stage: IStage) => {\n this._beforeRender && this._beforeRender(stage);\n };\n\n protected afterRender = (stage: IStage) => {\n this.renderCount++;\n this._afterRender && this._afterRender(stage);\n this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage));\n this._afterNextRenderCbs = null;\n };\n\n setBeforeRender(cb: (stage: IStage) => void) {\n this._beforeRender = cb;\n }\n\n setAfterRender(cb: (stage: IStage) => void) {\n this._afterRender = cb;\n }\n\n afterNextRender(cb: (stage: IStage) => void) {\n if (!this._afterNextRenderCbs) {\n this._afterNextRenderCbs = [];\n }\n this._afterNextRenderCbs.push(cb);\n }\n\n enableView3dTransform() {\n if (this.view3dTranform) {\n return;\n }\n this.view3dTranform = true;\n this.pluginService.register(new ViewTransform3dPlugin());\n }\n\n disableView3dTranform() {\n if (!this.view3dTranform) {\n return;\n }\n this.view3dTranform = false;\n this.pluginService.findPluginsByName('ViewTransform3dPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n\n enableAutoRender() {\n if (this.autoRender) {\n return;\n }\n this.autoRender = true;\n this.pluginService.register(new AutoRenderPlugin());\n }\n disableAutoRender() {\n if (!this.autoRender) {\n return;\n }\n this.autoRender = false;\n this.pluginService.findPluginsByName('AutoRenderPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableIncrementalAutoRender() {\n if (this.increaseAutoRender) {\n return;\n }\n this.increaseAutoRender = true;\n this.pluginService.register(new IncrementalAutoRenderPlugin());\n }\n disableIncrementalAutoRender() {\n if (!this.increaseAutoRender) {\n return;\n }\n this.increaseAutoRender = false;\n this.pluginService.findPluginsByName('IncrementalAutoRenderPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableDirtyBounds() {\n if (this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = new Bounds();\n let plugin = this.pluginService.findPluginsByName('DirtyBoundsPlugin')[0];\n if (!plugin) {\n plugin = new DirtyBoundsPlugin();\n this.pluginService.register(plugin);\n }\n plugin.activate(this.pluginService);\n }\n disableDirtyBounds() {\n if (!this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = null;\n this.pluginService.findPluginsByName('DirtyBoundsPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableLayout() {\n if (this._enableLayout) {\n return;\n }\n this._enableLayout = true;\n this.pluginService.register(new FlexLayoutPlugin());\n }\n disableLayout() {\n if (!this._enableLayout) {\n return;\n }\n this._enableLayout = false;\n this.pluginService.findPluginsByName('FlexLayoutPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableHtmlAttribute(container?: any) {\n if (this.htmlAttribute) {\n return;\n }\n this.htmlAttribute = container;\n this.pluginService.register(new HtmlAttributePlugin());\n }\n disableHtmlAttribute() {\n if (!this.htmlAttribute) {\n return;\n }\n this.htmlAttribute = false;\n this.pluginService.findPluginsByName('HtmlAttributePlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n\n // /**\n // * stage的appendChild,add\n // * @param node\n // * @returns\n // */\n // appendChild<T extends Node>(node: T): T | null {\n // const layer = this.at(0);\n // if (!layer) {\n // return null;\n // }\n // return layer.appendChild<T>(node);\n // }\n\n protected tryUpdateAABBBounds(): AABBBounds {\n const viewBox = this._viewBox;\n this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2);\n return this._AABBBounds;\n }\n\n combineLayer(ILayer1: ILayer, ILayer2: ILayer): ILayer {\n throw new Error('暂不支持');\n }\n // 如果传入CanvasId,如果存在相同Id,说明这两个图层使用相同的Canvas绘制\n // 但需要注意的是依然是两个图层(用于解决Table嵌入ChartSpace不影响Table的绘制)\n createLayer(canvasId?: string, layerMode?: LayerMode): ILayer {\n // 创建一个默认layer图层\n const layer = this.layerService.createLayer(this, {\n main: false,\n layerMode,\n canvasId\n });\n this.appendChild(layer);\n return layer;\n // const layer = new Layer(this, this.global, this.window, {\n // main: false,\n // canvasId\n // });\n // this.appendChild(layer);\n // return layer;\n }\n sortLayer(cb: (ILayer1: ILayer, layer2: ILayer) => number): void {\n const children = this.children;\n children.sort(cb);\n this.removeAllChild();\n children.forEach(c => {\n this.appendChild(c);\n });\n }\n removeLayer(ILayerId: number): ILayer | false {\n return this.removeChild(this.findChildByUid(ILayerId) as IGraphic) as ILayer;\n }\n tryInitInteractiveLayer() {\n // TODO:顺序可能会存在问题\n // 支持交互层,且没有创建过,那就创建\n if (this.supportInteractiveLayer && !this.interactiveLayer) {\n this.interactiveLayer = this.createLayer();\n this.interactiveLayer.name = '_builtin_interactive';\n this.nextFrameRenderLayerSet.add(this.interactiveLayer as any); // to be fixed\n }\n // this.interactiveLayer.afterDraw(l => {\n // l.removeAllChild();\n // });\n }\n\n clearViewBox(color?: string) {\n this.window.clearViewBox(this._viewBox, color);\n }\n\n render(layers?: ILayer[], params?: Partial<IDrawContext>): void {\n this.ticker.start();\n this.timeline.resume();\n const state = this.state;\n this.state = 'rendering';\n this.layerService.prepareStageLayer(this);\n if (!this._skipRender) {\n this.lastRenderparams = params;\n this.hooks.beforeRender.call(this);\n this.renderLayerList(this.children as ILayer[]);\n this.combineLayersToWindow();\n this.nextFrameRenderLayerSet.clear();\n this.hooks.afterRender.call(this);\n }\n this.state = state;\n this._skipRender && this._skipRender++;\n }\n\n protected combineLayersToWindow() {\n return;\n // this.forEach<ILayer>((layer, i) => {\n // layer.combineTo(this.window, {\n // clear: i === 0,\n // x: this.x,\n // y: this.y,\n // width: this.viewWidth,\n // height: this.viewHeight,\n // renderService: this.renderService,\n // background: layer === this.defaultLayer ? this.background : undefined,\n // updateBounds: !!this.dirtyBounds\n // });\n // });\n }\n\n renderNextFrame(layers?: ILayer[], force?: boolean): void {\n // render状态中调用的不会触发nextFrame,避免loop\n // if (this.state === 'rendering' && !force) {\n // console.log('abc');\n // return;\n // }\n // 性能优化,避免重复add\n if (this.nextFrameRenderLayerSet.size !== this.childrenCount) {\n (layers || this).forEach<ILayer>((layer: any) => {\n this.nextFrameRenderLayerSet.add(layer);\n });\n }\n if (!this.willNextFrameRender) {\n this.willNextFrameRender = true;\n this.global.getRequestAnimationFrame()(() => {\n this._doRenderInThisFrame(), (this.willNextFrameRender = false);\n });\n }\n }\n\n _doRenderInThisFrame() {\n this.timeline.resume();\n this.ticker.start();\n const state = this.state;\n this.state = 'rendering';\n this.layerService.prepareStageLayer(this);\n if (this.nextFrameRenderLayerSet.size && !this._skipRender) {\n this.hooks.beforeRender.call(this);\n this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {});\n this.combineLayersToWindow();\n this.hooks.afterRender.call(this);\n this.nextFrameRenderLayerSet.clear();\n }\n this.state = state;\n this._skipRender && this._skipRender++;\n }\n\n protected renderLayerList(layerList: ILayer[], params?: Partial<IDrawContext>) {\n const list: ILayer[] = [];\n // 只需要render main layer即可\n for (let i = 0; i < layerList.length; i++) {\n let l = layerList[i];\n if (l.layerMode === 'virtual') {\n l = l.getNativeHandler().mainHandler.layer;\n }\n if (!list.includes(l)) {\n list.push(l);\n }\n }\n list.forEach(layer => {\n // 记录当前的stamp,避免重复绘制layer(如果存在virtual layer)\n if (layer.renderCount > this.renderCount) {\n return;\n }\n layer.renderCount = this.renderCount + 1;\n\n layer.render(\n {\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n },\n { renderStyle: this.renderStyle, ...params }\n );\n });\n\n // 添加交互层渲染\n if (this.interactiveLayer && !layerList.includes(this.interactiveLayer)) {\n this.interactiveLayer.render(\n {\n renderService: this.renderService,\n updateBounds: !!this.dirtyBounds\n },\n { renderStyle: this.renderStyle, ...params }\n );\n }\n }\n\n resizeWindow(w: number, h: number, rerender: boolean = true) {\n this.window.resize(w, h);\n rerender && this.render();\n }\n\n /**\n * 语法糖,如果viewBox和window宽高一样的话,那么会同时缩放window和viewBox\n * @param w\n * @param h\n * @param rerender\n */\n resize(w: number, h: number, rerender: boolean = true): void {\n this.window.resize(w, h);\n this.forEachChildren<ILayer>(c => {\n c.resize(w, h);\n });\n // 如果不是子图的stage,那么认为用户也想要resize view\n if (!this._subView) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n }\n // 设置camera\n // this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });\n this.camera && this.option3d && this.set3dOptions(this.option3d);\n rerender && this.render();\n }\n resizeView(w: number, h: number, rerender: boolean = true) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n this.forEachChildren<ILayer>(c => {\n c.resizeView(w, h);\n });\n // 设置camera\n this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });\n rerender && this.render();\n }\n setViewBox(viewBox: IBoundsLike, rerender: boolean): void;\n setViewBox(x: number, y: number, w: number, h: number, rerender: boolean): void;\n setViewBox(x: number | IBoundsLike, y: number | boolean, w?: number, h?: number, rerender?: boolean): void {\n let isRerender: boolean = true;\n\n if (typeof x === 'object') {\n this.viewBox.setValue(x.x1, x.y1, x.x2, x.y2);\n if (y === false) {\n isRerender = false;\n }\n } else {\n this.viewBox.setValue(x, y as number, x + w, (y as number) + h);\n\n if (rerender === false) {\n isRerender = false;\n }\n }\n\n this.forEachChildren<ILayer>(c => {\n c.resizeView(this.viewBox.width(), this.viewBox.height());\n });\n isRerender && this.render();\n }\n setDpr(dpr: number, rerender: boolean = true): void {\n // this.window.setDpr(dpr);\n this.forEachChildren<ILayer>(c => {\n c.setDpr(dpr);\n });\n\n rerender && this.render();\n }\n setOrigin(x: number, y: number): void {\n throw new Error('暂不支持');\n }\n export(type: IExportType): HTMLCanvasElement | ImageData {\n throw new Error('暂不支持');\n }\n pick(x: number, y: number): PickResult | false {\n // 暂时不提供layer的pick\n const result = this.pickerService.pick(this.children as unknown as IGraphic[], new Point(x, y), {\n bounds: this.AABBBounds\n });\n if (result?.graphic || result?.group) {\n return result;\n }\n return false;\n }\n\n // 动画相关\n startAnimate(t: number): void {\n throw new Error('暂不支持');\n }\n setToFrame(t: number): void {\n throw new Error('暂不支持');\n }\n\n release() {\n super.release();\n this.eventSystem && this.eventSystem.release();\n this.pluginService.release();\n this.forEach(layer => {\n layer.release();\n });\n this.interactiveLayer && this.interactiveLayer.release();\n this.window.release();\n }\n\n setStage(stage?: IStage) {\n return;\n // this.stage = this;\n // this.forEachChildren(item => {\n // (item as Layer).setStage(this);\n // });\n }\n\n /**\n * 添加dirty区域,会修改参数b\n * @param b\n * @param matrix\n */\n dirty(b: IBounds, matrix?: IMatrix) {\n if (matrix) {\n b.transformWithMatrix(matrix);\n }\n if (this.dirtyBounds.empty()) {\n this.dirtyBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n this.dirtyBounds.union(b);\n }\n\n getLayer(name: string): undefined | ILayer {\n const layer = this.children.filter(layer => layer.name === name);\n return layer[0] as ILayer;\n }\n\n renderTo(window: IWindow, params: { x: number; y: number; width: number; height: number }) {\n this.forEachChildren<ILayer>((layer, i) => {\n layer.drawTo(window, {\n ...params,\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n clear: i === 0, // 第一个layer需要clear\n updateBounds: !!this.dirtyBounds\n });\n });\n }\n\n /**\n * 渲染到新的window上去\n * @param fullImage 是否是全量的image,因为可能之前的window有一部分场景树超过window的帧缓冲了\n * @returns\n */\n renderToNewWindow(fullImage: boolean = true, viewBox?: IAABBBounds): IWindow {\n const window = container.get<IWindow>(VWindow);\n if (fullImage) {\n window.create({\n width: this.viewWidth,\n height: this.viewHeight,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n } else {\n const width = viewBox ? viewBox.width() : Math.min(this.viewWidth, this.window.width - this.x);\n const height = viewBox ? viewBox.height() : Math.min(this.viewHeight, this.window.height - this.y);\n window.create({\n width,\n height,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n }\n\n const x = viewBox ? -viewBox.x1 : 0;\n const y = viewBox ? -viewBox.y1 : 0;\n this.renderTo(window, {\n x,\n y,\n width: viewBox ? viewBox.x2 : window.width,\n height: viewBox ? viewBox.y2 : window.height\n });\n return window;\n }\n\n toCanvas(fullImage: boolean = true, viewBox?: IAABBBounds): HTMLCanvasElement | null {\n const window = this.renderToNewWindow(fullImage, viewBox);\n const c = window.getNativeHandler();\n if (c.nativeCanvas) {\n return c.nativeCanvas;\n }\n return null;\n }\n\n setCursor(mode?: string): void {\n this._cursor = mode;\n this.eventSystem.setCursor(mode);\n }\n\n getCursor() {\n return this._cursor;\n }\n}\n"]}