@visactor/vrender-core 0.17.23-alpha.1 → 0.17.24-alpha.2

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 (81) hide show
  1. package/cjs/common/custom-path2d.d.ts +1 -0
  2. package/cjs/common/custom-path2d.js +5 -1
  3. package/cjs/common/custom-path2d.js.map +1 -1
  4. package/cjs/graphic/arc.js +12 -6
  5. package/cjs/graphic/arc.js.map +1 -1
  6. package/cjs/graphic/config.js +3 -0
  7. package/cjs/graphic/config.js.map +1 -1
  8. package/cjs/graphic/graphic-service/graphic-service.js +6 -5
  9. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  10. package/cjs/graphic/graphic.d.ts +1 -0
  11. package/cjs/graphic/graphic.js +2 -1
  12. package/cjs/graphic/graphic.js.map +1 -1
  13. package/cjs/graphic/group.d.ts +1 -1
  14. package/cjs/graphic/group.js +2 -2
  15. package/cjs/graphic/group.js.map +1 -1
  16. package/cjs/graphic/node-tree.d.ts +1 -1
  17. package/cjs/graphic/node-tree.js +3 -2
  18. package/cjs/graphic/node-tree.js.map +1 -1
  19. package/cjs/graphic/theme.js +1 -1
  20. package/cjs/graphic/theme.js.map +1 -1
  21. package/cjs/interface/graphic/arc.d.ts +2 -0
  22. package/cjs/interface/graphic/arc.js.map +1 -1
  23. package/cjs/interface/graphic.d.ts +2 -0
  24. package/cjs/interface/graphic.js.map +1 -1
  25. package/cjs/interface/node-tree.d.ts +1 -1
  26. package/cjs/interface/node-tree.js.map +1 -1
  27. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +24 -20
  28. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  29. package/cjs/render/contributions/render/arc-render.js +3 -1
  30. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  31. package/cjs/render/contributions/render/arc3d-render.js +4 -1
  32. package/cjs/render/contributions/render/arc3d-render.js.map +1 -1
  33. package/cjs/render/contributions/render/area-render.js +4 -2
  34. package/cjs/render/contributions/render/area-render.js.map +1 -1
  35. package/cjs/render/contributions/render/contributions/arc-contribution-render.js +4 -1
  36. package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  37. package/cjs/render/contributions/render/draw-contribution.d.ts +1 -1
  38. package/cjs/render/contributions/render/draw-contribution.js +13 -6
  39. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  40. package/cjs/render/contributions/render/module.js.map +1 -1
  41. package/es/common/custom-path2d.d.ts +1 -0
  42. package/es/common/custom-path2d.js +5 -1
  43. package/es/common/custom-path2d.js.map +1 -1
  44. package/es/graphic/arc.js +12 -5
  45. package/es/graphic/arc.js.map +1 -1
  46. package/es/graphic/config.js +3 -0
  47. package/es/graphic/config.js.map +1 -1
  48. package/es/graphic/graphic-service/graphic-service.js +6 -5
  49. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  50. package/es/graphic/graphic.d.ts +1 -0
  51. package/es/graphic/graphic.js +2 -1
  52. package/es/graphic/graphic.js.map +1 -1
  53. package/es/graphic/group.d.ts +1 -1
  54. package/es/graphic/group.js +2 -2
  55. package/es/graphic/group.js.map +1 -1
  56. package/es/graphic/node-tree.d.ts +1 -1
  57. package/es/graphic/node-tree.js +3 -2
  58. package/es/graphic/node-tree.js.map +1 -1
  59. package/es/graphic/theme.js +1 -1
  60. package/es/graphic/theme.js.map +1 -1
  61. package/es/interface/graphic/arc.d.ts +2 -0
  62. package/es/interface/graphic/arc.js.map +1 -1
  63. package/es/interface/graphic.d.ts +2 -0
  64. package/es/interface/graphic.js.map +1 -1
  65. package/es/interface/node-tree.d.ts +1 -1
  66. package/es/interface/node-tree.js.map +1 -1
  67. package/es/plugins/builtin-plugin/html-attribute-plugin.js +24 -20
  68. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  69. package/es/render/contributions/render/arc-render.js +3 -1
  70. package/es/render/contributions/render/arc-render.js.map +1 -1
  71. package/es/render/contributions/render/arc3d-render.js +4 -1
  72. package/es/render/contributions/render/arc3d-render.js.map +1 -1
  73. package/es/render/contributions/render/area-render.js +4 -2
  74. package/es/render/contributions/render/area-render.js.map +1 -1
  75. package/es/render/contributions/render/contributions/arc-contribution-render.js +4 -1
  76. package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  77. package/es/render/contributions/render/draw-contribution.d.ts +1 -1
  78. package/es/render/contributions/render/draw-contribution.js +13 -6
  79. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  80. package/es/render/contributions/render/module.js.map +1 -1
  81. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/draw-contribution.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mEAAwF;AAgBxF,+CAAgE;AAEhE,iFAA6E;AAC7E,8CAAoD;AAEpD,6CAA2F;AAE3F,kDAA+C;AAC/C,qCAAsF;AACtF,yDAAyD;AACzD,+DAA2D;AAE3D,wEAAoE;AACpE,wEAAoE;AACpE,sDAAmD;AAM5C,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAclC,YAIiD,aAA+B,EAK3D,gCAAyF;QAL7D,kBAAa,GAAb,aAAa,CAAkB;QAK3D,qCAAgC,GAAhC,gCAAgC,CAAyD;QAE5G,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,IAAI,eAAM,EAAE,CAAC;QAChC,IAAI,CAAC,iBAAiB,GAAG,IAAI,eAAM,EAAE,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,yBAAW,CAAC,MAAM,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,yBAAW,CAAC,YAAY,CAAC;QAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,IAAI;QACF,IAAI,CAAC,aAAa,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G,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;iBAClD;aACF;iBAAM;gBACL,OAAO,CAAC,SAAS,GAAG,IAAA,0BAAW,EAC7B,OAAO,EACP,KAAK,EACL;oBACE,UAAU,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM,EAAE;iBAC5D,EACD,CAAC,EACD,CAAC,CACF,CAAC;gBACF,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;aACvC;SACF;IACH,CAAC;IAED,SAAS,CAAC,aAA6B,EAAE,UAAwB;QAC/D,OAAO;IACT,CAAC;CACF,CAAA;AA5ZY,uBAAuB;IADnC,IAAA,2BAAU,GAAE;IAmBR,WAAA,IAAA,4BAAW,EAAC,sBAAa,CAAC,CAAA;IAG1B,WAAA,IAAA,uBAAM,EAAC,4CAAoB,CAAC,CAAA;IAC5B,WAAA,IAAA,sBAAK,EAAC,sCAAmB,CAAC,CAAA;;GAtBlB,uBAAuB,CA4ZnC;AA5ZY,0DAAuB","file":"draw-contribution.js","sourcesContent":["import { injectable, inject, named, multiInject } from '../../../common/inversify-lite';\nimport type {\n IContext2d,\n MaybePromise,\n IGraphic,\n IGroup,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider,\n IDrawItemInterceptorContribution,\n IDrawContribution,\n IRenderSelector,\n IGlobal\n} from '../../../interface';\nimport { findNextGraphic, foreach } from '../../../common/sort';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { DefaultAttribute } from '../../../graphic';\nimport type { IAABBBounds, IBounds, IBoundsLike, IMatrix, IMatrixLike } from '@visactor/vutils';\nimport { Bounds, Logger, getRectIntersect, isRectIntersect, last } from '@visactor/vutils';\nimport { LayerService } from '../../../core/constants';\nimport { container } from '../../../container';\nimport { GraphicRender, IncrementalDrawContribution, RenderSelector } from './symbol';\nimport { DrawItemInterceptor } from './draw-interceptor';\nimport { createColor } from '../../../common/canvas-utils';\nimport type { ILayerService } from '../../../interface/core';\nimport { boundsAllocate } from '../../../allocator/bounds-allocate';\nimport { matrixAllocate } from '../../../allocator/matrix-allocate';\nimport { application } from '../../../application';\n\n/**\n * 默认的渲染contribution,基于树状结构针对图元的渲染\n */\n@injectable()\nexport class DefaultDrawContribution implements IDrawContribution {\n declare currentRenderMap: Map<number, IGraphicRender>;\n declare defaultRenderMap: Map<number, IGraphicRender>;\n declare styleRenderMap: Map<string, Map<number, IGraphicRender>>;\n declare dirtyBounds: IBounds;\n declare backupDirtyBounds: IBounds;\n // 是否使用dirtyBounds\n declare useDirtyBounds: boolean;\n declare currentRenderService: IRenderService;\n declare InterceptorContributions: IDrawItemInterceptorContribution[];\n\n declare global: IGlobal;\n declare layerService: ILayerService;\n\n constructor(\n // @inject(ContributionProvider)\n // @named(GraphicRender)\n // protected readonly contributions: ContributionProvider<IGraphicRender>,\n @multiInject(GraphicRender) protected readonly contributions: IGraphicRender[],\n // @inject(RenderSelector) protected readonly renderSelector: IRenderSelector, // 根据图元类型选择对应的renderItem进行渲染\n // 拦截器\n @inject(ContributionProvider)\n @named(DrawItemInterceptor)\n protected readonly drawItemInterceptorContributions: IContributionProvider<IDrawItemInterceptorContribution>\n ) {\n this.currentRenderMap = new Map();\n this.defaultRenderMap = new Map();\n this.styleRenderMap = new Map();\n this.dirtyBounds = new Bounds();\n this.backupDirtyBounds = new Bounds();\n this.global = application.global;\n this.layerService = application.layerService;\n this.init();\n }\n\n init() {\n this.contributions.forEach(item => {\n if (item.style) {\n const map = this.styleRenderMap.get(item.style) || new Map();\n map.set(item.numberType, item);\n this.styleRenderMap.set(item.style, map);\n } else {\n this.defaultRenderMap.set(item.numberType, item);\n }\n });\n this.InterceptorContributions = this.drawItemInterceptorContributions\n .getContributions()\n .sort((a, b) => a.order - b.order);\n }\n\n prepareForDraw(renderService: IRenderService, drawContext: IDrawContext) {\n // 有dirtyBounds用dirtyBounds\n if (drawContext.updateBounds) {\n this.useDirtyBounds = true;\n } else {\n // 没有的话,看看是否需要跳过outRange的渲染\n this.useDirtyBounds = !drawContext.stage.params.optimize.disableCheckGraphicWidthOutRange;\n }\n }\n\n draw(renderService: IRenderService, drawContext: IDrawContext): MaybePromise<void> {\n this.prepareForDraw(renderService, drawContext);\n drawContext.drawContribution = this;\n this.currentRenderMap = this.styleRenderMap.get(drawContext.renderStyle) || this.defaultRenderMap;\n // this.startAtId = drawParams.startAtId;\n this.currentRenderService = renderService;\n // this.drawParams = drawParams;\n const { context, stage, x = 0, y = 0, width, height } = drawContext;\n\n if (!context) {\n return;\n }\n // 设置context的transform\n if (drawContext.keepMatrix) {\n if (context.nativeContext && context.nativeContext.getTransform) {\n const t = context.nativeContext.getTransform();\n context.setTransformFromMatrix(t, true, 1);\n }\n } else {\n context.inuse = true;\n // 初始化context\n context.clearMatrix();\n context.setTransformForCurrent(true);\n }\n\n const dirtyBounds: IBounds | undefined = this.dirtyBounds.setValue(0, 0, width, height);\n if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {\n const b = getRectIntersect(dirtyBounds, stage.dirtyBounds, false);\n dirtyBounds.x1 = Math.floor(b.x1);\n dirtyBounds.y1 = Math.floor(b.y1);\n dirtyBounds.x2 = Math.ceil(b.x2);\n dirtyBounds.y2 = Math.ceil(b.y2);\n }\n // 如果dpr不是整数或者.5的小数,需要格式化dirtyBounds\n const d = context.dpr % 1;\n if (d || d !== 0.5) {\n dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr;\n dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr;\n dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr;\n dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr;\n }\n this.backupDirtyBounds.copy(dirtyBounds);\n\n const drawInArea =\n dirtyBounds.width() * context.dpr < context.canvas.width ||\n dirtyBounds.height() * context.dpr < context.canvas.height;\n context.save();\n\n // 设置translate\n context.translate(x, y, true);\n if (drawInArea) {\n context.beginPath();\n context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height());\n context.clip();\n }\n\n // 如果存在3d视角,那么不使用dirtyBounds\n if (stage.camera) {\n this.dirtyBounds.clear();\n this.backupDirtyBounds.clear();\n }\n\n this.clearScreen(renderService, context, drawContext);\n // // 渲染的时候图元的起始位置就是x,y\n // this.backupDirtyBounds.translate(-x, -y);\n // this.dirtyBounds.translate(-x, -y);\n\n // // 设置translate\n // context.translate(x, y, true);\n\n context.save();\n renderService.renderTreeRoots\n .sort((a, b) => {\n return (a.attribute.zIndex ?? DefaultAttribute.zIndex) - (b.attribute.zIndex ?? DefaultAttribute.zIndex);\n })\n .forEach(group => {\n group.isContainer\n ? this.renderGroup(group as IGroup, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0))\n : this.renderItem(group as IGraphic, drawContext);\n });\n\n context.restore();\n context.restore();\n context.draw();\n // this.break = false;\n if (!drawContext.keepMatrix) {\n context.inuse = false;\n }\n }\n\n doRegister() {\n throw new Error('暂不支持');\n }\n\n // 找到下一个graphic\n protected _findNextGraphic(group: IGroup): IGraphic | null {\n let parent = group.parent;\n let id = group._uid;\n while (parent) {\n const g = findNextGraphic(parent, id, DefaultAttribute.zIndex);\n if (g) {\n return g;\n }\n id = parent._uid;\n parent = parent.parent;\n }\n return null;\n }\n\n renderGroup(group: IGroup, drawContext: IDrawContext, parentMatrix: IMatrix, skipSort?: boolean) {\n if (drawContext.break || group.attribute.visibleAll === false) {\n return;\n }\n if (group.incremental && (drawContext.startAtId == null || drawContext.startAtId === group._uid)) {\n drawContext.break = true;\n this._increaseRender(group, drawContext);\n return;\n }\n\n if (this.useDirtyBounds && !isRectIntersect(group.AABBBounds, this.dirtyBounds, false)) {\n return;\n }\n\n let nextM: IMatrix = parentMatrix;\n let tempBounds: IBounds;\n\n if (this.useDirtyBounds) {\n tempBounds = boundsAllocate.allocateByObj(this.dirtyBounds);\n // 变换dirtyBounds\n const gm = group.transMatrix;\n nextM = matrixAllocate.allocateByObj(parentMatrix).multiply(gm.a, gm.b, gm.c, gm.d, gm.e, gm.f);\n // const m = group.globalTransMatrix.getInverse();\n this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(nextM.getInverse());\n }\n\n this.renderItem(group, drawContext, {\n drawingCb: () => {\n skipSort\n ? group.forEachChildren((item: IGraphic) => {\n if (drawContext.break) {\n return;\n }\n if (item.isContainer) {\n this.renderGroup(item as IGroup, drawContext, nextM);\n } else {\n this.renderItem(item, drawContext);\n }\n })\n : foreach(\n group,\n DefaultAttribute.zIndex,\n (item: IGraphic) => {\n if (drawContext.break) {\n return;\n }\n if (item.isContainer) {\n this.renderGroup(item as IGroup, drawContext, nextM);\n } else {\n this.renderItem(item, drawContext);\n }\n },\n false,\n !!drawContext.context?.camera\n );\n }\n });\n\n if (this.useDirtyBounds) {\n this.dirtyBounds.copy(tempBounds);\n boundsAllocate.free(tempBounds);\n matrixAllocate.free(nextM);\n }\n }\n\n protected _increaseRender(group: IGroup, drawContext: IDrawContext) {\n const { layer, stage } = drawContext;\n const { subLayers } = layer;\n // 获取渐进渲染层\n let incrementalLayer = subLayers.get(group._uid);\n if (!incrementalLayer) {\n incrementalLayer = {\n layer: this.layerService.createLayer(stage),\n zIndex: subLayers.size,\n group\n };\n subLayers.set(group._uid, incrementalLayer);\n }\n // 渲染\n const incrementalContext = incrementalLayer.layer.getNativeHandler().getContext();\n const idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);\n idc.dirtyBounds.clear();\n idc.backupDirtyBounds.clear();\n (idc as any).draw(this.currentRenderService, {\n ...drawContext,\n drawContribution: idc,\n clear: 'transparent',\n layer: incrementalLayer.layer,\n context: incrementalContext,\n startAtId: group._uid,\n break: false\n });\n incrementalLayer.drawContribution = idc;\n // this.draw(this.currentRenderService, {...this.drawParams, startAtId: group._uid})\n // this.draw(this.currentRenderService, {...this.drawParams, clear: 'transparent', layer: incrementalContext.layer, context: incrementalContext, startAtId: group._uid})\n const nextGraphic = this._findNextGraphic(group);\n if (nextGraphic) {\n // 如果是下一个渐进渲染层,那就再来一次\n if (nextGraphic.isContainer && nextGraphic.incremental) {\n this._increaseRender(nextGraphic as IGroup, drawContext);\n } else {\n // 如果不是渐进渲染层,那就默认图层渲染\n let afterLayer = subLayers.get(nextGraphic._uid);\n if (!afterLayer) {\n afterLayer = {\n layer: this.layerService.createLayer(stage),\n zIndex: subLayers.size\n };\n subLayers.set(nextGraphic._uid, afterLayer);\n }\n const afterContext = afterLayer.layer.getNativeHandler().getContext();\n this.draw(this.currentRenderService, {\n ...drawContext,\n drawContribution: idc,\n clear: 'transparent',\n layer: afterLayer.layer,\n context: afterContext,\n startAtId: nextGraphic._uid,\n break: false\n });\n }\n }\n }\n\n getRenderContribution(graphic: IGraphic): IGraphicRender | null {\n // let renderer = this.renderSelector.selector(graphic);\n let renderer;\n if (!renderer) {\n renderer = this.selectRenderByNumberType(graphic.numberType);\n }\n if (!renderer) {\n renderer = this.selectRenderByType(graphic.type);\n }\n return renderer;\n }\n\n renderItem(graphic: IGraphic, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n // 添加拦截器\n if (this.InterceptorContributions.length) {\n for (let i = 0; i < this.InterceptorContributions.length; i++) {\n const drawContribution = this.InterceptorContributions[i];\n if (\n drawContribution.beforeDrawItem &&\n drawContribution.beforeDrawItem(graphic, this.currentRenderService, drawContext, this, params)\n ) {\n return;\n }\n }\n }\n\n const renderer = this.getRenderContribution(graphic);\n if (!renderer) {\n return;\n }\n\n let retrans: boolean = false;\n let tempBounds: IAABBBounds;\n\n if (graphic.parent) {\n const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;\n retrans = !!(scrollX || scrollY);\n if (retrans) {\n tempBounds = this.dirtyBounds.clone();\n // 变换dirtyBounds\n const m = graphic.globalTransMatrix.getInverse();\n this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(m);\n this.dirtyBounds.translate(-scrollX, -scrollY);\n }\n }\n\n if (this.useDirtyBounds && !(graphic.isContainer || isRectIntersect(graphic.AABBBounds, this.dirtyBounds, false))) {\n retrans && this.dirtyBounds.copy(tempBounds);\n return;\n }\n\n const skipDraw = drawContext.startAtId != null && graphic._uid !== drawContext.startAtId;\n if (graphic._uid === drawContext.startAtId) {\n drawContext.startAtId = null;\n }\n params && (params.skipDraw = skipDraw);\n if (skipDraw) {\n graphic.isContainer && renderer.draw(graphic, this.currentRenderService, drawContext, params);\n } else {\n renderer.draw(graphic, this.currentRenderService, drawContext, params);\n }\n\n retrans && this.dirtyBounds.copy(tempBounds);\n\n // 添加拦截器\n if (this.InterceptorContributions.length) {\n for (let i = 0; i < this.InterceptorContributions.length; i++) {\n const drawContribution = this.InterceptorContributions[i];\n if (drawContribution.afterDrawItem) {\n if (drawContribution.afterDrawItem(graphic, this.currentRenderService, drawContext, this)) {\n return;\n }\n }\n }\n }\n }\n // 根据type选择对应的render\n protected selectRenderByType(type?: string): IGraphicRender | null {\n Logger.getInstance().warn('未知错误,不应该走到这里');\n return null;\n }\n // 根据type选择对应的render\n protected selectRenderByNumberType(type?: number): IGraphicRender | null {\n return this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);\n }\n\n protected clearScreen(renderService: IRenderService, context: IContext2d, drawContext: IDrawContext) {\n const { clear } = drawContext;\n if (clear) {\n const canvas = context.getCanvas();\n const { width = canvas.width, height = canvas.height } = drawContext;\n const x = 0;\n const y = 0;\n context.clearRect(x, y, width, height);\n const stage = renderService.drawParams?.stage;\n stage && (context.globalAlpha = (stage as any).attribute.opacity ?? 1);\n if (stage && (stage as any).backgroundImg && (stage as any).resources) {\n const res = (stage as any).resources.get(clear);\n if (res && res.state === 'success' && res.data) {\n context.drawImage(res.data, x, y, width, height);\n }\n } else {\n context.fillStyle = createColor(\n context,\n clear,\n {\n AABBBounds: { x1: x, y1: y, x2: x + width, y2: y + height }\n },\n 0,\n 0\n );\n context.fillRect(x, y, width, height);\n }\n }\n }\n\n afterDraw(renderService: IRenderService, drawParams: IDrawContext) {\n return;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/draw-contribution.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mEAAwF;AAgBxF,+CAAgE;AAEhE,iFAA6E;AAC7E,8CAAoD;AAEpD,6CAA2F;AAE3F,kDAA+C;AAC/C,qCAAsF;AACtF,yDAAyD;AACzD,+DAA2D;AAE3D,wEAAoE;AACpE,wEAAoE;AACpE,sDAAmD;AAM5C,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAclC,YAIiD,aAA+B,EAK3D,gCAAyF;QAL7D,kBAAa,GAAb,aAAa,CAAkB;QAK3D,qCAAgC,GAAhC,gCAAgC,CAAyD;QAE5G,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,IAAI,eAAM,EAAE,CAAC;QAChC,IAAI,CAAC,iBAAiB,GAAG,IAAI,eAAM,EAAE,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,yBAAW,CAAC,MAAM,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,yBAAW,CAAC,YAAY,CAAC;QAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,IAAI;QACF,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAChC,IAAI,IAAI,CAAC,KAAK,EAAE;gBACd,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI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'../../../common/inversify-lite';\nimport type {\n IContext2d,\n MaybePromise,\n IGraphic,\n IGroup,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider,\n IDrawItemInterceptorContribution,\n IDrawContribution,\n IRenderSelector,\n IGlobal\n} from '../../../interface';\nimport { findNextGraphic, foreach } from '../../../common/sort';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { DefaultAttribute } from '../../../graphic';\nimport type { IAABBBounds, IBounds, IBoundsLike, IMatrix, IMatrixLike } from '@visactor/vutils';\nimport { Bounds, Logger, getRectIntersect, isRectIntersect, last } from '@visactor/vutils';\nimport { LayerService } from '../../../core/constants';\nimport { container } from '../../../container';\nimport { GraphicRender, IncrementalDrawContribution, RenderSelector } from './symbol';\nimport { DrawItemInterceptor } from './draw-interceptor';\nimport { createColor } from '../../../common/canvas-utils';\nimport type { ILayerService } from '../../../interface/core';\nimport { boundsAllocate } from '../../../allocator/bounds-allocate';\nimport { matrixAllocate } from '../../../allocator/matrix-allocate';\nimport { application } from '../../../application';\n\n/**\n * 默认的渲染contribution,基于树状结构针对图元的渲染\n */\n@injectable()\nexport class DefaultDrawContribution implements IDrawContribution {\n declare currentRenderMap: Map<number, IGraphicRender>;\n declare defaultRenderMap: Map<number, IGraphicRender>;\n declare styleRenderMap: Map<string, Map<number, IGraphicRender>>;\n declare dirtyBounds: IBounds;\n declare backupDirtyBounds: IBounds;\n // 是否使用dirtyBounds\n declare useDirtyBounds: boolean;\n declare currentRenderService: IRenderService;\n declare InterceptorContributions: IDrawItemInterceptorContribution[];\n\n declare global: IGlobal;\n declare layerService: ILayerService;\n\n constructor(\n // @inject(ContributionProvider)\n // @named(GraphicRender)\n // protected readonly contributions: ContributionProvider<IGraphicRender>,\n @multiInject(GraphicRender) protected readonly contributions: IGraphicRender[],\n // @inject(RenderSelector) protected readonly renderSelector: IRenderSelector, // 根据图元类型选择对应的renderItem进行渲染\n // 拦截器\n @inject(ContributionProvider)\n @named(DrawItemInterceptor)\n protected readonly drawItemInterceptorContributions: IContributionProvider<IDrawItemInterceptorContribution>\n ) {\n this.currentRenderMap = new Map();\n this.defaultRenderMap = new Map();\n this.styleRenderMap = new Map();\n this.dirtyBounds = new Bounds();\n this.backupDirtyBounds = new Bounds();\n this.global = application.global;\n this.layerService = application.layerService;\n this.init();\n }\n\n init() {\n this.contributions.forEach(item => {\n if (item.style) {\n const map = this.styleRenderMap.get(item.style) || new Map();\n map.set(item.numberType, item);\n this.styleRenderMap.set(item.style, map);\n } else {\n this.defaultRenderMap.set(item.numberType, item);\n }\n });\n this.InterceptorContributions = this.drawItemInterceptorContributions\n .getContributions()\n .sort((a, b) => a.order - b.order);\n }\n\n prepareForDraw(renderService: IRenderService, drawContext: IDrawContext) {\n // 有dirtyBounds用dirtyBounds\n if (drawContext.updateBounds) {\n this.useDirtyBounds = true;\n } else {\n // 没有的话,看看是否需要跳过outRange的渲染\n this.useDirtyBounds = !drawContext.stage.params.optimize.disableCheckGraphicWidthOutRange;\n }\n }\n\n draw(renderService: IRenderService, drawContext: IDrawContext): MaybePromise<void> {\n this.prepareForDraw(renderService, drawContext);\n drawContext.drawContribution = this;\n this.currentRenderMap = this.styleRenderMap.get(drawContext.renderStyle) || this.defaultRenderMap;\n // this.startAtId = drawParams.startAtId;\n this.currentRenderService = renderService;\n // this.drawParams = drawParams;\n const { context, stage, x = 0, y = 0, width, height } = drawContext;\n\n if (!context) {\n return;\n }\n // 设置context的transform\n if (drawContext.keepMatrix) {\n if (context.nativeContext && context.nativeContext.getTransform) {\n const t = context.nativeContext.getTransform();\n context.setTransformFromMatrix(t, true, 1);\n }\n } else {\n context.inuse = true;\n // 初始化context\n context.clearMatrix();\n context.setTransformForCurrent(true);\n }\n\n const dirtyBounds: IBounds | undefined = this.dirtyBounds.setValue(0, 0, width, height);\n if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {\n const b = getRectIntersect(dirtyBounds, stage.dirtyBounds, false);\n dirtyBounds.x1 = Math.floor(b.x1);\n dirtyBounds.y1 = Math.floor(b.y1);\n dirtyBounds.x2 = Math.ceil(b.x2);\n dirtyBounds.y2 = Math.ceil(b.y2);\n }\n // 如果dpr不是整数或者.5的小数,需要格式化dirtyBounds\n const d = context.dpr % 1;\n if (d || d !== 0.5) {\n dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr;\n dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr;\n dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr;\n dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr;\n }\n this.backupDirtyBounds.copy(dirtyBounds);\n\n const drawInArea =\n dirtyBounds.width() * context.dpr < context.canvas.width ||\n dirtyBounds.height() * context.dpr < context.canvas.height;\n context.save();\n\n // 设置translate\n context.translate(x, y, true);\n if (drawInArea) {\n context.beginPath();\n context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height());\n context.clip();\n }\n\n // 如果存在3d视角,那么不使用dirtyBounds\n if (stage.camera) {\n this.dirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n this.backupDirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n }\n\n this.clearScreen(renderService, context, drawContext);\n // // 渲染的时候图元的起始位置就是x,y\n // this.backupDirtyBounds.translate(-x, -y);\n // this.dirtyBounds.translate(-x, -y);\n\n // // 设置translate\n // context.translate(x, y, true);\n\n context.save();\n renderService.renderTreeRoots\n .sort((a, b) => {\n return (a.attribute.zIndex ?? DefaultAttribute.zIndex) - (b.attribute.zIndex ?? DefaultAttribute.zIndex);\n })\n .forEach(group => {\n group.isContainer\n ? this.renderGroup(group as IGroup, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0))\n : this.renderItem(group as IGraphic, drawContext);\n });\n\n context.restore();\n context.restore();\n context.draw();\n // this.break = false;\n if (!drawContext.keepMatrix) {\n context.inuse = false;\n }\n }\n\n doRegister() {\n throw new Error('暂不支持');\n }\n\n // 找到下一个graphic\n protected _findNextGraphic(group: IGroup): IGraphic | null {\n let parent = group.parent;\n let id = group._uid;\n while (parent) {\n const g = findNextGraphic(parent, id, DefaultAttribute.zIndex);\n if (g) {\n return g;\n }\n id = parent._uid;\n parent = parent.parent;\n }\n return null;\n }\n\n renderGroup(group: IGroup, drawContext: IDrawContext, parentMatrix: IMatrix, skipSort?: boolean) {\n if (drawContext.break || group.attribute.visibleAll === false) {\n return;\n }\n if (group.incremental && (drawContext.startAtId == null || drawContext.startAtId === group._uid)) {\n drawContext.break = true;\n this._increaseRender(group, drawContext);\n return;\n }\n\n if (this.useDirtyBounds && !isRectIntersect(group.AABBBounds, this.dirtyBounds, false)) {\n return;\n }\n\n let nextM: IMatrix = parentMatrix;\n let tempBounds: IBounds;\n\n if (this.useDirtyBounds) {\n tempBounds = boundsAllocate.allocateByObj(this.dirtyBounds);\n // 变换dirtyBounds\n const gm = group.transMatrix;\n nextM = matrixAllocate.allocateByObj(parentMatrix).multiply(gm.a, gm.b, gm.c, gm.d, gm.e, gm.f);\n // const m = group.globalTransMatrix.getInverse();\n this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(nextM.getInverse());\n }\n\n this.renderItem(group, drawContext, {\n drawingCb: () => {\n skipSort\n ? group.forEachChildren((item: IGraphic) => {\n if (drawContext.break) {\n return;\n }\n if (item.isContainer) {\n this.renderGroup(item as IGroup, drawContext, nextM);\n } else {\n this.renderItem(item, drawContext);\n }\n })\n : foreach(\n group,\n DefaultAttribute.zIndex,\n (item: IGraphic) => {\n if (drawContext.break) {\n return;\n }\n if (item.isContainer) {\n this.renderGroup(item as IGroup, drawContext, nextM);\n } else {\n this.renderItem(item, drawContext);\n }\n },\n false,\n !!drawContext.context?.camera\n );\n }\n });\n\n if (this.useDirtyBounds) {\n this.dirtyBounds.copy(tempBounds);\n boundsAllocate.free(tempBounds);\n matrixAllocate.free(nextM);\n }\n }\n\n protected _increaseRender(group: IGroup, drawContext: IDrawContext) {\n const { layer, stage } = drawContext;\n const { subLayers } = layer;\n // 获取渐进渲染层\n let incrementalLayer = subLayers.get(group._uid);\n if (!incrementalLayer) {\n incrementalLayer = {\n layer: this.layerService.createLayer(stage),\n zIndex: subLayers.size,\n group\n };\n subLayers.set(group._uid, incrementalLayer);\n }\n // 渲染\n const incrementalContext = incrementalLayer.layer.getNativeHandler().getContext();\n const idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);\n idc.dirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n idc.backupDirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n (idc as any).draw(this.currentRenderService, {\n ...drawContext,\n drawContribution: idc,\n clear: 'transparent',\n layer: incrementalLayer.layer,\n context: incrementalContext,\n startAtId: group._uid,\n break: false\n });\n incrementalLayer.drawContribution = idc;\n // this.draw(this.currentRenderService, {...this.drawParams, startAtId: group._uid})\n // this.draw(this.currentRenderService, {...this.drawParams, clear: 'transparent', layer: incrementalContext.layer, context: incrementalContext, startAtId: group._uid})\n const nextGraphic = this._findNextGraphic(group);\n if (nextGraphic) {\n // 如果是下一个渐进渲染层,那就再来一次\n if (nextGraphic.isContainer && nextGraphic.incremental) {\n this._increaseRender(nextGraphic as IGroup, drawContext);\n } else {\n // 如果不是渐进渲染层,那就默认图层渲染\n let afterLayer = subLayers.get(nextGraphic._uid);\n if (!afterLayer) {\n afterLayer = {\n layer: this.layerService.createLayer(stage),\n zIndex: subLayers.size\n };\n subLayers.set(nextGraphic._uid, afterLayer);\n }\n const afterContext = afterLayer.layer.getNativeHandler().getContext();\n this.draw(this.currentRenderService, {\n ...drawContext,\n drawContribution: idc,\n clear: 'transparent',\n layer: afterLayer.layer,\n context: afterContext,\n startAtId: nextGraphic._uid,\n break: false\n });\n }\n }\n }\n\n getRenderContribution(graphic: IGraphic): IGraphicRender | null {\n let renderer;\n if (!renderer) {\n renderer = this.selectRenderByNumberType(graphic.numberType, graphic);\n }\n if (!renderer) {\n renderer = this.selectRenderByType(graphic.type);\n }\n return renderer;\n }\n\n renderItem(graphic: IGraphic, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n // 添加拦截器\n if (this.InterceptorContributions.length) {\n for (let i = 0; i < this.InterceptorContributions.length; i++) {\n const drawContribution = this.InterceptorContributions[i];\n if (\n drawContribution.beforeDrawItem &&\n drawContribution.beforeDrawItem(graphic, this.currentRenderService, drawContext, this, params)\n ) {\n return;\n }\n }\n }\n\n const renderer = this.getRenderContribution(graphic);\n if (!renderer) {\n return;\n }\n\n let retrans: boolean = false;\n let tempBounds: IAABBBounds;\n\n if (graphic.parent) {\n const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;\n retrans = !!(scrollX || scrollY);\n if (retrans) {\n tempBounds = this.dirtyBounds.clone();\n // 变换dirtyBounds\n const m = graphic.globalTransMatrix.getInverse();\n this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(m);\n this.dirtyBounds.translate(-scrollX, -scrollY);\n }\n }\n\n if (this.useDirtyBounds && !(graphic.isContainer || isRectIntersect(graphic.AABBBounds, this.dirtyBounds, false))) {\n retrans && this.dirtyBounds.copy(tempBounds);\n return;\n }\n\n const skipDraw = drawContext.startAtId != null && graphic._uid !== drawContext.startAtId;\n if (graphic._uid === drawContext.startAtId) {\n drawContext.startAtId = null;\n }\n params && (params.skipDraw = skipDraw);\n if (skipDraw) {\n graphic.isContainer && renderer.draw(graphic, this.currentRenderService, drawContext, params);\n } else {\n renderer.draw(graphic, this.currentRenderService, drawContext, params);\n }\n\n retrans && this.dirtyBounds.copy(tempBounds);\n\n // 添加拦截器\n if (this.InterceptorContributions.length) {\n for (let i = 0; i < this.InterceptorContributions.length; i++) {\n const drawContribution = this.InterceptorContributions[i];\n if (drawContribution.afterDrawItem) {\n if (drawContribution.afterDrawItem(graphic, this.currentRenderService, drawContext, this)) {\n return;\n }\n }\n }\n }\n }\n // 根据type选择对应的render\n protected selectRenderByType(type?: string): IGraphicRender | null {\n Logger.getInstance().warn('未知错误,不应该走到这里');\n return null;\n }\n // 根据type选择对应的render\n protected selectRenderByNumberType(type: number, graphic: IGraphic): IGraphicRender | null {\n let data;\n if (graphic.attribute.renderStyle) {\n const currentRenderMap = this.styleRenderMap.get(graphic.attribute.renderStyle);\n data = currentRenderMap && currentRenderMap.get(type);\n }\n return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);\n }\n\n protected clearScreen(renderService: IRenderService, context: IContext2d, drawContext: IDrawContext) {\n const { clear } = drawContext;\n if (clear) {\n const canvas = context.getCanvas();\n const { width = canvas.width, height = canvas.height } = drawContext;\n const x = 0;\n const y = 0;\n context.clearRect(x, y, width, height);\n const stage = renderService.drawParams?.stage;\n stage && (context.globalAlpha = (stage as any).attribute.opacity ?? 1);\n if (stage && (stage as any).backgroundImg && (stage as any).resources) {\n const res = (stage as any).resources.get(clear);\n if (res && res.state === 'success' && res.data) {\n context.drawImage(res.data, x, y, width, height);\n }\n } else {\n context.fillStyle = createColor(\n context,\n clear,\n {\n AABBBounds: { x1: x, y1: y, x2: x + width, y2: y + height }\n },\n 0,\n 0\n );\n context.fillRect(x, y, width, height);\n }\n }\n }\n\n afterDraw(renderService: IRenderService, drawParams: IDrawContext) {\n return;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/module.ts"],"names":[],"mappings":";;AAAA,mEAAiE;AACjE,iFAAiF;AACjF,2DAA8D;AAC9D,iDAA0D;AAC1D,mFAAqF;AACrF,qCAAqG;AACrG,yDAAgG;AAChG,yDAAsG;AACtG,mDAIyB;AAEzB,kBAAe,IAAI,gCAAe,CAAC,IAAI,CAAC,EAAE;IACxC,IAAI,CAAC,uDAAuC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC1E,IAAI,CAAC,oDAAoC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAEvE,IAAI,CAAC,yBAAgB,CAAC,CAAC,EAAE,CAAC,2CAAuB,CAAC,CAAC;IACnD,IAAI,CAAC,oCAA2B,CAAC,CAAC,EAAE,CAAC,kEAAkC,CAAC,CAAC;IAKzE,IAAI,CAAC,oBAAW,CAAC,CAAC,EAAE,CAAC,uCAAwB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAClE,IAAI,CAAC,sBAAa,CAAC,CAAC,SAAS,CAAC,oBAAW,CAAC,CAAC;IAG3C,IAAA,gDAAwB,EAAC,IAAI,EAAE,mCAAuB,CAAC,CAAC;IAGxD,IAAI,CAAC,wDAAwC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC3E,IAAA,gDAAwB,EAAC,IAAI,EAAE,4CAAgC,CAAC,CAAC;IACjE,IAAA,gDAAwB,EAAC,IAAI,EAAE,sBAAa,CAAC,CAAC;IAK9C,IAAI,CAAC,wDAAqC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACxE,IAAI,CAAC,sCAAmB,CAAC,CAAC,SAAS,CAAC,wDAAqC,CAAC,CAAC;IAK3E,IAAA,gDAAwB,EAAC,IAAI,EAAE,sCAAmB,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC","file":"module.js","sourcesContent":["import { ContainerModule } from '../../../common/inversify-lite';\nimport { bindContributionProvider } from '../../../common/contribution-provider';\nimport { DefaultDrawContribution } from './draw-contribution';\nimport { DefaultCanvasGroupRender } from './group-render';\nimport { DefaultIncrementalDrawContribution } from './incremental-draw-contribution';\nimport { DrawContribution, GraphicRender, GroupRender, IncrementalDrawContribution } from './symbol';\nimport { CommonDrawItemInterceptorContribution, DrawItemInterceptor } from './draw-interceptor';\nimport { GroupRenderContribution, InteractiveSubRenderContribution } from './contributions/constants';\nimport {\n DefaultBaseBackgroundRenderContribution,\n DefaultBaseInteractiveRenderContribution,\n DefaultBaseTextureRenderContribution\n} from './contributions';\n\nexport default new ContainerModule(bind => {\n bind(DefaultBaseBackgroundRenderContribution).toSelf().inSingletonScope();\n bind(DefaultBaseTextureRenderContribution).toSelf().inSingletonScope();\n\n bind(DrawContribution).to(DefaultDrawContribution);\n bind(IncrementalDrawContribution).to(DefaultIncrementalDrawContribution);\n\n // bind(RenderSelector).to(DefaultRenderSelector).inSingletonScope();\n\n // group渲染器\n bind(GroupRender).to(DefaultCanvasGroupRender).inSingletonScope();\n bind(GraphicRender).toService(GroupRender);\n\n // group 渲染器注入contributions\n bindContributionProvider(bind, GroupRenderContribution);\n\n // 绑定通用interactive contribution\n bind(DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope();\n bindContributionProvider(bind, InteractiveSubRenderContribution);\n bindContributionProvider(bind, GraphicRender);\n\n // interceptor\n // bind(ShadowRootDrawItemInterceptorContribution).toSelf().inSingletonScope();\n // bind(DrawItemInterceptor).toService(ShadowRootDrawItemInterceptorContribution);\n bind(CommonDrawItemInterceptorContribution).toSelf().inSingletonScope();\n bind(DrawItemInterceptor).toService(CommonDrawItemInterceptorContribution);\n // bind(Canvas3DDrawItemInterceptor).toSelf().inSingletonScope();\n // bind(DrawItemInterceptor).toService(Canvas3DDrawItemInterceptor);\n // bind(InteractiveDrawItemInterceptorContribution).toSelf().inSingletonScope();\n // bind(DrawItemInterceptor).toService(InteractiveDrawItemInterceptorContribution);\n bindContributionProvider(bind, DrawItemInterceptor);\n});\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/module.ts"],"names":[],"mappings":";;AAAA,mEAAiE;AACjE,iFAAiF;AACjF,2DAA8D;AAC9D,iDAA0D;AAC1D,mFAAqF;AACrF,qCAAqH;AACrH,yDAAgG;AAChG,yDAAsG;AACtG,mDAIyB;AAEzB,kBAAe,IAAI,gCAAe,CAAC,IAAI,CAAC,EAAE;IACxC,IAAI,CAAC,uDAAuC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC1E,IAAI,CAAC,oDAAoC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAEvE,IAAI,CAAC,yBAAgB,CAAC,CAAC,EAAE,CAAC,2CAAuB,CAAC,CAAC;IACnD,IAAI,CAAC,oCAA2B,CAAC,CAAC,EAAE,CAAC,kEAAkC,CAAC,CAAC;IAKzE,IAAI,CAAC,oBAAW,CAAC,CAAC,EAAE,CAAC,uCAAwB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAClE,IAAI,CAAC,sBAAa,CAAC,CAAC,SAAS,CAAC,oBAAW,CAAC,CAAC;IAG3C,IAAA,gDAAwB,EAAC,IAAI,EAAE,mCAAuB,CAAC,CAAC;IAGxD,IAAI,CAAC,wDAAwC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC3E,IAAA,gDAAwB,EAAC,IAAI,EAAE,4CAAgC,CAAC,CAAC;IACjE,IAAA,gDAAwB,EAAC,IAAI,EAAE,sBAAa,CAAC,CAAC;IAK9C,IAAI,CAAC,wDAAqC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACxE,IAAI,CAAC,sCAAmB,CAAC,CAAC,SAAS,CAAC,wDAAqC,CAAC,CAAC;IAM3E,IAAA,gDAAwB,EAAC,IAAI,EAAE,sCAAmB,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC","file":"module.js","sourcesContent":["import { ContainerModule } from '../../../common/inversify-lite';\nimport { bindContributionProvider } from '../../../common/contribution-provider';\nimport { DefaultDrawContribution } from './draw-contribution';\nimport { DefaultCanvasGroupRender } from './group-render';\nimport { DefaultIncrementalDrawContribution } from './incremental-draw-contribution';\nimport { DrawContribution, GraphicRender, GroupRender, IncrementalDrawContribution, RenderSelector } from './symbol';\nimport { CommonDrawItemInterceptorContribution, DrawItemInterceptor } from './draw-interceptor';\nimport { GroupRenderContribution, InteractiveSubRenderContribution } from './contributions/constants';\nimport {\n DefaultBaseBackgroundRenderContribution,\n DefaultBaseInteractiveRenderContribution,\n DefaultBaseTextureRenderContribution\n} from './contributions';\n\nexport default new ContainerModule(bind => {\n bind(DefaultBaseBackgroundRenderContribution).toSelf().inSingletonScope();\n bind(DefaultBaseTextureRenderContribution).toSelf().inSingletonScope();\n\n bind(DrawContribution).to(DefaultDrawContribution);\n bind(IncrementalDrawContribution).to(DefaultIncrementalDrawContribution);\n\n // bind(RenderSelector).to(DefaultRenderSelector).inSingletonScope();\n\n // group渲染器\n bind(GroupRender).to(DefaultCanvasGroupRender).inSingletonScope();\n bind(GraphicRender).toService(GroupRender);\n\n // group 渲染器注入contributions\n bindContributionProvider(bind, GroupRenderContribution);\n\n // 绑定通用interactive contribution\n bind(DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope();\n bindContributionProvider(bind, InteractiveSubRenderContribution);\n bindContributionProvider(bind, GraphicRender);\n\n // interceptor\n // bind(ShadowRootDrawItemInterceptorContribution).toSelf().inSingletonScope();\n // bind(DrawItemInterceptor).toService(ShadowRootDrawItemInterceptorContribution);\n bind(CommonDrawItemInterceptorContribution).toSelf().inSingletonScope();\n bind(DrawItemInterceptor).toService(CommonDrawItemInterceptorContribution);\n // bind(RenderSelector).toService()\n // bind(Canvas3DDrawItemInterceptor).toSelf().inSingletonScope();\n // bind(DrawItemInterceptor).toService(Canvas3DDrawItemInterceptor);\n // bind(InteractiveDrawItemInterceptorContribution).toSelf().inSingletonScope();\n // bind(DrawItemInterceptor).toService(InteractiveDrawItemInterceptorContribution);\n bindContributionProvider(bind, DrawItemInterceptor);\n});\n"]}
@@ -21,6 +21,7 @@ export declare class CustomPath2D extends CurvePath implements ICustomPath2D {
21
21
  closePath(): this;
22
22
  addCurve(curve: ICurve<IPoint>): void;
23
23
  clear(): void;
24
+ beginPath(): void;
24
25
  toString(): string;
25
26
  fromString(str: string, x?: number, y?: number, sX?: number, sY?: number): this;
26
27
  fromLine(line: ILine): void;
@@ -65,6 +65,9 @@ export class CustomPath2D extends CurvePath {
65
65
  clear() {
66
66
  this.transformCbList = null, this.commandList.length = 0, this.curves.length = 0;
67
67
  }
68
+ beginPath() {
69
+ this.clear();
70
+ }
68
71
  toString() {
69
72
  if (!this.toStringCbList) {
70
73
  const list = [];
@@ -76,7 +79,8 @@ export class CustomPath2D extends CurvePath {
76
79
  let path = "";
77
80
  for (let i = 0; i < bezierPathList.length; i += 6) path += `C${bezierPathList[i]} ${bezierPathList[i + 1]} ${bezierPathList[i + 2]} ${bezierPathList[i + 3]} ${bezierPathList[i + 4]} ${bezierPathList[i + 5]}`;
78
81
  return path;
79
- }, list[enumCommandMap.Z] = cmd => "Z", this.toStringCbList = list;
82
+ }, list[enumCommandMap.R] = cmd => `M${cmd[1]} ${cmd[2]} h${cmd[3]} v${cmd[4]} H${cmd[1]}Z`,
83
+ list[enumCommandMap.Z] = cmd => "Z", this.toStringCbList = list;
80
84
  }
81
85
  const list = this.toStringCbList;
82
86
  let path = "";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common/custom-path2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1D,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAqB1C,MAAM,OAAO,YAAa,SAAQ,SAAS;IAQzC,YAAY,GAAa;QACvB,KAAK,EAAE,CAAC;QARV,gBAAW,GAAkB,EAAE,CAAC;QAS9B,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;SACjB;QACD,IAA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AC,CAAY,CAAC;KACvC;SAAM,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE;QACjC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAI,OAAO,CAAC,CAAC,CAAY,CAAC;KACvC;SAAM,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE;QACjC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAI,OAAO,CAAC,CAAC,CAAY,CAAC;KACvC;SAAM;QACL,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE;YAC9C,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAI,OAAO,CAAC,CAAC,CAAY,CAAC;SAC5D;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC","file":"custom-path2d.js","sourcesContent":["import { BoundsContext } from './bounds-context';\nimport type { CommandStrType, CommandType, ICurve, ICustomPath2D, IDirection, ILine, IPath2D } from '../interface';\nimport { CurvePath } from './segment/curve/path';\nimport { enumCommandMap, parseSvgPath } from './path-svg';\nimport type { IPoint, IPointLike } from '@visactor/vutils';\nimport { abs } from '@visactor/vutils';\nimport { Direction } from './enums';\nimport { drawArc, addArcToBezierPath } from './shape/arc';\nimport { renderCommandList } from './render-command-list';\nimport { calcLineCache } from './segment';\n\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// 基于d3-shape重构\n// https://github.com/vega/vega/blob/master/packages/vega-scenegraph/src/path/render.js\n\nexport class CustomPath2D extends CurvePath implements ICustomPath2D {\n commandList: CommandType[] = [];\n _boundsContext: IPath2D;\n _ctx?: IPath2D;\n direction?: IDirection;\n protected transformCbList?: ((cmd: CommandType, x: number, y: number, sx: number, sy: number) => void)[];\n protected toStringCbList?: ((cmd: CommandType) => string)[];\n\n constructor(ctx?: IPath2D) {\n super();\n if (ctx) {\n this._ctx = ctx;\n }\n this._boundsContext = new BoundsContext(this.bounds);\n }\n\n setCtx(ctx?: IPath2D) {\n this._ctx = ctx;\n }\n\n moveTo(x: number, y: number) {\n this.commandList.push([enumCommandMap.M, x, y]);\n this._ctx && this._ctx.moveTo(x, y);\n return this;\n }\n lineTo(x: number, y: number) {\n this.commandList.push([enumCommandMap.L, x, y]);\n this._ctx && this._ctx.lineTo(x, y);\n return this;\n }\n quadraticCurveTo(aCPx: number, aCPy: number, aX: number, aY: number) {\n this.commandList.push([enumCommandMap.Q, aCPx, aCPy, aX, aY]);\n this._ctx && this._ctx.quadraticCurveTo(aCPx, aCPy, aX, aY);\n return this;\n }\n bezierCurveTo(aCP1x: number, aCP1y: number, aCP2x: number, aCP2y: number, aX: number, aY: number) {\n this.commandList.push([enumCommandMap.C, aCP1x, aCP1y, aCP2x, aCP2y, aX, aY]);\n this._ctx && this._ctx.bezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY);\n return this;\n }\n arcTo(aX1: number, aY1: number, aX2: number, aY2: number, aRadius: number) {\n this.commandList.push([enumCommandMap.AT, aX1, aY1, aX2, aY2, aRadius]);\n this._ctx && this._ctx.arcTo(aX1, aY1, aX2, aY2, aRadius);\n return this;\n }\n ellipse(\n aX: number,\n aY: number,\n xRadius: number,\n yRadius: number,\n aRotation: number,\n aStartAngle: number,\n aEndAngle: number,\n aClockwise: boolean\n ) {\n this.commandList.push([enumCommandMap.E, aX, aY, xRadius, yRadius, aRotation, aStartAngle, aEndAngle, aClockwise]);\n this._ctx && this._ctx.ellipse(aX, aY, xRadius, yRadius, aRotation, aStartAngle, aEndAngle, aClockwise);\n return this;\n }\n rect(x: number, y: number, w: number, h: number) {\n this.commandList.push([enumCommandMap.R, x, y, w, h]);\n this._ctx && this._ctx.rect(x, y, w, h);\n return this;\n }\n arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean) {\n this.commandList.push([enumCommandMap.A, x, y, radius, startAngle, endAngle, counterclockwise]);\n this._ctx && this._ctx.arc(x, y, radius, startAngle, endAngle, counterclockwise);\n return this;\n }\n closePath() {\n this.commandList.push([enumCommandMap.Z]);\n this._ctx && this._ctx.closePath();\n return this;\n }\n\n addCurve(curve: ICurve<IPoint>) {\n this.curves.push(curve);\n // todo parse curve\n }\n clear() {\n this.transformCbList = null;\n this.commandList.length = 0;\n this.curves.length = 0;\n }\n\n toString(): string {\n if (!this.toStringCbList) {\n const list: ((cmd: CommandType) => string)[] = [];\n list[enumCommandMap.M] = (cmd: CommandType) => `M${cmd[1]} ${cmd[2]}`;\n list[enumCommandMap.L] = (cmd: CommandType) => `L${cmd[1]} ${cmd[2]}`;\n list[enumCommandMap.Q] = (cmd: CommandType) => `Q${cmd[1]} ${cmd[2]} ${cmd[3]} ${cmd[4]}`;\n list[enumCommandMap.C] = (cmd: CommandType) => `C${cmd[1]} ${cmd[2]} ${cmd[3]} ${cmd[4]} ${cmd[5]} ${cmd[6]}`;\n list[enumCommandMap.A] = (cmd: CommandType) => {\n const bezierPathList: number[] = [];\n addArcToBezierPath(\n bezierPathList,\n cmd[4] as number,\n cmd[5] as number,\n cmd[1] as number,\n cmd[2] as number,\n cmd[3] as number,\n cmd[3] as number\n );\n let path = '';\n for (let i = 0; i < bezierPathList.length; i += 6) {\n path += `C${bezierPathList[i]} ${bezierPathList[i + 1]} ${bezierPathList[i + 2]} ${bezierPathList[i + 3]} ${\n bezierPathList[i + 4]\n } ${bezierPathList[i + 5]}`;\n }\n return path;\n };\n // list[enumCommandMap.AT] = this.arcToTransform;\n // list[enumCommandMap.E] = this.ellipseTransform;\n // list[enumCommandMap.R] = this.rectTransform;\n // list[enumCommandMap.A] = this.arcTransform;\n list[enumCommandMap.Z] = (cmd: CommandType) => `Z`;\n this.toStringCbList = list;\n }\n\n const list = this.toStringCbList;\n let path = '';\n this.commandList.forEach(c => {\n path += list[c[0]](c);\n });\n return path;\n }\n\n fromString(str: string, x?: number, y?: number, sX?: number, sY?: number) {\n this.clear();\n\n // 解析path字符串\n const commandStrList = parseSvgPath(str) as CommandStrType[]; // TODO: 目前正则性能较差,后续需要加上回调函数供用户直接操作绘图命令\n this._runCommandStrList(commandStrList, x, y, sX, sY);\n\n // 更新bounds\n this._updateBounds();\n return this;\n }\n fromLine(line: ILine) {\n const { points, curveType, clipRangeByDimension } = line.attribute;\n if (!points) {\n return;\n }\n const cache = calcLineCache(points, curveType);\n if (clipRangeByDimension === 'x') {\n this.direction = Direction.ROW;\n } else if (clipRangeByDimension === 'y') {\n this.direction = Direction.COLUMN;\n } else if (clipRangeByDimension === 'auto') {\n this.direction = cache.direction;\n }\n this.curves = cache.curves;\n }\n fromCustomPath2D(path: ICustomPath2D, x?: number, y?: number, sX?: number, sY?: number) {\n this.clear();\n this._runCommandList(path.commandList as CommandType[], x, y, sX, sY);\n\n // 更新bounds\n this._updateBounds();\n return this;\n }\n transform(x: number, y: number, sx: number, sy: number) {\n const commandList = this.commandList;\n if (!this.transformCbList) {\n const list: ((cmd: CommandType, x: number, y: number, sx: number, sy: number) => void)[] = [];\n list[enumCommandMap.M] = this.moveToTransform;\n list[enumCommandMap.L] = this.lineToTransform;\n list[enumCommandMap.Q] = this.quadraticCurveToTransform;\n list[enumCommandMap.C] = this.bezierCurveToTransform;\n list[enumCommandMap.AT] = this.arcToTransform;\n list[enumCommandMap.E] = this.ellipseTransform;\n list[enumCommandMap.R] = this.rectTransform;\n list[enumCommandMap.A] = this.arcTransform;\n list[enumCommandMap.Z] = this.closePathTransform;\n this.transformCbList = list;\n }\n commandList.forEach(cmd => {\n this.transformCbList[cmd[0]](cmd, x, y, sx, sy);\n });\n this._updateBounds();\n }\n\n protected moveToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n }\n protected lineToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n }\n protected quadraticCurveToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx + x;\n cmd[4] = (cmd[4] as number) * sy + y;\n }\n protected bezierCurveToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx + x;\n cmd[4] = (cmd[4] as number) * sy + y;\n cmd[5] = (cmd[5] as number) * sx + x;\n cmd[6] = (cmd[6] as number) * sy + y;\n }\n arcToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx + x;\n cmd[4] = (cmd[4] as number) * sy + y;\n cmd[5] = ((cmd[5] as number) * (sx + sy)) / 2;\n }\n ellipseTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx;\n cmd[4] = (cmd[4] as number) * sy;\n }\n rectTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx;\n cmd[4] = (cmd[4] as number) * sy;\n }\n arcTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = ((cmd[3] as number) * (sx + sy)) / 2;\n }\n closePathTransform() {\n return;\n }\n protected _runCommandStrList(\n commandStrList: CommandStrType[],\n l: number = 0,\n t: number = 0,\n sX: number = 1,\n sY: number = 1\n ) {\n let current; // current instruction\n let previous = null;\n let x = 0; // current x\n let y = 0; // current y\n // let sX = 0;\n // let sY = 0;\n let controlX = 0; // current control point x\n let controlY = 0; // current control point y\n let tempX;\n let tempY;\n let tempControlX;\n let tempControlY;\n\n // if (isNil(l)) l = 0;\n // if (isNil(t)) t = 0;\n // if (isNil(sX)) sX = 1;\n // if (isNil(sY)) sY = sX;\n\n for (let i = 0, len = commandStrList.length; i < len; ++i) {\n current = commandStrList[i];\n if (sX !== 1 || sY !== 1) {\n current = scale(current, sX, sY);\n }\n\n switch (\n current[0] // first letter\n ) {\n case 'l': // lineto, relative\n x += current[1] as number;\n y += current[2] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'L': // lineto, absolute\n x = current[1] as number;\n y = current[2] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'h': // horizontal lineto, relative\n x += current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'H': // horizontal lineto, absolute\n x = current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'v': // vertical lineto, relative\n y += current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'V': // verical lineto, absolute\n y = current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'm': // moveTo, relative\n x += current[1] as number;\n y += current[2] as number;\n this.moveTo(x + l, y + t);\n break;\n\n case 'M': // moveTo, absolute\n x = current[1] as number;\n y = current[2] as number;\n this.moveTo(x + l, y + t);\n break;\n\n case 'c': // bezierCurveTo, relative\n tempX = x + (current[5] as number);\n tempY = y + (current[6] as number);\n controlX = x + (current[3] as number);\n controlY = y + (current[4] as number);\n this.bezierCurveTo(\n x + (current[1] as number) + l, // x1\n y + (current[2] as number) + t, // y1\n controlX + l, // x2\n controlY + t, // y2\n tempX + l,\n tempY + t\n );\n x = tempX;\n y = tempY;\n break;\n\n case 'C': // bezierCurveTo, absolute\n x = current[5] as number;\n y = current[6] as number;\n controlX = current[3] as number;\n controlY = current[4] as number;\n this.bezierCurveTo(\n (current[1] as number) + l,\n (current[2] as number) + t,\n controlX + l,\n controlY + t,\n x + l,\n y + t\n );\n break;\n\n case 's': // shorthand cubic bezierCurveTo, relative\n // transform to absolute x,y\n tempX = x + (current[3] as number);\n tempY = y + (current[4] as number);\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n this.bezierCurveTo(\n controlX + l,\n controlY + t,\n x + (current[1] as number) + l,\n y + (current[2] as number) + t,\n tempX + l,\n tempY + t\n );\n\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = x + (current[1] as number);\n controlY = y + (current[2] as number);\n\n x = tempX;\n y = tempY;\n break;\n\n case 'S': // shorthand cubic bezierCurveTo, absolute\n tempX = current[3] as number;\n tempY = current[4] as number;\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n this.bezierCurveTo(\n controlX + l,\n controlY + t,\n (current[1] as number) + l,\n (current[2] as number) + t,\n tempX + l,\n tempY + t\n );\n x = tempX;\n y = tempY;\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = current[1] as number;\n controlY = current[2] as number;\n\n break;\n\n case 'q': // quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + (current[3] as number);\n tempY = y + (current[4] as number);\n\n controlX = x + (current[1] as number);\n controlY = y + (current[2] as number);\n\n this.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n\n case 'Q': // quadraticCurveTo, absolute\n tempX = current[3] as number;\n tempY = current[4] as number;\n\n this.quadraticCurveTo((current[1] as number) + l, (current[2] as number) + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = current[1] as number;\n controlY = current[2] as number;\n break;\n\n case 't': // shorthand quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + (current[1] as number);\n tempY = y + (current[2] as number);\n\n if ((previous![0] as string).match(/[QqTt]/) === null) {\n // If there is no previous command or if the previous command was not a Q, q, T or t,\n // assume the control point is coincident with the current point\n controlX = x;\n controlY = y;\n } else if (previous![0] === 't') {\n // calculate reflection of previous control points for t\n controlX = 2 * x - (tempControlX as number);\n controlY = 2 * y - (tempControlY as number);\n } else if (previous![0] === 'q') {\n // calculate reflection of previous control points for q\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n }\n\n tempControlX = controlX;\n tempControlY = controlY;\n\n this.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = x + (current[1] as number);\n controlY = y + (current[2] as number);\n break;\n\n case 'T':\n tempX = current[1] as number;\n tempY = current[2] as number;\n\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n this.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n\n case 'a':\n drawArc(this, x + l, y + t, [\n current[1] as number,\n current[2] as number,\n current[3] as number,\n current[4] as number,\n current[5] as number,\n (current[6] as number) + x + l,\n (current[7] as number) + y + t\n ]);\n x += current[6] as number;\n y += current[7] as number;\n break;\n\n case 'A':\n drawArc(this, x + l, y + t, [\n current[1] as number,\n current[2] as number,\n current[3] as number,\n current[4] as number,\n current[5] as number,\n (current[6] as number) + l,\n (current[7] as number) + t\n ]);\n x = current[6] as number;\n y = current[7] as number;\n break;\n\n case 'z':\n case 'Z':\n this.closePath();\n break;\n }\n previous = current;\n }\n }\n\n protected _runCommandList(commandList: CommandType[], l: number = 0, t: number = 0, sX: number = 1, sY: number = 1) {\n if (l === 0 && t === 0 && sX === 1 && sY === 1) {\n this.commandList = commandList.map(entry => entry.slice() as CommandType);\n return;\n }\n\n for (let i = 0, len = commandList.length; i < len; ++i) {\n const current = commandList[i].slice() as CommandType;\n\n switch (\n current[0] // first letter\n ) {\n case enumCommandMap.L:\n this.lineToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.M:\n this.moveToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.C:\n this.bezierCurveToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.Q:\n this.quadraticCurveToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.A:\n this.arcToTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.E:\n this.ellipseTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.R:\n this.rectTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.AT:\n this.arcToTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.Z:\n this.closePath();\n break;\n }\n }\n }\n private _updateBounds() {\n this.bounds.clear();\n renderCommandList(this.commandList, this._boundsContext as unknown as ICustomPath2D);\n }\n\n release(): void {\n this.commandList = [];\n this._boundsContext = null;\n this._ctx = null;\n }\n\n getLength(): number {\n if (this.direction === Direction.COLUMN) {\n if (!this.curves.length) {\n return 0;\n }\n const sc = this.curves[0];\n const ec = this.curves[this.curves.length - 1];\n return abs(sc.p0.y - ec.p1.y);\n } else if (this.direction === Direction.ROW) {\n if (!this.curves.length) {\n return 0;\n }\n const sc = this.curves[0];\n const ec = this.curves[this.curves.length - 1];\n return abs(sc.p0.x - ec.p1.x);\n }\n return this.curves.reduce((l, c) => l + c.getLength(), 0);\n }\n\n getAttrAt(distance: number): { pos: IPointLike; angle: number } {\n if (!this.curves) {\n return { pos: { x: 0, y: 0 }, angle: 0 };\n }\n let _dis = 0;\n let curve: ICurve<IPoint>;\n for (let i = 0; i < this.curves.length; i++) {\n curve = this.curves[i];\n const cl = curve.getLength(this.direction);\n if (_dis + cl >= distance) {\n break;\n } else {\n _dis += cl;\n }\n }\n const t = (distance - _dis) / curve.getLength(this.direction);\n const pos = curve.getPointAt(t);\n const angle = curve.getAngleAt(t);\n return { pos, angle };\n }\n}\n\nconst temp = ['l', 0, 0, 0, 0, 0, 0, 0];\n\nfunction scale(current: CommandStrType, sX: number, sY: number) {\n const c = (temp[0] = current[0]);\n if (c === 'a' || c === 'A') {\n temp[1] = sX * (current[1] as number);\n temp[2] = sY * (current[2] as number);\n temp[3] = current[3] as number;\n temp[4] = current[4] as number;\n temp[5] = current[5] as number;\n temp[6] = sX * (current[6] as number);\n temp[7] = sY * (current[7] as number);\n } else if (c === 'h' || c === 'H') {\n temp[1] = sX * (current[1] as number);\n } else if (c === 'v' || c === 'V') {\n temp[1] = sY * (current[1] as number);\n } else {\n for (let i = 1, n = current.length; i < n; ++i) {\n temp[i] = (i % 2 === 1 ? sX : sY) * (current[i] as number);\n }\n }\n return temp;\n}\n"]}
1
+ {"version":3,"sources":["../src/common/custom-path2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1D,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,SAAS,EA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EAAE,CAAC,GAAI,OAAO,CAAC,CAAC,CAAY,CAAC;SAC5D;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC","file":"custom-path2d.js","sourcesContent":["import { BoundsContext } from './bounds-context';\nimport type { CommandStrType, CommandType, ICurve, ICustomPath2D, IDirection, ILine, IPath2D } from '../interface';\nimport { CurvePath } from './segment/curve/path';\nimport { enumCommandMap, parseSvgPath } from './path-svg';\nimport type { IPoint, IPointLike } from '@visactor/vutils';\nimport { abs } from '@visactor/vutils';\nimport { Direction } from './enums';\nimport { drawArc, addArcToBezierPath } from './shape/arc';\nimport { renderCommandList } from './render-command-list';\nimport { calcLineCache } from './segment';\n\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// 基于d3-shape重构\n// https://github.com/vega/vega/blob/master/packages/vega-scenegraph/src/path/render.js\n\nexport class CustomPath2D extends CurvePath implements ICustomPath2D {\n commandList: CommandType[] = [];\n _boundsContext: IPath2D;\n _ctx?: IPath2D;\n direction?: IDirection;\n protected transformCbList?: ((cmd: CommandType, x: number, y: number, sx: number, sy: number) => void)[];\n protected toStringCbList?: ((cmd: CommandType) => string)[];\n\n constructor(ctx?: IPath2D) {\n super();\n if (ctx) {\n this._ctx = ctx;\n }\n this._boundsContext = new BoundsContext(this.bounds);\n }\n\n setCtx(ctx?: IPath2D) {\n this._ctx = ctx;\n }\n\n moveTo(x: number, y: number) {\n this.commandList.push([enumCommandMap.M, x, y]);\n this._ctx && this._ctx.moveTo(x, y);\n return this;\n }\n lineTo(x: number, y: number) {\n this.commandList.push([enumCommandMap.L, x, y]);\n this._ctx && this._ctx.lineTo(x, y);\n return this;\n }\n quadraticCurveTo(aCPx: number, aCPy: number, aX: number, aY: number) {\n this.commandList.push([enumCommandMap.Q, aCPx, aCPy, aX, aY]);\n this._ctx && this._ctx.quadraticCurveTo(aCPx, aCPy, aX, aY);\n return this;\n }\n bezierCurveTo(aCP1x: number, aCP1y: number, aCP2x: number, aCP2y: number, aX: number, aY: number) {\n this.commandList.push([enumCommandMap.C, aCP1x, aCP1y, aCP2x, aCP2y, aX, aY]);\n this._ctx && this._ctx.bezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY);\n return this;\n }\n arcTo(aX1: number, aY1: number, aX2: number, aY2: number, aRadius: number) {\n this.commandList.push([enumCommandMap.AT, aX1, aY1, aX2, aY2, aRadius]);\n this._ctx && this._ctx.arcTo(aX1, aY1, aX2, aY2, aRadius);\n return this;\n }\n ellipse(\n aX: number,\n aY: number,\n xRadius: number,\n yRadius: number,\n aRotation: number,\n aStartAngle: number,\n aEndAngle: number,\n aClockwise: boolean\n ) {\n this.commandList.push([enumCommandMap.E, aX, aY, xRadius, yRadius, aRotation, aStartAngle, aEndAngle, aClockwise]);\n this._ctx && this._ctx.ellipse(aX, aY, xRadius, yRadius, aRotation, aStartAngle, aEndAngle, aClockwise);\n return this;\n }\n rect(x: number, y: number, w: number, h: number) {\n this.commandList.push([enumCommandMap.R, x, y, w, h]);\n this._ctx && this._ctx.rect(x, y, w, h);\n return this;\n }\n arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean) {\n this.commandList.push([enumCommandMap.A, x, y, radius, startAngle, endAngle, counterclockwise]);\n this._ctx && this._ctx.arc(x, y, radius, startAngle, endAngle, counterclockwise);\n return this;\n }\n closePath() {\n this.commandList.push([enumCommandMap.Z]);\n this._ctx && this._ctx.closePath();\n return this;\n }\n\n addCurve(curve: ICurve<IPoint>) {\n this.curves.push(curve);\n // todo parse curve\n }\n clear() {\n this.transformCbList = null;\n this.commandList.length = 0;\n this.curves.length = 0;\n }\n\n beginPath() {\n this.clear();\n }\n\n toString(): string {\n if (!this.toStringCbList) {\n const list: ((cmd: CommandType) => string)[] = [];\n list[enumCommandMap.M] = (cmd: CommandType) => `M${cmd[1]} ${cmd[2]}`;\n list[enumCommandMap.L] = (cmd: CommandType) => `L${cmd[1]} ${cmd[2]}`;\n list[enumCommandMap.Q] = (cmd: CommandType) => `Q${cmd[1]} ${cmd[2]} ${cmd[3]} ${cmd[4]}`;\n list[enumCommandMap.C] = (cmd: CommandType) => `C${cmd[1]} ${cmd[2]} ${cmd[3]} ${cmd[4]} ${cmd[5]} ${cmd[6]}`;\n list[enumCommandMap.A] = (cmd: CommandType) => {\n const bezierPathList: number[] = [];\n addArcToBezierPath(\n bezierPathList,\n cmd[4] as number,\n cmd[5] as number,\n cmd[1] as number,\n cmd[2] as number,\n cmd[3] as number,\n cmd[3] as number\n );\n let path = '';\n for (let i = 0; i < bezierPathList.length; i += 6) {\n path += `C${bezierPathList[i]} ${bezierPathList[i + 1]} ${bezierPathList[i + 2]} ${bezierPathList[i + 3]} ${\n bezierPathList[i + 4]\n } ${bezierPathList[i + 5]}`;\n }\n return path;\n };\n // list[enumCommandMap.AT] = this.arcToTransform;\n // list[enumCommandMap.E] = this.ellipseTransform;\n list[enumCommandMap.R] = (cmd: CommandType) => `M${cmd[1]} ${cmd[2]} h${cmd[3]} v${cmd[4]} H${cmd[1]}Z`;\n // list[enumCommandMap.A] = this.arcTransform;\n list[enumCommandMap.Z] = (cmd: CommandType) => `Z`;\n this.toStringCbList = list;\n }\n\n const list = this.toStringCbList;\n let path = '';\n this.commandList.forEach(c => {\n path += list[c[0]](c);\n });\n return path;\n }\n\n fromString(str: string, x?: number, y?: number, sX?: number, sY?: number) {\n this.clear();\n\n // 解析path字符串\n const commandStrList = parseSvgPath(str) as CommandStrType[]; // TODO: 目前正则性能较差,后续需要加上回调函数供用户直接操作绘图命令\n this._runCommandStrList(commandStrList, x, y, sX, sY);\n\n // 更新bounds\n this._updateBounds();\n return this;\n }\n fromLine(line: ILine) {\n const { points, curveType, clipRangeByDimension } = line.attribute;\n if (!points) {\n return;\n }\n const cache = calcLineCache(points, curveType);\n if (clipRangeByDimension === 'x') {\n this.direction = Direction.ROW;\n } else if (clipRangeByDimension === 'y') {\n this.direction = Direction.COLUMN;\n } else if (clipRangeByDimension === 'auto') {\n this.direction = cache.direction;\n }\n this.curves = cache.curves;\n }\n fromCustomPath2D(path: ICustomPath2D, x?: number, y?: number, sX?: number, sY?: number) {\n this.clear();\n this._runCommandList(path.commandList as CommandType[], x, y, sX, sY);\n\n // 更新bounds\n this._updateBounds();\n return this;\n }\n transform(x: number, y: number, sx: number, sy: number) {\n const commandList = this.commandList;\n if (!this.transformCbList) {\n const list: ((cmd: CommandType, x: number, y: number, sx: number, sy: number) => void)[] = [];\n list[enumCommandMap.M] = this.moveToTransform;\n list[enumCommandMap.L] = this.lineToTransform;\n list[enumCommandMap.Q] = this.quadraticCurveToTransform;\n list[enumCommandMap.C] = this.bezierCurveToTransform;\n list[enumCommandMap.AT] = this.arcToTransform;\n list[enumCommandMap.E] = this.ellipseTransform;\n list[enumCommandMap.R] = this.rectTransform;\n list[enumCommandMap.A] = this.arcTransform;\n list[enumCommandMap.Z] = this.closePathTransform;\n this.transformCbList = list;\n }\n commandList.forEach(cmd => {\n this.transformCbList[cmd[0]](cmd, x, y, sx, sy);\n });\n this._updateBounds();\n }\n\n protected moveToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n }\n protected lineToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n }\n protected quadraticCurveToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx + x;\n cmd[4] = (cmd[4] as number) * sy + y;\n }\n protected bezierCurveToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx + x;\n cmd[4] = (cmd[4] as number) * sy + y;\n cmd[5] = (cmd[5] as number) * sx + x;\n cmd[6] = (cmd[6] as number) * sy + y;\n }\n arcToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx + x;\n cmd[4] = (cmd[4] as number) * sy + y;\n cmd[5] = ((cmd[5] as number) * (sx + sy)) / 2;\n }\n ellipseTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx;\n cmd[4] = (cmd[4] as number) * sy;\n }\n rectTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx;\n cmd[4] = (cmd[4] as number) * sy;\n }\n arcTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = ((cmd[3] as number) * (sx + sy)) / 2;\n }\n closePathTransform() {\n return;\n }\n protected _runCommandStrList(\n commandStrList: CommandStrType[],\n l: number = 0,\n t: number = 0,\n sX: number = 1,\n sY: number = 1\n ) {\n let current; // current instruction\n let previous = null;\n let x = 0; // current x\n let y = 0; // current y\n // let sX = 0;\n // let sY = 0;\n let controlX = 0; // current control point x\n let controlY = 0; // current control point y\n let tempX;\n let tempY;\n let tempControlX;\n let tempControlY;\n\n // if (isNil(l)) l = 0;\n // if (isNil(t)) t = 0;\n // if (isNil(sX)) sX = 1;\n // if (isNil(sY)) sY = sX;\n\n for (let i = 0, len = commandStrList.length; i < len; ++i) {\n current = commandStrList[i];\n if (sX !== 1 || sY !== 1) {\n current = scale(current, sX, sY);\n }\n\n switch (\n current[0] // first letter\n ) {\n case 'l': // lineto, relative\n x += current[1] as number;\n y += current[2] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'L': // lineto, absolute\n x = current[1] as number;\n y = current[2] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'h': // horizontal lineto, relative\n x += current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'H': // horizontal lineto, absolute\n x = current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'v': // vertical lineto, relative\n y += current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'V': // verical lineto, absolute\n y = current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'm': // moveTo, relative\n x += current[1] as number;\n y += current[2] as number;\n this.moveTo(x + l, y + t);\n break;\n\n case 'M': // moveTo, absolute\n x = current[1] as number;\n y = current[2] as number;\n this.moveTo(x + l, y + t);\n break;\n\n case 'c': // bezierCurveTo, relative\n tempX = x + (current[5] as number);\n tempY = y + (current[6] as number);\n controlX = x + (current[3] as number);\n controlY = y + (current[4] as number);\n this.bezierCurveTo(\n x + (current[1] as number) + l, // x1\n y + (current[2] as number) + t, // y1\n controlX + l, // x2\n controlY + t, // y2\n tempX + l,\n tempY + t\n );\n x = tempX;\n y = tempY;\n break;\n\n case 'C': // bezierCurveTo, absolute\n x = current[5] as number;\n y = current[6] as number;\n controlX = current[3] as number;\n controlY = current[4] as number;\n this.bezierCurveTo(\n (current[1] as number) + l,\n (current[2] as number) + t,\n controlX + l,\n controlY + t,\n x + l,\n y + t\n );\n break;\n\n case 's': // shorthand cubic bezierCurveTo, relative\n // transform to absolute x,y\n tempX = x + (current[3] as number);\n tempY = y + (current[4] as number);\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n this.bezierCurveTo(\n controlX + l,\n controlY + t,\n x + (current[1] as number) + l,\n y + (current[2] as number) + t,\n tempX + l,\n tempY + t\n );\n\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = x + (current[1] as number);\n controlY = y + (current[2] as number);\n\n x = tempX;\n y = tempY;\n break;\n\n case 'S': // shorthand cubic bezierCurveTo, absolute\n tempX = current[3] as number;\n tempY = current[4] as number;\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n this.bezierCurveTo(\n controlX + l,\n controlY + t,\n (current[1] as number) + l,\n (current[2] as number) + t,\n tempX + l,\n tempY + t\n );\n x = tempX;\n y = tempY;\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = current[1] as number;\n controlY = current[2] as number;\n\n break;\n\n case 'q': // quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + (current[3] as number);\n tempY = y + (current[4] as number);\n\n controlX = x + (current[1] as number);\n controlY = y + (current[2] as number);\n\n this.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n\n case 'Q': // quadraticCurveTo, absolute\n tempX = current[3] as number;\n tempY = current[4] as number;\n\n this.quadraticCurveTo((current[1] as number) + l, (current[2] as number) + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = current[1] as number;\n controlY = current[2] as number;\n break;\n\n case 't': // shorthand quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + (current[1] as number);\n tempY = y + (current[2] as number);\n\n if ((previous![0] as string).match(/[QqTt]/) === null) {\n // If there is no previous command or if the previous command was not a Q, q, T or t,\n // assume the control point is coincident with the current point\n controlX = x;\n controlY = y;\n } else if (previous![0] === 't') {\n // calculate reflection of previous control points for t\n controlX = 2 * x - (tempControlX as number);\n controlY = 2 * y - (tempControlY as number);\n } else if (previous![0] === 'q') {\n // calculate reflection of previous control points for q\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n }\n\n tempControlX = controlX;\n tempControlY = controlY;\n\n this.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = x + (current[1] as number);\n controlY = y + (current[2] as number);\n break;\n\n case 'T':\n tempX = current[1] as number;\n tempY = current[2] as number;\n\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n this.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n\n case 'a':\n drawArc(this, x + l, y + t, [\n current[1] as number,\n current[2] as number,\n current[3] as number,\n current[4] as number,\n current[5] as number,\n (current[6] as number) + x + l,\n (current[7] as number) + y + t\n ]);\n x += current[6] as number;\n y += current[7] as number;\n break;\n\n case 'A':\n drawArc(this, x + l, y + t, [\n current[1] as number,\n current[2] as number,\n current[3] as number,\n current[4] as number,\n current[5] as number,\n (current[6] as number) + l,\n (current[7] as number) + t\n ]);\n x = current[6] as number;\n y = current[7] as number;\n break;\n\n case 'z':\n case 'Z':\n this.closePath();\n break;\n }\n previous = current;\n }\n }\n\n protected _runCommandList(commandList: CommandType[], l: number = 0, t: number = 0, sX: number = 1, sY: number = 1) {\n if (l === 0 && t === 0 && sX === 1 && sY === 1) {\n this.commandList = commandList.map(entry => entry.slice() as CommandType);\n return;\n }\n\n for (let i = 0, len = commandList.length; i < len; ++i) {\n const current = commandList[i].slice() as CommandType;\n\n switch (\n current[0] // first letter\n ) {\n case enumCommandMap.L:\n this.lineToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.M:\n this.moveToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.C:\n this.bezierCurveToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.Q:\n this.quadraticCurveToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.A:\n this.arcToTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.E:\n this.ellipseTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.R:\n this.rectTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.AT:\n this.arcToTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.Z:\n this.closePath();\n break;\n }\n }\n }\n private _updateBounds() {\n this.bounds.clear();\n renderCommandList(this.commandList, this._boundsContext as unknown as ICustomPath2D);\n }\n\n release(): void {\n this.commandList = [];\n this._boundsContext = null;\n this._ctx = null;\n }\n\n getLength(): number {\n if (this.direction === Direction.COLUMN) {\n if (!this.curves.length) {\n return 0;\n }\n const sc = this.curves[0];\n const ec = this.curves[this.curves.length - 1];\n return abs(sc.p0.y - ec.p1.y);\n } else if (this.direction === Direction.ROW) {\n if (!this.curves.length) {\n return 0;\n }\n const sc = this.curves[0];\n const ec = this.curves[this.curves.length - 1];\n return abs(sc.p0.x - ec.p1.x);\n }\n return this.curves.reduce((l, c) => l + c.getLength(), 0);\n }\n\n getAttrAt(distance: number): { pos: IPointLike; angle: number } {\n if (!this.curves) {\n return { pos: { x: 0, y: 0 }, angle: 0 };\n }\n let _dis = 0;\n let curve: ICurve<IPoint>;\n for (let i = 0; i < this.curves.length; i++) {\n curve = this.curves[i];\n const cl = curve.getLength(this.direction);\n if (_dis + cl >= distance) {\n break;\n } else {\n _dis += cl;\n }\n }\n const t = (distance - _dis) / curve.getLength(this.direction);\n const pos = curve.getPointAt(t);\n const angle = curve.getAngleAt(t);\n return { pos, angle };\n }\n}\n\nconst temp = ['l', 0, 0, 0, 0, 0, 0, 0];\n\nfunction scale(current: CommandStrType, sX: number, sY: number) {\n const c = (temp[0] = current[0]);\n if (c === 'a' || c === 'A') {\n temp[1] = sX * (current[1] as number);\n temp[2] = sY * (current[2] as number);\n temp[3] = current[3] as number;\n temp[4] = current[4] as number;\n temp[5] = current[5] as number;\n temp[6] = sX * (current[6] as number);\n temp[7] = sY * (current[7] as number);\n } else if (c === 'h' || c === 'H') {\n temp[1] = sX * (current[1] as number);\n } else if (c === 'v' || c === 'V') {\n temp[1] = sY * (current[1] as number);\n } else {\n for (let i = 1, n = current.length; i < n; ++i) {\n temp[i] = (i % 2 === 1 ? sX : sY) * (current[i] as number);\n }\n }\n return temp;\n}\n"]}
package/es/graphic/arc.js CHANGED
@@ -26,8 +26,9 @@ export class Arc extends Graphic {
26
26
  return this._validNumber(startAngle) && this._validNumber(endAngle) && this._validNumber(outerRadius) && this._validNumber(innerRadius);
27
27
  }
28
28
  getParsedCornerRadius() {
29
- const arcTheme = getTheme(this).arc, {cornerRadius: cornerRadius = arcTheme.cornerRadius, outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius} = this.attribute;
30
- if (0 === cornerRadius || "0%" === cornerRadius) return 0;
29
+ const arcTheme = getTheme(this).arc, {cornerRadius: cornerRadius = arcTheme.cornerRadius, innerPadding: innerPadding = arcTheme.innerPadding, outerPadding: outerPadding = arcTheme.outerPadding} = this.attribute;
30
+ let {outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius} = this.attribute;
31
+ if (outerRadius += outerPadding, innerRadius -= innerPadding, 0 === cornerRadius || "0%" === cornerRadius) return 0;
31
32
  const deltaRadius = Math.abs(outerRadius - innerRadius);
32
33
  return Math.min(isNumber(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
33
34
  }
@@ -39,7 +40,10 @@ export class Arc extends Graphic {
39
40
  cap && abs(deltaAngle) < pi2 - epsilon) {
40
41
  let startCap = 1, endCap = 1;
41
42
  cap.length && (startCap = Number(cap[0]), endCap = Number(cap[1]));
42
- const {outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius} = this.attribute, capWidth = Math.abs(outerRadius - innerRadius) / 2, capAngle = capWidth / outerRadius;
43
+ let {outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius} = this.attribute;
44
+ const {outerPadding: outerPadding = arcTheme.outerPadding, innerPadding: innerPadding = arcTheme.innerPadding} = this.attribute;
45
+ outerRadius += outerPadding, innerRadius -= innerPadding;
46
+ const capWidth = Math.abs(outerRadius - innerRadius) / 2, capAngle = capWidth / outerRadius;
43
47
  if (capWidth > epsilon && outerRadius > epsilon) return {
44
48
  startAngle: startAngle - sign * capAngle * startCap,
45
49
  endAngle: endAngle + sign * capAngle * endCap,
@@ -53,7 +57,10 @@ export class Arc extends Graphic {
53
57
  };
54
58
  }
55
59
  getParsePadAngle(startAngle, endAngle) {
56
- const arcTheme = getTheme(this).arc, {outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius, padAngle: padAngle = arcTheme.padAngle} = this.attribute, {padRadius: padRadius = sqrt(outerRadius * outerRadius + innerRadius * innerRadius)} = this.attribute, deltaAngle = abs(endAngle - startAngle);
60
+ const arcTheme = getTheme(this).arc, {innerPadding: innerPadding = arcTheme.innerPadding, outerPadding: outerPadding = arcTheme.outerPadding, padAngle: padAngle = arcTheme.padAngle} = this.attribute;
61
+ let {outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius} = this.attribute;
62
+ outerRadius += outerPadding, innerRadius -= innerPadding;
63
+ const {padRadius: padRadius = sqrt(outerRadius * outerRadius + innerRadius * innerRadius)} = this.attribute, deltaAngle = abs(endAngle - startAngle);
57
64
  let outerStartAngle = startAngle, outerEndAngle = endAngle, innerStartAngle = startAngle, innerEndAngle = endAngle;
58
65
  const halfPadAngle = padAngle / 2;
59
66
  let innerDeltaAngle = deltaAngle, outerDeltaAngle = deltaAngle;
@@ -102,7 +109,7 @@ export class Arc extends Graphic {
102
109
  }
103
110
  toCustomPath() {
104
111
  const attribute = this.attribute, {startAngle: startAngle, endAngle: endAngle} = this.getParsedAngle();
105
- let innerRadius = attribute.innerRadius, outerRadius = attribute.outerRadius;
112
+ let innerRadius = attribute.innerRadius - (attribute.innerPadding || 0), outerRadius = attribute.outerRadius - (attribute.outerPadding || 0);
106
113
  const deltaAngle = abs(endAngle - startAngle), clockwise = endAngle > startAngle;
107
114
  if (outerRadius < innerRadius) {
108
115
  const temp = outerRadius;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/arc.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEzG,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAmB9C,MAAM,kBAAkB,GAAG;IACzB,aAAa;IACb,aAAa;IACb,YAAY;IACZ,UAAU;IACV,cAAc;IACd,UAAU;IACV,WAAW;IACX,KAAK;IACL,GAAG,sBAAsB;CAC1B,CAAC;AAMF,MAAM,OAAO,GAAI,SAAQ,OAA6B;IA8CpD,YAAY,MAA4B;QACtC,KAAK,CAAC,MAAM,CAAC,CAAC;QA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AI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;YAChC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC;YAC9D,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;YAChC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;YAC7D,IAAI,CAAC,SAAS,EAAE,CAAC;SAClB;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO,IAAI,GAAG,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IACxC,CAAC;IAED,oBAAoB;QAClB,OAAO,GAAG,CAAC,mBAAmB,CAAC;IACjC,CAAC;;AAhRM,uBAAmB,mBACxB,GAAG,EAAE,CAAC,IACH,mBAAmB,EACtB;AAgRJ,MAAM,UAAU,SAAS,CAAC,UAAgC;IACxD,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;AAC7B,CAAC","file":"arc.js","sourcesContent":["import type { AABBBounds, OBBBounds } from '@visactor/vutils';\nimport { pi2, sin, epsilon, abs, asin, clampAngleByRadian, isNumber, cos, sqrt } from '@visactor/vutils';\nimport type { IArc, IArcGraphicAttribute } from '../interface/graphic/arc';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { parsePadding } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport type { GraphicType } from '../interface';\nimport { ARC_NUMBER_TYPE } from './constants';\n\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\nconst ARC_UPDATE_TAG_KEY = [\n 'innerRadius',\n 'outerRadius',\n 'startAngle',\n 'endAngle',\n 'cornerRadius',\n 'padAngle',\n 'padRadius',\n 'cap',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\n/**\n * 圆形图元\n * 默认顺时针绘制\n */\nexport class Arc extends Graphic<IArcGraphicAttribute> implements IArc {\n type: GraphicType = 'arc';\n\n static NOWORK_ANIMATE_ATTR = {\n cap: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n // static parseCornerRadius(r: IArcGraphicAttribute['cornerRadius']) {\n // if (isArray(r)) {\n // if ((r as any[]).length === 1) {\n // const value = r[0];\n // return [value, value, value, value];\n // }\n\n // if ((r as any[]).length === 2) {\n // return [r[0], r[0], r[1], r[1]];\n // }\n\n // if ((r as any[]).length === 3) {\n // return [r[0], r[1], r[2], 0];\n // }\n\n // return (r as any[]).slice(0, 4);\n // }\n\n // return [r as string | number, r as string | number, r as string | number, r as string | number];\n // }\n\n // static isCornerRadiusEqual(oldR: IArcGraphicAttribute['cornerRadius'], newR: IArcGraphicAttribute['cornerRadius']) {\n // throw new Error('暂不支持');\n // if (oldR === newR) {\n // return true;\n // }\n\n // if (isArray(oldR) && !isArray(newR)) {\n // return (oldR as (string | number)[]).every(r => r === newR);\n // }\n\n // if (!isArray(oldR) && isArray(newR)) {\n // return (newR as (string | number)[]).every(r => r === oldR);\n // }\n\n // return arrayEqual(oldR as (string | number)[], newR as (string | number)[]);\n // }\n\n constructor(params: IArcGraphicAttribute) {\n super(params);\n this.numberType = ARC_NUMBER_TYPE;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { startAngle, endAngle, outerRadius, innerRadius } = this.attribute;\n return (\n this._validNumber(startAngle) &&\n this._validNumber(endAngle) &&\n this._validNumber(outerRadius) &&\n this._validNumber(innerRadius)\n );\n }\n\n getParsedCornerRadius() {\n const arcTheme = getTheme(this).arc;\n const {\n cornerRadius = arcTheme.cornerRadius,\n outerRadius = arcTheme.outerRadius,\n innerRadius = arcTheme.innerRadius\n } = this.attribute;\n if (cornerRadius === 0 || cornerRadius === '0%') {\n return 0;\n }\n const deltaRadius = Math.abs(outerRadius - innerRadius);\n return Math.min(\n isNumber(cornerRadius, true)\n ? (cornerRadius as number)\n : (deltaRadius * parseFloat(cornerRadius as string)) / 100,\n deltaRadius / 2\n );\n }\n\n getParsedAngle() {\n const arcTheme = getTheme(this).arc;\n let { startAngle = arcTheme.startAngle, endAngle = arcTheme.endAngle } = this.attribute;\n const { cap = arcTheme.cap } = this.attribute;\n\n const sign = endAngle - startAngle >= 0 ? 1 : -1;\n const deltaAngle = endAngle - startAngle;\n\n startAngle = clampAngleByRadian(startAngle);\n endAngle = startAngle + deltaAngle;\n\n if (cap && abs(deltaAngle) < pi2 - epsilon) {\n let startCap = 1;\n let endCap = 1;\n if ((cap as boolean[]).length) {\n startCap = Number(cap[0]);\n endCap = Number(cap[1]);\n }\n const { outerRadius = arcTheme.outerRadius, innerRadius = arcTheme.innerRadius } = this.attribute;\n const capWidth = Math.abs(outerRadius - innerRadius) / 2;\n // 以外边界长度为准\n const capAngle = capWidth / outerRadius;\n\n if (capWidth > epsilon && outerRadius > epsilon) {\n return {\n startAngle: startAngle - sign * capAngle * startCap,\n endAngle: endAngle + sign * capAngle * endCap,\n sc: sign * capAngle * startCap,\n ec: sign * capAngle * endCap\n };\n }\n }\n\n return {\n startAngle: startAngle,\n endAngle: endAngle\n };\n }\n\n // 参考 https://github.com/d3/d3-shape/blob/main/src/arc.js\n getParsePadAngle(startAngle: number, endAngle: number) {\n const arcTheme = getTheme(this).arc;\n const {\n outerRadius = arcTheme.outerRadius,\n innerRadius = arcTheme.innerRadius,\n padAngle = arcTheme.padAngle\n } = this.attribute;\n\n const { padRadius = sqrt(outerRadius * outerRadius + innerRadius * innerRadius) } = this.attribute;\n const deltaAngle = abs(endAngle - startAngle);\n\n // Or is it a circular or annular sector?\n let outerStartAngle = startAngle;\n let outerEndAngle = endAngle;\n let innerStartAngle = startAngle;\n let innerEndAngle = endAngle;\n const halfPadAngle = padAngle / 2;\n let innerDeltaAngle = deltaAngle;\n let outerDeltaAngle = deltaAngle;\n\n // Apply padding? Note that since r1 ≥ r0, outerDeltaAngle ≥ innerDeltaAngle.\n if (halfPadAngle > epsilon && padRadius > epsilon) {\n const sign = endAngle > startAngle ? 1 : -1;\n\n let p0 = asin((Number(padRadius) / innerRadius) * sin(halfPadAngle));\n let p1 = asin((Number(padRadius) / outerRadius) * sin(halfPadAngle));\n if ((innerDeltaAngle -= p0 * 2) > epsilon) {\n p0 *= sign;\n innerStartAngle += p0;\n innerEndAngle -= p0;\n } else {\n innerDeltaAngle = 0;\n innerStartAngle = innerEndAngle = (startAngle + endAngle) / 2;\n }\n if ((outerDeltaAngle -= p1 * 2) > epsilon) {\n p1 *= sign;\n outerStartAngle += p1;\n outerEndAngle -= p1;\n } else {\n outerDeltaAngle = 0;\n outerStartAngle = outerEndAngle = (startAngle + endAngle) / 2;\n }\n\n return {\n outerStartAngle,\n outerEndAngle,\n innerStartAngle,\n innerEndAngle,\n innerDeltaAngle,\n outerDeltaAngle\n };\n }\n\n return {\n outerStartAngle,\n outerEndAngle,\n innerStartAngle,\n innerEndAngle,\n innerDeltaAngle,\n outerDeltaAngle\n };\n }\n\n protected doUpdateAABBBounds(full?: boolean): AABBBounds {\n const arcTheme = getTheme(this).arc;\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = application.graphicService.updateArcAABBBounds(\n attribute,\n getTheme(this).arc,\n this._AABBBounds,\n full,\n this\n ) as AABBBounds;\n\n const { boundsPadding = arcTheme.boundsPadding } = attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n bounds.expand(paddingArray);\n }\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n protected tryUpdateOBBBounds(): OBBBounds {\n throw new Error('暂不支持');\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, ARC_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, ARC_UPDATE_TAG_KEY);\n }\n\n getDefaultAttribute(name: string) {\n const arcTheme = getTheme(this).arc;\n return arcTheme[name];\n }\n\n toCustomPath() {\n const x = 0;\n const y = 0;\n\n const attribute = this.attribute;\n const { startAngle, endAngle } = this.getParsedAngle();\n let innerRadius = attribute.innerRadius;\n let outerRadius = attribute.outerRadius;\n const deltaAngle = abs(endAngle - startAngle);\n const clockwise: boolean = endAngle > startAngle;\n\n if (outerRadius < innerRadius) {\n const temp = outerRadius;\n outerRadius = innerRadius;\n innerRadius = temp;\n }\n\n const path = new CustomPath2D();\n\n if (outerRadius <= epsilon) {\n path.moveTo(x, y);\n } else if (deltaAngle >= pi2 - epsilon) {\n // 是个完整的圆环\n // Or is it a circle or annulus?\n path.moveTo(x + outerRadius * cos(startAngle), y + outerRadius * sin(startAngle));\n path.arc(x, y, outerRadius, startAngle, endAngle, !clockwise);\n if (innerRadius > epsilon) {\n path.moveTo(x + innerRadius * cos(endAngle), y + innerRadius * sin(endAngle));\n path.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\n }\n } else {\n const xors = outerRadius * cos(startAngle);\n const yors = outerRadius * sin(startAngle);\n const xire = innerRadius * cos(endAngle);\n const yire = innerRadius * sin(endAngle);\n\n path.moveTo(x + xors, y + yors);\n path.arc(x, y, outerRadius, startAngle, endAngle, !clockwise);\n path.lineTo(x + xire, y + yire);\n path.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\n path.closePath();\n }\n\n return path;\n }\n\n clone() {\n return new Arc({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Arc.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createArc(attributes: IArcGraphicAttribute): IArc {\n return new Arc(attributes);\n}\n\n// addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY);\n"]}
1
+ {"version":3,"sources":["../src/graphic/arc.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEzG,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAmB9C,MAAM,kBAAkB,GAAG;IACzB,aAAa;IACb,aAAa;IACb,YAAY;IACZ,UAAU;IACV,cAAc;IACd,UAAU;IACV,WAAW;IACX,KAAK;IACL,GAAG,sBAAsB;CAC1B,CAAC;AAMF,MAAM,OAAO,GAAI,SAAQ,OAA6B;IA8CpD,YAAY,MAA4B;QACtC,KAAK,CAAC,MAAM,CAAC,CAAC;QA9ChB,SAAI,GAAgB,KAAK,CAAC;QA+CxB,IAAI,CAAC,UA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AAyRJ,MAAM,UAAU,SAAS,CAAC,UAAgC;IACxD,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;AAC7B,CAAC","file":"arc.js","sourcesContent":["import type { AABBBounds, OBBBounds } from '@visactor/vutils';\nimport { pi2, sin, epsilon, abs, asin, clampAngleByRadian, isNumber, cos, sqrt } from '@visactor/vutils';\nimport type { IArc, IArcGraphicAttribute } from '../interface/graphic/arc';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { parsePadding } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport type { GraphicType } from '../interface';\nimport { ARC_NUMBER_TYPE } from './constants';\n\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\nconst ARC_UPDATE_TAG_KEY = [\n 'innerRadius',\n 'outerRadius',\n 'startAngle',\n 'endAngle',\n 'cornerRadius',\n 'padAngle',\n 'padRadius',\n 'cap',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\n/**\n * 圆形图元\n * 默认顺时针绘制\n */\nexport class Arc extends Graphic<IArcGraphicAttribute> implements IArc {\n type: GraphicType = 'arc';\n\n static NOWORK_ANIMATE_ATTR = {\n cap: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n // static parseCornerRadius(r: IArcGraphicAttribute['cornerRadius']) {\n // if (isArray(r)) {\n // if ((r as any[]).length === 1) {\n // const value = r[0];\n // return [value, value, value, value];\n // }\n\n // if ((r as any[]).length === 2) {\n // return [r[0], r[0], r[1], r[1]];\n // }\n\n // if ((r as any[]).length === 3) {\n // return [r[0], r[1], r[2], 0];\n // }\n\n // return (r as any[]).slice(0, 4);\n // }\n\n // return [r as string | number, r as string | number, r as string | number, r as string | number];\n // }\n\n // static isCornerRadiusEqual(oldR: IArcGraphicAttribute['cornerRadius'], newR: IArcGraphicAttribute['cornerRadius']) {\n // throw new Error('暂不支持');\n // if (oldR === newR) {\n // return true;\n // }\n\n // if (isArray(oldR) && !isArray(newR)) {\n // return (oldR as (string | number)[]).every(r => r === newR);\n // }\n\n // if (!isArray(oldR) && isArray(newR)) {\n // return (newR as (string | number)[]).every(r => r === oldR);\n // }\n\n // return arrayEqual(oldR as (string | number)[], newR as (string | number)[]);\n // }\n\n constructor(params: IArcGraphicAttribute) {\n super(params);\n this.numberType = ARC_NUMBER_TYPE;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { startAngle, endAngle, outerRadius, innerRadius } = this.attribute;\n return (\n this._validNumber(startAngle) &&\n this._validNumber(endAngle) &&\n this._validNumber(outerRadius) &&\n this._validNumber(innerRadius)\n );\n }\n\n getParsedCornerRadius() {\n const arcTheme = getTheme(this).arc;\n const {\n cornerRadius = arcTheme.cornerRadius,\n innerPadding = arcTheme.innerPadding,\n outerPadding = arcTheme.outerPadding\n } = this.attribute;\n let { outerRadius = arcTheme.outerRadius, innerRadius = arcTheme.innerRadius } = this.attribute;\n outerRadius += outerPadding;\n innerRadius -= innerPadding;\n if (cornerRadius === 0 || cornerRadius === '0%') {\n return 0;\n }\n const deltaRadius = Math.abs(outerRadius - innerRadius);\n return Math.min(\n isNumber(cornerRadius, true)\n ? (cornerRadius as number)\n : (deltaRadius * parseFloat(cornerRadius as string)) / 100,\n deltaRadius / 2\n );\n }\n\n getParsedAngle() {\n const arcTheme = getTheme(this).arc;\n let { startAngle = arcTheme.startAngle, endAngle = arcTheme.endAngle } = this.attribute;\n const { cap = arcTheme.cap } = this.attribute;\n\n const sign = endAngle - startAngle >= 0 ? 1 : -1;\n const deltaAngle = endAngle - startAngle;\n\n startAngle = clampAngleByRadian(startAngle);\n endAngle = startAngle + deltaAngle;\n\n if (cap && abs(deltaAngle) < pi2 - epsilon) {\n let startCap = 1;\n let endCap = 1;\n if ((cap as boolean[]).length) {\n startCap = Number(cap[0]);\n endCap = Number(cap[1]);\n }\n let { outerRadius = arcTheme.outerRadius, innerRadius = arcTheme.innerRadius } = this.attribute;\n const { outerPadding = arcTheme.outerPadding, innerPadding = arcTheme.innerPadding } = this.attribute;\n outerRadius += outerPadding;\n innerRadius -= innerPadding;\n const capWidth = Math.abs(outerRadius - innerRadius) / 2;\n // 以外边界长度为准\n const capAngle = capWidth / outerRadius;\n\n if (capWidth > epsilon && outerRadius > epsilon) {\n return {\n startAngle: startAngle - sign * capAngle * startCap,\n endAngle: endAngle + sign * capAngle * endCap,\n sc: sign * capAngle * startCap,\n ec: sign * capAngle * endCap\n };\n }\n }\n\n return {\n startAngle: startAngle,\n endAngle: endAngle\n };\n }\n\n // 参考 https://github.com/d3/d3-shape/blob/main/src/arc.js\n getParsePadAngle(startAngle: number, endAngle: number) {\n const arcTheme = getTheme(this).arc;\n const {\n innerPadding = arcTheme.innerPadding,\n outerPadding = arcTheme.outerPadding,\n padAngle = arcTheme.padAngle\n } = this.attribute;\n let { outerRadius = arcTheme.outerRadius, innerRadius = arcTheme.innerRadius } = this.attribute;\n outerRadius += outerPadding;\n innerRadius -= innerPadding;\n\n const { padRadius = sqrt(outerRadius * outerRadius + innerRadius * innerRadius) } = this.attribute;\n const deltaAngle = abs(endAngle - startAngle);\n\n // Or is it a circular or annular sector?\n let outerStartAngle = startAngle;\n let outerEndAngle = endAngle;\n let innerStartAngle = startAngle;\n let innerEndAngle = endAngle;\n const halfPadAngle = padAngle / 2;\n let innerDeltaAngle = deltaAngle;\n let outerDeltaAngle = deltaAngle;\n\n // Apply padding? Note that since r1 ≥ r0, outerDeltaAngle ≥ innerDeltaAngle.\n if (halfPadAngle > epsilon && padRadius > epsilon) {\n const sign = endAngle > startAngle ? 1 : -1;\n\n let p0 = asin((Number(padRadius) / innerRadius) * sin(halfPadAngle));\n let p1 = asin((Number(padRadius) / outerRadius) * sin(halfPadAngle));\n if ((innerDeltaAngle -= p0 * 2) > epsilon) {\n p0 *= sign;\n innerStartAngle += p0;\n innerEndAngle -= p0;\n } else {\n innerDeltaAngle = 0;\n innerStartAngle = innerEndAngle = (startAngle + endAngle) / 2;\n }\n if ((outerDeltaAngle -= p1 * 2) > epsilon) {\n p1 *= sign;\n outerStartAngle += p1;\n outerEndAngle -= p1;\n } else {\n outerDeltaAngle = 0;\n outerStartAngle = outerEndAngle = (startAngle + endAngle) / 2;\n }\n\n return {\n outerStartAngle,\n outerEndAngle,\n innerStartAngle,\n innerEndAngle,\n innerDeltaAngle,\n outerDeltaAngle\n };\n }\n\n return {\n outerStartAngle,\n outerEndAngle,\n innerStartAngle,\n innerEndAngle,\n innerDeltaAngle,\n outerDeltaAngle\n };\n }\n\n protected doUpdateAABBBounds(full?: boolean): AABBBounds {\n const arcTheme = getTheme(this).arc;\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = application.graphicService.updateArcAABBBounds(\n attribute,\n getTheme(this).arc,\n this._AABBBounds,\n full,\n this\n ) as AABBBounds;\n\n const { boundsPadding = arcTheme.boundsPadding } = attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n bounds.expand(paddingArray);\n }\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n protected tryUpdateOBBBounds(): OBBBounds {\n throw new Error('暂不支持');\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, ARC_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, ARC_UPDATE_TAG_KEY);\n }\n\n getDefaultAttribute(name: string) {\n const arcTheme = getTheme(this).arc;\n return arcTheme[name];\n }\n\n toCustomPath() {\n const x = 0;\n const y = 0;\n\n const attribute = this.attribute;\n const { startAngle, endAngle } = this.getParsedAngle();\n let innerRadius = attribute.innerRadius - (attribute.innerPadding || 0);\n let outerRadius = attribute.outerRadius - (attribute.outerPadding || 0);\n const deltaAngle = abs(endAngle - startAngle);\n const clockwise: boolean = endAngle > startAngle;\n\n if (outerRadius < innerRadius) {\n const temp = outerRadius;\n outerRadius = innerRadius;\n innerRadius = temp;\n }\n\n const path = new CustomPath2D();\n\n if (outerRadius <= epsilon) {\n path.moveTo(x, y);\n } else if (deltaAngle >= pi2 - epsilon) {\n // 是个完整的圆环\n // Or is it a circle or annulus?\n path.moveTo(x + outerRadius * cos(startAngle), y + outerRadius * sin(startAngle));\n path.arc(x, y, outerRadius, startAngle, endAngle, !clockwise);\n if (innerRadius > epsilon) {\n path.moveTo(x + innerRadius * cos(endAngle), y + innerRadius * sin(endAngle));\n path.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\n }\n } else {\n const xors = outerRadius * cos(startAngle);\n const yors = outerRadius * sin(startAngle);\n const xire = innerRadius * cos(endAngle);\n const yire = innerRadius * sin(endAngle);\n\n path.moveTo(x + xors, y + yors);\n path.arc(x, y, outerRadius, startAngle, endAngle, !clockwise);\n path.lineTo(x + xire, y + yire);\n path.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\n path.closePath();\n }\n\n return path;\n }\n\n clone() {\n return new Arc({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Arc.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createArc(attributes: IArcGraphicAttribute): IArc {\n return new Arc(attributes);\n}\n\n// addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY);\n"]}
@@ -124,6 +124,7 @@ export const DefaultAttribute = Object.assign(Object.assign(Object.assign({
124
124
  zIndex: 0,
125
125
  layout: null,
126
126
  boundsPadding: 0,
127
+ renderStyle: "default",
127
128
  pickMode: "accurate",
128
129
  customPickShape: null,
129
130
  boundsMode: "accurate",
@@ -149,6 +150,8 @@ export const DefaultArcAttribute = Object.assign(Object.assign({}, DefaultAttrib
149
150
  endAngle: pi2,
150
151
  innerRadius: 0,
151
152
  outerRadius: 1,
153
+ innerPadding: 0,
154
+ outerPadding: 0,
152
155
  cornerRadius: 0,
153
156
  padRadius: 0,
154
157
  padAngle: 0,