@visactor/vrender-core 1.0.0-alpha.5 → 1.0.0-alpha.6

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 (246) hide show
  1. package/cjs/animate/config.d.ts +0 -1
  2. package/cjs/animate/config.js +1 -5
  3. package/cjs/animate/config.js.map +1 -1
  4. package/cjs/application.d.ts +2 -1
  5. package/cjs/application.js.map +1 -1
  6. package/cjs/color-string/interpolate.js +5 -2
  7. package/cjs/color-string/interpolate.js.map +1 -1
  8. package/cjs/common/canvas-utils.js +6 -3
  9. package/cjs/common/canvas-utils.js.map +1 -1
  10. package/cjs/common/custom-path2d.js +2 -2
  11. package/cjs/common/custom-path2d.js.map +1 -1
  12. package/cjs/common/morphing-utils.js +32 -124
  13. package/cjs/common/morphing-utils.js.map +1 -1
  14. package/cjs/common/segment/index.js +3 -0
  15. package/cjs/common/segment/index.js.map +1 -1
  16. package/cjs/common/segment/step.d.ts +6 -0
  17. package/cjs/common/segment/step.js +19 -2
  18. package/cjs/common/segment/step.js.map +1 -1
  19. package/cjs/common/shape/arc.d.ts +1 -1
  20. package/cjs/common/shape/arc.js +7 -3
  21. package/cjs/common/shape/arc.js.map +1 -1
  22. package/cjs/common/split-path.js +1 -1
  23. package/cjs/common/split-path.js.map +1 -1
  24. package/cjs/common/utils.d.ts +0 -2
  25. package/cjs/common/utils.js +4 -8
  26. package/cjs/common/utils.js.map +1 -1
  27. package/cjs/graphic/arc.d.ts +1 -2
  28. package/cjs/graphic/arc.js +4 -3
  29. package/cjs/graphic/arc.js.map +1 -1
  30. package/cjs/graphic/area.d.ts +1 -2
  31. package/cjs/graphic/area.js +5 -2
  32. package/cjs/graphic/area.js.map +1 -1
  33. package/cjs/graphic/circle.d.ts +1 -2
  34. package/cjs/graphic/circle.js +7 -3
  35. package/cjs/graphic/circle.js.map +1 -1
  36. package/cjs/graphic/config.d.ts +2 -1
  37. package/cjs/graphic/config.js +10 -3
  38. package/cjs/graphic/config.js.map +1 -1
  39. package/cjs/graphic/constants.d.ts +1 -0
  40. package/cjs/graphic/constants.js +4 -3
  41. package/cjs/graphic/constants.js.map +1 -1
  42. package/cjs/graphic/graphic.d.ts +7 -1
  43. package/cjs/graphic/graphic.js +20 -15
  44. package/cjs/graphic/graphic.js.map +1 -1
  45. package/cjs/graphic/image.js +2 -1
  46. package/cjs/graphic/image.js.map +1 -1
  47. package/cjs/graphic/index.d.ts +1 -0
  48. package/cjs/graphic/index.js +8 -8
  49. package/cjs/graphic/index.js.map +1 -1
  50. package/cjs/graphic/line.d.ts +1 -2
  51. package/cjs/graphic/line.js +7 -2
  52. package/cjs/graphic/line.js.map +1 -1
  53. package/cjs/graphic/path.js +2 -1
  54. package/cjs/graphic/path.js.map +1 -1
  55. package/cjs/graphic/polygon.js +2 -1
  56. package/cjs/graphic/polygon.js.map +1 -1
  57. package/cjs/graphic/rect.js +7 -3
  58. package/cjs/graphic/rect.js.map +1 -1
  59. package/cjs/graphic/richtext/icon.d.ts +1 -1
  60. package/cjs/graphic/richtext/icon.js.map +1 -1
  61. package/cjs/graphic/richtext.js +3 -2
  62. package/cjs/graphic/richtext.js.map +1 -1
  63. package/cjs/graphic/star.d.ts +52 -0
  64. package/cjs/graphic/star.js +78 -0
  65. package/cjs/graphic/star.js.map +1 -0
  66. package/cjs/graphic/symbol.js +3 -1
  67. package/cjs/graphic/symbol.js.map +1 -1
  68. package/cjs/graphic/text.js +1 -0
  69. package/cjs/graphic/text.js.map +1 -1
  70. package/cjs/graphic/theme.js +2 -0
  71. package/cjs/graphic/theme.js.map +1 -1
  72. package/cjs/index.d.ts +2 -0
  73. package/cjs/index.js +7 -6
  74. package/cjs/index.js.map +1 -1
  75. package/cjs/interface/animation/animate.d.ts +17 -0
  76. package/cjs/interface/animation/animate.js.map +1 -1
  77. package/cjs/interface/common.d.ts +1 -1
  78. package/cjs/interface/common.js.map +1 -1
  79. package/cjs/interface/contribution.d.ts +2 -0
  80. package/cjs/interface/contribution.js.map +1 -1
  81. package/cjs/interface/graphic/index.d.ts +1 -0
  82. package/cjs/interface/graphic/index.js +3 -2
  83. package/cjs/interface/graphic/index.js.map +1 -1
  84. package/cjs/interface/graphic/star.d.ts +12 -0
  85. package/cjs/interface/graphic/star.js +6 -0
  86. package/cjs/interface/graphic/star.js.map +1 -0
  87. package/cjs/interface/graphic/theme.d.ts +3 -0
  88. package/cjs/interface/graphic/theme.js.map +1 -1
  89. package/cjs/interface/graphic.d.ts +11 -0
  90. package/cjs/interface/graphic.js.map +1 -1
  91. package/cjs/interface/render.d.ts +1 -0
  92. package/cjs/interface/render.js.map +1 -1
  93. package/cjs/modules.d.ts +2 -1
  94. package/cjs/modules.js +4 -3
  95. package/cjs/modules.js.map +1 -1
  96. package/cjs/register/register-star.d.ts +1 -0
  97. package/cjs/register/register-star.js +14 -0
  98. package/cjs/register/register-star.js.map +1 -0
  99. package/cjs/render/contributions/render/area-render.js +2 -2
  100. package/cjs/render/contributions/render/area-render.js.map +1 -1
  101. package/cjs/render/contributions/render/contributions/constants.d.ts +1 -0
  102. package/cjs/render/contributions/render/contributions/constants.js +3 -2
  103. package/cjs/render/contributions/render/contributions/constants.js.map +1 -1
  104. package/cjs/render/contributions/render/contributions/index.d.ts +1 -0
  105. package/cjs/render/contributions/render/contributions/index.js +2 -2
  106. package/cjs/render/contributions/render/contributions/index.js.map +1 -1
  107. package/cjs/render/contributions/render/contributions/star-contribution-render.d.ts +2 -0
  108. package/cjs/render/contributions/render/contributions/star-contribution-render.js +11 -0
  109. package/cjs/render/contributions/render/contributions/star-contribution-render.js.map +1 -0
  110. package/cjs/render/contributions/render/line-render.js +1 -1
  111. package/cjs/render/contributions/render/line-render.js.map +1 -1
  112. package/cjs/render/contributions/render/star-module.d.ts +2 -0
  113. package/cjs/render/contributions/render/star-module.js +15 -0
  114. package/cjs/render/contributions/render/star-module.js.map +1 -0
  115. package/cjs/render/contributions/render/star-render.d.ts +10 -0
  116. package/cjs/render/contributions/render/star-render.js +54 -0
  117. package/cjs/render/contributions/render/star-render.js.map +1 -0
  118. package/cjs/render/contributions/render/symbol.d.ts +1 -0
  119. package/cjs/render/contributions/render/symbol.js +2 -2
  120. package/cjs/render/contributions/render/symbol.js.map +1 -1
  121. package/cjs/render/render-service.d.ts +1 -1
  122. package/cjs/render/render-service.js.map +1 -1
  123. package/dist/index.es.js +12277 -12107
  124. package/es/animate/config.d.ts +0 -1
  125. package/es/animate/config.js +0 -5
  126. package/es/animate/config.js.map +1 -1
  127. package/es/application.d.ts +2 -1
  128. package/es/application.js.map +1 -1
  129. package/es/color-string/interpolate.js +4 -1
  130. package/es/color-string/interpolate.js.map +1 -1
  131. package/es/common/canvas-utils.js +6 -3
  132. package/es/common/canvas-utils.js.map +1 -1
  133. package/es/common/custom-path2d.js +2 -2
  134. package/es/common/custom-path2d.js.map +1 -1
  135. package/es/common/morphing-utils.js +29 -124
  136. package/es/common/morphing-utils.js.map +1 -1
  137. package/es/common/segment/index.js +4 -1
  138. package/es/common/segment/index.js.map +1 -1
  139. package/es/common/segment/step.d.ts +6 -0
  140. package/es/common/segment/step.js +13 -0
  141. package/es/common/segment/step.js.map +1 -1
  142. package/es/common/shape/arc.d.ts +1 -1
  143. package/es/common/shape/arc.js +7 -3
  144. package/es/common/shape/arc.js.map +1 -1
  145. package/es/common/split-path.js +1 -1
  146. package/es/common/split-path.js.map +1 -1
  147. package/es/common/utils.d.ts +0 -2
  148. package/es/common/utils.js +0 -4
  149. package/es/common/utils.js.map +1 -1
  150. package/es/graphic/arc.d.ts +1 -2
  151. package/es/graphic/arc.js +4 -3
  152. package/es/graphic/arc.js.map +1 -1
  153. package/es/graphic/area.d.ts +1 -2
  154. package/es/graphic/area.js +5 -2
  155. package/es/graphic/area.js.map +1 -1
  156. package/es/graphic/circle.d.ts +1 -2
  157. package/es/graphic/circle.js +6 -3
  158. package/es/graphic/circle.js.map +1 -1
  159. package/es/graphic/config.d.ts +2 -1
  160. package/es/graphic/config.js +11 -2
  161. package/es/graphic/config.js.map +1 -1
  162. package/es/graphic/constants.d.ts +1 -0
  163. package/es/graphic/constants.js +2 -0
  164. package/es/graphic/constants.js.map +1 -1
  165. package/es/graphic/graphic.d.ts +7 -1
  166. package/es/graphic/graphic.js +21 -14
  167. package/es/graphic/graphic.js.map +1 -1
  168. package/es/graphic/image.js +2 -1
  169. package/es/graphic/image.js.map +1 -1
  170. package/es/graphic/index.d.ts +1 -0
  171. package/es/graphic/index.js +2 -0
  172. package/es/graphic/index.js.map +1 -1
  173. package/es/graphic/line.d.ts +1 -2
  174. package/es/graphic/line.js +7 -2
  175. package/es/graphic/line.js.map +1 -1
  176. package/es/graphic/path.js +2 -1
  177. package/es/graphic/path.js.map +1 -1
  178. package/es/graphic/polygon.js +2 -1
  179. package/es/graphic/polygon.js.map +1 -1
  180. package/es/graphic/rect.js +7 -3
  181. package/es/graphic/rect.js.map +1 -1
  182. package/es/graphic/richtext/icon.d.ts +1 -1
  183. package/es/graphic/richtext/icon.js.map +1 -1
  184. package/es/graphic/richtext.js +3 -2
  185. package/es/graphic/richtext.js.map +1 -1
  186. package/es/graphic/star.d.ts +52 -0
  187. package/es/graphic/star.js +82 -0
  188. package/es/graphic/star.js.map +1 -0
  189. package/es/graphic/symbol.js +3 -1
  190. package/es/graphic/symbol.js.map +1 -1
  191. package/es/graphic/text.js +1 -0
  192. package/es/graphic/text.js.map +1 -1
  193. package/es/graphic/theme.js +3 -1
  194. package/es/graphic/theme.js.map +1 -1
  195. package/es/index.d.ts +2 -0
  196. package/es/index.js +4 -0
  197. package/es/index.js.map +1 -1
  198. package/es/interface/animation/animate.d.ts +17 -0
  199. package/es/interface/animation/animate.js.map +1 -1
  200. package/es/interface/common.d.ts +1 -1
  201. package/es/interface/common.js.map +1 -1
  202. package/es/interface/contribution.d.ts +2 -0
  203. package/es/interface/contribution.js.map +1 -1
  204. package/es/interface/graphic/index.d.ts +1 -0
  205. package/es/interface/graphic/index.js +2 -0
  206. package/es/interface/graphic/index.js.map +1 -1
  207. package/es/interface/graphic/star.d.ts +12 -0
  208. package/es/interface/graphic/star.js +2 -0
  209. package/es/interface/graphic/star.js.map +1 -0
  210. package/es/interface/graphic/theme.d.ts +3 -0
  211. package/es/interface/graphic/theme.js.map +1 -1
  212. package/es/interface/graphic.d.ts +11 -0
  213. package/es/interface/graphic.js.map +1 -1
  214. package/es/interface/render.d.ts +1 -0
  215. package/es/interface/render.js.map +1 -1
  216. package/es/modules.d.ts +2 -1
  217. package/es/modules.js +6 -0
  218. package/es/modules.js.map +1 -1
  219. package/es/register/register-star.d.ts +1 -0
  220. package/es/register/register-star.js +8 -0
  221. package/es/register/register-star.js.map +1 -0
  222. package/es/render/contributions/render/area-render.js +2 -2
  223. package/es/render/contributions/render/area-render.js.map +1 -1
  224. package/es/render/contributions/render/contributions/constants.d.ts +1 -0
  225. package/es/render/contributions/render/contributions/constants.js +2 -0
  226. package/es/render/contributions/render/contributions/constants.js.map +1 -1
  227. package/es/render/contributions/render/contributions/index.d.ts +1 -0
  228. package/es/render/contributions/render/contributions/index.js +2 -0
  229. package/es/render/contributions/render/contributions/index.js.map +1 -1
  230. package/es/render/contributions/render/contributions/star-contribution-render.d.ts +2 -0
  231. package/es/render/contributions/render/contributions/star-contribution-render.js +8 -0
  232. package/es/render/contributions/render/contributions/star-contribution-render.js.map +1 -0
  233. package/es/render/contributions/render/line-render.js +1 -1
  234. package/es/render/contributions/render/line-render.js.map +1 -1
  235. package/es/render/contributions/render/star-module.d.ts +2 -0
  236. package/es/render/contributions/render/star-module.js +13 -0
  237. package/es/render/contributions/render/star-module.js.map +1 -0
  238. package/es/render/contributions/render/star-render.d.ts +10 -0
  239. package/es/render/contributions/render/star-render.js +59 -0
  240. package/es/render/contributions/render/star-render.js.map +1 -0
  241. package/es/render/contributions/render/symbol.d.ts +1 -0
  242. package/es/render/contributions/render/symbol.js +2 -0
  243. package/es/render/contributions/render/symbol.js.map +1 -1
  244. package/es/render/render-service.d.ts +1 -1
  245. package/es/render/render-service.js.map +1 -1
  246. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/contribution.ts"],"names":[],"mappings":"","file":"contribution.js","sourcesContent":["import type { MaybePromise, Releaseable } from './common';\nimport type { IContext2d } from './context';\nimport type { IThemeAttribute, IMarkAttribute } from './graphic/creator';\nimport type { IGraphicAttribute } from './graphic';\nimport type { ISymbol, ISymbolGraphicAttribute } from './graphic/symbol';\nimport type { BaseRenderContributionTime } from '../common/enums';\nimport type { IArc, IArcGraphicAttribute } from './graphic/arc';\nimport type { IArea, IAreaGraphicAttribute } from './graphic/area';\nimport type { IText, ITextGraphicAttribute } from './graphic/text';\nimport type { ICircle, ICircleGraphicAttribute } from './graphic/circle';\nimport type { IGroup, IGroupGraphicAttribute } from './graphic/group';\nimport type { IImage, IImageGraphicAttribute } from './graphic/image';\nimport type { IPath, IPathGraphicAttribute } from './graphic/path';\nimport type { IPolygon, IPolygonGraphicAttribute } from './graphic/polygon';\nimport type { IRect, IRectGraphicAttribute } from './graphic/rect';\nimport type { IStage } from './stage';\nimport type { ICanvasLike } from './canvas';\nimport type { IDrawContext } from './render';\n\nexport interface IContribution<T> extends Releaseable {\n configure: (service: T, ...data: any) => void;\n}\n\nexport interface IBaseRenderContribution<GraphicType, AttributeType> {\n time: BaseRenderContributionTime;\n useStyle: boolean;\n order: number;\n supportedAppName?: string | string[];\n\n drawShape: (\n graphic: GraphicType,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<AttributeType>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n params?: any\n ) => void;\n}\n\nexport type ISymbolRenderContribution = IBaseRenderContribution<ISymbol, ISymbolGraphicAttribute>;\n\nexport type IArcRenderContribution = IBaseRenderContribution<IArc, IArcGraphicAttribute>;\n\nexport type ITextRenderContribution = IBaseRenderContribution<IText, ITextGraphicAttribute>;\n\nexport type IAreaRenderContribution = IBaseRenderContribution<IArea, IAreaGraphicAttribute>;\n\nexport type ICircleRenderContribution = IBaseRenderContribution<ICircle, ICircleGraphicAttribute>;\n\nexport type IGroupRenderContribution = IBaseRenderContribution<IGroup, IGroupGraphicAttribute>;\n\nexport type IImageRenderContribution = IBaseRenderContribution<IImage, IImageGraphicAttribute>;\n\nexport type IPathRenderContribution = IBaseRenderContribution<IPath, IPathGraphicAttribute>;\n\nexport type IPolygonRenderContribution = IBaseRenderContribution<IPolygon, IPolygonGraphicAttribute>;\n\nexport type IRectRenderContribution = IBaseRenderContribution<IRect, IRectGraphicAttribute>;\n\nexport interface IContributionProvider<T> {\n getContributions: () => T[];\n}\n\nexport interface IApplicationContribution {\n // 调用初始化函数\n initialize?: () => void;\n\n configure?: (stage: IStage) => MaybePromise<void>;\n\n onDestroy?: (stage: IStage) => MaybePromise<void>;\n}\n\nexport interface ITTCanvas extends ICanvasLike {\n width: number;\n height: number;\n offsetWidth: number;\n offsetHeight: number;\n getContext: () => any;\n // 构造 getBoundingClientRect 方法\n getBoundingClientRect: () => { width: number; height: number };\n id: string;\n}\n\nexport interface ILynxCanvas extends ICanvasLike {\n width: number;\n height: number;\n offsetWidth: number;\n offsetHeight: number;\n getContext: () => any;\n // 构造 getBoundingClientRect 方法\n getBoundingClientRect: () => { width: number; height: number };\n id: string;\n}\n\nexport interface IDomRef {\n id: string;\n width: number;\n height: number;\n left: number;\n top: number;\n right: number;\n bottom: number;\n x: number;\n y: number;\n\n requestAnimationFrame?: any;\n cancelAnimationFrame?: any;\n getBoundingClientRect?: () => { height: number; width: number };\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/contribution.ts"],"names":[],"mappings":"","file":"contribution.js","sourcesContent":["import type { MaybePromise, Releaseable } from './common';\nimport type { IContext2d } from './context';\nimport type { IThemeAttribute, IMarkAttribute } from './graphic/creator';\nimport type { IGraphicAttribute } from './graphic';\nimport type { ISymbol, ISymbolGraphicAttribute } from './graphic/symbol';\nimport type { BaseRenderContributionTime } from '../common/enums';\nimport type { IArc, IArcGraphicAttribute } from './graphic/arc';\nimport type { IArea, IAreaGraphicAttribute } from './graphic/area';\nimport type { IText, ITextGraphicAttribute } from './graphic/text';\nimport type { ICircle, ICircleGraphicAttribute } from './graphic/circle';\nimport type { IGroup, IGroupGraphicAttribute } from './graphic/group';\nimport type { IImage, IImageGraphicAttribute } from './graphic/image';\nimport type { IPath, IPathGraphicAttribute } from './graphic/path';\nimport type { IPolygon, IPolygonGraphicAttribute } from './graphic/polygon';\nimport type { IRect, IRectGraphicAttribute } from './graphic/rect';\nimport type { IStar, IStarGraphicAttribute } from './graphic/star';\nimport type { IStage } from './stage';\nimport type { ICanvasLike } from './canvas';\nimport type { IDrawContext } from './render';\n\nexport interface IContribution<T> extends Releaseable {\n configure: (service: T, ...data: any) => void;\n}\n\nexport interface IBaseRenderContribution<GraphicType, AttributeType> {\n time: BaseRenderContributionTime;\n useStyle: boolean;\n order: number;\n supportedAppName?: string | string[];\n\n drawShape: (\n graphic: GraphicType,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<AttributeType>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n params?: any\n ) => void;\n}\n\nexport type ISymbolRenderContribution = IBaseRenderContribution<ISymbol, ISymbolGraphicAttribute>;\n\nexport type IArcRenderContribution = IBaseRenderContribution<IArc, IArcGraphicAttribute>;\n\nexport type ITextRenderContribution = IBaseRenderContribution<IText, ITextGraphicAttribute>;\n\nexport type IAreaRenderContribution = IBaseRenderContribution<IArea, IAreaGraphicAttribute>;\n\nexport type ICircleRenderContribution = IBaseRenderContribution<ICircle, ICircleGraphicAttribute>;\n\nexport type IStarRenderContribution = IBaseRenderContribution<IStar, IStarGraphicAttribute>;\n\nexport type IGroupRenderContribution = IBaseRenderContribution<IGroup, IGroupGraphicAttribute>;\n\nexport type IImageRenderContribution = IBaseRenderContribution<IImage, IImageGraphicAttribute>;\n\nexport type IPathRenderContribution = IBaseRenderContribution<IPath, IPathGraphicAttribute>;\n\nexport type IPolygonRenderContribution = IBaseRenderContribution<IPolygon, IPolygonGraphicAttribute>;\n\nexport type IRectRenderContribution = IBaseRenderContribution<IRect, IRectGraphicAttribute>;\n\nexport interface IContributionProvider<T> {\n getContributions: () => T[];\n}\n\nexport interface IApplicationContribution {\n // 调用初始化函数\n initialize?: () => void;\n\n configure?: (stage: IStage) => MaybePromise<void>;\n\n onDestroy?: (stage: IStage) => MaybePromise<void>;\n}\n\nexport interface ITTCanvas extends ICanvasLike {\n width: number;\n height: number;\n offsetWidth: number;\n offsetHeight: number;\n getContext: () => any;\n // 构造 getBoundingClientRect 方法\n getBoundingClientRect: () => { width: number; height: number };\n id: string;\n}\n\nexport interface ILynxCanvas extends ICanvasLike {\n width: number;\n height: number;\n offsetWidth: number;\n offsetHeight: number;\n getContext: () => any;\n // 构造 getBoundingClientRect 方法\n getBoundingClientRect: () => { width: number; height: number };\n id: string;\n}\n\nexport interface IDomRef {\n id: string;\n width: number;\n height: number;\n left: number;\n top: number;\n right: number;\n bottom: number;\n x: number;\n y: number;\n\n requestAnimationFrame?: any;\n cancelAnimationFrame?: any;\n getBoundingClientRect?: () => { height: number; width: number };\n}\n"]}
@@ -20,6 +20,7 @@ export * from './rect';
20
20
  export * from './rect3d';
21
21
  export * from './richText';
22
22
  export * from './shadow-root';
23
+ export * from './star';
23
24
  export * from './svg';
24
25
  export * from './symbol';
25
26
  export * from './text';
@@ -42,6 +42,8 @@ export * from "./richText";
42
42
 
43
43
  export * from "./shadow-root";
44
44
 
45
+ export * from "./star";
46
+
45
47
  export * from "./svg";
46
48
 
47
49
  export * from "./symbol";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC","file":"index.js","sourcesContent":["export * from './creator';\nexport * from './theme';\nexport * from './arc';\nexport * from './arc3d';\nexport * from './area';\nexport * from './bounds';\nexport * from './circle';\nexport * from './ellipse';\nexport * from './face3d';\nexport * from './glyph';\nexport * from './group';\nexport * from './image';\nexport * from './isogon';\nexport * from './line';\nexport * from './path';\nexport * from './polygon';\nexport * from './polyline';\nexport * from './pyramid3d';\nexport * from './rect';\nexport * from './rect3d';\nexport * from './richText';\nexport * from './shadow-root';\nexport * from './svg';\nexport * from './symbol';\nexport * from './text';\nexport * from './util';\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC","file":"index.js","sourcesContent":["export * from './creator';\nexport * from './theme';\nexport * from './arc';\nexport * from './arc3d';\nexport * from './area';\nexport * from './bounds';\nexport * from './circle';\nexport * from './ellipse';\nexport * from './face3d';\nexport * from './glyph';\nexport * from './group';\nexport * from './image';\nexport * from './isogon';\nexport * from './line';\nexport * from './path';\nexport * from './polygon';\nexport * from './polyline';\nexport * from './pyramid3d';\nexport * from './rect';\nexport * from './rect3d';\nexport * from './richText';\nexport * from './shadow-root';\nexport * from './star';\nexport * from './svg';\nexport * from './symbol';\nexport * from './text';\nexport * from './util';\n"]}
@@ -0,0 +1,12 @@
1
+ import type { IPointLike } from '@visactor/vutils';
2
+ import type { IGraphicAttribute, IGraphic } from '../graphic';
3
+ export type IStarAttribute = {
4
+ width: number;
5
+ height: number;
6
+ spikes: number;
7
+ thickness: number;
8
+ };
9
+ export type IStarGraphicAttribute = Partial<IGraphicAttribute> & Partial<IStarAttribute>;
10
+ export type IStar = IGraphic<IStarGraphicAttribute> & {
11
+ getCachedPoints: () => IPointLike[];
12
+ };
@@ -0,0 +1,2 @@
1
+ export { };
2
+ //# sourceMappingURL=star.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/interface/graphic/star.ts"],"names":[],"mappings":"","file":"star.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\n\nexport type IStarAttribute = {\n /**\n * Width of the star\n */\n width: number;\n\n /**\n * Height of the star\n */\n height: number;\n\n /**\n * Number of spikes/corners (must be >= 3)\n */\n spikes: number;\n\n /**\n * How much the corners protrude (0-1)\n * 0 means a regular polygon, 1 means maximum protrusion\n */\n thickness: number;\n};\n\nexport type IStarGraphicAttribute = Partial<IGraphicAttribute> & Partial<IStarAttribute>;\n\nexport type IStar = IGraphic<IStarGraphicAttribute> & {\n getCachedPoints: () => IPointLike[];\n};\n"]}
@@ -10,6 +10,7 @@ import type { IPathGraphicAttribute } from './path';
10
10
  import type { IPolygonGraphicAttribute } from './polygon';
11
11
  import type { IRectGraphicAttribute } from './rect';
12
12
  import type { IRichTextGraphicAttribute, IRichTextIconGraphicAttribute } from './richText';
13
+ import type { IStarGraphicAttribute } from './star';
13
14
  import type { ISymbolGraphicAttribute } from './symbol';
14
15
  import type { ITextGraphicAttribute } from './text';
15
16
  export interface IThemeSpec {
@@ -21,6 +22,7 @@ export interface IThemeSpec {
21
22
  line?: Partial<ILineGraphicAttribute>;
22
23
  path?: Partial<IPathGraphicAttribute>;
23
24
  symbol?: Partial<ISymbolGraphicAttribute>;
25
+ star?: Partial<IStarGraphicAttribute>;
24
26
  group?: Partial<IGroupGraphicAttribute>;
25
27
  polygon?: Partial<IPolygonGraphicAttribute>;
26
28
  image?: Partial<IImageGraphicAttribute>;
@@ -38,6 +40,7 @@ export interface IFullThemeSpec {
38
40
  glyph: Required<IGlyphGraphicAttribute>;
39
41
  group: Required<IGroupGraphicAttribute>;
40
42
  polygon: Required<IPolygonGraphicAttribute>;
43
+ star: Required<IStarGraphicAttribute>;
41
44
  richtext: Required<IRichTextGraphicAttribute>;
42
45
  richtextIcon: Required<IRichTextIconGraphicAttribute>;
43
46
  image: Required<IImageGraphicAttribute>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["import type { IGraphicAttribute } from '../graphic';\nimport type { IArcGraphicAttribute } from './arc';\nimport type { IAreaGraphicAttribute } from './area';\nimport type { ICircleGraphicAttribute } from './circle';\nimport type { IGlyphGraphicAttribute } from './glyph';\nimport type { IGroup, IGroupGraphicAttribute } from './group';\nimport type { IImageGraphicAttribute } from './image';\nimport type { ILineGraphicAttribute } from './line';\nimport type { IPathGraphicAttribute } from './path';\nimport type { IPolygonGraphicAttribute } from './polygon';\nimport type { IRectGraphicAttribute } from './rect';\nimport type { IRichTextGraphicAttribute, IRichTextIconGraphicAttribute } from './richText';\nimport type { ISymbolGraphicAttribute } from './symbol';\nimport type { ITextGraphicAttribute } from './text';\n\nexport interface IThemeSpec {\n text?: Partial<ITextGraphicAttribute>;\n rect?: Partial<IRectGraphicAttribute>;\n arc?: Partial<IArcGraphicAttribute>;\n area?: Partial<IAreaGraphicAttribute>;\n circle?: Partial<ICircleGraphicAttribute>;\n line?: Partial<ILineGraphicAttribute>;\n path?: Partial<IPathGraphicAttribute>;\n symbol?: Partial<ISymbolGraphicAttribute>;\n group?: Partial<IGroupGraphicAttribute>;\n polygon?: Partial<IPolygonGraphicAttribute>;\n image?: Partial<IImageGraphicAttribute>;\n common?: Partial<IGraphicAttribute>;\n}\n\nexport interface IFullThemeSpec {\n arc: Required<IArcGraphicAttribute>;\n area: Required<IAreaGraphicAttribute>;\n circle: Required<ICircleGraphicAttribute>;\n line: Required<ILineGraphicAttribute>;\n path: Required<IPathGraphicAttribute>;\n symbol: Required<ISymbolGraphicAttribute>;\n text: Required<ITextGraphicAttribute>;\n rect: Required<IRectGraphicAttribute>;\n glyph: Required<IGlyphGraphicAttribute>;\n group: Required<IGroupGraphicAttribute>;\n polygon: Required<IPolygonGraphicAttribute>;\n richtext: Required<IRichTextGraphicAttribute>;\n richtextIcon: Required<IRichTextIconGraphicAttribute>;\n image: Required<IImageGraphicAttribute>;\n}\n\nexport interface ITheme {\n getTheme: (g: IGroup) => IFullThemeSpec;\n combinedTheme?: IFullThemeSpec;\n userTheme?: IThemeSpec;\n nextTheme?: IThemeSpec;\n applyTheme: (group: IGroup, pt: IThemeSpec, force?: boolean) => IThemeSpec;\n setTheme: (t: IThemeSpec, g: IGroup) => void;\n dirty: boolean;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["import type { IGraphicAttribute } from '../graphic';\nimport type { IArcGraphicAttribute } from './arc';\nimport type { IAreaGraphicAttribute } from './area';\nimport type { ICircleGraphicAttribute } from './circle';\nimport type { IGlyphGraphicAttribute } from './glyph';\nimport type { IGroup, IGroupGraphicAttribute } from './group';\nimport type { IImageGraphicAttribute } from './image';\nimport type { ILineGraphicAttribute } from './line';\nimport type { IPathGraphicAttribute } from './path';\nimport type { IPolygonGraphicAttribute } from './polygon';\nimport type { IRectGraphicAttribute } from './rect';\nimport type { IRichTextGraphicAttribute, IRichTextIconGraphicAttribute } from './richText';\nimport type { IStarGraphicAttribute } from './star';\nimport type { ISymbolGraphicAttribute } from './symbol';\nimport type { ITextGraphicAttribute } from './text';\n\nexport interface IThemeSpec {\n text?: Partial<ITextGraphicAttribute>;\n rect?: Partial<IRectGraphicAttribute>;\n arc?: Partial<IArcGraphicAttribute>;\n area?: Partial<IAreaGraphicAttribute>;\n circle?: Partial<ICircleGraphicAttribute>;\n line?: Partial<ILineGraphicAttribute>;\n path?: Partial<IPathGraphicAttribute>;\n symbol?: Partial<ISymbolGraphicAttribute>;\n star?: Partial<IStarGraphicAttribute>;\n group?: Partial<IGroupGraphicAttribute>;\n polygon?: Partial<IPolygonGraphicAttribute>;\n image?: Partial<IImageGraphicAttribute>;\n common?: Partial<IGraphicAttribute>;\n}\n\nexport interface IFullThemeSpec {\n arc: Required<IArcGraphicAttribute>;\n area: Required<IAreaGraphicAttribute>;\n circle: Required<ICircleGraphicAttribute>;\n line: Required<ILineGraphicAttribute>;\n path: Required<IPathGraphicAttribute>;\n symbol: Required<ISymbolGraphicAttribute>;\n text: Required<ITextGraphicAttribute>;\n rect: Required<IRectGraphicAttribute>;\n glyph: Required<IGlyphGraphicAttribute>;\n group: Required<IGroupGraphicAttribute>;\n polygon: Required<IPolygonGraphicAttribute>;\n star: Required<IStarGraphicAttribute>;\n richtext: Required<IRichTextGraphicAttribute>;\n richtextIcon: Required<IRichTextIconGraphicAttribute>;\n image: Required<IImageGraphicAttribute>;\n}\n\nexport interface ITheme {\n getTheme: (g: IGroup) => IFullThemeSpec;\n combinedTheme?: IFullThemeSpec;\n userTheme?: IThemeSpec;\n nextTheme?: IThemeSpec;\n applyTheme: (group: IGroup, pt: IThemeSpec, force?: boolean) => IThemeSpec;\n setTheme: (t: IThemeSpec, g: IGroup) => void;\n dirty: boolean;\n}\n"]}
@@ -113,6 +113,11 @@ export interface CommonDomOptions {
113
113
  penetrateEventList?: string[];
114
114
  anchorType?: 'position' | 'boundsLeftTop' | BoundsAnchorType;
115
115
  }
116
+ export type IRoughStyle = {
117
+ fillStyle: 'hachure' | 'solid' | 'zigzag' | 'cross-hatch' | 'dots' | 'sunburst' | 'dashed' | 'zigzag-line';
118
+ roughness: number;
119
+ bowing: number;
120
+ };
116
121
  export type IGraphicStyle = ILayout & IFillStyle & IStrokeStyle & IPickStyle & {
117
122
  forceBoundsWidth: number | (() => number) | undefined;
118
123
  forceBoundsHeight: number | (() => number) | undefined;
@@ -147,12 +152,16 @@ export type IGraphicStyle = ILayout & IFillStyle & IStrokeStyle & IPickStyle & {
147
152
  cursor: Cursor | null;
148
153
  filter: string;
149
154
  renderStyle?: 'default' | 'rough' | any;
155
+ roughStyle?: IRoughStyle | null;
150
156
  html: ({
151
157
  dom: string | HTMLElement;
152
158
  } & SimpleDomStyleOptions & CommonDomOptions) | null;
153
159
  react: ({
154
160
  element: any;
155
161
  } & SimpleDomStyleOptions & CommonDomOptions) | null;
162
+ vue: ({
163
+ element: any;
164
+ } & SimpleDomStyleOptions & CommonDomOptions) | null;
156
165
  };
157
166
  export type IPickStyle = {
158
167
  pickStrokeBuffer: number;
@@ -233,6 +242,8 @@ export interface IGraphic<T extends Partial<IGraphicAttribute> = Partial<IGraphi
233
242
  parent: IGroup | null;
234
243
  isContainer?: boolean;
235
244
  in3dMode?: boolean;
245
+ widthWithoutTransform?: number;
246
+ heightWithoutTransform?: number;
236
247
  stamp?: number;
237
248
  animationBackUps?: {
238
249
  from: Record<string, any>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic.ts"],"names":[],"mappings":"","file":"graphic.js","sourcesContent":["import type { IAABBBounds, IMatrix, IPointLike, IPoint, BoundsAnchorType, IOBBBounds } from '@visactor/vutils';\nimport type { IAnimate, IStep, EasingType, IAnimateTarget, ITimeline } from './animation';\nimport type { IColor } from './color';\nimport type { IGroup } from './graphic/group';\nimport type { IShadowRoot } from './graphic/shadow-root';\nimport type { ILayer } from './layer';\nimport type { INode } from './node-tree';\nimport type { ICustomPath2D } from './path';\nimport type { IStage } from './stage';\nimport type { IGlyphGraphicAttribute } from './graphic/glyph';\nimport type { IContainPointMode } from '../common/enums';\nimport type { IFace3d } from './graphic/face3d';\nimport type { IPickerService } from './picker';\nimport type { ISymbolClass } from './graphic/symbol';\n\ntype IStrokeSeg = {\n /**\n * 百分比\n */\n start: number;\n /**\n * 百分比\n * end和length二选一\n */\n end: number;\n /**\n * 像素长度\n */\n length: number;\n};\n\n// TODO 最后加一个any\nexport type GraphicType =\n | 'area'\n | 'circle'\n | 'ellipse'\n | 'line'\n | 'rect'\n | 'rect3d'\n | 'path'\n | 'richtext'\n | 'text'\n | 'arc'\n | 'arc3d'\n | 'image'\n | 'symbol'\n | 'group'\n | 'shadowroot'\n | 'polygon'\n | 'pyramid3d'\n | 'glyph'\n | string;\n\n// Cursor style\n// See: https://developer.mozilla.org/en-US/docs/Web/CSS/cursor\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'none'\n | 'context-menu'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'cell'\n | 'crosshair'\n | 'text'\n | 'vertical-text'\n | 'alias'\n | 'copy'\n | 'move'\n | 'no-drop'\n | 'not-allowed'\n | 'grab'\n | 'grabbing'\n | 'all-scroll'\n | 'col-resize'\n | 'row-resize'\n | 'n-resize'\n | 'e-resize'\n | 's-resize'\n | 'w-resize'\n | 'ne-resize'\n | 'nw-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'ew-resize'\n | 'ns-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n | 'zoom-in'\n | 'zoom-out';\n\nexport type ITransform = {\n /**\n * x坐标\n */\n x: number;\n /**\n * y坐标\n */\n y: number;\n /**\n * z坐标\n */\n z: number;\n /**\n * x方向偏移量\n */\n dx: number;\n /**\n * y方向偏移量\n */\n dy: number;\n /**\n * z方向偏移量\n */\n dz: number;\n /**\n * x方向的滚动值\n */\n scrollX: number;\n /**\n * y方向的滚动值\n */\n scrollY: number;\n /**\n * x方向的缩放值\n */\n scaleX: number;\n /**\n * y方向的缩放值\n */\n scaleY: number;\n /**\n * z方向的缩放值\n */\n scaleZ: number;\n /**\n * 绕z轴的转角,即xy平面上的旋转角度\n */\n angle: number;\n /**\n * 绕x轴的转角\n */\n alpha: number;\n /**\n * 绕y轴的转角\n */\n beta: number;\n /**\n * 应用缩放的中心\n */\n scaleCenter: [number | string, number | string];\n /**\n * 基于AABB的锚点位置,用于简单的定位某些path\n */\n anchor: [number | string, number | string];\n /**\n * 3d的锚点位置\n */\n anchor3d: [number | string, number | string, number] | [number | string, number | string];\n /**\n * 处理矩阵,在正常计算完变换矩阵之后,会将该矩阵乘到变换矩阵上得到最终的变换矩阵\n */\n postMatrix: IMatrix;\n};\n\nexport type IFillType = boolean | string | IColor;\nexport type IFillStyle = {\n /**\n * 图形的填充透明度\n */\n fillOpacity: number;\n /**\n * 图形模糊效果程度\n */\n shadowBlur: number;\n /**\n * 图形的阴影颜色\n */\n shadowColor: string;\n /**\n * 阴影水平偏移距离\n */\n shadowOffsetX: number;\n /**\n * 阴影垂直偏移距离\n */\n shadowOffsetY: number;\n /**\n * 图形的填充颜色\n */\n fill: IFillType;\n};\n\nexport type ILayout = {\n /**\n * 设置对齐方式\n */\n alignSelf: 'auto' | 'flex-start' | 'flex-end' | 'center';\n};\n\nexport type IBorderStyle = Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> & {\n /**\n * 边距离边缘的距离\n */\n distance: number | string;\n /**\n * 是否显示边框,默认是不显示的\n */\n visible?: boolean;\n};\n\nexport type IStrokeType = boolean | string | IColor | null;\nexport type IStrokeStyle = {\n /**\n * 外部边框的样式配置,默认不展示外部边框\n */\n outerBorder: Partial<IBorderStyle>;\n /**\n * 内部边框的样式配置\n */\n innerBorder: Partial<IBorderStyle>;\n /**\n * 描边的透明度\n */\n strokeOpacity: number;\n /**\n * 设置线条虚线样式的属性,它通过定义实线和空白的交替长度来创建虚线效果\n */\n lineDash: number[];\n\n /**\n * 设置虚线样式的起始偏移量\n */\n lineDashOffset: number;\n\n /**\n * 设置线条的宽度\n */\n lineWidth: number;\n\n /**\n * 设置线条末端的样式\n */\n lineCap: CanvasLineCap;\n\n /**\n * 设置线条拐角的样式\n */\n lineJoin: CanvasLineJoin;\n\n /**\n * 设置线条拐角处的斜接限制\n */\n miterLimit: number;\n /**\n * 描边的boundsBuffer,用于控制bounds的buffer\n */\n strokeBoundsBuffer: number;\n /**\n * stroke - true 全描边\n * stroke - false 不描边\n * stroke 为数值类型,适用于rect\\arc等图形,用于配置部分描边的场景,其中\n *\n * 0b00000 - 不描边\n * 0b000001 - top\n * 0b000010 - right\n * 0b000100 - bottom\n * 0b001000 - left\n * 相应的:\n * 0b000011 - top + right\n * 0b000111 - top + right + bottom\n * 0b001111 - 全描边\n *\n * stroke - boolean[],适用于rect\\arc等图形,用于配置部分描边的场景\n */\n stroke: IStrokeType[] | IStrokeType;\n};\n\ntype TextureType = 'circle' | 'diamond' | 'rect' | 'vertical-line' | 'horizontal-line' | 'bias-lr' | 'bias-rl' | 'grid';\n\nexport type IConnectedStyle = {\n /**\n * 连接,取零或者断开\n */\n connectedType: 'connect' | 'none';\n /**\n * 连接线的样式配置\n */\n connectedStyle: {\n stroke: IStrokeStyle['stroke'];\n strokeOpacity: IStrokeStyle['strokeOpacity'];\n lineDash: IStrokeStyle['lineDash'];\n lineDashOffset: IStrokeStyle['lineDashOffset'];\n lineCap: IStrokeStyle['lineCap'];\n lineJoin: IStrokeStyle['lineJoin'];\n lineWidth: IStrokeStyle['lineWidth'];\n fill: IFillStyle['fill'];\n fillOpacity: IFillStyle['fillOpacity'];\n };\n connectedX: number;\n connectedY: number;\n};\n\nexport type IBackgroundConfig = {\n stroke?: string | boolean;\n fill?: string | boolean;\n lineWidth?: number;\n cornerRadius?: number;\n expandX?: number;\n expandY?: number;\n};\n\ntype IBackgroundType = string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig;\n\nexport interface SimpleDomStyleOptions {\n /**\n * 容器的宽度\n */\n width: number;\n /**\n * 容器的高度\n */\n height: number;\n /**\n * 容器的样式设置\n */\n style?:\n | string\n | Record<string, any>\n | ((\n pos: { top: number; left: number; width: number; height: number },\n graphic: IGraphic,\n wrapContainer: HTMLElement\n ) => Record<string, any>); // 容器的样式\n}\n\nexport interface CommonDomOptions {\n /**\n * 全局唯一的id\n */\n id?: string;\n /**\n * 容器元素的id或者dom元素\n */\n container: string | HTMLElement | null;\n /**\n * 是否显示\n */\n visible?: boolean;\n /**\n * 是否支持事件冒泡\n */\n pointerEvents?: boolean | string;\n /**\n * 可穿透的事件列表\n * @since 0.21.2\n */\n penetrateEventList?: string[];\n /**\n * 定位类型\n * 'position' - 根据挂载图形节点的坐标也就是x,y进行定位\n * 'boundsLeftTop' - 定位到挂载图形节点bounds的左上角\n * 'left' - 定位到挂载图形节点bounds 的左侧\n * 'right' - 定位到挂载图形节点bounds 的右侧\n * 'bottom' - 定位到挂载图形节点bounds 的底部\n * 'top' - 定位到挂载图形节点bounds 的顶部\n * 'center' - 定位到挂载图形节点bounds 的中心\n * 'top-left' - 定位到挂载图形节点bounds 的左上角\n * 'top-right' - 定位到挂载图形节点bounds 的右上角\n * 'bottom-left' - 定位到挂载图形节点bounds 的左下角\n * 'bottom-right' - 定位到挂载图形节点bounds 的右下角\n */\n anchorType?: 'position' | 'boundsLeftTop' | BoundsAnchorType;\n}\n\nexport type IGraphicStyle = ILayout &\n IFillStyle &\n IStrokeStyle &\n IPickStyle & {\n /**\n * 强制设置的bounds宽度,主要用于使用html或者react展示图形的时候,设置一个固定的宽度\n */\n forceBoundsWidth: number | (() => number) | undefined;\n /**\n * 强制设置的bounds高度,主要用于使用html或者react展示图形的时候,设置一个固定的高度\n */\n forceBoundsHeight: number | (() => number) | undefined;\n /**\n * 透明度,会同时影响填充和描边\n */\n opacity: number;\n /**\n * 影子节点\n */\n shadowGraphic?: IGraphic | undefined;\n /**\n * 背景填充模式(与具体图元有关)\n */\n backgroundMode: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';\n /**\n * 是否正好填充,只在repeat-x或者repeat-y以及no-repeat的时候生效\n */\n backgroundFit: boolean;\n /**\n * 是否保持背景图的宽高比\n */\n backgroundKeepAspectRatio: boolean;\n /**\n * 背景图缩放,只在no-repeat的时候生效\n */\n backgroundScale: number;\n /**\n * 背景图偏移,只在no-repeat的时候生效\n */\n backgroundOffsetX: number;\n /**\n * 背景图偏移,只在no-repeat的时候生效\n */\n backgroundOffsetY: number;\n /**\n * 背景图是否裁切,是否调用clip避免绘制到图元外部\n */\n backgroundClip: boolean;\n /**\n * 背景圆角半径\n */\n backgroundCornerRadius: number | number[];\n /**\n * 背景透明度\n */\n backgroundOpacity: number;\n /**\n * 背景,支持颜色字符串、html image元素、html canvas元素\n */\n // 纹理是否自动做动画\n autoAnimateTexture: boolean;\n // 如果做动画的话,这里代表ratio\n textureRatio: number;\n textureOptions: any;\n background:\n | IBackgroundType\n | {\n /**\n * 背景,支持颜色字符串、html image元素、html canvas元素\n */\n background: IBackgroundType;\n /**\n * 背景的x方向偏移量\n */\n dx?: number;\n /**\n * 背景的y方向偏移量\n */\n dy?: number;\n /**\n * 背景宽度\n */\n width?: number;\n /**\n * 背景高度\n */\n height?: number;\n /**\n * 背景的x坐标\n */\n x?: number;\n /**\n * 背景的y坐标\n */\n y?: number;\n }\n | null; // 背景,可以与fill同时存在\n /**\n * 纹理的类型\n */\n texture: TextureType | string;\n /**\n * 纹理的颜色\n */\n textureColor: string;\n /**\n * 纹理的大小\n */\n textureSize: number;\n /**\n * 纹理的间隙\n */\n texturePadding: number;\n\n blur: number;\n /**\n * 设置图形对应的鼠标样式\n */\n cursor: Cursor | null;\n // @deprecated 用处少废弃,后续考虑新设计API\n filter: string;\n renderStyle?: 'default' | 'rough' | any;\n /**\n * HTML的dom或者string\n */\n html:\n | ({\n /**\n * dom字符串或者dom\n */\n dom: string | HTMLElement;\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n /**\n * 使用react元素渲染内容\n */\n react:\n | ({\n /**\n * react场景节点\n */\n element: any;\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n };\n\nexport type IPickStyle = {\n /**\n * 给stroke模式的pick额外加的buffer,用于外界控制stroke区域的pick范围\n */\n pickStrokeBuffer: number;\n};\n\nexport type IDebugType = {\n _debug_bounds: boolean | ((c: any, g: any) => void);\n};\nexport type IGraphicAttribute = IDebugType &\n IGraphicStyle &\n ITransform & {\n /**\n * stroke百分比\n */\n strokeSeg: IStrokeSeg | null;\n /**\n * 包围盒的padding\n */\n boundsPadding: number | number[];\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode: 'accurate' | 'imprecise' | 'custom';\n boundsMode: 'accurate' | 'imprecise' | 'empty';\n customPickShape: () => boolean | null;\n /**\n * 是否支持事件拾取,默认为 true。\n * @default true\n */\n pickable: boolean;\n /**\n * 是否支持fill拾取,默认为 true。\n * @experimental\n * @default true\n */\n fillPickable: boolean;\n /**\n * 是否支持stroke拾取,默认为 true。\n * @experimental\n * @default true\n */\n strokePickable: boolean;\n /**\n * 对于 group 节点,是否支持其子元素的事件拾取,默认为 true。\n * 如果 group `pickable` 关闭,`childrenPickable` 开启,那么 group 的子节点仍参与事件拾取\n * @default true\n */\n childrenPickable: boolean;\n /**\n * 元素是否可见。\n * @default true\n */\n visible: boolean;\n /**\n * 分组下的层级,层级越小越先绘制\n */\n zIndex: number;\n layout: any;\n /**\n * 是否隐藏元素(只是绘制的时候不绘制)\n */\n renderable: boolean;\n /**\n * 是否在3d中控制方向\n * false: 不控制方向\n * true: 始终控制方向朝摄像机\n */\n keepDirIn3d?: boolean;\n shadowRootIdx: number;\n shadowPickMode?: 'full' | 'graphic';\n /**\n * 全局范围的层级,设置了这个属性的图形,会提取到交互层进行渲染\n */\n globalZIndex: number;\n /**\n * canvas 的合成方式\n */\n globalCompositeOperation: CanvasRenderingContext2D['globalCompositeOperation'] | '';\n /**\n * 完全支持滚动 | 完全不支持滚动 | 支持x方向的滚动 | 支持y方向的滚动\n */\n overflow: 'scroll' | 'hidden' | 'scroll-x' | 'scroll-y';\n /**\n * 绘制fill和stroke的顺序,为0表示fill先绘制,1表示stroke先绘制\n */\n fillStrokeOrder: number;\n /**\n * @since 0.20.15\n * 保持stroke的scale,默认为false,为true的话stroke显示的宽度会随着scale变化\n */\n keepStrokeScale: boolean;\n\n /**\n * @since 0.22.2\n * 裁剪路径,用于裁剪图形,用于普通图元的裁剪\n * 由于一般情况下普通图元只需要一个形状即可,所以这里不需要配置具体的位置和大小,强制中心在图元中心,宽高和图元Bounds宽高一致\n * 不考虑其他复杂情况,否则配置项就非常多了,比如多路径,或者配置位置大小等,如果配置大小那还得用户自己去拿图元的大小,目前没有这种需求\n */\n clipConfig: {\n shape: string;\n } | null;\n };\n\nexport interface IGraphicJson<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>> {\n attribute: Partial<T>;\n _uid: number;\n type: string;\n name: string;\n children: IGraphicJson<T>[];\n}\n\n/** the context of setAttribute */\nexport type ISetAttributeContext = {\n /** type of setAttribute */\n type?: number;\n animationState?: {\n step?: IStep;\n isFirstFrameOfStep?: boolean;\n /** ratio of animation */\n ratio?: number;\n /** is animation end? */\n end?: boolean;\n };\n skipUpdateCallback?: boolean;\n};\n\nexport type IGraphicAnimateParams = {\n slience?: boolean;\n id?: number | string;\n timeline?: ITimeline;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n};\n\nexport interface IGraphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends INode,\n IAnimateTarget {\n type?: GraphicType;\n numberType?: number;\n stage?: IStage;\n layer?: ILayer;\n shadowRoot?: IShadowRoot;\n glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n backgroundImg?: boolean;\n attachedThemeGraphic?: IGraphic<any>;\n /**\n * 保存语法上下文\n */\n context?: Record<string, any>;\n bindDom?: Map<\n string | HTMLElement,\n { container: HTMLElement | string; dom: HTMLElement | any; wrapGroup: HTMLDivElement | any; root?: any }\n >;\n\n valid: boolean;\n parent: IGroup | null;\n isContainer?: boolean;\n // 是否是3d模式(是否应用3d视角)\n in3dMode?: boolean;\n\n // 上次更新的stamp\n stamp?: number;\n animationBackUps?: {\n from: Record<string, any>;\n to: Record<string, any>;\n };\n\n attribute: Partial<T>;\n\n /** 用于实现morph动画场景,转换成bezier曲线渲染 */\n pathProxy?: ICustomPath2D | ((attrs: T) => ICustomPath2D);\n incremental?: number;\n incrementalAt?: number;\n\n /** 记录state对应的图形属性 */\n states?: Record<string, Partial<T>>;\n normalAttrs?: Partial<T>;\n stateProxy?: (stateName: string, targetStates?: string[]) => Partial<T>;\n findFace?: () => IFace3d;\n toggleState: (stateName: string, hasAnimation?: boolean) => void;\n removeState: (stateName: string, hasAnimation?: boolean) => void;\n clearStates: (hasAnimation?: boolean) => void;\n useStates: (states: string[], hasAnimation?: boolean) => void;\n addState: (stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) => void;\n hasState: (stateName?: string) => boolean;\n getState: (stateName: string) => Partial<T>;\n onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n applyStateAttrs: (attrs: Partial<T>, stateNames: string[], hasAnimation?: boolean, isClear?: boolean) => void;\n updateNormalAttrs: (stateAttrs: Partial<T>) => void;\n\n // get\n readonly AABBBounds: IAABBBounds; // 用于获取当前节点的AABB包围盒\n readonly OBBBounds: IOBBBounds; // 获取OBB包围盒,旋转防重叠需要用\n readonly globalAABBBounds: IAABBBounds; // 全局AABB包围盒\n readonly transMatrix: IMatrix; // 变换矩阵,动态计算\n readonly globalTransMatrix: IMatrix; // 变换矩阵,动态计算\n\n getOffsetXY: (attr?: ITransform) => IPoint;\n\n // function\n containsPoint: (x: number, y: number, mode?: IContainPointMode, picker?: IPickerService) => boolean;\n\n setMode: (mode: '3d' | '2d') => void;\n isValid: () => boolean;\n\n getClipPath: () => ISymbolClass | null;\n\n // TODO: transform API\n // 基于当前transform的变换,普通用户尽量别用,拿捏不住的~\n translate: (x: number, y: number) => this;\n translateTo: (x: number, y: number) => this;\n scale: (scaleX: number, scaleY: number, scaleCenter?: IPointLike) => this;\n scaleTo: (scaleX: number, scaleY: number) => this;\n rotate: (angle: number, rotateCenter?: IPointLike) => this;\n rotateTo: (angle: number) => this;\n skewTo: (b: number, c: number) => this;\n addUpdateBoundTag: () => void;\n addUpdateShapeAndBoundsTag: () => void;\n addUpdateLayoutTag: () => void;\n\n update: (d?: { bounds: boolean; trans: boolean }) => void;\n\n // animate\n animate?: (params?: IGraphicAnimateParams) => IAnimate;\n\n // 语法糖,可有可无,有的为了首屏性能考虑做成get方法,有的由外界直接托管,内部不赋值\n name?: string;\n\n // 供render处理shape缓存tag\n shouldUpdateShape: () => boolean;\n clearUpdateShapeTag: () => void;\n\n // // 供render缓存shape\n // cacheShape?: ICustomPath2D;\n // // 线段使用的path2D\n // cacheLine?: ISegPath2D | ISegPath2D[];\n // // 面积图使用的path2D\n // cacheArea?: IAreaCacheItem | IAreaCacheItem[];\n\n setAttributes: (params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n initAttributes: (params: Partial<T>) => void;\n\n setAttribute: (key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n setStage: (stage?: IStage, layer?: ILayer) => void;\n onSetStage: (cb: (g: IGraphic, stage: IStage) => void) => void;\n\n shouldUpdateAABBBounds: () => boolean;\n shouldSelfChangeUpdateAABBBounds: () => boolean;\n shouldUpdateGlobalMatrix: () => boolean;\n\n addUpdatePositionTag: () => void;\n addUpdateGlobalPositionTag: () => void;\n\n attachShadow: () => IShadowRoot;\n detachShadow: () => void;\n\n toJson: () => IGraphicJson;\n\n /** 创建pathProxy */\n createPathProxy: (path?: string) => void;\n /** 将图形转换成CustomPath2D */\n toCustomPath?: () => ICustomPath2D;\n\n resources?: Map<\n string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n imageLoadSuccess: (url: string, data: HTMLImageElement) => void;\n imageLoadFail: (url: string) => void;\n\n clone: () => IGraphic;\n stopAnimates: (stopChildren?: boolean) => void;\n getNoWorkAnimateAttr: () => Record<string, number>;\n getGraphicTheme: () => T;\n\n getAttributes: (final?: boolean) => Partial<T>;\n}\n\nexport interface IRoot extends IGraphic {\n pick: (x: number, y: number) => IGraphic;\n}\n\n/**\n * 动画配置\n */\nexport type IAnimateConfig = {\n duration?: number;\n easing?: EasingType;\n};\n\nexport type GraphicReleaseStatus = 'released' | 'willRelease';\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic.ts"],"names":[],"mappings":"","file":"graphic.js","sourcesContent":["import type { IAABBBounds, IMatrix, IPointLike, IPoint, BoundsAnchorType, IOBBBounds } from '@visactor/vutils';\nimport type { IAnimate, IStep, EasingType, IAnimateTarget, ITimeline } from './animation';\nimport type { IColor } from './color';\nimport type { IGroup } from './graphic/group';\nimport type { IShadowRoot } from './graphic/shadow-root';\nimport type { ILayer } from './layer';\nimport type { INode } from './node-tree';\nimport type { ICustomPath2D } from './path';\nimport type { IStage } from './stage';\nimport type { IGlyphGraphicAttribute } from './graphic/glyph';\nimport type { IContainPointMode } from '../common/enums';\nimport type { IFace3d } from './graphic/face3d';\nimport type { IPickerService } from './picker';\nimport type { ISymbolClass } from './graphic/symbol';\n\ntype IStrokeSeg = {\n /**\n * 百分比\n */\n start: number;\n /**\n * 百分比\n * end和length二选一\n */\n end: number;\n /**\n * 像素长度\n */\n length: number;\n};\n\n// TODO 最后加一个any\nexport type GraphicType =\n | 'area'\n | 'circle'\n | 'ellipse'\n | 'line'\n | 'rect'\n | 'rect3d'\n | 'path'\n | 'richtext'\n | 'text'\n | 'arc'\n | 'arc3d'\n | 'image'\n | 'symbol'\n | 'group'\n | 'shadowroot'\n | 'polygon'\n | 'pyramid3d'\n | 'glyph'\n | string;\n\n// Cursor style\n// See: https://developer.mozilla.org/en-US/docs/Web/CSS/cursor\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'none'\n | 'context-menu'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'cell'\n | 'crosshair'\n | 'text'\n | 'vertical-text'\n | 'alias'\n | 'copy'\n | 'move'\n | 'no-drop'\n | 'not-allowed'\n | 'grab'\n | 'grabbing'\n | 'all-scroll'\n | 'col-resize'\n | 'row-resize'\n | 'n-resize'\n | 'e-resize'\n | 's-resize'\n | 'w-resize'\n | 'ne-resize'\n | 'nw-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'ew-resize'\n | 'ns-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n | 'zoom-in'\n | 'zoom-out';\n\nexport type ITransform = {\n /**\n * x坐标\n */\n x: number;\n /**\n * y坐标\n */\n y: number;\n /**\n * z坐标\n */\n z: number;\n /**\n * x方向偏移量\n */\n dx: number;\n /**\n * y方向偏移量\n */\n dy: number;\n /**\n * z方向偏移量\n */\n dz: number;\n /**\n * x方向的滚动值\n */\n scrollX: number;\n /**\n * y方向的滚动值\n */\n scrollY: number;\n /**\n * x方向的缩放值\n */\n scaleX: number;\n /**\n * y方向的缩放值\n */\n scaleY: number;\n /**\n * z方向的缩放值\n */\n scaleZ: number;\n /**\n * 绕z轴的转角,即xy平面上的旋转角度\n */\n angle: number;\n /**\n * 绕x轴的转角\n */\n alpha: number;\n /**\n * 绕y轴的转角\n */\n beta: number;\n /**\n * 应用缩放的中心\n */\n scaleCenter: [number | string, number | string];\n /**\n * 基于AABB的锚点位置,用于简单的定位某些path\n */\n anchor: [number | string, number | string];\n /**\n * 3d的锚点位置\n */\n anchor3d: [number | string, number | string, number] | [number | string, number | string];\n /**\n * 处理矩阵,在正常计算完变换矩阵之后,会将该矩阵乘到变换矩阵上得到最终的变换矩阵\n */\n postMatrix: IMatrix;\n};\n\nexport type IFillType = boolean | string | IColor;\nexport type IFillStyle = {\n /**\n * 图形的填充透明度\n */\n fillOpacity: number;\n /**\n * 图形模糊效果程度\n */\n shadowBlur: number;\n /**\n * 图形的阴影颜色\n */\n shadowColor: string;\n /**\n * 阴影水平偏移距离\n */\n shadowOffsetX: number;\n /**\n * 阴影垂直偏移距离\n */\n shadowOffsetY: number;\n /**\n * 图形的填充颜色\n */\n fill: IFillType;\n};\n\nexport type ILayout = {\n /**\n * 设置对齐方式\n */\n alignSelf: 'auto' | 'flex-start' | 'flex-end' | 'center';\n};\n\nexport type IBorderStyle = Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> & {\n /**\n * 边距离边缘的距离\n */\n distance: number | string;\n /**\n * 是否显示边框,默认是不显示的\n */\n visible?: boolean;\n};\n\nexport type IStrokeType = boolean | string | IColor | null;\nexport type IStrokeStyle = {\n /**\n * 外部边框的样式配置,默认不展示外部边框\n */\n outerBorder: Partial<IBorderStyle>;\n /**\n * 内部边框的样式配置\n */\n innerBorder: Partial<IBorderStyle>;\n /**\n * 描边的透明度\n */\n strokeOpacity: number;\n /**\n * 设置线条虚线样式的属性,它通过定义实线和空白的交替长度来创建虚线效果\n */\n lineDash: number[];\n\n /**\n * 设置虚线样式的起始偏移量\n */\n lineDashOffset: number;\n\n /**\n * 设置线条的宽度\n */\n lineWidth: number;\n\n /**\n * 设置线条末端的样式\n */\n lineCap: CanvasLineCap;\n\n /**\n * 设置线条拐角的样式\n */\n lineJoin: CanvasLineJoin;\n\n /**\n * 设置线条拐角处的斜接限制\n */\n miterLimit: number;\n /**\n * 描边的boundsBuffer,用于控制bounds的buffer\n */\n strokeBoundsBuffer: number;\n /**\n * stroke - true 全描边\n * stroke - false 不描边\n * stroke 为数值类型,适用于rect\\arc等图形,用于配置部分描边的场景,其中\n *\n * 0b00000 - 不描边\n * 0b000001 - top\n * 0b000010 - right\n * 0b000100 - bottom\n * 0b001000 - left\n * 相应的:\n * 0b000011 - top + right\n * 0b000111 - top + right + bottom\n * 0b001111 - 全描边\n *\n * stroke - boolean[],适用于rect\\arc等图形,用于配置部分描边的场景\n */\n stroke: IStrokeType[] | IStrokeType;\n};\n\ntype TextureType = 'circle' | 'diamond' | 'rect' | 'vertical-line' | 'horizontal-line' | 'bias-lr' | 'bias-rl' | 'grid';\n\nexport type IConnectedStyle = {\n /**\n * 连接,取零或者断开\n */\n connectedType: 'connect' | 'none';\n /**\n * 连接线的样式配置\n */\n connectedStyle: {\n stroke: IStrokeStyle['stroke'];\n strokeOpacity: IStrokeStyle['strokeOpacity'];\n lineDash: IStrokeStyle['lineDash'];\n lineDashOffset: IStrokeStyle['lineDashOffset'];\n lineCap: IStrokeStyle['lineCap'];\n lineJoin: IStrokeStyle['lineJoin'];\n lineWidth: IStrokeStyle['lineWidth'];\n fill: IFillStyle['fill'];\n fillOpacity: IFillStyle['fillOpacity'];\n };\n connectedX: number;\n connectedY: number;\n};\n\nexport type IBackgroundConfig = {\n stroke?: string | boolean;\n fill?: string | boolean;\n lineWidth?: number;\n cornerRadius?: number;\n expandX?: number;\n expandY?: number;\n};\n\ntype IBackgroundType = string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig;\n\nexport interface SimpleDomStyleOptions {\n /**\n * 容器的宽度\n */\n width: number;\n /**\n * 容器的高度\n */\n height: number;\n /**\n * 容器的样式设置\n */\n style?:\n | string\n | Record<string, any>\n | ((\n pos: { top: number; left: number; width: number; height: number },\n graphic: IGraphic,\n wrapContainer: HTMLElement\n ) => Record<string, any>); // 容器的样式\n}\n\nexport interface CommonDomOptions {\n /**\n * 全局唯一的id\n */\n id?: string;\n /**\n * 容器元素的id或者dom元素\n */\n container: string | HTMLElement | null;\n /**\n * 是否显示\n */\n visible?: boolean;\n /**\n * 是否支持事件冒泡\n */\n pointerEvents?: boolean | string;\n /**\n * 可穿透的事件列表\n * @since 0.21.2\n */\n penetrateEventList?: string[];\n /**\n * 定位类型\n * 'position' - 根据挂载图形节点的坐标也就是x,y进行定位\n * 'boundsLeftTop' - 定位到挂载图形节点bounds的左上角\n * 'left' - 定位到挂载图形节点bounds 的左侧\n * 'right' - 定位到挂载图形节点bounds 的右侧\n * 'bottom' - 定位到挂载图形节点bounds 的底部\n * 'top' - 定位到挂载图形节点bounds 的顶部\n * 'center' - 定位到挂载图形节点bounds 的中心\n * 'top-left' - 定位到挂载图形节点bounds 的左上角\n * 'top-right' - 定位到挂载图形节点bounds 的右上角\n * 'bottom-left' - 定位到挂载图形节点bounds 的左下角\n * 'bottom-right' - 定位到挂载图形节点bounds 的右下角\n */\n anchorType?: 'position' | 'boundsLeftTop' | BoundsAnchorType;\n}\n\nexport type IRoughStyle = {\n fillStyle: 'hachure' | 'solid' | 'zigzag' | 'cross-hatch' | 'dots' | 'sunburst' | 'dashed' | 'zigzag-line';\n roughness: number;\n bowing: number;\n};\n\nexport type IGraphicStyle = ILayout &\n IFillStyle &\n IStrokeStyle &\n IPickStyle & {\n /**\n * 强制设置的bounds宽度,主要用于使用html或者react展示图形的时候,设置一个固定的宽度\n */\n forceBoundsWidth: number | (() => number) | undefined;\n /**\n * 强制设置的bounds高度,主要用于使用html或者react展示图形的时候,设置一个固定的高度\n */\n forceBoundsHeight: number | (() => number) | undefined;\n /**\n * 透明度,会同时影响填充和描边\n */\n opacity: number;\n /**\n * 影子节点\n */\n shadowGraphic?: IGraphic | undefined;\n /**\n * 背景填充模式(与具体图元有关)\n */\n backgroundMode: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';\n /**\n * 是否正好填充,只在repeat-x或者repeat-y以及no-repeat的时候生效\n */\n backgroundFit: boolean;\n /**\n * 是否保持背景图的宽高比\n */\n backgroundKeepAspectRatio: boolean;\n /**\n * 背景图缩放,只在no-repeat的时候生效\n */\n backgroundScale: number;\n /**\n * 背景图偏移,只在no-repeat的时候生效\n */\n backgroundOffsetX: number;\n /**\n * 背景图偏移,只在no-repeat的时候生效\n */\n backgroundOffsetY: number;\n /**\n * 背景图是否裁切,是否调用clip避免绘制到图元外部\n */\n backgroundClip: boolean;\n /**\n * 背景圆角半径\n */\n backgroundCornerRadius: number | number[];\n /**\n * 背景透明度\n */\n backgroundOpacity: number;\n /**\n * 背景,支持颜色字符串、html image元素、html canvas元素\n */\n // 纹理是否自动做动画\n autoAnimateTexture: boolean;\n // 如果做动画的话,这里代表ratio\n textureRatio: number;\n textureOptions: any;\n background:\n | IBackgroundType\n | {\n /**\n * 背景,支持颜色字符串、html image元素、html canvas元素\n */\n background: IBackgroundType;\n /**\n * 背景的x方向偏移量\n */\n dx?: number;\n /**\n * 背景的y方向偏移量\n */\n dy?: number;\n /**\n * 背景宽度\n */\n width?: number;\n /**\n * 背景高度\n */\n height?: number;\n /**\n * 背景的x坐标\n */\n x?: number;\n /**\n * 背景的y坐标\n */\n y?: number;\n }\n | null; // 背景,可以与fill同时存在\n /**\n * 纹理的类型\n */\n texture: TextureType | string;\n /**\n * 纹理的颜色\n */\n textureColor: string;\n /**\n * 纹理的大小\n */\n textureSize: number;\n /**\n * 纹理的间隙\n */\n texturePadding: number;\n\n blur: number;\n /**\n * 设置图形对应的鼠标样式\n */\n cursor: Cursor | null;\n // @deprecated 用处少废弃,后续考虑新设计API\n filter: string;\n renderStyle?: 'default' | 'rough' | any;\n roughStyle?: IRoughStyle | null;\n /**\n * HTML的dom或者string\n */\n html:\n | ({\n /**\n * dom字符串或者dom\n */\n dom: string | HTMLElement;\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n /**\n * 使用react元素渲染内容\n */\n react:\n | ({\n /**\n * react场景节点\n */\n element: any;\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n /**\n * 使用vue组件渲染内容\n */\n vue:\n | ({\n /**\n * vue 虚拟节点\n */\n element: any;\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n };\n\nexport type IPickStyle = {\n /**\n * 给stroke模式的pick额外加的buffer,用于外界控制stroke区域的pick范围\n */\n pickStrokeBuffer: number;\n};\n\nexport type IDebugType = {\n _debug_bounds: boolean | ((c: any, g: any) => void);\n};\nexport type IGraphicAttribute = IDebugType &\n IGraphicStyle &\n ITransform & {\n /**\n * stroke百分比\n */\n strokeSeg: IStrokeSeg | null;\n /**\n * 包围盒的padding\n */\n boundsPadding: number | number[];\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode: 'accurate' | 'imprecise' | 'custom';\n boundsMode: 'accurate' | 'imprecise' | 'empty';\n customPickShape: () => boolean | null;\n /**\n * 是否支持事件拾取,默认为 true。\n * @default true\n */\n pickable: boolean;\n /**\n * 是否支持fill拾取,默认为 true。\n * @experimental\n * @default true\n */\n fillPickable: boolean;\n /**\n * 是否支持stroke拾取,默认为 true。\n * @experimental\n * @default true\n */\n strokePickable: boolean;\n /**\n * 对于 group 节点,是否支持其子元素的事件拾取,默认为 true。\n * 如果 group `pickable` 关闭,`childrenPickable` 开启,那么 group 的子节点仍参与事件拾取\n * @default true\n */\n childrenPickable: boolean;\n /**\n * 元素是否可见。\n * @default true\n */\n visible: boolean;\n /**\n * 分组下的层级,层级越小越先绘制\n */\n zIndex: number;\n layout: any;\n /**\n * 是否隐藏元素(只是绘制的时候不绘制)\n */\n renderable: boolean;\n /**\n * 是否在3d中控制方向\n * false: 不控制方向\n * true: 始终控制方向朝摄像机\n */\n keepDirIn3d?: boolean;\n shadowRootIdx: number;\n shadowPickMode?: 'full' | 'graphic';\n /**\n * 全局范围的层级,设置了这个属性的图形,会提取到交互层进行渲染\n */\n globalZIndex: number;\n /**\n * canvas 的合成方式\n */\n globalCompositeOperation: CanvasRenderingContext2D['globalCompositeOperation'] | '';\n /**\n * 完全支持滚动 | 完全不支持滚动 | 支持x方向的滚动 | 支持y方向的滚动\n */\n overflow: 'scroll' | 'hidden' | 'scroll-x' | 'scroll-y';\n /**\n * 绘制fill和stroke的顺序,为0表示fill先绘制,1表示stroke先绘制\n */\n fillStrokeOrder: number;\n /**\n * @since 0.20.15\n * 保持stroke的scale,默认为false,为true的话stroke显示的宽度会随着scale变化\n */\n keepStrokeScale: boolean;\n\n /**\n * @since 0.22.2\n * 裁剪路径,用于裁剪图形,用于普通图元的裁剪\n * 由于一般情况下普通图元只需要一个形状即可,所以这里不需要配置具体的位置和大小,强制中心在图元中心,宽高和图元Bounds宽高一致\n * 不考虑其他复杂情况,否则配置项就非常多了,比如多路径,或者配置位置大小等,如果配置大小那还得用户自己去拿图元的大小,目前没有这种需求\n */\n clipConfig: {\n shape: string;\n } | null;\n };\n\nexport interface IGraphicJson<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>> {\n attribute: Partial<T>;\n _uid: number;\n type: string;\n name: string;\n children: IGraphicJson<T>[];\n}\n\n/** the context of setAttribute */\nexport type ISetAttributeContext = {\n /** type of setAttribute */\n type?: number;\n animationState?: {\n step?: IStep;\n isFirstFrameOfStep?: boolean;\n /** ratio of animation */\n ratio?: number;\n /** is animation end? */\n end?: boolean;\n };\n skipUpdateCallback?: boolean;\n};\n\nexport type IGraphicAnimateParams = {\n slience?: boolean;\n id?: number | string;\n timeline?: ITimeline;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n};\n\nexport interface IGraphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends INode,\n IAnimateTarget {\n type?: GraphicType;\n numberType?: number;\n stage?: IStage;\n layer?: ILayer;\n shadowRoot?: IShadowRoot;\n glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n backgroundImg?: boolean;\n attachedThemeGraphic?: IGraphic<any>;\n /**\n * 保存语法上下文\n */\n context?: Record<string, any>;\n bindDom?: Map<\n string | HTMLElement,\n { container: HTMLElement | string; dom: HTMLElement | any; wrapGroup: HTMLDivElement | any; root?: any }\n >;\n\n valid: boolean;\n parent: IGroup | null;\n isContainer?: boolean;\n // 是否是3d模式(是否应用3d视角)\n in3dMode?: boolean;\n\n // 不考虑transform的宽高,特殊情况下会使用到\n widthWithoutTransform?: number;\n heightWithoutTransform?: number;\n\n // 上次更新的stamp\n stamp?: number;\n animationBackUps?: {\n from: Record<string, any>;\n to: Record<string, any>;\n };\n\n attribute: Partial<T>;\n\n /** 用于实现morph动画场景,转换成bezier曲线渲染 */\n pathProxy?: ICustomPath2D | ((attrs: T) => ICustomPath2D);\n incremental?: number;\n incrementalAt?: number;\n\n /** 记录state对应的图形属性 */\n states?: Record<string, Partial<T>>;\n normalAttrs?: Partial<T>;\n stateProxy?: (stateName: string, targetStates?: string[]) => Partial<T>;\n findFace?: () => IFace3d;\n toggleState: (stateName: string, hasAnimation?: boolean) => void;\n removeState: (stateName: string, hasAnimation?: boolean) => void;\n clearStates: (hasAnimation?: boolean) => void;\n useStates: (states: string[], hasAnimation?: boolean) => void;\n addState: (stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) => void;\n hasState: (stateName?: string) => boolean;\n getState: (stateName: string) => Partial<T>;\n onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n applyStateAttrs: (attrs: Partial<T>, stateNames: string[], hasAnimation?: boolean, isClear?: boolean) => void;\n updateNormalAttrs: (stateAttrs: Partial<T>) => void;\n\n // get\n readonly AABBBounds: IAABBBounds; // 用于获取当前节点的AABB包围盒\n readonly OBBBounds: IOBBBounds; // 获取OBB包围盒,旋转防重叠需要用\n readonly globalAABBBounds: IAABBBounds; // 全局AABB包围盒\n readonly transMatrix: IMatrix; // 变换矩阵,动态计算\n readonly globalTransMatrix: IMatrix; // 变换矩阵,动态计算\n\n getOffsetXY: (attr?: ITransform) => IPoint;\n\n // function\n containsPoint: (x: number, y: number, mode?: IContainPointMode, picker?: IPickerService) => boolean;\n\n setMode: (mode: '3d' | '2d') => void;\n isValid: () => boolean;\n\n getClipPath: () => ISymbolClass | null;\n\n // TODO: transform API\n // 基于当前transform的变换,普通用户尽量别用,拿捏不住的~\n translate: (x: number, y: number) => this;\n translateTo: (x: number, y: number) => this;\n scale: (scaleX: number, scaleY: number, scaleCenter?: IPointLike) => this;\n scaleTo: (scaleX: number, scaleY: number) => this;\n rotate: (angle: number, rotateCenter?: IPointLike) => this;\n rotateTo: (angle: number) => this;\n skewTo: (b: number, c: number) => this;\n addUpdateBoundTag: () => void;\n addUpdateShapeAndBoundsTag: () => void;\n addUpdateLayoutTag: () => void;\n\n update: (d?: { bounds: boolean; trans: boolean }) => void;\n\n // animate\n animate?: (params?: IGraphicAnimateParams) => IAnimate;\n\n // 语法糖,可有可无,有的为了首屏性能考虑做成get方法,有的由外界直接托管,内部不赋值\n name?: string;\n\n // 供render处理shape缓存tag\n shouldUpdateShape: () => boolean;\n clearUpdateShapeTag: () => void;\n\n // // 供render缓存shape\n // cacheShape?: ICustomPath2D;\n // // 线段使用的path2D\n // cacheLine?: ISegPath2D | ISegPath2D[];\n // // 面积图使用的path2D\n // cacheArea?: IAreaCacheItem | IAreaCacheItem[];\n\n setAttributes: (params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n initAttributes: (params: Partial<T>) => void;\n\n setAttribute: (key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n setStage: (stage?: IStage, layer?: ILayer) => void;\n onSetStage: (cb: (g: IGraphic, stage: IStage) => void) => void;\n\n shouldUpdateAABBBounds: () => boolean;\n shouldSelfChangeUpdateAABBBounds: () => boolean;\n shouldUpdateGlobalMatrix: () => boolean;\n\n addUpdatePositionTag: () => void;\n addUpdateGlobalPositionTag: () => void;\n\n attachShadow: () => IShadowRoot;\n detachShadow: () => void;\n\n toJson: () => IGraphicJson;\n\n /** 创建pathProxy */\n createPathProxy: (path?: string) => void;\n /** 将图形转换成CustomPath2D */\n toCustomPath?: () => ICustomPath2D;\n\n resources?: Map<\n string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n imageLoadSuccess: (url: string, data: HTMLImageElement) => void;\n imageLoadFail: (url: string) => void;\n\n clone: () => IGraphic;\n stopAnimates: (stopChildren?: boolean) => void;\n getNoWorkAnimateAttr: () => Record<string, number>;\n getGraphicTheme: () => T;\n\n getAttributes: (final?: boolean) => Partial<T>;\n}\n\nexport interface IRoot extends IGraphic {\n pick: (x: number, y: number) => IGraphic;\n}\n\n/**\n * 动画配置\n */\nexport type IAnimateConfig = {\n duration?: number;\n easing?: EasingType;\n};\n\nexport type GraphicReleaseStatus = 'released' | 'willRelease';\n"]}
@@ -25,6 +25,7 @@ export interface IRenderService {
25
25
  renderTreeRoots: IGraphic[];
26
26
  renderLists: IGraphic[];
27
27
  drawParams: IRenderServiceDrawParams;
28
+ drawContribution: IDrawContribution;
28
29
  prepare: (updateBounds: boolean) => void;
29
30
  prepareRenderList: () => void;
30
31
  beforeDraw: (params: IRenderServiceDrawParams) => void;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/render.ts"],"names":[],"mappings":"","file":"render.js","sourcesContent":["import type { IAABBBounds, IBounds, IMatrix, IMatrixLike } from '@visactor/vutils';\nimport type { IColor } from './color';\nimport type { IContext2d } from './context';\nimport type { IGraphic, IGraphicAttribute } from './graphic';\nimport type { IMarkAttribute, IThemeAttribute } from './graphic/creator';\nimport type { IFullThemeSpec } from './graphic/theme';\nimport type { ILayer } from './layer';\nimport type { IStage } from './stage';\nimport type { IGroup } from './graphic/group';\nimport type { MaybePromise } from './common';\nimport type { ISyncHook } from './sync-hook';\n\n// 用于绘制的参数,提供context\n// TODO: 考虑是否可以隐藏上下文类型\nexport interface IRenderServiceDrawParams {\n context?: IContext2d;\n\n // 绘制的区域以及是否需要清屏\n clear?: string | IColor | boolean;\n viewBox: IBounds;\n transMatrix?: IMatrixLike;\n stage: IStage;\n layer: ILayer;\n renderService: IRenderService;\n updateBounds: boolean;\n renderStyle?: string;\n}\n\nexport interface IRenderService {\n dirtyBounds: IBounds;\n renderTreeRoots: IGraphic[]; // 此次render的数组\n renderLists: IGraphic[];\n drawParams: IRenderServiceDrawParams;\n\n prepare: (updateBounds: boolean) => void;\n prepareRenderList: () => void;\n beforeDraw: (params: IRenderServiceDrawParams) => void;\n draw: (params: IRenderServiceDrawParams) => void;\n afterDraw: (params: IRenderServiceDrawParams) => void;\n render: (groups: IGroup[], params: IRenderServiceDrawParams) => MaybePromise<void>;\n}\n\nexport interface IDrawContext extends IRenderServiceDrawParams {\n startAtId?: number;\n break?: boolean;\n restartIncremental?: boolean;\n // multi图元开始的位置\n multiGraphicOptions?: {\n startAtIdx: number;\n length: number;\n };\n in3dInterceptor?: boolean;\n drawContribution?: IDrawContribution;\n // hack内容\n hack_pieFace?: 'inside' | 'bottom' | 'top' | 'outside';\n // group是否有旋转,每一个renderGroup都会更新,用于在renderItem的时候给子节点使用\n isGroupScroll?: boolean;\n}\n\nexport interface IDrawContribution {\n hooks?: {\n completeDraw: ISyncHook<[]>;\n };\n dirtyBounds?: IAABBBounds;\n backupDirtyBounds?: IAABBBounds;\n rendering?: boolean;\n currentRenderMap: Map<number, IGraphicRender>;\n defaultRenderMap: Map<number, IGraphicRender>;\n styleRenderMap: Map<string, Map<number, IGraphicRender>>;\n draw: (renderService: IRenderService, drawParams: IDrawContext) => MaybePromise<void>;\n afterDraw?: (renderService: IRenderService, drawParams: IDrawContext) => MaybePromise<void>;\n getRenderContribution: (graphic: IGraphic) => IGraphicRender | null;\n renderGroup: (group: IGroup, drawContext: IDrawContext, matrix: IMatrixLike, skipSort?: boolean) => void;\n renderItem: (graphic: IGraphic, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) => void;\n}\n\nexport interface IGraphicRenderDrawParams {\n beforeDrawCb?: () => void;\n afterDrawCb?: () => void;\n drawingCb?: () => void;\n skipDraw?: boolean;\n theme?: IFullThemeSpec;\n // TODO 这里是为了性能优化,之前使用匿名函数的方式闭包等逻辑会影响性能,现在直接将函数显示定义,将参数传入提升性能,就是牺牲了代码可读性\n // 用于在group中进行递归渲染的参数\n renderInGroupParams?: {\n skipSort?: boolean;\n nextM?: IMatrixLike;\n };\n // 用于在group中进行递归渲染的函数\n renderInGroup?: (skipSort: boolean, group: IGroup, drawContext: IDrawContext, nextM: IMatrixLike) => void;\n}\n\nexport interface IGraphicRender {\n type: string; // 图元类型\n numberType: number;\n style?: string;\n z?: number;\n draw: (\n graphic: IGraphic,\n renderService: IRenderService,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams\n ) => void;\n drawShape?: (\n graphic: IGraphic,\n ctx: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) => void;\n}\n\nexport interface IBeforeRenderConstribution {\n apply: (renderService: IRenderService) => MaybePromise<void>;\n}\n\nexport interface IRenderSelector {\n selector: (graphic: IGraphic) => IGraphicRender | null;\n}\n\nexport interface IDrawItemInterceptorContribution {\n order: number;\n beforeDrawItem?: (\n graphic: IGraphic,\n renderService: IRenderService,\n drawContext: IDrawContext,\n drawContribution: IDrawContribution,\n params?: IGraphicRenderDrawParams\n ) => boolean;\n afterDrawItem?: (\n graphic: IGraphic,\n renderService: IRenderService,\n drawContext: IDrawContext,\n drawContribution: IDrawContribution,\n params?: IGraphicRenderDrawParams\n ) => boolean;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/render.ts"],"names":[],"mappings":"","file":"render.js","sourcesContent":["import type { IAABBBounds, IBounds, IMatrix, IMatrixLike } from '@visactor/vutils';\nimport type { IColor } from './color';\nimport type { IContext2d } from './context';\nimport type { IGraphic, IGraphicAttribute } from './graphic';\nimport type { IMarkAttribute, IThemeAttribute } from './graphic/creator';\nimport type { IFullThemeSpec } from './graphic/theme';\nimport type { ILayer } from './layer';\nimport type { IStage } from './stage';\nimport type { IGroup } from './graphic/group';\nimport type { MaybePromise } from './common';\nimport type { ISyncHook } from './sync-hook';\n\n// 用于绘制的参数,提供context\n// TODO: 考虑是否可以隐藏上下文类型\nexport interface IRenderServiceDrawParams {\n context?: IContext2d;\n\n // 绘制的区域以及是否需要清屏\n clear?: string | IColor | boolean;\n viewBox: IBounds;\n transMatrix?: IMatrixLike;\n stage: IStage;\n layer: ILayer;\n renderService: IRenderService;\n updateBounds: boolean;\n renderStyle?: string;\n}\n\nexport interface IRenderService {\n dirtyBounds: IBounds;\n renderTreeRoots: IGraphic[]; // 此次render的数组\n renderLists: IGraphic[];\n drawParams: IRenderServiceDrawParams;\n drawContribution: IDrawContribution;\n\n prepare: (updateBounds: boolean) => void;\n prepareRenderList: () => void;\n beforeDraw: (params: IRenderServiceDrawParams) => void;\n draw: (params: IRenderServiceDrawParams) => void;\n afterDraw: (params: IRenderServiceDrawParams) => void;\n render: (groups: IGroup[], params: IRenderServiceDrawParams) => MaybePromise<void>;\n}\n\nexport interface IDrawContext extends IRenderServiceDrawParams {\n startAtId?: number;\n break?: boolean;\n restartIncremental?: boolean;\n // multi图元开始的位置\n multiGraphicOptions?: {\n startAtIdx: number;\n length: number;\n };\n in3dInterceptor?: boolean;\n drawContribution?: IDrawContribution;\n // hack内容\n hack_pieFace?: 'inside' | 'bottom' | 'top' | 'outside';\n // group是否有旋转,每一个renderGroup都会更新,用于在renderItem的时候给子节点使用\n isGroupScroll?: boolean;\n}\n\nexport interface IDrawContribution {\n hooks?: {\n completeDraw: ISyncHook<[]>;\n };\n dirtyBounds?: IAABBBounds;\n backupDirtyBounds?: IAABBBounds;\n rendering?: boolean;\n currentRenderMap: Map<number, IGraphicRender>;\n defaultRenderMap: Map<number, IGraphicRender>;\n styleRenderMap: Map<string, Map<number, IGraphicRender>>;\n draw: (renderService: IRenderService, drawParams: IDrawContext) => MaybePromise<void>;\n afterDraw?: (renderService: IRenderService, drawParams: IDrawContext) => MaybePromise<void>;\n getRenderContribution: (graphic: IGraphic) => IGraphicRender | null;\n renderGroup: (group: IGroup, drawContext: IDrawContext, matrix: IMatrixLike, skipSort?: boolean) => void;\n renderItem: (graphic: IGraphic, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) => void;\n}\n\nexport interface IGraphicRenderDrawParams {\n beforeDrawCb?: () => void;\n afterDrawCb?: () => void;\n drawingCb?: () => void;\n skipDraw?: boolean;\n theme?: IFullThemeSpec;\n // TODO 这里是为了性能优化,之前使用匿名函数的方式闭包等逻辑会影响性能,现在直接将函数显示定义,将参数传入提升性能,就是牺牲了代码可读性\n // 用于在group中进行递归渲染的参数\n renderInGroupParams?: {\n skipSort?: boolean;\n nextM?: IMatrixLike;\n };\n // 用于在group中进行递归渲染的函数\n renderInGroup?: (skipSort: boolean, group: IGroup, drawContext: IDrawContext, nextM: IMatrixLike) => void;\n}\n\nexport interface IGraphicRender {\n type: string; // 图元类型\n numberType: number;\n style?: string;\n z?: number;\n draw: (\n graphic: IGraphic,\n renderService: IRenderService,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams\n ) => void;\n drawShape?: (\n graphic: IGraphic,\n ctx: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) => void;\n}\n\nexport interface IBeforeRenderConstribution {\n apply: (renderService: IRenderService) => MaybePromise<void>;\n}\n\nexport interface IRenderSelector {\n selector: (graphic: IGraphic) => IGraphicRender | null;\n}\n\nexport interface IDrawItemInterceptorContribution {\n order: number;\n beforeDrawItem?: (\n graphic: IGraphic,\n renderService: IRenderService,\n drawContext: IDrawContext,\n drawContribution: IDrawContribution,\n params?: IGraphicRenderDrawParams\n ) => boolean;\n afterDrawItem?: (\n graphic: IGraphic,\n renderService: IRenderService,\n drawContext: IDrawContext,\n drawContribution: IDrawContribution,\n params?: IGraphicRenderDrawParams\n ) => boolean;\n}\n"]}
package/es/modules.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { IGlobal, IGraphicService } from './interface';
1
+ import type { IGlobal, IGraphicService, IRenderService } from './interface';
2
2
  import type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';
3
3
  export declare function preLoadAllModule(): void;
4
4
  export declare namespace preLoadAllModule {
@@ -8,4 +8,5 @@ export declare const vglobal: IGlobal;
8
8
  export declare const graphicUtil: IGraphicUtil;
9
9
  export declare const transformUtil: ITransformUtil;
10
10
  export declare const graphicService: IGraphicService;
11
+ export declare const renderService: IRenderService;
11
12
  export declare const layerService: ILayerService;
package/es/modules.js CHANGED
@@ -24,6 +24,8 @@ import { container } from "./container";
24
24
 
25
25
  import { VGlobal } from "./constants";
26
26
 
27
+ import { RenderService } from "./render";
28
+
27
29
  export function preLoadAllModule() {
28
30
  preLoadAllModule.__loaded || (preLoadAllModule.__loaded = !0, container.load(coreModule),
29
31
  container.load(graphicModule), container.load(renderModule), container.load(pickModule),
@@ -48,6 +50,10 @@ export const graphicService = container.get(GraphicService);
48
50
 
49
51
  application.graphicService = graphicService;
50
52
 
53
+ export const renderService = container.get(RenderService);
54
+
55
+ application.renderService = renderService;
56
+
51
57
  export const layerService = container.get(LayerService);
52
58
 
53
59
  application.layerService = layerService;
package/es/modules.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAE/C,OAAO,aAAa,MAAM,0CAA0C,CAAC;AACrE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,wBAAwB,MAAM,8BAA8B,CAAC;AACpE,OAAO,uBAAuB,MAAM,gCAAgC,CAAC;AAGrE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,UAAU,gBAAgB;IAC9B,IAAI,gBAAgB,CAAC,QAAQ,EAAE;QAC7B,OAAO;KACR;IACD,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC9B,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7B,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAE3B,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7B,wBAAwB,CAAC,SAAS,CAAC,CAAC;IACpC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AACrC,CAAC;AAED,gBAAgB,CAAC,QAAQ,GAAG,KAAK,CAAC;AAElC,gBAAgB,EAAE,CAAC;AAKnB,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAU,OAAO,CAAC,CAAC;AACvD,WAAW,CAAC,MAAM,GAAG,OAAO,CAAC;AAC7B,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,GAAG,CAAe,WAAW,CAAC,CAAC;AACpE,WAAW,CAAC,WAAW,GAAG,WAAW,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC,GAAG,CAAiB,aAAa,CAAC,CAAC;AAC1E,WAAW,CAAC,aAAa,GAAG,aAAa,CAAC;AAC1C,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC,GAAG,CAAkB,cAAc,CAAC,CAAC;AAC7E,WAAW,CAAC,cAAc,GAAG,cAAc,CAAC;AAa5C,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAgB,YAAY,CAAC,CAAC;AACvE,WAAW,CAAC,YAAY,GAAG,YAAY,CAAC","file":"modules.js","sourcesContent":["import coreModule from './core/core-modules';\nimport renderModule from './render/render-modules';\nimport pickModule from './picker/pick-modules';\n// import allocatorModule from './allocator/allocator-modules';\nimport graphicModule from './graphic/graphic-service/graphic-module';\nimport pluginModule from './plugins/plugin-modules';\nimport loadBuiltinContributions from './core/contributions/modules';\nimport loadRenderContributions from './render/contributions/modules';\n// import loadPickContributions from './picker/contributions/modules';\n// import loadCanvasContributions from './canvas/contributions/modules';\nimport { LayerService } from './core/constants';\n// import { IMat4Allocate, IMatrixAllocate, Mat4Allocate, MatrixAllocate } from './allocator/matrix-allocate';\n// import { GlobalPickerService } from './picker/constants';\nimport type { IGlobal, IGraphicService, IPickerService } from './interface';\nimport { application } from './application';\nimport type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';\nimport { GraphicService } from './graphic/constants';\nimport { GraphicUtil, TransformUtil } from './core/constants';\nimport { container } from './container';\nimport { VGlobal } from './constants';\n\nexport function preLoadAllModule() {\n if (preLoadAllModule.__loaded) {\n return;\n }\n preLoadAllModule.__loaded = true;\n container.load(coreModule);\n container.load(graphicModule);\n container.load(renderModule);\n container.load(pickModule);\n // container.load(allocatorModule);\n container.load(pluginModule);\n loadBuiltinContributions(container);\n loadRenderContributions(container);\n}\n\npreLoadAllModule.__loaded = false;\n\npreLoadAllModule();\n// loadPickContributions(container);\n// loadCanvasContributions(container);\n\n// 全局变量\nexport const vglobal = container.get<IGlobal>(VGlobal);\napplication.global = vglobal;\nexport const graphicUtil = container.get<IGraphicUtil>(GraphicUtil);\napplication.graphicUtil = graphicUtil;\nexport const transformUtil = container.get<ITransformUtil>(TransformUtil);\napplication.transformUtil = transformUtil;\nexport const graphicService = container.get<IGraphicService>(GraphicService);\napplication.graphicService = graphicService;\n// export const matrixAllocate = container.get<IMatrixAllocate>(MatrixAllocate);\n// export const mat4Allocate = container.get<IMat4Allocate>(Mat4Allocate);\n// export const canvasAllocate = container.get<ICanvasAllocate>(CanvasAllocate);\n// export const arcAllocate = container.get<IArcAllocate>(ArcAllocate);\n// export const areaAllocate = container.get<IAreaAllocate>(AreaAllocate);\n// export const circleAllocate = container.get<ICircleAllocate>(CircleAllocate);\n// export const lineAllocate = container.get<ILineAllocate>(LineAllocate);\n// export const pathAllocate = container.get<IPathAllocate>(PathAllocate);\n// export const rectAllocate = container.get<IRectAllocate>(RectAllocate);\n// export const symbolAllocate = container.get<ISymbolAllocate>(SymbolAllocate);\n// export const textAllocate = container.get<ITextAllocate>(TextAllocate);\n// export const pickerService = container.get<IPickerService>(GlobalPickerService);\nexport const layerService = container.get<ILayerService>(LayerService);\napplication.layerService = layerService;\n"]}
1
+ {"version":3,"sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAE/C,OAAO,aAAa,MAAM,0CAA0C,CAAC;AACrE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,wBAAwB,MAAM,8BAA8B,CAAC;AACpE,OAAO,uBAAuB,MAAM,gCAAgC,CAAC;AAGrE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,gBAAgB;IAC9B,IAAI,gBAAgB,CAAC,QAAQ,EAAE;QAC7B,OAAO;KACR;IACD,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC9B,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7B,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAE3B,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7B,wBAAwB,CAAC,SAAS,CAAC,CAAC;IACpC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AACrC,CAAC;AAED,gBAAgB,CAAC,QAAQ,GAAG,KAAK,CAAC;AAElC,gBAAgB,EAAE,CAAC;AAKnB,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAU,OAAO,CAAC,CAAC;AACvD,WAAW,CAAC,MAAM,GAAG,OAAO,CAAC;AAC7B,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,GAAG,CAAe,WAAW,CAAC,CAAC;AACpE,WAAW,CAAC,WAAW,GAAG,WAAW,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC,GAAG,CAAiB,aAAa,CAAC,CAAC;AAC1E,WAAW,CAAC,aAAa,GAAG,aAAa,CAAC;AAC1C,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC,GAAG,CAAkB,cAAc,CAAC,CAAC;AAC7E,WAAW,CAAC,cAAc,GAAG,cAAc,CAAC;AAC5C,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC,GAAG,CAAiB,aAAa,CAAC,CAAC;AAC1E,WAAW,CAAC,aAAa,GAAG,aAAa,CAAC;AAa1C,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAgB,YAAY,CAAC,CAAC;AACvE,WAAW,CAAC,YAAY,GAAG,YAAY,CAAC","file":"modules.js","sourcesContent":["import coreModule from './core/core-modules';\nimport renderModule from './render/render-modules';\nimport pickModule from './picker/pick-modules';\n// import allocatorModule from './allocator/allocator-modules';\nimport graphicModule from './graphic/graphic-service/graphic-module';\nimport pluginModule from './plugins/plugin-modules';\nimport loadBuiltinContributions from './core/contributions/modules';\nimport loadRenderContributions from './render/contributions/modules';\n// import loadPickContributions from './picker/contributions/modules';\n// import loadCanvasContributions from './canvas/contributions/modules';\nimport { LayerService } from './core/constants';\n// import { IMat4Allocate, IMatrixAllocate, Mat4Allocate, MatrixAllocate } from './allocator/matrix-allocate';\n// import { GlobalPickerService } from './picker/constants';\nimport type { IGlobal, IGraphicService, IPickerService, IRenderService } from './interface';\nimport { application } from './application';\nimport type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';\nimport { GraphicService } from './graphic/constants';\nimport { GraphicUtil, TransformUtil } from './core/constants';\nimport { container } from './container';\nimport { VGlobal } from './constants';\nimport { RenderService } from './render';\n\nexport function preLoadAllModule() {\n if (preLoadAllModule.__loaded) {\n return;\n }\n preLoadAllModule.__loaded = true;\n container.load(coreModule);\n container.load(graphicModule);\n container.load(renderModule);\n container.load(pickModule);\n // container.load(allocatorModule);\n container.load(pluginModule);\n loadBuiltinContributions(container);\n loadRenderContributions(container);\n}\n\npreLoadAllModule.__loaded = false;\n\npreLoadAllModule();\n// loadPickContributions(container);\n// loadCanvasContributions(container);\n\n// 全局变量\nexport const vglobal = container.get<IGlobal>(VGlobal);\napplication.global = vglobal;\nexport const graphicUtil = container.get<IGraphicUtil>(GraphicUtil);\napplication.graphicUtil = graphicUtil;\nexport const transformUtil = container.get<ITransformUtil>(TransformUtil);\napplication.transformUtil = transformUtil;\nexport const graphicService = container.get<IGraphicService>(GraphicService);\napplication.graphicService = graphicService;\nexport const renderService = container.get<IRenderService>(RenderService);\napplication.renderService = renderService;\n// export const matrixAllocate = container.get<IMatrixAllocate>(MatrixAllocate);\n// export const mat4Allocate = container.get<IMat4Allocate>(Mat4Allocate);\n// export const canvasAllocate = container.get<ICanvasAllocate>(CanvasAllocate);\n// export const arcAllocate = container.get<IArcAllocate>(ArcAllocate);\n// export const areaAllocate = container.get<IAreaAllocate>(AreaAllocate);\n// export const circleAllocate = container.get<ICircleAllocate>(CircleAllocate);\n// export const lineAllocate = container.get<ILineAllocate>(LineAllocate);\n// export const pathAllocate = container.get<IPathAllocate>(PathAllocate);\n// export const rectAllocate = container.get<IRectAllocate>(RectAllocate);\n// export const symbolAllocate = container.get<ISymbolAllocate>(SymbolAllocate);\n// export const textAllocate = container.get<ITextAllocate>(TextAllocate);\n// export const pickerService = container.get<IPickerService>(GlobalPickerService);\nexport const layerService = container.get<ILayerService>(LayerService);\napplication.layerService = layerService;\n"]}
@@ -0,0 +1 @@
1
+ export declare function registerStarGraphic(): void;
@@ -0,0 +1,8 @@
1
+ import { createStar } from "../graphic/star";
2
+
3
+ import { graphicCreator } from "../graphic/graphic-creator";
4
+
5
+ export function registerStarGraphic() {
6
+ graphicCreator.RegisterGraphicCreator("star", createStar);
7
+ }
8
+ //# sourceMappingURL=register-star.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/register/register-star.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,MAAM,UAAU,mBAAmB;IACjC,cAAc,CAAC,sBAAsB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAC5D,CAAC","file":"register-star.js","sourcesContent":["import { createStar } from '../graphic/star';\nimport { graphicCreator } from '../graphic/graphic-creator';\n\nexport function registerStarGraphic() {\n graphicCreator.RegisterGraphicCreator('star', createStar);\n}\n"]}
@@ -195,7 +195,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
195
195
  } else startP = points[0], endP = points[points.length - 1];
196
196
  const xTotalLength = abs(endP.x - startP.x), yTotalLength = abs(endP.y - startP.y);
197
197
  direction = null == endP.x1 ? Direction.ROW : null == endP.y1 ? Direction.COLUMN : Number.isFinite(xTotalLength + yTotalLength) ? xTotalLength > yTotalLength ? Direction.ROW : Direction.COLUMN : Direction.ROW,
198
- drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {
198
+ drawAreaSegments(context, cache, clipRange, {
199
199
  offsetX: offsetX,
200
200
  offsetY: offsetY,
201
201
  offsetZ: offsetZ,
@@ -211,7 +211,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
211
211
  if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute); else {
212
212
  const {stroke: stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke} = attribute;
213
213
  isArray(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(),
214
- drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction.ROW ? "x" : "y", {
214
+ drawSegments(context, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction.ROW ? "x" : "y", {
215
215
  offsetX: offsetX,
216
216
  offsetY: offsetY,
217
217
  offsetZ: offsetZ
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/area-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAkB3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,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AC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,sBAAsB,CAAC,CAAA;;GANrB,uBAAuB,CA0lBnC;SA1lBY,uBAAuB","file":"area-render.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport { abs, isArray, min } from '@visactor/vutils';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\nimport type {\n IArea,\n IAreaCacheItem,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IThemeAttribute,\n ISegPath2D,\n IAreaRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider\n} from '../../../interface';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { calcLineCache } from '../../../common/segment';\n\nimport { getTheme } from '../../../graphic/theme';\nimport { AreaRenderContribution } from './contributions/constants';\nimport { Direction } from '../../../common/enums';\nimport { drawAreaSegments } from '../../../common/render-area';\nimport { AREA_NUMBER_TYPE } from '../../../graphic/constants';\nimport { drawSegments } from '../../../common/render-curve';\nimport { BaseRender } from './base-render';\nimport {\n defaultAreaBackgroundRenderContribution,\n defaultAreaTextureRenderContribution\n} from './contributions/area-contribution-render';\n\n@injectable()\nexport class DefaultCanvasAreaRender extends BaseRender<IArea> implements IGraphicRender {\n type: 'area';\n numberType: number = AREA_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(AreaRenderContribution)\n protected readonly areaRenderContribitions: IContributionProvider<IAreaRenderContribution>\n ) {\n super();\n this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution];\n this.init(areaRenderContribitions);\n }\n\n drawLinearAreaHighPerformance(\n area: IArea,\n context: IContext2d,\n fill: boolean,\n stroke: boolean,\n fillOpacity: number,\n strokeOpacity: number,\n offsetX: number,\n offsetY: number,\n areaAttribute: Required<IAreaGraphicAttribute>,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const { points } = area.attribute;\n if (points.length < 2) {\n return;\n }\n context.beginPath();\n\n const z = this.z ?? 0;\n const startP = points[0];\n\n context.moveTo(startP.x + offsetX, startP.y + offsetY, z);\n for (let i = 1; i < points.length; i++) {\n const p = points[i];\n context.lineTo(p.x + offsetX, p.y + offsetY, z);\n }\n for (let i = points.length - 1; i >= 0; i--) {\n const p = points[i];\n context.lineTo((p.x1 ?? p.x) + offsetX, (p.y1 ?? p.y) + offsetY, z);\n }\n context.closePath();\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute);\n\n this.beforeRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n areaAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute: area.attribute }\n );\n\n const { x: originX = 0, x: originY = 0 } = area.attribute;\n const _runFill = () => {\n if (fill !== false) {\n if (fillCb) {\n fillCb(context, area.attribute, areaAttribute);\n } else if (fillOpacity) {\n context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);\n context.fill();\n }\n }\n };\n\n const _runStroke = () => {\n if (stroke) {\n const { stroke = areaAttribute && areaAttribute.stroke } = area.attribute;\n if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {\n context.beginPath();\n if (stroke[0]) {\n context.moveTo(startP.x + offsetX, startP.y + offsetY, z);\n for (let i = 1; i < points.length; i++) {\n const p = points[i];\n context.lineTo(p.x + offsetX, p.y + offsetY, z);\n }\n } else if (stroke[2]) {\n const endP = points[points.length - 1];\n context.moveTo(endP.x + offsetX, endP.y + offsetY, z);\n for (let i = points.length - 2; i >= 0; i--) {\n const p = points[i];\n context.lineTo((p.x1 ?? p.x) + offsetX, (p.y1 ?? p.y) + offsetY, z);\n }\n }\n }\n if (strokeCb) {\n strokeCb(context, area.attribute, areaAttribute);\n } else {\n context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);\n context.stroke();\n }\n }\n };\n\n _runFill();\n this.afterRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n areaAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute: area.attribute }\n );\n _runStroke();\n }\n\n drawShape(\n area: IArea,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const areaAttribute = getTheme(area, params?.theme).area;\n const {\n fill = areaAttribute.fill,\n stroke = areaAttribute.stroke,\n fillOpacity = areaAttribute.fillOpacity,\n z = areaAttribute.z,\n strokeOpacity = areaAttribute.strokeOpacity,\n curveTension = areaAttribute.curveTension,\n connectedType = areaAttribute.connectedType\n } = area.attribute;\n\n const data = this.valid(area, areaAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { doFill } = data;\n const doStroke = data.doStroke && data.sVisible;\n\n const { clipRange = areaAttribute.clipRange, closePath, points, segments } = area.attribute;\n let { curveType = areaAttribute.curveType } = area.attribute;\n if (closePath && curveType === 'linear') {\n curveType = 'linearClosed';\n }\n\n function parsePoint(points: IPointLike[], connectedType: 'none' | 'connect') {\n if (connectedType !== 'connect') {\n return points;\n }\n return points.filter(p => p.defined !== false);\n }\n\n if (clipRange === 1 && !segments && !points.some(p => p.defined === false) && curveType === 'linear') {\n return this.drawLinearAreaHighPerformance(\n area,\n context,\n !!fill,\n doStroke,\n fillOpacity,\n strokeOpacity,\n x,\n y,\n areaAttribute,\n drawContext,\n params,\n fillCb,\n strokeCb\n );\n }\n\n // 更新cache\n if (area.shouldUpdateShape()) {\n if (segments && segments.length) {\n let startPoint: IPointLike;\n let lastTopSeg: { endX: number; endY: number };\n const topCaches = segments\n .map((seg, index) => {\n if (seg.points.length <= 1) {\n // 第一个点的话,直接设置lastTopSeg\n if (index === 0) {\n seg.points[0] && (lastTopSeg = { endX: seg.points[0].x, endY: seg.points[0].y });\n return null;\n }\n }\n // 添加上一个segment结束的点作为这个segment的起始点\n if (index === 1) {\n startPoint = { x: lastTopSeg.endX, y: lastTopSeg.endY };\n } else if (index > 1) {\n startPoint.x = lastTopSeg.endX;\n startPoint.y = lastTopSeg.endY;\n }\n const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {\n startPoint,\n curveTension\n });\n lastTopSeg = data;\n return data;\n })\n .filter(item => !!item);\n let lastBottomSeg: ISegPath2D;\n const bottomCaches = [];\n for (let i = segments.length - 1; i >= 0; i--) {\n const points = segments[i].points;\n const bottomPoints: IPointLike[] = [];\n for (let i = points.length - 1; i >= 0; i--) {\n bottomPoints.push({\n x: points[i].x1 ?? points[i].x,\n y: points[i].y1 ?? points[i].y\n });\n }\n // 处理一下bottom的segments,bottom的segments需要手动添加endPoints\n if (i !== 0) {\n const lastSegmentPoints = segments[i - 1].points;\n const endPoint = lastSegmentPoints[lastSegmentPoints.length - 1];\n endPoint &&\n bottomPoints.push({\n x: endPoint.x1 ?? endPoint.x,\n y: endPoint.y1 ?? endPoint.y\n });\n }\n if (bottomPoints.length > 1) {\n lastBottomSeg = calcLineCache(\n parsePoint(bottomPoints, connectedType),\n curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType,\n { curveTension }\n );\n bottomCaches.unshift(lastBottomSeg);\n }\n }\n area.cacheArea = bottomCaches.map((item, index) => ({\n top: topCaches[index],\n bottom: item\n }));\n } else if (points && points.length) {\n // 转换points\n const topPoints = parsePoint(points, connectedType);\n const bottomPoints: IPointLike[] = [];\n for (let i = topPoints.length - 1; i >= 0; i--) {\n bottomPoints.push({\n x: topPoints[i].x1 ?? topPoints[i].x,\n y: topPoints[i].y1 ?? topPoints[i].y\n });\n }\n const topCache = calcLineCache(topPoints, curveType, { curveTension });\n const bottomCache = calcLineCache(\n bottomPoints,\n curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType,\n { curveTension }\n );\n\n area.cacheArea = { top: topCache, bottom: bottomCache };\n } else {\n area.cacheArea = null;\n area.clearUpdateShapeTag();\n return;\n }\n area.clearUpdateShapeTag();\n }\n\n if (Array.isArray(area.cacheArea)) {\n const segments = area.attribute.segments.filter(item => item.points.length);\n // 如果第一个seg只有一个点,那么shift出去\n if (segments[0].points.length === 1) {\n segments.shift();\n }\n if (clipRange === 1) {\n let skip = false;\n // 性能优化,不需要clip的线段不需要计算长度\n area.cacheArea.forEach((cache, index) => {\n if (skip) {\n return;\n }\n skip = this.drawSegmentItem(\n context,\n cache,\n doFill,\n fillOpacity,\n doStroke,\n strokeOpacity,\n segments[index],\n [areaAttribute, area.attribute],\n clipRange,\n x,\n y,\n z,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n });\n } else {\n // 如果是segments的话,每个clipRange需要重新计算\n // 整个线段的总长度\n const totalLength = area.cacheArea.reduce((l, c) => l + c.top.getLength(), 0);\n // 总需要绘制的长度\n const totalDrawLength = clipRange * totalLength;\n // 直到上次绘制的长度\n let drawedLengthUntilLast = 0;\n let skip = false;\n area.cacheArea.forEach((cache, index) => {\n if (skip) {\n return;\n }\n const curSegLength = cache.top.getLength();\n const _cr = (totalDrawLength - drawedLengthUntilLast) / curSegLength;\n drawedLengthUntilLast += curSegLength;\n if (_cr > 0) {\n skip = this.drawSegmentItem(\n context,\n cache,\n doFill,\n fillOpacity,\n doStroke,\n strokeOpacity,\n segments[index],\n [areaAttribute, area.attribute],\n min(_cr, 1),\n x,\n y,\n z,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n });\n }\n } else {\n this.drawSegmentItem(\n context,\n area.cacheArea as IAreaCacheItem,\n doFill,\n fillOpacity,\n doStroke,\n strokeOpacity,\n area.attribute,\n areaAttribute,\n clipRange,\n x,\n y,\n z,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n }\n\n draw(area: IArea, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const areaAttribute = getTheme(area, params?.theme).area;\n this._draw(area, areaAttribute, false, drawContext, params);\n }\n\n /**\n * 绘制segment\n * @param context\n * @param cache\n * @param fill\n * @param stroke\n * @param attribute\n * @param defaultAttribute\n * @param clipRange\n * @param offsetX\n * @param offsetY\n * @param fillCb\n * @param strokeCb\n * @returns 返回true代表跳过后续绘制\n */\n protected drawSegmentItem(\n context: IContext2d,\n cache: IAreaCacheItem,\n fill: boolean,\n fillOpacity: number,\n stroke: boolean,\n strokeOpacity: number,\n attribute: Partial<IAreaGraphicAttribute>,\n defaultAttribute: Required<IAreaGraphicAttribute> | Partial<IAreaGraphicAttribute>[],\n clipRange: number,\n offsetX: number,\n offsetY: number,\n offsetZ: number,\n area: IArea,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean\n ): boolean {\n return this._drawSegmentItem(\n context,\n cache,\n fill,\n fillOpacity,\n stroke,\n strokeOpacity,\n attribute,\n defaultAttribute,\n clipRange,\n offsetX,\n offsetY,\n offsetZ,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n protected _drawSegmentItem(\n context: IContext2d,\n cache: IAreaCacheItem,\n fill: boolean,\n fillOpacity: number,\n stroke: boolean,\n strokeOpacity: number,\n attribute: Partial<IAreaGraphicAttribute>,\n defaultAttribute: Required<IAreaGraphicAttribute> | Partial<IAreaGraphicAttribute>[],\n clipRange: number,\n offsetX: number,\n offsetY: number,\n offsetZ: number,\n area: IArea,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean\n ) {\n if (\n !(\n cache &&\n cache.top &&\n cache.bottom &&\n cache.top.curves &&\n cache.top.curves.length &&\n cache.bottom.curves &&\n cache.bottom.curves.length\n )\n ) {\n return;\n }\n\n context.beginPath();\n\n const ret: boolean = false;\n const { points, segments } = area.attribute;\n let direction = Direction.ROW;\n let endP: IPointLike;\n let startP: IPointLike;\n if (segments) {\n const endSeg = segments[segments.length - 1];\n const startSeg = segments[0];\n startP = startSeg.points[0];\n endP = endSeg.points[endSeg.points.length - 1];\n } else {\n startP = points[0];\n endP = points[points.length - 1];\n }\n const xTotalLength = abs(endP.x - startP.x);\n const yTotalLength = abs(endP.y - startP.y);\n if (endP.x1 == null) {\n direction = Direction.ROW;\n } else if (endP.y1 == null) {\n direction = Direction.COLUMN;\n } else if (!Number.isFinite(xTotalLength + yTotalLength)) {\n direction = Direction.ROW;\n } else {\n direction = xTotalLength > yTotalLength ? Direction.ROW : Direction.COLUMN;\n }\n drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {\n offsetX,\n offsetY,\n offsetZ,\n direction\n });\n\n this.beforeRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n defaultAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute }\n );\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);\n\n const { x: originX = 0, x: originY = 0 } = attribute;\n const _runFill = () => {\n if (fill !== false) {\n if (fillCb) {\n fillCb(context, attribute, defaultAttribute);\n } else if (fillOpacity) {\n context.setCommonStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute);\n context.fill();\n }\n }\n };\n\n const _runStroke = () => {\n if (stroke !== false) {\n if (strokeCb) {\n strokeCb(context, attribute, defaultAttribute);\n } else {\n const { stroke = defaultAttribute && (defaultAttribute as any)[1] && (defaultAttribute as any)[1].stroke } =\n attribute;\n if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {\n context.beginPath();\n drawSegments(\n context.camera ? context : context.nativeContext,\n stroke[0] ? cache.top : cache.bottom,\n clipRange,\n direction === Direction.ROW ? 'x' : 'y',\n {\n offsetX,\n offsetY,\n offsetZ\n }\n );\n }\n context.setStrokeStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute);\n context.stroke();\n }\n }\n };\n\n _runFill();\n this.afterRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n defaultAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute }\n );\n _runStroke();\n\n return ret;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/area-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAkB3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,S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,CAAC;QAEb,OAAO,GAAG,CAAC;IACb,CAAC;CACF,CAAA;AA1lBY,uBAAuB;IADnC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,sBAAsB,CAAC,CAAA;;GANrB,uBAAuB,CA0lBnC;SA1lBY,uBAAuB","file":"area-render.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport { abs, isArray, min } from '@visactor/vutils';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\nimport type {\n IArea,\n IAreaCacheItem,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IThemeAttribute,\n ISegPath2D,\n IAreaRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider\n} from '../../../interface';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { calcLineCache } from '../../../common/segment';\n\nimport { getTheme } from '../../../graphic/theme';\nimport { AreaRenderContribution } from './contributions/constants';\nimport { Direction } from '../../../common/enums';\nimport { drawAreaSegments } from '../../../common/render-area';\nimport { AREA_NUMBER_TYPE } from '../../../graphic/constants';\nimport { drawSegments } from '../../../common/render-curve';\nimport { BaseRender } from './base-render';\nimport {\n defaultAreaBackgroundRenderContribution,\n defaultAreaTextureRenderContribution\n} from './contributions/area-contribution-render';\n\n@injectable()\nexport class DefaultCanvasAreaRender extends BaseRender<IArea> implements IGraphicRender {\n type: 'area';\n numberType: number = AREA_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(AreaRenderContribution)\n protected readonly areaRenderContribitions: IContributionProvider<IAreaRenderContribution>\n ) {\n super();\n this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution];\n this.init(areaRenderContribitions);\n }\n\n drawLinearAreaHighPerformance(\n area: IArea,\n context: IContext2d,\n fill: boolean,\n stroke: boolean,\n fillOpacity: number,\n strokeOpacity: number,\n offsetX: number,\n offsetY: number,\n areaAttribute: Required<IAreaGraphicAttribute>,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const { points } = area.attribute;\n if (points.length < 2) {\n return;\n }\n context.beginPath();\n\n const z = this.z ?? 0;\n const startP = points[0];\n\n context.moveTo(startP.x + offsetX, startP.y + offsetY, z);\n for (let i = 1; i < points.length; i++) {\n const p = points[i];\n context.lineTo(p.x + offsetX, p.y + offsetY, z);\n }\n for (let i = points.length - 1; i >= 0; i--) {\n const p = points[i];\n context.lineTo((p.x1 ?? p.x) + offsetX, (p.y1 ?? p.y) + offsetY, z);\n }\n context.closePath();\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute);\n\n this.beforeRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n areaAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute: area.attribute }\n );\n\n const { x: originX = 0, x: originY = 0 } = area.attribute;\n const _runFill = () => {\n if (fill !== false) {\n if (fillCb) {\n fillCb(context, area.attribute, areaAttribute);\n } else if (fillOpacity) {\n context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);\n context.fill();\n }\n }\n };\n\n const _runStroke = () => {\n if (stroke) {\n const { stroke = areaAttribute && areaAttribute.stroke } = area.attribute;\n if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {\n context.beginPath();\n if (stroke[0]) {\n context.moveTo(startP.x + offsetX, startP.y + offsetY, z);\n for (let i = 1; i < points.length; i++) {\n const p = points[i];\n context.lineTo(p.x + offsetX, p.y + offsetY, z);\n }\n } else if (stroke[2]) {\n const endP = points[points.length - 1];\n context.moveTo(endP.x + offsetX, endP.y + offsetY, z);\n for (let i = points.length - 2; i >= 0; i--) {\n const p = points[i];\n context.lineTo((p.x1 ?? p.x) + offsetX, (p.y1 ?? p.y) + offsetY, z);\n }\n }\n }\n if (strokeCb) {\n strokeCb(context, area.attribute, areaAttribute);\n } else {\n context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);\n context.stroke();\n }\n }\n };\n\n _runFill();\n this.afterRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n areaAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute: area.attribute }\n );\n _runStroke();\n }\n\n drawShape(\n area: IArea,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const areaAttribute = getTheme(area, params?.theme).area;\n const {\n fill = areaAttribute.fill,\n stroke = areaAttribute.stroke,\n fillOpacity = areaAttribute.fillOpacity,\n z = areaAttribute.z,\n strokeOpacity = areaAttribute.strokeOpacity,\n curveTension = areaAttribute.curveTension,\n connectedType = areaAttribute.connectedType\n } = area.attribute;\n\n const data = this.valid(area, areaAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { doFill } = data;\n const doStroke = data.doStroke && data.sVisible;\n\n const { clipRange = areaAttribute.clipRange, closePath, points, segments } = area.attribute;\n let { curveType = areaAttribute.curveType } = area.attribute;\n if (closePath && curveType === 'linear') {\n curveType = 'linearClosed';\n }\n\n function parsePoint(points: IPointLike[], connectedType: 'none' | 'connect') {\n if (connectedType !== 'connect') {\n return points;\n }\n return points.filter(p => p.defined !== false);\n }\n\n if (clipRange === 1 && !segments && !points.some(p => p.defined === false) && curveType === 'linear') {\n return this.drawLinearAreaHighPerformance(\n area,\n context,\n !!fill,\n doStroke,\n fillOpacity,\n strokeOpacity,\n x,\n y,\n areaAttribute,\n drawContext,\n params,\n fillCb,\n strokeCb\n );\n }\n\n // 更新cache\n if (area.shouldUpdateShape()) {\n if (segments && segments.length) {\n let startPoint: IPointLike;\n let lastTopSeg: { endX: number; endY: number };\n const topCaches = segments\n .map((seg, index) => {\n if (seg.points.length <= 1) {\n // 第一个点的话,直接设置lastTopSeg\n if (index === 0) {\n seg.points[0] && (lastTopSeg = { endX: seg.points[0].x, endY: seg.points[0].y });\n return null;\n }\n }\n // 添加上一个segment结束的点作为这个segment的起始点\n if (index === 1) {\n startPoint = { x: lastTopSeg.endX, y: lastTopSeg.endY };\n } else if (index > 1) {\n startPoint.x = lastTopSeg.endX;\n startPoint.y = lastTopSeg.endY;\n }\n const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {\n startPoint,\n curveTension\n });\n lastTopSeg = data;\n return data;\n })\n .filter(item => !!item);\n let lastBottomSeg: ISegPath2D;\n const bottomCaches = [];\n for (let i = segments.length - 1; i >= 0; i--) {\n const points = segments[i].points;\n const bottomPoints: IPointLike[] = [];\n for (let i = points.length - 1; i >= 0; i--) {\n bottomPoints.push({\n x: points[i].x1 ?? points[i].x,\n y: points[i].y1 ?? points[i].y\n });\n }\n // 处理一下bottom的segments,bottom的segments需要手动添加endPoints\n if (i !== 0) {\n const lastSegmentPoints = segments[i - 1].points;\n const endPoint = lastSegmentPoints[lastSegmentPoints.length - 1];\n endPoint &&\n bottomPoints.push({\n x: endPoint.x1 ?? endPoint.x,\n y: endPoint.y1 ?? endPoint.y\n });\n }\n if (bottomPoints.length > 1) {\n lastBottomSeg = calcLineCache(\n parsePoint(bottomPoints, connectedType),\n curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType,\n { curveTension }\n );\n bottomCaches.unshift(lastBottomSeg);\n }\n }\n area.cacheArea = bottomCaches.map((item, index) => ({\n top: topCaches[index],\n bottom: item\n }));\n } else if (points && points.length) {\n // 转换points\n const topPoints = parsePoint(points, connectedType);\n const bottomPoints: IPointLike[] = [];\n for (let i = topPoints.length - 1; i >= 0; i--) {\n bottomPoints.push({\n x: topPoints[i].x1 ?? topPoints[i].x,\n y: topPoints[i].y1 ?? topPoints[i].y\n });\n }\n const topCache = calcLineCache(topPoints, curveType, { curveTension });\n const bottomCache = calcLineCache(\n bottomPoints,\n curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType,\n { curveTension }\n );\n\n area.cacheArea = { top: topCache, bottom: bottomCache };\n } else {\n area.cacheArea = null;\n area.clearUpdateShapeTag();\n return;\n }\n area.clearUpdateShapeTag();\n }\n\n if (Array.isArray(area.cacheArea)) {\n const segments = area.attribute.segments.filter(item => item.points.length);\n // 如果第一个seg只有一个点,那么shift出去\n if (segments[0].points.length === 1) {\n segments.shift();\n }\n if (clipRange === 1) {\n let skip = false;\n // 性能优化,不需要clip的线段不需要计算长度\n area.cacheArea.forEach((cache, index) => {\n if (skip) {\n return;\n }\n skip = this.drawSegmentItem(\n context,\n cache,\n doFill,\n fillOpacity,\n doStroke,\n strokeOpacity,\n segments[index],\n [areaAttribute, area.attribute],\n clipRange,\n x,\n y,\n z,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n });\n } else {\n // 如果是segments的话,每个clipRange需要重新计算\n // 整个线段的总长度\n const totalLength = area.cacheArea.reduce((l, c) => l + c.top.getLength(), 0);\n // 总需要绘制的长度\n const totalDrawLength = clipRange * totalLength;\n // 直到上次绘制的长度\n let drawedLengthUntilLast = 0;\n let skip = false;\n area.cacheArea.forEach((cache, index) => {\n if (skip) {\n return;\n }\n const curSegLength = cache.top.getLength();\n const _cr = (totalDrawLength - drawedLengthUntilLast) / curSegLength;\n drawedLengthUntilLast += curSegLength;\n if (_cr > 0) {\n skip = this.drawSegmentItem(\n context,\n cache,\n doFill,\n fillOpacity,\n doStroke,\n strokeOpacity,\n segments[index],\n [areaAttribute, area.attribute],\n min(_cr, 1),\n x,\n y,\n z,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n });\n }\n } else {\n this.drawSegmentItem(\n context,\n area.cacheArea as IAreaCacheItem,\n doFill,\n fillOpacity,\n doStroke,\n strokeOpacity,\n area.attribute,\n areaAttribute,\n clipRange,\n x,\n y,\n z,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n }\n\n draw(area: IArea, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const areaAttribute = getTheme(area, params?.theme).area;\n this._draw(area, areaAttribute, false, drawContext, params);\n }\n\n /**\n * 绘制segment\n * @param context\n * @param cache\n * @param fill\n * @param stroke\n * @param attribute\n * @param defaultAttribute\n * @param clipRange\n * @param offsetX\n * @param offsetY\n * @param fillCb\n * @param strokeCb\n * @returns 返回true代表跳过后续绘制\n */\n protected drawSegmentItem(\n context: IContext2d,\n cache: IAreaCacheItem,\n fill: boolean,\n fillOpacity: number,\n stroke: boolean,\n strokeOpacity: number,\n attribute: Partial<IAreaGraphicAttribute>,\n defaultAttribute: Required<IAreaGraphicAttribute> | Partial<IAreaGraphicAttribute>[],\n clipRange: number,\n offsetX: number,\n offsetY: number,\n offsetZ: number,\n area: IArea,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean\n ): boolean {\n return this._drawSegmentItem(\n context,\n cache,\n fill,\n fillOpacity,\n stroke,\n strokeOpacity,\n attribute,\n defaultAttribute,\n clipRange,\n offsetX,\n offsetY,\n offsetZ,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n protected _drawSegmentItem(\n context: IContext2d,\n cache: IAreaCacheItem,\n fill: boolean,\n fillOpacity: number,\n stroke: boolean,\n strokeOpacity: number,\n attribute: Partial<IAreaGraphicAttribute>,\n defaultAttribute: Required<IAreaGraphicAttribute> | Partial<IAreaGraphicAttribute>[],\n clipRange: number,\n offsetX: number,\n offsetY: number,\n offsetZ: number,\n area: IArea,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean\n ) {\n if (\n !(\n cache &&\n cache.top &&\n cache.bottom &&\n cache.top.curves &&\n cache.top.curves.length &&\n cache.bottom.curves &&\n cache.bottom.curves.length\n )\n ) {\n return;\n }\n\n context.beginPath();\n\n const ret: boolean = false;\n const { points, segments } = area.attribute;\n let direction = Direction.ROW;\n let endP: IPointLike;\n let startP: IPointLike;\n if (segments) {\n const endSeg = segments[segments.length - 1];\n const startSeg = segments[0];\n startP = startSeg.points[0];\n endP = endSeg.points[endSeg.points.length - 1];\n } else {\n startP = points[0];\n endP = points[points.length - 1];\n }\n const xTotalLength = abs(endP.x - startP.x);\n const yTotalLength = abs(endP.y - startP.y);\n if (endP.x1 == null) {\n direction = Direction.ROW;\n } else if (endP.y1 == null) {\n direction = Direction.COLUMN;\n } else if (!Number.isFinite(xTotalLength + yTotalLength)) {\n direction = Direction.ROW;\n } else {\n direction = xTotalLength > yTotalLength ? Direction.ROW : Direction.COLUMN;\n }\n drawAreaSegments(context, cache, clipRange, {\n offsetX,\n offsetY,\n offsetZ,\n direction\n });\n\n this.beforeRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n defaultAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute }\n );\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);\n\n const { x: originX = 0, x: originY = 0 } = attribute;\n const _runFill = () => {\n if (fill !== false) {\n if (fillCb) {\n fillCb(context, attribute, defaultAttribute);\n } else if (fillOpacity) {\n context.setCommonStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute);\n context.fill();\n }\n }\n };\n\n const _runStroke = () => {\n if (stroke !== false) {\n if (strokeCb) {\n strokeCb(context, attribute, defaultAttribute);\n } else {\n const { stroke = defaultAttribute && (defaultAttribute as any)[1] && (defaultAttribute as any)[1].stroke } =\n attribute;\n if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {\n context.beginPath();\n drawSegments(\n context,\n stroke[0] ? cache.top : cache.bottom,\n clipRange,\n direction === Direction.ROW ? 'x' : 'y',\n {\n offsetX,\n offsetY,\n offsetZ\n }\n );\n }\n context.setStrokeStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute);\n context.stroke();\n }\n }\n };\n\n _runFill();\n this.afterRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n defaultAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute }\n );\n _runStroke();\n\n return ret;\n }\n}\n"]}
@@ -8,5 +8,6 @@ export declare const PolygonRenderContribution: unique symbol;
8
8
  export declare const RectRenderContribution: unique symbol;
9
9
  export declare const SymbolRenderContribution: unique symbol;
10
10
  export declare const TextRenderContribution: unique symbol;
11
+ export declare const StarRenderContribution: unique symbol;
11
12
  export declare const CommonRenderContribution: unique symbol;
12
13
  export declare const InteractiveSubRenderContribution: unique symbol;