@visactor/vrender-core 1.0.14 → 1.0.16

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.
Files changed (44) hide show
  1. package/cjs/application.d.ts +2 -1
  2. package/cjs/application.js +8 -1
  3. package/cjs/application.js.map +1 -1
  4. package/cjs/core/stage.js +4 -4
  5. package/cjs/core/stage.js.map +1 -1
  6. package/cjs/modules.d.ts +1 -2
  7. package/cjs/modules.js +3 -4
  8. package/cjs/modules.js.map +1 -1
  9. package/cjs/render/constants.d.ts +2 -0
  10. package/cjs/render/constants.js +7 -0
  11. package/cjs/render/constants.js.map +1 -0
  12. package/cjs/render/contributions/render/arc-render.js +1 -1
  13. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  14. package/cjs/render/index.d.ts +1 -0
  15. package/cjs/render/index.js +2 -2
  16. package/cjs/render/index.js.map +1 -1
  17. package/cjs/render/render-modules.js +2 -2
  18. package/cjs/render/render-modules.js.map +1 -1
  19. package/cjs/render/render-service.d.ts +0 -2
  20. package/cjs/render/render-service.js +1 -3
  21. package/cjs/render/render-service.js.map +1 -1
  22. package/dist/index.es.js +15 -8
  23. package/es/application.d.ts +2 -1
  24. package/es/application.js +10 -1
  25. package/es/application.js.map +1 -1
  26. package/es/core/stage.js +1 -1
  27. package/es/core/stage.js.map +1 -1
  28. package/es/modules.d.ts +1 -2
  29. package/es/modules.js +0 -6
  30. package/es/modules.js.map +1 -1
  31. package/es/render/constants.d.ts +2 -0
  32. package/es/render/constants.js +4 -0
  33. package/es/render/constants.js.map +1 -0
  34. package/es/render/contributions/render/arc-render.js +1 -1
  35. package/es/render/contributions/render/arc-render.js.map +1 -1
  36. package/es/render/index.d.ts +1 -0
  37. package/es/render/index.js +2 -0
  38. package/es/render/index.js.map +1 -1
  39. package/es/render/render-modules.js +3 -1
  40. package/es/render/render-modules.js.map +1 -1
  41. package/es/render/render-service.d.ts +0 -2
  42. package/es/render/render-service.js +0 -4
  43. package/es/render/render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/vutils';\nimport { Bounds, Point, isString } from '@visactor/vutils';\nimport type {\n IGraphic,\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 ILayerService,\n ITimeline,\n IOptimizeType,\n LayerMode,\n PickResult,\n IPlugin,\n IGraphicService,\n IRenderServiceDrawParams\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 } from '../graphic/group';\nimport { Theme } from '../graphic/theme';\nimport { PickerService } from '../picker/constants';\nimport { PluginService } from '../plugins/constants';\nimport { AutoRenderPlugin } from '../plugins/builtin-plugin/auto-render-plugin';\nimport { AutoRefreshPlugin } from '../plugins/builtin-plugin/auto-refresh-plugin';\nimport { IncrementalAutoRenderPlugin } from '../plugins/builtin-plugin/incremental-auto-render-plugin';\nimport { DirtyBoundsPlugin } from '../plugins/builtin-plugin/dirty-bounds-plugin';\nimport { SyncHook } from '../tapable';\nimport { LayerService } from './constants';\nimport { application } from '../application';\nimport { isBrowserEnv } from '../env-check';\nimport { Factory } from '../factory';\nimport { Graphic, GraphicService } from '../graphic';\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 private _background: string | IColor;\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 afterClearScreen: ISyncHook<[IRenderServiceDrawParams]>;\n afterClearRect: ISyncHook<[IRenderServiceDrawParams]>;\n };\n\n set viewBox(b: IBoundsLike) {\n this.window.setViewBox(b);\n }\n get viewBox(): IAABBBounds {\n return this.window.getViewBox();\n }\n\n /**\n * @deprecated 不建议使用\n */\n get x(): number {\n return this.window.getViewBox().x1;\n }\n /**\n * @deprecated 不建议使用\n */\n set x(x: number) {\n const b = this.window.getViewBox();\n b.translate(x - b.x1, 0);\n this.window.setViewBox(b);\n }\n /**\n * @deprecated 不建议使用\n */\n get y(): number {\n return this.window.getViewBox().y1;\n }\n /**\n * @deprecated 不建议使用\n */\n set y(y: number) {\n const b = this.window.getViewBox();\n b.translate(0, y - b.y1);\n this.window.setViewBox(b);\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.window.getViewBox().width();\n }\n set viewWidth(w: number) {\n this.resizeView(w, this.viewHeight);\n }\n get viewHeight(): number {\n return this.window.getViewBox().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 protected _ticker: ITicker;\n\n autoRender: boolean;\n autoRefresh: boolean;\n _enableLayout: boolean;\n htmlAttribute: boolean | string | any;\n reactAttribute: boolean | string | any;\n increaseAutoRender: boolean;\n view3dTranform: boolean;\n readonly window: IWindow;\n private readonly global: IGlobal;\n readonly renderService: IRenderService;\n protected pickerService?: IPickerService;\n readonly pluginService: IPluginService;\n readonly layerService: ILayerService;\n readonly graphicService: IGraphicService;\n private _eventSystem?: EventSystem;\n private get eventSystem(): EventSystem {\n return this._eventSystem;\n }\n\n protected _beforeRenderList: Array<(stage: IStage) => void>;\n protected _afterRenderList: Array<(stage: IStage) => void>;\n protected _afterClearScreen?: (drawParams: any) => void;\n protected _afterClearRect?: (drawParams: any) => 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 // 是否在render之前执行了tick,如果没有执行,尝试执行tick用来应用动画属性,避免动画过程中随意赋值然后又调用同步render导致属性的突变\n // 第一次render不需要强行走动画\n protected tickedBeforeRender: boolean = true;\n\n // 随机分配一个rafId\n readonly rafId: number;\n\n get ticker() {\n return this._ticker;\n }\n\n set ticker(ticker: ITicker) {\n ticker.bindStage(this);\n if (this._ticker) {\n this._ticker.removeListener('tick', this.afterTickCb);\n }\n ticker.addTimeline(this.timeline);\n this._ticker = ticker;\n this._ticker.on('tick', this.afterTickCb);\n }\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 afterClearScreen: new SyncHook(['stage']),\n afterClearRect: new SyncHook(['stage'])\n };\n this.global = application.global;\n if (!this.global.env && isBrowserEnv()) {\n // 如果是浏览器环境,默认设置env\n this.global.setEnv('browser');\n }\n this.window = container.get<IWindow>(VWindow);\n this.renderService = container.get<IRenderService>(RenderService);\n this.pluginService = container.get<IPluginService>(PluginService);\n this.layerService = container.get<ILayerService>(LayerService);\n this.graphicService = container.get<IGraphicService>(GraphicService);\n this.pluginService.active(this, params);\n this._beforeRenderList = [];\n this._afterRenderList = [];\n\n this.window.create({\n width: params.width,\n height: params.height,\n viewBox: params.viewBox,\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.state = 'normal';\n this.renderCount = 0;\n this.tryInitEventSystem();\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._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(this.layerService.createLayer(this, { main: true }));\n\n this.nextFrameRenderLayerSet = new Set();\n this.willNextFrameRender = false;\n this.stage = this;\n this.renderStyle = params.renderStyle;\n\n // this.autoRender = params.autoRender;\n if (params.autoRender) {\n this.enableAutoRender();\n }\n if (params.autoRefresh) {\n this.enableAutoRefresh();\n }\n // 默认不开启dirtyBounds\n if (params.disableDirtyBounds === false) {\n this.enableDirtyBounds();\n }\n\n if (params.enableHtmlAttribute) {\n this.enableHtmlAttribute(params.enableHtmlAttribute);\n }\n if (params.ReactDOM) {\n this.enableReactAttribute(params.ReactDOM);\n }\n\n params.enableLayout && this.enableLayout();\n this.hooks.beforeRender.tap('constructor', this.beforeRender);\n this.hooks.afterRender.tap('constructor', this.afterRender);\n if (params.beforeRender) {\n this._beforeRenderList.push(params.beforeRender);\n }\n if (params.afterRender) {\n this._afterRenderList.push(params.afterRender);\n }\n this.hooks.afterClearScreen.tap('constructor', this.afterClearScreen);\n this.hooks.afterClearRect.tap('constructor', this.afterClearRect);\n this._afterClearScreen = params.afterClearScreen;\n this._afterClearRect = params.afterClearRect;\n this.supportInteractiveLayer = params.interactiveLayer !== false;\n if (!params.optimize) {\n params.optimize = {\n tickRenderMode: 'effect'\n };\n }\n this.optmize(params.optimize);\n // 如果背景是图片,触发加载图片操作\n if (params.background && isString(this._background) && this._background.includes('/')) {\n this.setAttributes({ background: this._background });\n }\n\n this.initAnimate(params);\n this.rafId = params.rafId ?? Math.floor(Math.random() * 6);\n }\n\n initAnimate(params: Partial<IStageParams>) {\n if ((this as any).createTicker && (this as any).createTimeline) {\n this._ticker = params.ticker || (this as any).createTicker(this);\n this._ticker.bindStage(this);\n if (this.params.optimize?.tickRenderMode === 'performance') {\n this._ticker.setFPS(30);\n }\n this.timeline = (this as any).createTimeline();\n this._ticker.addTimeline(this.timeline);\n this._ticker.on('tick', this.afterTickCb);\n }\n }\n\n startAnimate() {\n if (this._ticker && this.timeline) {\n this._ticker.start();\n this.timeline.resume();\n }\n }\n\n pauseRender(sr: number = -1) {\n this._skipRender = sr;\n }\n\n resumeRender() {\n this._skipRender = 0;\n }\n\n protected tryInitEventSystem() {\n if (this.global.supportEvent && !this._eventSystem) {\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 supportsPointerEvents: this.params.supportsPointerEvents,\n supportsTouchEvents: this.params.supportsTouchEvents,\n ...this.params.event\n });\n }\n }\n\n preventRender(prevent: boolean) {\n if (prevent) {\n this._skipRender = -Infinity;\n } else {\n // 判断是否需要outRange优化\n if (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 this.params.optimize = params;\n }\n\n // 优化渲染\n protected optmizeRender(skipRenderWithOutRange: boolean = false) {\n if (!skipRenderWithOutRange) {\n return;\n }\n // 不在视口内的时候,跳过渲染\n this._skipRender = this._skipRender < 0 ? this._skipRender : this.window.isVisible() ? 0 : 1;\n this.window.onVisibleChange(this._onVisibleChange);\n }\n\n protected _onVisibleChange = (visible: boolean) => {\n if (this._skipRender < 0) {\n return;\n }\n if (visible) {\n if (this.dirtyBounds) {\n const b = this.window.getViewBox();\n this.dirtyBounds.setValue(b.x1, b.y1, b.width(), b.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 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 const DirectionalLight = Factory.getPlugin('DirectionalLight');\n\n if (DirectionalLight) {\n this.light = new DirectionalLight(dir, color, ambient);\n }\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 const OrthoCamera = Factory.getPlugin('OrthoCamera');\n if (OrthoCamera) {\n this.camera = new OrthoCamera(cameraParams);\n }\n }\n\n if (options.enableView3dTransform) {\n this.enableView3dTransform();\n }\n }\n\n protected beforeRender = (stage: IStage) => {\n this._beforeRenderList.forEach(cb => cb(stage));\n };\n protected afterClearScreen = (drawParams: any) => {\n this._afterClearScreen && this._afterClearScreen(drawParams);\n };\n protected afterClearRect = (drawParams: any) => {\n this._afterClearRect && this._afterClearRect(drawParams);\n };\n\n protected afterRender = (stage: IStage) => {\n this.renderCount++;\n this._afterRenderList.forEach(cb => cb(stage));\n this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage));\n this._afterNextRenderCbs = null;\n this.tickedBeforeRender = false;\n };\n\n protected afterTickCb = () => {\n this.tickedBeforeRender = true;\n // 性能模式不用立刻渲染\n this.state !== 'rendering' && this.renderNextFrame();\n };\n\n setBeforeRender(cb: (stage: IStage) => void) {\n this._beforeRenderList.push(cb);\n }\n\n removeBeforeRender(cb: (stage: IStage) => void) {\n this._beforeRenderList = this._beforeRenderList.filter(c => c !== cb);\n }\n\n setAfterRender(cb: (stage: IStage) => void) {\n this._afterRenderList.push(cb);\n }\n\n removeAfterRender(cb: (stage: IStage) => void) {\n this._afterRenderList = this._afterRenderList.filter(c => c !== 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 const ViewTransform3dPlugin = Factory.getPlugin('ViewTransform3dPlugin');\n\n if (ViewTransform3dPlugin) {\n this.pluginService.register(new ViewTransform3dPlugin());\n }\n }\n\n disableView3dTranform() {\n if (!this.view3dTranform) {\n return;\n }\n this.view3dTranform = false;\n this.pluginService.findPluginsByName('ViewTransform3dPlugin').forEach(plugin => {\n this.pluginService.unRegister(plugin);\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 this.pluginService.unRegister(plugin);\n });\n }\n enableAutoRefresh() {\n if (this.autoRefresh) {\n return;\n }\n this.autoRefresh = true;\n this.pluginService.register(new AutoRefreshPlugin());\n }\n disableAutoRefresh() {\n if (!this.autoRefresh) {\n return;\n }\n this.autoRefresh = false;\n this.pluginService.findPluginsByName('AutoRefreshPlugin').forEach(plugin => {\n this.pluginService.unRegister(plugin);\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 this.pluginService.unRegister(plugin);\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 } else {\n plugin.activate(this.pluginService);\n }\n }\n disableDirtyBounds() {\n if (!this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = null;\n this.pluginService.findPluginsByName('DirtyBoundsPlugin').forEach(plugin => {\n this.pluginService.unRegister(plugin);\n });\n }\n enableLayout() {\n if (this._enableLayout) {\n return;\n }\n this._enableLayout = true;\n\n const FlexLayoutPlugin = Factory.getPlugin('FlexLayoutPlugin');\n\n if (FlexLayoutPlugin) {\n this.pluginService.register(new FlexLayoutPlugin());\n }\n }\n disableLayout() {\n if (!this._enableLayout) {\n return;\n }\n this._enableLayout = false;\n this.pluginService.findPluginsByName('FlexLayoutPlugin').forEach(plugin => {\n this.pluginService.unRegister(plugin);\n });\n }\n enableHtmlAttribute(container?: any) {\n if (this.htmlAttribute) {\n return;\n }\n const HtmlAttributePlugin = Factory.getPlugin('HtmlAttributePlugin');\n\n if (HtmlAttributePlugin) {\n this.htmlAttribute = container;\n this.pluginService.register(new HtmlAttributePlugin());\n }\n }\n disableHtmlAttribute() {\n if (!this.htmlAttribute) {\n return;\n }\n this.htmlAttribute = false;\n this.pluginService.findPluginsByName('HtmlAttributePlugin').forEach(plugin => {\n this.pluginService.unRegister(plugin);\n });\n }\n enableReactAttribute(container?: any) {\n if (this.reactAttribute) {\n return;\n }\n const ReactAttributePlugin = Factory.getPlugin('ReactAttributePlugin');\n\n if (ReactAttributePlugin) {\n this.reactAttribute = container;\n this.pluginService.register(new ReactAttributePlugin());\n }\n }\n disableReactAttribute() {\n if (!this.reactAttribute) {\n return;\n }\n this.reactAttribute = false;\n this.pluginService.findPluginsByName('ReactAttributePlugin').forEach(plugin => {\n this.pluginService.unRegister(plugin);\n });\n }\n\n getPluginsByName(name: string): IPlugin[] {\n return this.pluginService.findPluginsByName(name);\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(): IAABBBounds {\n const viewBox = this.window.getViewBox();\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 if (this.releaseStatus === 'released') {\n return;\n }\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 if (this.releaseStatus === 'released') {\n return;\n }\n // TODO:顺序可能会存在问题\n // 支持交互层,且没有创建过,那就创建\n if (this.supportInteractiveLayer && !this.interactiveLayer) {\n this.interactiveLayer = this.createLayer();\n this.interactiveLayer.name = '_builtin_interactive';\n this.interactiveLayer.attribute.pickable = false;\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(color);\n }\n\n render(layers?: ILayer[], params?: Partial<IDrawContext>): void {\n if (this.releaseStatus === 'released') {\n return;\n }\n this.startAnimate();\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 if (!this._skipRender) {\n this.renderLayerList(this.children as ILayer[]);\n this.combineLayersToWindow();\n this.nextFrameRenderLayerSet.clear();\n }\n this.hooks.afterRender.call(this);\n }\n this.state = state;\n this._skipRender && this._skipRender++;\n }\n\n protected combineLayersToWindow() {\n // TODO 后续支持通用的渲染模型\n if (this.global.env === 'harmony') {\n const ctx = this.window.getContext().nativeContext;\n this.forEachChildren<ILayer>((layer, i) => {\n if (i > 0) {\n const image = layer\n .getNativeHandler()\n .getContext()\n .canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();\n ctx.transferFromImageBitmap(image);\n }\n });\n }\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.getSpecifiedRequestAnimationFrame(this.rafId)(() => {\n this._doRenderInThisFrame(), (this.willNextFrameRender = false);\n });\n }\n }\n\n _doRenderInThisFrame() {\n if (this.releaseStatus === 'released') {\n return;\n }\n this.startAnimate();\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 if (!this._skipRender) {\n this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {});\n this.combineLayersToWindow();\n this.nextFrameRenderLayerSet.clear();\n }\n this.hooks.afterRender.call(this);\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 if (layer === this.interactiveLayer) {\n // 交互层由于其特殊性,不使用dirtyBounds\n this.dirtyBounds && this.dirtyBounds.clear();\n }\n layer.render(\n {\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!(this.dirtyBounds && !this.dirtyBounds.empty()),\n viewBox: this.window.getViewBox(),\n transMatrix: this.window.getViewBoxTransform()\n },\n { renderStyle: this.renderStyle, ...params }\n );\n });\n\n // 添加交互层渲染\n if (this.interactiveLayer && !layerList.includes(this.interactiveLayer)) {\n // 交互层由于其特殊性,不使用dirtyBounds\n this.dirtyBounds && this.dirtyBounds.clear();\n this.interactiveLayer.render(\n {\n renderService: this.renderService,\n updateBounds: !!(this.dirtyBounds && !this.dirtyBounds.empty()),\n viewBox: this.window.getViewBox(),\n transMatrix: this.window.getViewBoxTransform()\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 if (this.releaseStatus === 'released') {\n return;\n }\n // 如果不是子图的stage,那么认为用户也想要resize view\n if (!this.window.hasSubView()) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n }\n this.window.resize(w, h);\n this.forEachChildren<ILayer>(c => {\n c.resize(w, 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 if (this.releaseStatus === 'released') {\n return;\n }\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 if (this.releaseStatus === 'released') {\n return;\n }\n // 暂时不提供layer的pick\n const result = this.getPickerService().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 setToFrame(t: number): void {\n throw new Error('暂不支持');\n }\n\n release() {\n super.release();\n\n this.hooks.beforeRender.unTap('constructor', this.beforeRender);\n this.hooks.afterRender.unTap('constructor', this.afterRender);\n\n this.eventSystem && this.eventSystem.release();\n this.layerService.releaseStage(this);\n this.pluginService.release();\n this.forEach(layer => {\n layer.release();\n });\n // 额外删除掉interactiveLayer的节点\n if (this.interactiveLayer) {\n this.interactiveLayer.forEachChildren((item: IGraphic) => {\n item.setStage && item.setStage(null, null);\n this.interactiveLayer.removeChild(item);\n });\n this.interactiveLayer.release();\n }\n this.window.release();\n this._ticker?.remTimeline(this?.timeline);\n this._ticker?.removeListener('tick', this.afterTickCb);\n this.renderService.renderTreeRoots = [];\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 (this.releaseStatus === 'released') {\n return;\n }\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) {\n if (this.releaseStatus === 'released') {\n return;\n }\n this.forEachChildren<ILayer>((layer, i) => {\n layer.drawTo(window, {\n // ...params,\n renderService: this.renderService,\n viewBox: window.getViewBox(),\n transMatrix: window.getViewBoxTransform(),\n background: layer === this.defaultLayer ? this.background : undefined,\n clear: i === 0, // 第一个layer需要clear\n updateBounds: !!(this.dirtyBounds && !this.dirtyBounds.empty())\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 if (this.releaseStatus === 'released') {\n return;\n }\n const window = container.get<IWindow>(VWindow);\n const x1 = viewBox ? -viewBox.x1 : 0;\n const y1 = viewBox ? -viewBox.y1 : 0;\n const x2 = viewBox ? viewBox.x2 : this.viewWidth;\n const y2 = viewBox ? viewBox.y2 : this.viewHeight;\n const width = viewBox ? viewBox.width() : this.viewWidth;\n const height = viewBox ? viewBox.height() : this.viewHeight;\n if (fullImage) {\n window.create({\n viewBox: { x1, y1, x2, y2 },\n width,\n height,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n } else {\n window.create({\n viewBox: { x1, y1, x2, y2 },\n width,\n height,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n }\n\n this.renderTo(window);\n return window;\n }\n\n toCanvas(fullImage: boolean = true, viewBox?: IAABBBounds): HTMLCanvasElement | null {\n if (this.releaseStatus === 'released') {\n return;\n }\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, 'ignore');\n }\n\n getCursor() {\n return this._cursor;\n }\n\n eventPointTransform(e: PointerEvent | WheelEvent | TouchEvent): { x: number; y: number } {\n const point = this.global.mapToCanvasPoint(e, this.window);\n\n return this.stage.window.pointTransform(point.x, point.y);\n }\n\n pauseTriggerEvent() {\n this._eventSystem && this._eventSystem.pauseTriggerEvent();\n }\n resumeTriggerEvent() {\n this._eventSystem && this._eventSystem.resumeTriggerEvent();\n }\n\n getPickerService() {\n if (!this.pickerService) {\n this.pickerService = container.get<IPickerService>(PickerService);\n }\n return this.pickerService;\n }\n\n reInit() {\n this.renderService.reInit();\n this.pickerService.reInit();\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/stage.ts"],"names":[],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C,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,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,mBAAmB,CAAC,CAAyC;QAC3D,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAE3D,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE,CAAC;IAC7D,CAAC;IACD,kBAAkB;QAChB,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,CAAC;IAC9D,CAAC;IAED,gBAAgB;QACd,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACvB,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,GAAG,CAAiB,aAAa,CAAC,CAAC;SACnE;QACD,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;IAC9B,CAAC;CACF","file":"stage.js","sourcesContent":["import type { IAABBBounds, IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';\nimport { Bounds, Point, isString } from '@visactor/vutils';\nimport type {\n IGraphic,\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 ILayerService,\n ITimeline,\n IOptimizeType,\n LayerMode,\n PickResult,\n IPlugin,\n IGraphicService,\n IRenderServiceDrawParams\n} from '../interface';\nimport { VWindow } from './window';\nimport type { Layer } from './layer';\nimport { EventSystem } from '../event';\nimport { container } from '../container';\nimport { RenderService } from '../render/constants';\nimport { Group } from '../graphic/group';\nimport { Theme } from '../graphic/theme';\nimport { PickerService } from '../picker/constants';\nimport { PluginService } from '../plugins/constants';\nimport { AutoRenderPlugin } from '../plugins/builtin-plugin/auto-render-plugin';\nimport { AutoRefreshPlugin } from '../plugins/builtin-plugin/auto-refresh-plugin';\nimport { IncrementalAutoRenderPlugin } from '../plugins/builtin-plugin/incremental-auto-render-plugin';\nimport { DirtyBoundsPlugin } from '../plugins/builtin-plugin/dirty-bounds-plugin';\nimport { SyncHook } from '../tapable';\nimport { LayerService } from './constants';\nimport { application } from '../application';\nimport { isBrowserEnv } from '../env-check';\nimport { Factory } from '../factory';\nimport { Graphic, GraphicService } from '../graphic';\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 private _background: string | IColor;\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 afterClearScreen: ISyncHook<[IRenderServiceDrawParams]>;\n afterClearRect: ISyncHook<[IRenderServiceDrawParams]>;\n };\n\n set viewBox(b: IBoundsLike) {\n this.window.setViewBox(b);\n }\n get viewBox(): IAABBBounds {\n return this.window.getViewBox();\n }\n\n /**\n * @deprecated 不建议使用\n */\n get x(): number {\n return this.window.getViewBox().x1;\n }\n /**\n * @deprecated 不建议使用\n */\n set x(x: number) {\n const b = this.window.getViewBox();\n b.translate(x - b.x1, 0);\n this.window.setViewBox(b);\n }\n /**\n * @deprecated 不建议使用\n */\n get y(): number {\n return this.window.getViewBox().y1;\n }\n /**\n * @deprecated 不建议使用\n */\n set y(y: number) {\n const b = this.window.getViewBox();\n b.translate(0, y - b.y1);\n this.window.setViewBox(b);\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.window.getViewBox().width();\n }\n set viewWidth(w: number) {\n this.resizeView(w, this.viewHeight);\n }\n get viewHeight(): number {\n return this.window.getViewBox().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 protected _ticker: ITicker;\n\n autoRender: boolean;\n autoRefresh: boolean;\n _enableLayout: boolean;\n htmlAttribute: boolean | string | any;\n reactAttribute: boolean | string | any;\n increaseAutoRender: boolean;\n view3dTranform: boolean;\n readonly window: IWindow;\n private readonly global: IGlobal;\n readonly renderService: IRenderService;\n protected pickerService?: IPickerService;\n readonly pluginService: IPluginService;\n readonly layerService: ILayerService;\n readonly graphicService: IGraphicService;\n private _eventSystem?: EventSystem;\n private get eventSystem(): EventSystem {\n return this._eventSystem;\n }\n\n protected _beforeRenderList: Array<(stage: IStage) => void>;\n protected _afterRenderList: Array<(stage: IStage) => void>;\n protected _afterClearScreen?: (drawParams: any) => void;\n protected _afterClearRect?: (drawParams: any) => 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 // 是否在render之前执行了tick,如果没有执行,尝试执行tick用来应用动画属性,避免动画过程中随意赋值然后又调用同步render导致属性的突变\n // 第一次render不需要强行走动画\n protected tickedBeforeRender: boolean = true;\n\n // 随机分配一个rafId\n readonly rafId: number;\n\n get ticker() {\n return this._ticker;\n }\n\n set ticker(ticker: ITicker) {\n ticker.bindStage(this);\n if (this._ticker) {\n this._ticker.removeListener('tick', this.afterTickCb);\n }\n ticker.addTimeline(this.timeline);\n this._ticker = ticker;\n this._ticker.on('tick', this.afterTickCb);\n }\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 afterClearScreen: new SyncHook(['stage']),\n afterClearRect: new SyncHook(['stage'])\n };\n this.global = application.global;\n if (!this.global.env && isBrowserEnv()) {\n // 如果是浏览器环境,默认设置env\n this.global.setEnv('browser');\n }\n this.window = container.get<IWindow>(VWindow);\n this.renderService = container.get<IRenderService>(RenderService);\n this.pluginService = container.get<IPluginService>(PluginService);\n this.layerService = container.get<ILayerService>(LayerService);\n this.graphicService = container.get<IGraphicService>(GraphicService);\n this.pluginService.active(this, params);\n this._beforeRenderList = [];\n this._afterRenderList = [];\n\n this.window.create({\n width: params.width,\n height: params.height,\n viewBox: params.viewBox,\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.state = 'normal';\n this.renderCount = 0;\n this.tryInitEventSystem();\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._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(this.layerService.createLayer(this, { main: true }));\n\n this.nextFrameRenderLayerSet = new Set();\n this.willNextFrameRender = false;\n this.stage = this;\n this.renderStyle = params.renderStyle;\n\n // this.autoRender = params.autoRender;\n if (params.autoRender) {\n this.enableAutoRender();\n }\n if (params.autoRefresh) {\n this.enableAutoRefresh();\n }\n // 默认不开启dirtyBounds\n if (params.disableDirtyBounds === false) {\n this.enableDirtyBounds();\n }\n\n if (params.enableHtmlAttribute) {\n this.enableHtmlAttribute(params.enableHtmlAttribute);\n }\n if (params.ReactDOM) {\n this.enableReactAttribute(params.ReactDOM);\n }\n\n params.enableLayout && this.enableLayout();\n this.hooks.beforeRender.tap('constructor', this.beforeRender);\n this.hooks.afterRender.tap('constructor', this.afterRender);\n if (params.beforeRender) {\n this._beforeRenderList.push(params.beforeRender);\n }\n if (params.afterRender) {\n this._afterRenderList.push(params.afterRender);\n }\n this.hooks.afterClearScreen.tap('constructor', this.afterClearScreen);\n this.hooks.afterClearRect.tap('constructor', this.afterClearRect);\n this._afterClearScreen = params.afterClearScreen;\n this._afterClearRect = params.afterClearRect;\n this.supportInteractiveLayer = params.interactiveLayer !== false;\n if (!params.optimize) {\n params.optimize = {\n tickRenderMode: 'effect'\n };\n }\n this.optmize(params.optimize);\n // 如果背景是图片,触发加载图片操作\n if (params.background && isString(this._background) && this._background.includes('/')) {\n this.setAttributes({ background: this._background });\n }\n\n this.initAnimate(params);\n this.rafId = params.rafId ?? Math.floor(Math.random() * 6);\n }\n\n initAnimate(params: Partial<IStageParams>) {\n if ((this as any).createTicker && (this as any).createTimeline) {\n this._ticker = params.ticker || (this as any).createTicker(this);\n this._ticker.bindStage(this);\n if (this.params.optimize?.tickRenderMode === 'performance') {\n this._ticker.setFPS(30);\n }\n this.timeline = (this as any).createTimeline();\n this._ticker.addTimeline(this.timeline);\n this._ticker.on('tick', this.afterTickCb);\n }\n }\n\n startAnimate() {\n if (this._ticker && this.timeline) {\n this._ticker.start();\n this.timeline.resume();\n }\n }\n\n pauseRender(sr: number = -1) {\n this._skipRender = sr;\n }\n\n resumeRender() {\n this._skipRender = 0;\n }\n\n protected tryInitEventSystem() {\n if (this.global.supportEvent && !this._eventSystem) {\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 supportsPointerEvents: this.params.supportsPointerEvents,\n supportsTouchEvents: this.params.supportsTouchEvents,\n ...this.params.event\n });\n }\n }\n\n preventRender(prevent: boolean) {\n if (prevent) {\n this._skipRender = -Infinity;\n } else {\n // 判断是否需要outRange优化\n if (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 this.params.optimize = params;\n }\n\n // 优化渲染\n protected optmizeRender(skipRenderWithOutRange: boolean = false) {\n if (!skipRenderWithOutRange) {\n return;\n }\n // 不在视口内的时候,跳过渲染\n this._skipRender = this._skipRender < 0 ? this._skipRender : this.window.isVisible() ? 0 : 1;\n this.window.onVisibleChange(this._onVisibleChange);\n }\n\n protected _onVisibleChange = (visible: boolean) => {\n if (this._skipRender < 0) {\n return;\n }\n if (visible) {\n if (this.dirtyBounds) {\n const b = this.window.getViewBox();\n this.dirtyBounds.setValue(b.x1, b.y1, b.width(), b.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 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 const DirectionalLight = Factory.getPlugin('DirectionalLight');\n\n if (DirectionalLight) {\n this.light = new DirectionalLight(dir, color, ambient);\n }\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 const OrthoCamera = Factory.getPlugin('OrthoCamera');\n if (OrthoCamera) {\n this.camera = new OrthoCamera(cameraParams);\n }\n }\n\n if (options.enableView3dTransform) {\n this.enableView3dTransform();\n }\n }\n\n protected beforeRender = (stage: IStage) => {\n this._beforeRenderList.forEach(cb => cb(stage));\n };\n protected afterClearScreen = (drawParams: any) => {\n this._afterClearScreen && this._afterClearScreen(drawParams);\n };\n protected afterClearRect = (drawParams: any) => {\n this._afterClearRect && this._afterClearRect(drawParams);\n };\n\n protected afterRender = (stage: IStage) => {\n this.renderCount++;\n this._afterRenderList.forEach(cb => cb(stage));\n this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage));\n this._afterNextRenderCbs = null;\n this.tickedBeforeRender = false;\n };\n\n protected afterTickCb = () => {\n this.tickedBeforeRender = true;\n // 性能模式不用立刻渲染\n this.state !== 'rendering' && this.renderNextFrame();\n };\n\n setBeforeRender(cb: (stage: IStage) => void) {\n this._beforeRenderList.push(cb);\n }\n\n removeBeforeRender(cb: (stage: IStage) => void) {\n this._beforeRenderList = this._beforeRenderList.filter(c => c !== cb);\n }\n\n setAfterRender(cb: (stage: IStage) => void) {\n this._afterRenderList.push(cb);\n }\n\n removeAfterRender(cb: (stage: IStage) => void) {\n this._afterRenderList = this._afterRenderList.filter(c => c !== 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 const ViewTransform3dPlugin = Factory.getPlugin('ViewTransform3dPlugin');\n\n if (ViewTransform3dPlugin) {\n this.pluginService.register(new ViewTransform3dPlugin());\n }\n }\n\n disableView3dTranform() {\n if (!this.view3dTranform) {\n return;\n }\n this.view3dTranform = false;\n this.pluginService.findPluginsByName('ViewTransform3dPlugin').forEach(plugin => {\n this.pluginService.unRegister(plugin);\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 this.pluginService.unRegister(plugin);\n });\n }\n enableAutoRefresh() {\n if (this.autoRefresh) {\n return;\n }\n this.autoRefresh = true;\n this.pluginService.register(new AutoRefreshPlugin());\n }\n disableAutoRefresh() {\n if (!this.autoRefresh) {\n return;\n }\n this.autoRefresh = false;\n this.pluginService.findPluginsByName('AutoRefreshPlugin').forEach(plugin => {\n this.pluginService.unRegister(plugin);\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 this.pluginService.unRegister(plugin);\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 } else {\n plugin.activate(this.pluginService);\n }\n }\n disableDirtyBounds() {\n if (!this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = null;\n this.pluginService.findPluginsByName('DirtyBoundsPlugin').forEach(plugin => {\n this.pluginService.unRegister(plugin);\n });\n }\n enableLayout() {\n if (this._enableLayout) {\n return;\n }\n this._enableLayout = true;\n\n const FlexLayoutPlugin = Factory.getPlugin('FlexLayoutPlugin');\n\n if (FlexLayoutPlugin) {\n this.pluginService.register(new FlexLayoutPlugin());\n }\n }\n disableLayout() {\n if (!this._enableLayout) {\n return;\n }\n this._enableLayout = false;\n this.pluginService.findPluginsByName('FlexLayoutPlugin').forEach(plugin => {\n this.pluginService.unRegister(plugin);\n });\n }\n enableHtmlAttribute(container?: any) {\n if (this.htmlAttribute) {\n return;\n }\n const HtmlAttributePlugin = Factory.getPlugin('HtmlAttributePlugin');\n\n if (HtmlAttributePlugin) {\n this.htmlAttribute = container;\n this.pluginService.register(new HtmlAttributePlugin());\n }\n }\n disableHtmlAttribute() {\n if (!this.htmlAttribute) {\n return;\n }\n this.htmlAttribute = false;\n this.pluginService.findPluginsByName('HtmlAttributePlugin').forEach(plugin => {\n this.pluginService.unRegister(plugin);\n });\n }\n enableReactAttribute(container?: any) {\n if (this.reactAttribute) {\n return;\n }\n const ReactAttributePlugin = Factory.getPlugin('ReactAttributePlugin');\n\n if (ReactAttributePlugin) {\n this.reactAttribute = container;\n this.pluginService.register(new ReactAttributePlugin());\n }\n }\n disableReactAttribute() {\n if (!this.reactAttribute) {\n return;\n }\n this.reactAttribute = false;\n this.pluginService.findPluginsByName('ReactAttributePlugin').forEach(plugin => {\n this.pluginService.unRegister(plugin);\n });\n }\n\n getPluginsByName(name: string): IPlugin[] {\n return this.pluginService.findPluginsByName(name);\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(): IAABBBounds {\n const viewBox = this.window.getViewBox();\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 if (this.releaseStatus === 'released') {\n return;\n }\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 if (this.releaseStatus === 'released') {\n return;\n }\n // TODO:顺序可能会存在问题\n // 支持交互层,且没有创建过,那就创建\n if (this.supportInteractiveLayer && !this.interactiveLayer) {\n this.interactiveLayer = this.createLayer();\n this.interactiveLayer.name = '_builtin_interactive';\n this.interactiveLayer.attribute.pickable = false;\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(color);\n }\n\n render(layers?: ILayer[], params?: Partial<IDrawContext>): void {\n if (this.releaseStatus === 'released') {\n return;\n }\n this.startAnimate();\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 if (!this._skipRender) {\n this.renderLayerList(this.children as ILayer[]);\n this.combineLayersToWindow();\n this.nextFrameRenderLayerSet.clear();\n }\n this.hooks.afterRender.call(this);\n }\n this.state = state;\n this._skipRender && this._skipRender++;\n }\n\n protected combineLayersToWindow() {\n // TODO 后续支持通用的渲染模型\n if (this.global.env === 'harmony') {\n const ctx = this.window.getContext().nativeContext;\n this.forEachChildren<ILayer>((layer, i) => {\n if (i > 0) {\n const image = layer\n .getNativeHandler()\n .getContext()\n .canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();\n ctx.transferFromImageBitmap(image);\n }\n });\n }\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.getSpecifiedRequestAnimationFrame(this.rafId)(() => {\n this._doRenderInThisFrame(), (this.willNextFrameRender = false);\n });\n }\n }\n\n _doRenderInThisFrame() {\n if (this.releaseStatus === 'released') {\n return;\n }\n this.startAnimate();\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 if (!this._skipRender) {\n this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {});\n this.combineLayersToWindow();\n this.nextFrameRenderLayerSet.clear();\n }\n this.hooks.afterRender.call(this);\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 if (layer === this.interactiveLayer) {\n // 交互层由于其特殊性,不使用dirtyBounds\n this.dirtyBounds && this.dirtyBounds.clear();\n }\n layer.render(\n {\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!(this.dirtyBounds && !this.dirtyBounds.empty()),\n viewBox: this.window.getViewBox(),\n transMatrix: this.window.getViewBoxTransform()\n },\n { renderStyle: this.renderStyle, ...params }\n );\n });\n\n // 添加交互层渲染\n if (this.interactiveLayer && !layerList.includes(this.interactiveLayer)) {\n // 交互层由于其特殊性,不使用dirtyBounds\n this.dirtyBounds && this.dirtyBounds.clear();\n this.interactiveLayer.render(\n {\n renderService: this.renderService,\n updateBounds: !!(this.dirtyBounds && !this.dirtyBounds.empty()),\n viewBox: this.window.getViewBox(),\n transMatrix: this.window.getViewBoxTransform()\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 if (this.releaseStatus === 'released') {\n return;\n }\n // 如果不是子图的stage,那么认为用户也想要resize view\n if (!this.window.hasSubView()) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n }\n this.window.resize(w, h);\n this.forEachChildren<ILayer>(c => {\n c.resize(w, 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 if (this.releaseStatus === 'released') {\n return;\n }\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 if (this.releaseStatus === 'released') {\n return;\n }\n // 暂时不提供layer的pick\n const result = this.getPickerService().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 setToFrame(t: number): void {\n throw new Error('暂不支持');\n }\n\n release() {\n super.release();\n\n this.hooks.beforeRender.unTap('constructor', this.beforeRender);\n this.hooks.afterRender.unTap('constructor', this.afterRender);\n\n this.eventSystem && this.eventSystem.release();\n this.layerService.releaseStage(this);\n this.pluginService.release();\n this.forEach(layer => {\n layer.release();\n });\n // 额外删除掉interactiveLayer的节点\n if (this.interactiveLayer) {\n this.interactiveLayer.forEachChildren((item: IGraphic) => {\n item.setStage && item.setStage(null, null);\n this.interactiveLayer.removeChild(item);\n });\n this.interactiveLayer.release();\n }\n this.window.release();\n this._ticker?.remTimeline(this?.timeline);\n this._ticker?.removeListener('tick', this.afterTickCb);\n this.renderService.renderTreeRoots = [];\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 (this.releaseStatus === 'released') {\n return;\n }\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) {\n if (this.releaseStatus === 'released') {\n return;\n }\n this.forEachChildren<ILayer>((layer, i) => {\n layer.drawTo(window, {\n // ...params,\n renderService: this.renderService,\n viewBox: window.getViewBox(),\n transMatrix: window.getViewBoxTransform(),\n background: layer === this.defaultLayer ? this.background : undefined,\n clear: i === 0, // 第一个layer需要clear\n updateBounds: !!(this.dirtyBounds && !this.dirtyBounds.empty())\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 if (this.releaseStatus === 'released') {\n return;\n }\n const window = container.get<IWindow>(VWindow);\n const x1 = viewBox ? -viewBox.x1 : 0;\n const y1 = viewBox ? -viewBox.y1 : 0;\n const x2 = viewBox ? viewBox.x2 : this.viewWidth;\n const y2 = viewBox ? viewBox.y2 : this.viewHeight;\n const width = viewBox ? viewBox.width() : this.viewWidth;\n const height = viewBox ? viewBox.height() : this.viewHeight;\n if (fullImage) {\n window.create({\n viewBox: { x1, y1, x2, y2 },\n width,\n height,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n } else {\n window.create({\n viewBox: { x1, y1, x2, y2 },\n width,\n height,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n }\n\n this.renderTo(window);\n return window;\n }\n\n toCanvas(fullImage: boolean = true, viewBox?: IAABBBounds): HTMLCanvasElement | null {\n if (this.releaseStatus === 'released') {\n return;\n }\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, 'ignore');\n }\n\n getCursor() {\n return this._cursor;\n }\n\n eventPointTransform(e: PointerEvent | WheelEvent | TouchEvent): { x: number; y: number } {\n const point = this.global.mapToCanvasPoint(e, this.window);\n\n return this.stage.window.pointTransform(point.x, point.y);\n }\n\n pauseTriggerEvent() {\n this._eventSystem && this._eventSystem.pauseTriggerEvent();\n }\n resumeTriggerEvent() {\n this._eventSystem && this._eventSystem.resumeTriggerEvent();\n }\n\n getPickerService() {\n if (!this.pickerService) {\n this.pickerService = container.get<IPickerService>(PickerService);\n }\n return this.pickerService;\n }\n\n reInit() {\n this.renderService.reInit();\n this.pickerService.reInit();\n }\n}\n"]}
package/es/modules.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { IGlobal, IGraphicService, IRenderService } from './interface';
1
+ import type { IGlobal, IGraphicService } from './interface';
2
2
  import type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';
3
3
  export declare function preLoadAllModule(): void;
4
4
  export declare namespace preLoadAllModule {
@@ -8,5 +8,4 @@ export declare const vglobal: IGlobal;
8
8
  export declare const graphicUtil: IGraphicUtil;
9
9
  export declare const transformUtil: ITransformUtil;
10
10
  export declare const graphicService: IGraphicService;
11
- export declare const renderService: IRenderService;
12
11
  export declare const layerService: ILayerService;
package/es/modules.js CHANGED
@@ -24,8 +24,6 @@ import { container } from "./container";
24
24
 
25
25
  import { VGlobal } from "./constants";
26
26
 
27
- import { RenderService } from "./render";
28
-
29
27
  export function preLoadAllModule() {
30
28
  preLoadAllModule.__loaded || (preLoadAllModule.__loaded = !0, container.load(coreModule),
31
29
  container.load(graphicModule), container.load(renderModule), container.load(pickModule),
@@ -50,10 +48,6 @@ export const graphicService = container.get(GraphicService);
50
48
 
51
49
  application.graphicService = graphicService;
52
50
 
53
- export const renderService = container.get(RenderService);
54
-
55
- application.renderService = renderService;
56
-
57
51
  export const layerService = container.get(LayerService);
58
52
 
59
53
  application.layerService = layerService;
package/es/modules.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAE/C,OAAO,aAAa,MAAM,0CAA0C,CAAC;AACrE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,wBAAwB,MAAM,8BAA8B,CAAC;AACpE,OAAO,uBAAuB,MAAM,gCAAgC,CAAC;AAGrE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,C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,CAAiB,aAAa,CAAC,CAAC;AAC1E,WAAW,CAAC,aAAa,GAAG,aAAa,CAAC;AAa1C,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAgB,YAAY,CAAC,CAAC;AACvE,WAAW,CAAC,YAAY,GAAG,YAAY,CAAC","file":"modules.js","sourcesContent":["import coreModule from './core/core-modules';\nimport renderModule from './render/render-modules';\nimport pickModule from './picker/pick-modules';\n// import allocatorModule from './allocator/allocator-modules';\nimport graphicModule from './graphic/graphic-service/graphic-module';\nimport pluginModule from './plugins/plugin-modules';\nimport loadBuiltinContributions from './core/contributions/modules';\nimport loadRenderContributions from './render/contributions/modules';\n// import loadPickContributions from './picker/contributions/modules';\n// import loadCanvasContributions from './canvas/contributions/modules';\nimport { LayerService } from './core/constants';\n// import { IMat4Allocate, IMatrixAllocate, Mat4Allocate, MatrixAllocate } from './allocator/matrix-allocate';\n// import { GlobalPickerService } from './picker/constants';\nimport type { IGlobal, IGraphicService, IPickerService, IRenderService } from './interface';\nimport { application } from './application';\nimport type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';\nimport { GraphicService } from './graphic/constants';\nimport { GraphicUtil, TransformUtil } from './core/constants';\nimport { container } from './container';\nimport { VGlobal } from './constants';\nimport { RenderService } from './render';\n\nexport function preLoadAllModule() {\n if (preLoadAllModule.__loaded) {\n return;\n }\n preLoadAllModule.__loaded = true;\n container.load(coreModule);\n container.load(graphicModule);\n container.load(renderModule);\n container.load(pickModule);\n // container.load(allocatorModule);\n container.load(pluginModule);\n loadBuiltinContributions(container);\n loadRenderContributions(container);\n}\n\npreLoadAllModule.__loaded = false;\n\npreLoadAllModule();\n// loadPickContributions(container);\n// loadCanvasContributions(container);\n\n// 全局变量\nexport const vglobal = container.get<IGlobal>(VGlobal);\napplication.global = vglobal;\nexport const graphicUtil = container.get<IGraphicUtil>(GraphicUtil);\napplication.graphicUtil = graphicUtil;\nexport const transformUtil = container.get<ITransformUtil>(TransformUtil);\napplication.transformUtil = transformUtil;\nexport const graphicService = container.get<IGraphicService>(GraphicService);\napplication.graphicService = graphicService;\nexport const renderService = container.get<IRenderService>(RenderService);\napplication.renderService = renderService;\n// export const matrixAllocate = container.get<IMatrixAllocate>(MatrixAllocate);\n// export const mat4Allocate = container.get<IMat4Allocate>(Mat4Allocate);\n// export const canvasAllocate = container.get<ICanvasAllocate>(CanvasAllocate);\n// export const arcAllocate = container.get<IArcAllocate>(ArcAllocate);\n// export const areaAllocate = container.get<IAreaAllocate>(AreaAllocate);\n// export const circleAllocate = container.get<ICircleAllocate>(CircleAllocate);\n// export const lineAllocate = container.get<ILineAllocate>(LineAllocate);\n// export const pathAllocate = container.get<IPathAllocate>(PathAllocate);\n// export const rectAllocate = container.get<IRectAllocate>(RectAllocate);\n// export const symbolAllocate = container.get<ISymbolAllocate>(SymbolAllocate);\n// export const textAllocate = container.get<ITextAllocate>(TextAllocate);\n// export const pickerService = container.get<IPickerService>(GlobalPickerService);\nexport const layerService = container.get<ILayerService>(LayerService);\napplication.layerService = layerService;\n"]}
1
+ {"version":3,"sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAE/C,OAAO,aAAa,MAAM,0CAA0C,CAAC;AACrE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,wBAAwB,MAAM,8BAA8B,CAAC;AACpE,OAAO,uBAAuB,MAAM,gCAAgC,CAAC;AAGrE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CA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core-modules';\nimport renderModule from './render/render-modules';\nimport pickModule from './picker/pick-modules';\n// import allocatorModule from './allocator/allocator-modules';\nimport graphicModule from './graphic/graphic-service/graphic-module';\nimport pluginModule from './plugins/plugin-modules';\nimport loadBuiltinContributions from './core/contributions/modules';\nimport loadRenderContributions from './render/contributions/modules';\n// import loadPickContributions from './picker/contributions/modules';\n// import loadCanvasContributions from './canvas/contributions/modules';\nimport { LayerService } from './core/constants';\n// import { IMat4Allocate, IMatrixAllocate, Mat4Allocate, MatrixAllocate } from './allocator/matrix-allocate';\n// import { GlobalPickerService } from './picker/constants';\nimport type { IGlobal, IGraphicService, IPickerService, IRenderService } from './interface';\nimport { application } from './application';\nimport type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';\nimport { GraphicService } from './graphic/constants';\nimport { GraphicUtil, TransformUtil } from './core/constants';\nimport { container } from './container';\nimport { VGlobal } from './constants';\n\nexport function preLoadAllModule() {\n if (preLoadAllModule.__loaded) {\n return;\n }\n preLoadAllModule.__loaded = true;\n container.load(coreModule);\n container.load(graphicModule);\n container.load(renderModule);\n container.load(pickModule);\n // container.load(allocatorModule);\n container.load(pluginModule);\n loadBuiltinContributions(container);\n loadRenderContributions(container);\n}\n\npreLoadAllModule.__loaded = false;\n\npreLoadAllModule();\n// loadPickContributions(container);\n// loadCanvasContributions(container);\n\n// 全局变量\nexport const vglobal = container.get<IGlobal>(VGlobal);\napplication.global = vglobal;\nexport const graphicUtil = container.get<IGraphicUtil>(GraphicUtil);\napplication.graphicUtil = graphicUtil;\nexport const transformUtil = container.get<ITransformUtil>(TransformUtil);\napplication.transformUtil = transformUtil;\nexport const graphicService = container.get<IGraphicService>(GraphicService);\napplication.graphicService = graphicService;\n// export const renderService = container.get<IRenderService>(RenderService);\n// application.renderService = renderService;\n// export const matrixAllocate = container.get<IMatrixAllocate>(MatrixAllocate);\n// export const mat4Allocate = container.get<IMat4Allocate>(Mat4Allocate);\n// export const canvasAllocate = container.get<ICanvasAllocate>(CanvasAllocate);\n// export const arcAllocate = container.get<IArcAllocate>(ArcAllocate);\n// export const areaAllocate = container.get<IAreaAllocate>(AreaAllocate);\n// export const circleAllocate = container.get<ICircleAllocate>(CircleAllocate);\n// export const lineAllocate = container.get<ILineAllocate>(LineAllocate);\n// export const pathAllocate = container.get<IPathAllocate>(PathAllocate);\n// export const rectAllocate = container.get<IRectAllocate>(RectAllocate);\n// export const symbolAllocate = container.get<ISymbolAllocate>(SymbolAllocate);\n// export const textAllocate = container.get<ITextAllocate>(TextAllocate);\n// export const pickerService = container.get<IPickerService>(GlobalPickerService);\nexport const layerService = container.get<ILayerService>(LayerService);\napplication.layerService = layerService;\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const RenderService: unique symbol;
2
+ export declare const BeforeRenderConstribution: unique symbol;
@@ -0,0 +1,4 @@
1
+ export const RenderService = Symbol.for("RenderService");
2
+
3
+ export const BeforeRenderConstribution = Symbol.for("BeforeRenderConstribution");
4
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/render/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC","file":"constants.js","sourcesContent":["export const RenderService = Symbol.for('RenderService');\nexport const BeforeRenderConstribution = Symbol.for('BeforeRenderConstribution');\n"]}
@@ -134,7 +134,7 @@ let DefaultCanvasArcRender = class extends BaseRender {
134
134
  context.fill()));
135
135
  }
136
136
  _runStroke(arc, context, x, y, arcAttribute, doStroke, isFullStroke, sVisible, strokeCb) {
137
- doStroke && isFullStroke && (strokeCb || sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute),
137
+ doStroke && isFullStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute),
138
138
  context.stroke()));
139
139
  }
140
140
  draw(arc, renderService, drawContext, params) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/arc-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAkB3D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,sCAAsC,EACtC,4BAA4B,EAC5B,mCAAmC,EACpC,MAAM,iBAAiB,CAAC;AAmBlB,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,UAAgB;IAI1D,YAGqB,0BAAyE;QAE5F,KAAK,EAAE,CAAC;QAFW,+BAA0B,GAA1B,0BAA0B,CAA+C;QAL9F,eAAU,GAAW,eAAe,CAAC;QAQnC,IAAI,CAAC,oBAAoB,GAAG;YAC1B,4BAA4B;YAC5B,sCAAsC;YACtC,mCAAmC;SACpC,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,0BAA0B,C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AO,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,YAAY,CAAC,CAAC;gBACnF,OAAO,CAAC,IAAI,EAAE,CAAC;aAChB;SACF;IACH,CAAC;IAEO,UAAU,CAChB,GAAS,EACT,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,YAA4C,EAC5C,QAAiB,EACjB,YAAqB,EACrB,QAAiB,EACjB,QAIY;QAEZ,IAAI,QAAQ,IAAI,YAAY,EAAE;YAC5B,IAAI,QAAQ,EAAE;aAEb;iBAAM,IAAI,QAAQ,EAAE;gBACnB,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;gBAE/D,OAAO,CAAC,MAAM,EAAE,CAAC;aAClB;SACF;IACH,CAAC;IAED,IAAI,CAAC,GAAS,EAAE,aAA6B,EAAE,WAAyB,EAAE,MAAiC;QACzG,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,GAAG,CAAC;QACtD,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAC1E,CAAC;CACF,CAAA;AA3bY,sBAAsB;IADlC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,qBAAqB,CAAC,CAAA;;GANpB,sBAAsB,CA2blC;SA3bY,sBAAsB","file":"arc-render.js","sourcesContent":["import { abs, atan2, cos, epsilon, min, sin, pi2, isBoolean } from '@visactor/vutils';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\nimport { getTheme } from '../../../graphic/theme';\nimport { parseStroke } from '../../../common/utils';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { calculateArcCornerRadius } from '../render/utils';\nimport type {\n IContext2d,\n IArc,\n IPath2D,\n IGraphicAttribute,\n IMarkAttribute,\n IThemeAttribute,\n IGradientColor,\n IArcRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider,\n IConicalGradient,\n IArcGraphicAttribute\n} from '../../../interface';\nimport { cornerTangents, drawArcPath, fillVisible } from './utils';\nimport { getConicGradientAt } from '../../../canvas/conical-gradient';\nimport { ArcRenderContribution } from './contributions/constants';\nimport { ARC_NUMBER_TYPE } from '../../../graphic/constants';\nimport { BaseRender } from './base-render';\nimport {\n defaultArcBackgroundRenderContribution,\n defaultArcRenderContribution,\n defaultArcTextureRenderContribution\n} from './contributions';\n/**\n * 部分源码参考 https://github.com/d3/d3-shape/\n * Copyright 2010-2022 Mike Bostock\n\n Permission to use, copy, modify, and/or distribute this software for any purpose\n with or without fee is hereby granted, provided that the above copyright notice\n and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n THIS SOFTWARE.\n */\n\n@injectable()\nexport class DefaultCanvasArcRender extends BaseRender<IArc> implements IGraphicRender {\n type: 'arc';\n numberType: number = ARC_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(ArcRenderContribution)\n protected readonly graphicRenderContributions: IContributionProvider<IArcRenderContribution>\n ) {\n super();\n this.builtinContributions = [\n defaultArcRenderContribution,\n defaultArcBackgroundRenderContribution,\n defaultArcTextureRenderContribution\n ];\n this.init(graphicRenderContributions);\n }\n\n // 绘制尾部cap\n drawArcTailCapPath(\n arc: IArc,\n context: IContext2d | IPath2D,\n cx: number,\n cy: number,\n outerRadius: number,\n innerRadius: number,\n _sa: number,\n _ea: number\n ) {\n const capAngle = _ea - _sa;\n const data = arc.getParsedAngle();\n const startAngle = data.startAngle;\n let endAngle = data.endAngle;\n endAngle = _ea;\n\n const deltaAngle = abs(endAngle - startAngle);\n const clockwise: boolean = endAngle > startAngle;\n let collapsedToLine: boolean = false;\n // 规范化outerRadius和innerRadius\n if (outerRadius < innerRadius) {\n const temp = outerRadius;\n outerRadius = innerRadius;\n innerRadius = temp;\n }\n\n const {\n outerDeltaAngle,\n xors,\n yors,\n xirs,\n yirs,\n limitedOcr,\n outerCornerRadiusStart,\n outerCornerRadiusEnd,\n maxOuterCornerRadius,\n xore,\n yore,\n xire,\n yire,\n limitedIcr,\n innerDeltaAngle,\n innerStartAngle,\n innerCornerRadiusStart,\n innerCornerRadiusEnd,\n maxInnerCornerRadius\n } = calculateArcCornerRadius(arc, startAngle, endAngle, innerRadius, outerRadius);\n\n if (limitedOcr > epsilon) {\n const cornerRadiusStart = min(outerCornerRadiusStart, limitedOcr);\n const cornerRadiusEnd = min(outerCornerRadiusEnd, limitedOcr);\n // Does the sector’s outer ring have rounded corners?\n const t0 = cornerTangents(xirs, yirs, xors, yors, outerRadius, cornerRadiusStart, Number(clockwise));\n const t1 = cornerTangents(xore, yore, xire, yire, outerRadius, cornerRadiusEnd, Number(clockwise));\n\n // Have the corners merged?\n if (limitedOcr < maxOuterCornerRadius && cornerRadiusStart === cornerRadiusEnd) {\n context.moveTo(cx + t0.cx + t0.x01, cy + t0.cy + t0.y01);\n context.arc(cx + t0.cx, cy + t0.cy, limitedOcr, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !clockwise);\n } else {\n const a1 = endAngle - capAngle - 0.03;\n const a2 = atan2(t1.y11, t1.x11);\n context.arc(cx, cy, outerRadius, a1, a2, !clockwise);\n cornerRadiusEnd > 0 &&\n context.arc(\n cx + t1.cx,\n cy + t1.cy,\n cornerRadiusEnd,\n atan2(t1.y11, t1.x11),\n atan2(t1.y01, t1.x01),\n !clockwise\n );\n }\n } else {\n context.moveTo(cx + xors, cy + yors);\n }\n // else {\n // // Or is the outer ring just a circular arc?\n // if (!partStroke || partStroke[0]) {\n // context.moveTo(cx + xors, cy + yors);\n // context.arc(cx, cy, outerRadius, outerStartAngle, outerEndAngle, !clockwise);\n // } else {\n // // context.moveTo(cx + outerRadius * cos(outerEndAngle), cy + yore);\n // }\n // }\n // // Is there no inner ring, and it’s a circular sector?\n // // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(innerRadius > epsilon) || innerDeltaAngle < 0.001) {\n context.lineTo(cx + xire, cy + yire);\n collapsedToLine = true;\n } else if (limitedIcr > epsilon) {\n const cornerRadiusStart = min(innerCornerRadiusStart, limitedIcr);\n const cornerRadiusEnd = min(innerCornerRadiusEnd, limitedIcr);\n // Does the sector’s inner ring (or point) have rounded corners?\n const t0 = cornerTangents(xire, yire, xore, yore, innerRadius, -cornerRadiusEnd, Number(clockwise));\n const t1 = cornerTangents(xors, yors, xirs, yirs, innerRadius, -cornerRadiusStart, Number(clockwise));\n\n context.lineTo(cx + t0.cx + t0.x01, cy + t0.cy + t0.y01);\n\n // Have the corners merged?\n if (limitedIcr < maxInnerCornerRadius && cornerRadiusStart === cornerRadiusEnd) {\n const arcEndAngle = atan2(t1.y01, t1.x01);\n context.arc(cx + t0.cx, cy + t0.cy, limitedIcr, atan2(t0.y01, t0.x01), arcEndAngle, !clockwise);\n } else {\n cornerRadiusEnd > 0 &&\n context.arc(\n cx + t0.cx,\n cy + t0.cy,\n cornerRadiusEnd,\n atan2(t0.y01, t0.x01),\n atan2(t0.y11, t0.x11),\n !clockwise\n );\n const a1 = atan2(t0.cy + t0.y11, t0.cx + t0.x11);\n const a2 = endAngle - capAngle - 0.03;\n context.arc(cx, cy, innerRadius, a1, a2, clockwise);\n }\n } else {\n context.lineTo(cx + innerRadius * cos(innerStartAngle), cy + innerRadius * sin(innerStartAngle));\n }\n\n return collapsedToLine;\n }\n\n drawShape(\n arc: IArc,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n arcAttribute?: Required<IArcGraphicAttribute>\n ) {\n // const arcAttribute = graphicService.themeService.getCurrentTheme().arcAttribute;\n arcAttribute = arcAttribute ?? getTheme(arc, params?.theme).arc;\n const {\n fill = arcAttribute.fill,\n stroke = arcAttribute.stroke,\n x: originX = arcAttribute.x,\n y: originY = arcAttribute.y,\n fillStrokeOrder = arcAttribute.fillStrokeOrder\n } = arc.attribute;\n const data = this.valid(arc, arcAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n const {\n outerPadding = arcAttribute.outerPadding,\n innerPadding = arcAttribute.innerPadding,\n cap = arcAttribute.cap,\n forceShowCap = arcAttribute.forceShowCap\n } = arc.attribute;\n let { outerRadius = arcAttribute.outerRadius, innerRadius = arcAttribute.innerRadius } = arc.attribute;\n outerRadius += outerPadding;\n innerRadius -= innerPadding;\n // 判断是否是环形渐变,且有头部cap,那就偏移渐变色角度\n let conicalOffset = 0;\n const tempChangeConicalColor =\n ((isBoolean(cap) && cap) || (cap as boolean[])[0]) && (fill as IGradientColor).gradient === 'conical';\n if (tempChangeConicalColor) {\n const { sc, startAngle, endAngle } = arc.getParsedAngle();\n if (abs(endAngle - startAngle) < pi2 - epsilon) {\n conicalOffset = sc || 0;\n (fill as IConicalGradient).startAngle -= conicalOffset;\n (fill as IConicalGradient).endAngle -= conicalOffset;\n }\n }\n\n let beforeRenderContribitionsRuned = false;\n const { isFullStroke, stroke: arrayStroke } = parseStroke(stroke);\n if (doFill || isFullStroke) {\n context.beginPath();\n // if (arc.shouldUpdateShape()) {\n // // 更新shape\n // arc.cache = new Path2D(context);\n // this.drawArcPath(arc, arc.cache, x, y, outerRadius, innerRadius);\n // arc.clearUpdateShapeTag();\n // } else {\n // if (arc.cache) {\n // renderCommandList(arc.cache.commandList, context);\n // }\n // }\n // 测试后,cache对于重绘性能提升不大,但是在首屏有一定性能损耗,因此arc不再使用cache\n drawArcPath(arc, context, x, y, outerRadius, innerRadius);\n\n beforeRenderContribitionsRuned = true;\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);\n this.beforeRenderStep(\n arc,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n arcAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n // 内联的函数性能差\n // const _runFill = () => {\n // if (doFill) {\n // if (fillCb) {\n // fillCb(context, arc.attribute, arcAttribute);\n // } else if (fVisible) {\n // context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute);\n // context.fill();\n // }\n // }\n // };\n\n // const _runStroke = () => {\n // if (doStroke && isFullStroke) {\n // if (strokeCb) {\n // strokeCb(context, arc.attribute, arcAttribute);\n // } else if (sVisible) {\n // context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute);\n // context.stroke();\n // }\n // }\n // };\n\n if (!fillStrokeOrder) {\n this._runFill(arc, context, x, y, arcAttribute, doFill, fVisible, originX, originY, fillCb);\n this._runStroke(arc, context, x, y, arcAttribute, doStroke, isFullStroke, sVisible, strokeCb);\n } else {\n this._runStroke(arc, context, x, y, arcAttribute, doStroke, isFullStroke, sVisible, strokeCb);\n this._runFill(arc, context, x, y, arcAttribute, doFill, fVisible, originX, originY, fillCb);\n }\n }\n\n // 需要局部渲染描边的时候\n if (!isFullStroke && doStroke) {\n context.beginPath();\n const collapsedToLine = drawArcPath(arc, context, x, y, outerRadius, innerRadius, arrayStroke);\n\n if (!beforeRenderContribitionsRuned) {\n this.beforeRenderStep(\n arc,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n arcAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n if (strokeCb) {\n strokeCb(context, arc.attribute, arcAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute);\n context.stroke();\n }\n }\n\n // 绘制cap\n if (((isBoolean(cap) && cap) || (cap as boolean[])[1]) && forceShowCap) {\n const { startAngle: sa, endAngle: ea } = arc.getParsedAngle();\n const deltaAngle = abs(ea - sa);\n if (deltaAngle >= pi2 - epsilon) {\n context.beginPath();\n const capWidth = Math.abs(outerRadius - innerRadius) / 2;\n // 以外边界长度为准\n const capAngle = capWidth / outerRadius;\n const { endAngle = arcAttribute.endAngle, fill = arcAttribute.fill } = arc.attribute;\n const startAngle = endAngle;\n this.drawArcTailCapPath(arc, context, x, y, outerRadius, innerRadius, startAngle, startAngle + capAngle);\n\n if (!beforeRenderContribitionsRuned) {\n this.beforeRenderStep(\n arc,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n arcAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n const _runFill = () => {\n if (doFill) {\n // 获取渐变色最后一个颜色\n const color = fill;\n if ((color as IGradientColor).gradient === 'conical') {\n const lastColor = getConicGradientAt(0, 0, endAngle, color as any);\n if (fillCb) {\n // fillCb(context, arc.attribute, arcAttribute);\n } else if (fillVisible) {\n // context.closePath();\n context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute);\n context.fillStyle = lastColor as string;\n context.fill();\n }\n }\n }\n };\n\n const _runStroke = () => {\n if (doStroke) {\n if (strokeCb) {\n // fillCb(context, arc.attribute, arcAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute);\n // context.strokeStyle = 'red';\n context.stroke();\n }\n }\n };\n\n if (!fillStrokeOrder) {\n _runFill();\n _runStroke();\n } else {\n _runFill();\n _runStroke();\n }\n }\n }\n\n this.afterRenderStep(\n arc,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n arcAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n if (tempChangeConicalColor) {\n (fill as IConicalGradient).startAngle += conicalOffset;\n (fill as IConicalGradient).endAngle += conicalOffset;\n }\n }\n\n private _runFill(\n arc: IArc,\n context: IContext2d,\n x: number,\n y: number,\n arcAttribute: Required<IArcGraphicAttribute>,\n doFill: boolean,\n fVisible: boolean,\n originX: number,\n originY: number,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n if (doFill) {\n if (fillCb) {\n fillCb(context, arc.attribute, arcAttribute);\n } else if (fVisible) {\n context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute);\n context.fill();\n }\n }\n }\n\n private _runStroke(\n arc: IArc,\n context: IContext2d,\n x: number,\n y: number,\n arcAttribute: Required<IArcGraphicAttribute>,\n doStroke: boolean,\n isFullStroke: boolean,\n sVisible: boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n if (doStroke && isFullStroke) {\n if (strokeCb) {\n // fillCb(context, arc.attribute, arcAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute);\n // context.strokeStyle = 'red';\n context.stroke();\n }\n }\n }\n\n draw(arc: IArc, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const arcAttribute = getTheme(arc, params?.theme).arc;\n this._draw(arc, arcAttribute, false, drawContext, params, arcAttribute);\n }\n}\n"]}
1
+ {"version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,IAAI,EAAE,CAAC;aAChB;SACF;IACH,CAAC;IAEO,UAAU,CAChB,GAAS,EACT,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,YAA4C,EAC5C,QAAiB,EACjB,YAAqB,EACrB,QAAiB,EACjB,QAIY;QAEZ,IAAI,QAAQ,IAAI,YAAY,EAAE;YAC5B,IAAI,QAAQ,EAAE;gBACZ,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;aAChD;iBAAM,IAAI,QAAQ,EAAE;gBACnB,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;gBAE/D,OAAO,CAAC,MAAM,EAAE,CAAC;aAClB;SACF;IACH,CAAC;IAED,IAAI,CAAC,GAAS,EAAE,aAA6B,EAAE,WAAyB,EAAE,MAAiC;QACzG,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,GAAG,CAAC;QACtD,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAC1E,CAAC;CACF,CAAA;AA3bY,sBAAsB;IADlC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,qBAAqB,CAAC,CAAA;;GANpB,sBAAsB,CA2blC;SA3bY,sBAAsB","file":"arc-render.js","sourcesContent":["import { abs, atan2, cos, epsilon, min, sin, pi2, isBoolean } from '@visactor/vutils';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\nimport { getTheme } from '../../../graphic/theme';\nimport { parseStroke } from '../../../common/utils';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { calculateArcCornerRadius } from '../render/utils';\nimport type {\n IContext2d,\n IArc,\n IPath2D,\n IGraphicAttribute,\n IMarkAttribute,\n IThemeAttribute,\n IGradientColor,\n IArcRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider,\n IConicalGradient,\n IArcGraphicAttribute\n} from '../../../interface';\nimport { cornerTangents, drawArcPath, fillVisible } from './utils';\nimport { getConicGradientAt } from '../../../canvas/conical-gradient';\nimport { ArcRenderContribution } from './contributions/constants';\nimport { ARC_NUMBER_TYPE } from '../../../graphic/constants';\nimport { BaseRender } from './base-render';\nimport {\n defaultArcBackgroundRenderContribution,\n defaultArcRenderContribution,\n defaultArcTextureRenderContribution\n} from './contributions';\n/**\n * 部分源码参考 https://github.com/d3/d3-shape/\n * Copyright 2010-2022 Mike Bostock\n\n Permission to use, copy, modify, and/or distribute this software for any purpose\n with or without fee is hereby granted, provided that the above copyright notice\n and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n THIS SOFTWARE.\n */\n\n@injectable()\nexport class DefaultCanvasArcRender extends BaseRender<IArc> implements IGraphicRender {\n type: 'arc';\n numberType: number = ARC_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(ArcRenderContribution)\n protected readonly graphicRenderContributions: IContributionProvider<IArcRenderContribution>\n ) {\n super();\n this.builtinContributions = [\n defaultArcRenderContribution,\n defaultArcBackgroundRenderContribution,\n defaultArcTextureRenderContribution\n ];\n this.init(graphicRenderContributions);\n }\n\n // 绘制尾部cap\n drawArcTailCapPath(\n arc: IArc,\n context: IContext2d | IPath2D,\n cx: number,\n cy: number,\n outerRadius: number,\n innerRadius: number,\n _sa: number,\n _ea: number\n ) {\n const capAngle = _ea - _sa;\n const data = arc.getParsedAngle();\n const startAngle = data.startAngle;\n let endAngle = data.endAngle;\n endAngle = _ea;\n\n const deltaAngle = abs(endAngle - startAngle);\n const clockwise: boolean = endAngle > startAngle;\n let collapsedToLine: boolean = false;\n // 规范化outerRadius和innerRadius\n if (outerRadius < innerRadius) {\n const temp = outerRadius;\n outerRadius = innerRadius;\n innerRadius = temp;\n }\n\n const {\n outerDeltaAngle,\n xors,\n yors,\n xirs,\n yirs,\n limitedOcr,\n outerCornerRadiusStart,\n outerCornerRadiusEnd,\n maxOuterCornerRadius,\n xore,\n yore,\n xire,\n yire,\n limitedIcr,\n innerDeltaAngle,\n innerStartAngle,\n innerCornerRadiusStart,\n innerCornerRadiusEnd,\n maxInnerCornerRadius\n } = calculateArcCornerRadius(arc, startAngle, endAngle, innerRadius, outerRadius);\n\n if (limitedOcr > epsilon) {\n const cornerRadiusStart = min(outerCornerRadiusStart, limitedOcr);\n const cornerRadiusEnd = min(outerCornerRadiusEnd, limitedOcr);\n // Does the sector’s outer ring have rounded corners?\n const t0 = cornerTangents(xirs, yirs, xors, yors, outerRadius, cornerRadiusStart, Number(clockwise));\n const t1 = cornerTangents(xore, yore, xire, yire, outerRadius, cornerRadiusEnd, Number(clockwise));\n\n // Have the corners merged?\n if (limitedOcr < maxOuterCornerRadius && cornerRadiusStart === cornerRadiusEnd) {\n context.moveTo(cx + t0.cx + t0.x01, cy + t0.cy + t0.y01);\n context.arc(cx + t0.cx, cy + t0.cy, limitedOcr, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !clockwise);\n } else {\n const a1 = endAngle - capAngle - 0.03;\n const a2 = atan2(t1.y11, t1.x11);\n context.arc(cx, cy, outerRadius, a1, a2, !clockwise);\n cornerRadiusEnd > 0 &&\n context.arc(\n cx + t1.cx,\n cy + t1.cy,\n cornerRadiusEnd,\n atan2(t1.y11, t1.x11),\n atan2(t1.y01, t1.x01),\n !clockwise\n );\n }\n } else {\n context.moveTo(cx + xors, cy + yors);\n }\n // else {\n // // Or is the outer ring just a circular arc?\n // if (!partStroke || partStroke[0]) {\n // context.moveTo(cx + xors, cy + yors);\n // context.arc(cx, cy, outerRadius, outerStartAngle, outerEndAngle, !clockwise);\n // } else {\n // // context.moveTo(cx + outerRadius * cos(outerEndAngle), cy + yore);\n // }\n // }\n // // Is there no inner ring, and it’s a circular sector?\n // // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(innerRadius > epsilon) || innerDeltaAngle < 0.001) {\n context.lineTo(cx + xire, cy + yire);\n collapsedToLine = true;\n } else if (limitedIcr > epsilon) {\n const cornerRadiusStart = min(innerCornerRadiusStart, limitedIcr);\n const cornerRadiusEnd = min(innerCornerRadiusEnd, limitedIcr);\n // Does the sector’s inner ring (or point) have rounded corners?\n const t0 = cornerTangents(xire, yire, xore, yore, innerRadius, -cornerRadiusEnd, Number(clockwise));\n const t1 = cornerTangents(xors, yors, xirs, yirs, innerRadius, -cornerRadiusStart, Number(clockwise));\n\n context.lineTo(cx + t0.cx + t0.x01, cy + t0.cy + t0.y01);\n\n // Have the corners merged?\n if (limitedIcr < maxInnerCornerRadius && cornerRadiusStart === cornerRadiusEnd) {\n const arcEndAngle = atan2(t1.y01, t1.x01);\n context.arc(cx + t0.cx, cy + t0.cy, limitedIcr, atan2(t0.y01, t0.x01), arcEndAngle, !clockwise);\n } else {\n cornerRadiusEnd > 0 &&\n context.arc(\n cx + t0.cx,\n cy + t0.cy,\n cornerRadiusEnd,\n atan2(t0.y01, t0.x01),\n atan2(t0.y11, t0.x11),\n !clockwise\n );\n const a1 = atan2(t0.cy + t0.y11, t0.cx + t0.x11);\n const a2 = endAngle - capAngle - 0.03;\n context.arc(cx, cy, innerRadius, a1, a2, clockwise);\n }\n } else {\n context.lineTo(cx + innerRadius * cos(innerStartAngle), cy + innerRadius * sin(innerStartAngle));\n }\n\n return collapsedToLine;\n }\n\n drawShape(\n arc: IArc,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n arcAttribute?: Required<IArcGraphicAttribute>\n ) {\n // const arcAttribute = graphicService.themeService.getCurrentTheme().arcAttribute;\n arcAttribute = arcAttribute ?? getTheme(arc, params?.theme).arc;\n const {\n fill = arcAttribute.fill,\n stroke = arcAttribute.stroke,\n x: originX = arcAttribute.x,\n y: originY = arcAttribute.y,\n fillStrokeOrder = arcAttribute.fillStrokeOrder\n } = arc.attribute;\n const data = this.valid(arc, arcAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n const {\n outerPadding = arcAttribute.outerPadding,\n innerPadding = arcAttribute.innerPadding,\n cap = arcAttribute.cap,\n forceShowCap = arcAttribute.forceShowCap\n } = arc.attribute;\n let { outerRadius = arcAttribute.outerRadius, innerRadius = arcAttribute.innerRadius } = arc.attribute;\n outerRadius += outerPadding;\n innerRadius -= innerPadding;\n // 判断是否是环形渐变,且有头部cap,那就偏移渐变色角度\n let conicalOffset = 0;\n const tempChangeConicalColor =\n ((isBoolean(cap) && cap) || (cap as boolean[])[0]) && (fill as IGradientColor).gradient === 'conical';\n if (tempChangeConicalColor) {\n const { sc, startAngle, endAngle } = arc.getParsedAngle();\n if (abs(endAngle - startAngle) < pi2 - epsilon) {\n conicalOffset = sc || 0;\n (fill as IConicalGradient).startAngle -= conicalOffset;\n (fill as IConicalGradient).endAngle -= conicalOffset;\n }\n }\n\n let beforeRenderContribitionsRuned = false;\n const { isFullStroke, stroke: arrayStroke } = parseStroke(stroke);\n if (doFill || isFullStroke) {\n context.beginPath();\n // if (arc.shouldUpdateShape()) {\n // // 更新shape\n // arc.cache = new Path2D(context);\n // this.drawArcPath(arc, arc.cache, x, y, outerRadius, innerRadius);\n // arc.clearUpdateShapeTag();\n // } else {\n // if (arc.cache) {\n // renderCommandList(arc.cache.commandList, context);\n // }\n // }\n // 测试后,cache对于重绘性能提升不大,但是在首屏有一定性能损耗,因此arc不再使用cache\n drawArcPath(arc, context, x, y, outerRadius, innerRadius);\n\n beforeRenderContribitionsRuned = true;\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);\n this.beforeRenderStep(\n arc,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n arcAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n // 内联的函数性能差\n // const _runFill = () => {\n // if (doFill) {\n // if (fillCb) {\n // fillCb(context, arc.attribute, arcAttribute);\n // } else if (fVisible) {\n // context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute);\n // context.fill();\n // }\n // }\n // };\n\n // const _runStroke = () => {\n // if (doStroke && isFullStroke) {\n // if (strokeCb) {\n // strokeCb(context, arc.attribute, arcAttribute);\n // } else if (sVisible) {\n // context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute);\n // context.stroke();\n // }\n // }\n // };\n\n if (!fillStrokeOrder) {\n this._runFill(arc, context, x, y, arcAttribute, doFill, fVisible, originX, originY, fillCb);\n this._runStroke(arc, context, x, y, arcAttribute, doStroke, isFullStroke, sVisible, strokeCb);\n } else {\n this._runStroke(arc, context, x, y, arcAttribute, doStroke, isFullStroke, sVisible, strokeCb);\n this._runFill(arc, context, x, y, arcAttribute, doFill, fVisible, originX, originY, fillCb);\n }\n }\n\n // 需要局部渲染描边的时候\n if (!isFullStroke && doStroke) {\n context.beginPath();\n const collapsedToLine = drawArcPath(arc, context, x, y, outerRadius, innerRadius, arrayStroke);\n\n if (!beforeRenderContribitionsRuned) {\n this.beforeRenderStep(\n arc,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n arcAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n if (strokeCb) {\n strokeCb(context, arc.attribute, arcAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute);\n context.stroke();\n }\n }\n\n // 绘制cap\n if (((isBoolean(cap) && cap) || (cap as boolean[])[1]) && forceShowCap) {\n const { startAngle: sa, endAngle: ea } = arc.getParsedAngle();\n const deltaAngle = abs(ea - sa);\n if (deltaAngle >= pi2 - epsilon) {\n context.beginPath();\n const capWidth = Math.abs(outerRadius - innerRadius) / 2;\n // 以外边界长度为准\n const capAngle = capWidth / outerRadius;\n const { endAngle = arcAttribute.endAngle, fill = arcAttribute.fill } = arc.attribute;\n const startAngle = endAngle;\n this.drawArcTailCapPath(arc, context, x, y, outerRadius, innerRadius, startAngle, startAngle + capAngle);\n\n if (!beforeRenderContribitionsRuned) {\n this.beforeRenderStep(\n arc,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n arcAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n const _runFill = () => {\n if (doFill) {\n // 获取渐变色最后一个颜色\n const color = fill;\n if ((color as IGradientColor).gradient === 'conical') {\n const lastColor = getConicGradientAt(0, 0, endAngle, color as any);\n if (fillCb) {\n // fillCb(context, arc.attribute, arcAttribute);\n } else if (fillVisible) {\n // context.closePath();\n context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute);\n context.fillStyle = lastColor as string;\n context.fill();\n }\n }\n }\n };\n\n const _runStroke = () => {\n if (doStroke) {\n if (strokeCb) {\n // fillCb(context, arc.attribute, arcAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute);\n // context.strokeStyle = 'red';\n context.stroke();\n }\n }\n };\n\n if (!fillStrokeOrder) {\n _runFill();\n _runStroke();\n } else {\n _runFill();\n _runStroke();\n }\n }\n }\n\n this.afterRenderStep(\n arc,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n arcAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n if (tempChangeConicalColor) {\n (fill as IConicalGradient).startAngle += conicalOffset;\n (fill as IConicalGradient).endAngle += conicalOffset;\n }\n }\n\n private _runFill(\n arc: IArc,\n context: IContext2d,\n x: number,\n y: number,\n arcAttribute: Required<IArcGraphicAttribute>,\n doFill: boolean,\n fVisible: boolean,\n originX: number,\n originY: number,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n if (doFill) {\n if (fillCb) {\n fillCb(context, arc.attribute, arcAttribute);\n } else if (fVisible) {\n context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute);\n context.fill();\n }\n }\n }\n\n private _runStroke(\n arc: IArc,\n context: IContext2d,\n x: number,\n y: number,\n arcAttribute: Required<IArcGraphicAttribute>,\n doStroke: boolean,\n isFullStroke: boolean,\n sVisible: boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n if (doStroke && isFullStroke) {\n if (strokeCb) {\n strokeCb(context, arc.attribute, arcAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute);\n // context.strokeStyle = 'red';\n context.stroke();\n }\n }\n }\n\n draw(arc: IArc, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const arcAttribute = getTheme(arc, params?.theme).arc;\n this._draw(arc, arcAttribute, false, drawContext, params, arcAttribute);\n }\n}\n"]}
@@ -1,3 +1,4 @@
1
1
  export * from './render-service';
2
+ export * from './constants';
2
3
  export * from './contributions/render';
3
4
  export * from './contributions/render/contributions/constants';
@@ -1,5 +1,7 @@
1
1
  export * from "./render-service";
2
2
 
3
+ export * from "./constants";
4
+
3
5
  export * from "./contributions/render";
4
6
 
5
7
  export * from "./contributions/render/contributions/constants";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/index.ts"],"names":[],"mappings":"AAEA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gDAAgD,CAAC","file":"index.js","sourcesContent":["// export { RenderService, IDrawContribution, IRenderService, IRenderServiceDrawParams } from './render-service';\n// export { GraphicRender, IGraphicRender } from './contributions/render/graphic-render';\nexport * from './render-service';\nexport * from './contributions/render';\nexport * from './contributions/render/contributions/constants';\n"]}
1
+ {"version":3,"sources":["../src/render/index.ts"],"names":[],"mappings":"AAEA,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,gDAAgD,CAAC","file":"index.js","sourcesContent":["// export { RenderService, IDrawContribution, IRenderService, IRenderServiceDrawParams } from './render-service';\n// export { GraphicRender, IGraphicRender } from './contributions/render/graphic-render';\nexport * from './render-service';\nexport * from './constants';\nexport * from './contributions/render';\nexport * from './contributions/render/contributions/constants';\n"]}
@@ -1,6 +1,8 @@
1
1
  import { ContainerModule } from "../common/inversify-lite";
2
2
 
3
- import { DefaultRenderService, RenderService } from "./render-service";
3
+ import { DefaultRenderService } from "./render-service";
4
+
5
+ import { RenderService } from "./constants";
4
6
 
5
7
  export default new ContainerModule((bind => {
6
8
  bind(RenderService).to(DefaultRenderService);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/render-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEvE,eAAe,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE;IACxC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC","file":"render-modules.js","sourcesContent":["import { ContainerModule } from '../common/inversify-lite';\nimport { DefaultRenderService, RenderService } from './render-service';\n\nexport default new ContainerModule(bind => {\n bind(RenderService).to(DefaultRenderService);\n});\n"]}
1
+ {"version":3,"sources":["../src/render/render-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,eAAe,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE;IACxC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC","file":"render-modules.js","sourcesContent":["import { ContainerModule } from '../common/inversify-lite';\nimport { DefaultRenderService } from './render-service';\nimport { RenderService } from './constants';\n\nexport default new ContainerModule(bind => {\n bind(RenderService).to(DefaultRenderService);\n});\n"]}