@visactor/vrender 0.15.0-alpha.14 → 0.15.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/cjs/animate/animate.d.ts +0 -1
  2. package/cjs/animate/animate.js +0 -3
  3. package/cjs/animate/animate.js.map +1 -1
  4. package/cjs/animate/timeline.d.ts +1 -1
  5. package/cjs/animate/timeline.js +2 -2
  6. package/cjs/animate/timeline.js.map +1 -1
  7. package/cjs/canvas/contributions/browser/context.d.ts +0 -1
  8. package/cjs/common/contribution-provider.d.ts +0 -1
  9. package/cjs/common/contribution-provider.js +2 -7
  10. package/cjs/common/contribution-provider.js.map +1 -1
  11. package/cjs/common/enums.d.ts +2 -4
  12. package/cjs/common/enums.js +2 -3
  13. package/cjs/common/enums.js.map +1 -1
  14. package/cjs/core/contributions/env/base-contribution.d.ts +1 -11
  15. package/cjs/core/contributions/env/base-contribution.js +1 -22
  16. package/cjs/core/contributions/env/base-contribution.js.map +1 -1
  17. package/cjs/core/contributions/env/browser-contribution.d.ts +2 -11
  18. package/cjs/core/contributions/env/browser-contribution.js +0 -66
  19. package/cjs/core/contributions/env/browser-contribution.js.map +1 -1
  20. package/cjs/core/contributions/textMeasure/layout.js +1 -1
  21. package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
  22. package/cjs/core/contributions/window/base-contribution.d.ts +5 -11
  23. package/cjs/core/contributions/window/base-contribution.js +0 -10
  24. package/cjs/core/contributions/window/base-contribution.js.map +1 -1
  25. package/cjs/core/contributions/window/browser-contribution.d.ts +0 -11
  26. package/cjs/core/contributions/window/browser-contribution.js +2 -33
  27. package/cjs/core/contributions/window/browser-contribution.js.map +1 -1
  28. package/cjs/core/global.d.ts +1 -11
  29. package/cjs/core/global.js +0 -18
  30. package/cjs/core/global.js.map +1 -1
  31. package/cjs/core/layer.js +6 -6
  32. package/cjs/core/layer.js.map +1 -1
  33. package/cjs/core/stage.d.ts +4 -13
  34. package/cjs/core/stage.js +25 -54
  35. package/cjs/core/stage.js.map +1 -1
  36. package/cjs/core/window.d.ts +0 -6
  37. package/cjs/core/window.js +1 -10
  38. package/cjs/core/window.js.map +1 -1
  39. package/cjs/graphic/builtin-symbol/arrow2-left.js +1 -1
  40. package/cjs/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  41. package/cjs/graphic/builtin-symbol/arrow2-right.js +1 -1
  42. package/cjs/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  43. package/cjs/graphic/builtin-symbol/index.d.ts +1 -1
  44. package/cjs/graphic/builtin-symbol/index.js +2 -2
  45. package/cjs/graphic/builtin-symbol/index.js.map +1 -1
  46. package/cjs/graphic/builtin-symbol/utils.d.ts +5 -13
  47. package/cjs/graphic/builtin-symbol/utils.js +9 -23
  48. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  49. package/cjs/graphic/config.js +6 -7
  50. package/cjs/graphic/config.js.map +1 -1
  51. package/cjs/graphic/constants.d.ts +0 -22
  52. package/cjs/graphic/constants.js +2 -20
  53. package/cjs/graphic/constants.js.map +1 -1
  54. package/cjs/graphic/graphic.d.ts +0 -3
  55. package/cjs/graphic/graphic.js +26 -40
  56. package/cjs/graphic/graphic.js.map +1 -1
  57. package/cjs/graphic/group.js +1 -1
  58. package/cjs/graphic/group.js.map +1 -1
  59. package/cjs/graphic/index.d.ts +0 -1
  60. package/cjs/graphic/index.js +13 -13
  61. package/cjs/graphic/index.js.map +1 -1
  62. package/cjs/graphic/richtext/utils.d.ts +1 -1
  63. package/cjs/graphic/richtext/utils.js +1 -1
  64. package/cjs/graphic/richtext/utils.js.map +1 -1
  65. package/cjs/graphic/symbol.d.ts +1 -2
  66. package/cjs/graphic/symbol.js +4 -27
  67. package/cjs/graphic/symbol.js.map +1 -1
  68. package/cjs/graphic/text.js +23 -33
  69. package/cjs/graphic/text.js.map +1 -1
  70. package/cjs/graphic/tools.d.ts +2 -3
  71. package/cjs/graphic/tools.js +3 -58
  72. package/cjs/graphic/tools.js.map +1 -1
  73. package/cjs/graphic/wrap-text.js +8 -10
  74. package/cjs/graphic/wrap-text.js.map +1 -1
  75. package/cjs/index.d.ts +1 -2
  76. package/cjs/index.js +2 -2
  77. package/cjs/index.js.map +1 -1
  78. package/cjs/interface/animate.d.ts +1 -3
  79. package/cjs/interface/animate.js.map +1 -1
  80. package/cjs/interface/global.d.ts +1 -25
  81. package/cjs/interface/global.js.map +1 -1
  82. package/cjs/interface/graphic/image.d.ts +0 -1
  83. package/cjs/interface/graphic/image.js.map +1 -1
  84. package/cjs/interface/graphic/line.d.ts +1 -0
  85. package/cjs/interface/graphic/line.js.map +1 -1
  86. package/cjs/interface/graphic/symbol.d.ts +2 -3
  87. package/cjs/interface/graphic/symbol.js.map +1 -1
  88. package/cjs/interface/graphic/text.d.ts +0 -1
  89. package/cjs/interface/graphic/text.js.map +1 -1
  90. package/cjs/interface/graphic.d.ts +3 -25
  91. package/cjs/interface/graphic.js.map +1 -1
  92. package/cjs/interface/render.d.ts +0 -1
  93. package/cjs/interface/render.js.map +1 -1
  94. package/cjs/interface/stage.d.ts +3 -10
  95. package/cjs/interface/stage.js.map +1 -1
  96. package/cjs/interface/window.d.ts +0 -12
  97. package/cjs/interface/window.js.map +1 -1
  98. package/cjs/picker/contributions/canvas-picker/symbol-picker.js +2 -4
  99. package/cjs/picker/contributions/canvas-picker/symbol-picker.js.map +1 -1
  100. package/cjs/picker/pick-interceptor.js +3 -2
  101. package/cjs/picker/pick-interceptor.js.map +1 -1
  102. package/cjs/plugins/builtin-plugin/flex-layout-plugin.d.ts +0 -2
  103. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +21 -42
  104. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  105. package/cjs/plugins/plugin-modules.js +1 -1
  106. package/cjs/plugins/plugin-modules.js.map +1 -1
  107. package/cjs/render/contributions/render/area-render.js +31 -21
  108. package/cjs/render/contributions/render/area-render.js.map +1 -1
  109. package/cjs/render/contributions/render/contributions/image-contribution-render.js +1 -23
  110. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  111. package/cjs/render/contributions/render/draw-contribution.d.ts +1 -3
  112. package/cjs/render/contributions/render/draw-contribution.js +1 -3
  113. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  114. package/cjs/render/contributions/render/image-render.js +3 -7
  115. package/cjs/render/contributions/render/image-render.js.map +1 -1
  116. package/cjs/render/contributions/render/line-render.js +50 -23
  117. package/cjs/render/contributions/render/line-render.js.map +1 -1
  118. package/cjs/render/contributions/render/symbol-render.js +5 -12
  119. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  120. package/cjs/render/contributions/render/utils.d.ts +2 -2
  121. package/cjs/render/contributions/render/utils.js.map +1 -1
  122. package/cjs/render/render-service.js +1 -3
  123. package/cjs/render/render-service.js.map +1 -1
  124. package/dist/index.js +318 -3342
  125. package/dist/index.min.js +1 -1
  126. package/es/animate/animate.d.ts +0 -1
  127. package/es/animate/animate.js +0 -3
  128. package/es/animate/animate.js.map +1 -1
  129. package/es/animate/timeline.d.ts +1 -1
  130. package/es/animate/timeline.js +2 -2
  131. package/es/animate/timeline.js.map +1 -1
  132. package/es/canvas/contributions/browser/context.d.ts +0 -1
  133. package/es/common/contribution-provider.d.ts +0 -1
  134. package/es/common/contribution-provider.js +0 -4
  135. package/es/common/contribution-provider.js.map +1 -1
  136. package/es/common/enums.d.ts +2 -4
  137. package/es/common/enums.js +2 -3
  138. package/es/common/enums.js.map +1 -1
  139. package/es/core/contributions/env/base-contribution.d.ts +1 -11
  140. package/es/core/contributions/env/base-contribution.js +0 -23
  141. package/es/core/contributions/env/base-contribution.js.map +1 -1
  142. package/es/core/contributions/env/browser-contribution.d.ts +2 -11
  143. package/es/core/contributions/env/browser-contribution.js +1 -67
  144. package/es/core/contributions/env/browser-contribution.js.map +1 -1
  145. package/es/core/contributions/textMeasure/layout.js +1 -1
  146. package/es/core/contributions/textMeasure/layout.js.map +1 -1
  147. package/es/core/contributions/window/base-contribution.d.ts +5 -11
  148. package/es/core/contributions/window/base-contribution.js +0 -10
  149. package/es/core/contributions/window/base-contribution.js.map +1 -1
  150. package/es/core/contributions/window/browser-contribution.d.ts +0 -11
  151. package/es/core/contributions/window/browser-contribution.js +2 -33
  152. package/es/core/contributions/window/browser-contribution.js.map +1 -1
  153. package/es/core/global.d.ts +1 -11
  154. package/es/core/global.js +0 -18
  155. package/es/core/global.js.map +1 -1
  156. package/es/core/layer.js +6 -6
  157. package/es/core/layer.js.map +1 -1
  158. package/es/core/stage.d.ts +4 -13
  159. package/es/core/stage.js +24 -57
  160. package/es/core/stage.js.map +1 -1
  161. package/es/core/window.d.ts +0 -6
  162. package/es/core/window.js +1 -10
  163. package/es/core/window.js.map +1 -1
  164. package/es/graphic/builtin-symbol/arrow2-left.js +1 -1
  165. package/es/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  166. package/es/graphic/builtin-symbol/arrow2-right.js +1 -1
  167. package/es/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  168. package/es/graphic/builtin-symbol/index.d.ts +1 -1
  169. package/es/graphic/builtin-symbol/index.js +1 -11
  170. package/es/graphic/builtin-symbol/index.js.map +1 -1
  171. package/es/graphic/builtin-symbol/utils.d.ts +5 -13
  172. package/es/graphic/builtin-symbol/utils.js +7 -25
  173. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  174. package/es/graphic/config.js +6 -7
  175. package/es/graphic/config.js.map +1 -1
  176. package/es/graphic/constants.d.ts +0 -22
  177. package/es/graphic/constants.js +0 -26
  178. package/es/graphic/constants.js.map +1 -1
  179. package/es/graphic/graphic.d.ts +0 -3
  180. package/es/graphic/graphic.js +26 -40
  181. package/es/graphic/graphic.js.map +1 -1
  182. package/es/graphic/group.js +1 -1
  183. package/es/graphic/group.js.map +1 -1
  184. package/es/graphic/index.d.ts +0 -1
  185. package/es/graphic/index.js +0 -2
  186. package/es/graphic/index.js.map +1 -1
  187. package/es/graphic/richtext/utils.d.ts +1 -1
  188. package/es/graphic/richtext/utils.js +1 -1
  189. package/es/graphic/richtext/utils.js.map +1 -1
  190. package/es/graphic/symbol.d.ts +1 -2
  191. package/es/graphic/symbol.js +1 -28
  192. package/es/graphic/symbol.js.map +1 -1
  193. package/es/graphic/text.js +23 -33
  194. package/es/graphic/text.js.map +1 -1
  195. package/es/graphic/tools.d.ts +2 -3
  196. package/es/graphic/tools.js +0 -59
  197. package/es/graphic/tools.js.map +1 -1
  198. package/es/graphic/wrap-text.js +8 -10
  199. package/es/graphic/wrap-text.js.map +1 -1
  200. package/es/index.d.ts +1 -2
  201. package/es/index.js +1 -3
  202. package/es/index.js.map +1 -1
  203. package/es/interface/animate.d.ts +1 -3
  204. package/es/interface/animate.js.map +1 -1
  205. package/es/interface/global.d.ts +1 -25
  206. package/es/interface/global.js.map +1 -1
  207. package/es/interface/graphic/image.d.ts +0 -1
  208. package/es/interface/graphic/image.js.map +1 -1
  209. package/es/interface/graphic/line.d.ts +1 -0
  210. package/es/interface/graphic/line.js.map +1 -1
  211. package/es/interface/graphic/symbol.d.ts +2 -3
  212. package/es/interface/graphic/symbol.js.map +1 -1
  213. package/es/interface/graphic/text.d.ts +0 -1
  214. package/es/interface/graphic/text.js.map +1 -1
  215. package/es/interface/graphic.d.ts +3 -25
  216. package/es/interface/graphic.js.map +1 -1
  217. package/es/interface/render.d.ts +0 -1
  218. package/es/interface/render.js.map +1 -1
  219. package/es/interface/stage.d.ts +3 -10
  220. package/es/interface/stage.js.map +1 -1
  221. package/es/interface/window.d.ts +0 -12
  222. package/es/interface/window.js.map +1 -1
  223. package/es/picker/contributions/canvas-picker/symbol-picker.js +1 -6
  224. package/es/picker/contributions/canvas-picker/symbol-picker.js.map +1 -1
  225. package/es/picker/pick-interceptor.js +3 -2
  226. package/es/picker/pick-interceptor.js.map +1 -1
  227. package/es/plugins/builtin-plugin/flex-layout-plugin.d.ts +0 -2
  228. package/es/plugins/builtin-plugin/flex-layout-plugin.js +20 -47
  229. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  230. package/es/plugins/plugin-modules.js +2 -2
  231. package/es/plugins/plugin-modules.js.map +1 -1
  232. package/es/render/contributions/render/area-render.js +30 -20
  233. package/es/render/contributions/render/area-render.js.map +1 -1
  234. package/es/render/contributions/render/contributions/image-contribution-render.js +0 -27
  235. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  236. package/es/render/contributions/render/draw-contribution.d.ts +1 -3
  237. package/es/render/contributions/render/draw-contribution.js +0 -4
  238. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  239. package/es/render/contributions/render/image-render.js +2 -10
  240. package/es/render/contributions/render/image-render.js.map +1 -1
  241. package/es/render/contributions/render/line-render.js +49 -22
  242. package/es/render/contributions/render/line-render.js.map +1 -1
  243. package/es/render/contributions/render/symbol-render.js +5 -12
  244. package/es/render/contributions/render/symbol-render.js.map +1 -1
  245. package/es/render/contributions/render/utils.d.ts +2 -2
  246. package/es/render/contributions/render/utils.js.map +1 -1
  247. package/es/render/render-service.js +1 -3
  248. package/es/render/render-service.js.map +1 -1
  249. package/package.json +13 -10
  250. package/cjs/graphic/builtin-symbol/arrow2-down.d.ts +0 -12
  251. package/cjs/graphic/builtin-symbol/arrow2-down.js +0 -30
  252. package/cjs/graphic/builtin-symbol/arrow2-down.js.map +0 -1
  253. package/cjs/graphic/builtin-symbol/arrow2-up.d.ts +0 -12
  254. package/cjs/graphic/builtin-symbol/arrow2-up.js +0 -30
  255. package/cjs/graphic/builtin-symbol/arrow2-up.js.map +0 -1
  256. package/cjs/graphic/builtin-symbol/close.d.ts +0 -13
  257. package/cjs/graphic/builtin-symbol/close.js +0 -33
  258. package/cjs/graphic/builtin-symbol/close.js.map +0 -1
  259. package/cjs/graphic/builtin-symbol/line-h.d.ts +0 -13
  260. package/cjs/graphic/builtin-symbol/line-h.js +0 -32
  261. package/cjs/graphic/builtin-symbol/line-h.js.map +0 -1
  262. package/cjs/graphic/builtin-symbol/line-v.d.ts +0 -13
  263. package/cjs/graphic/builtin-symbol/line-v.js +0 -32
  264. package/cjs/graphic/builtin-symbol/line-v.js.map +0 -1
  265. package/cjs/jsx/graphicType.d.ts +0 -172
  266. package/cjs/jsx/graphicType.js +0 -133
  267. package/cjs/jsx/graphicType.js.map +0 -1
  268. package/cjs/jsx/index.d.ts +0 -2
  269. package/cjs/jsx/index.js +0 -21
  270. package/cjs/jsx/index.js.map +0 -1
  271. package/cjs/jsx/jsx-classic.d.ts +0 -3
  272. package/cjs/jsx/jsx-classic.js +0 -58
  273. package/cjs/jsx/jsx-classic.js.map +0 -1
  274. package/cjs/plugins/builtin-plugin/html-attribute-plugin.d.ts +0 -13
  275. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +0 -79
  276. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +0 -1
  277. package/es/graphic/builtin-symbol/arrow2-down.d.ts +0 -12
  278. package/es/graphic/builtin-symbol/arrow2-down.js +0 -24
  279. package/es/graphic/builtin-symbol/arrow2-down.js.map +0 -1
  280. package/es/graphic/builtin-symbol/arrow2-up.d.ts +0 -12
  281. package/es/graphic/builtin-symbol/arrow2-up.js +0 -24
  282. package/es/graphic/builtin-symbol/arrow2-up.js.map +0 -1
  283. package/es/graphic/builtin-symbol/close.d.ts +0 -13
  284. package/es/graphic/builtin-symbol/close.js +0 -27
  285. package/es/graphic/builtin-symbol/close.js.map +0 -1
  286. package/es/graphic/builtin-symbol/line-h.d.ts +0 -13
  287. package/es/graphic/builtin-symbol/line-h.js +0 -26
  288. package/es/graphic/builtin-symbol/line-h.js.map +0 -1
  289. package/es/graphic/builtin-symbol/line-v.d.ts +0 -13
  290. package/es/graphic/builtin-symbol/line-v.js +0 -26
  291. package/es/graphic/builtin-symbol/line-v.js.map +0 -1
  292. package/es/jsx/graphicType.d.ts +0 -172
  293. package/es/jsx/graphicType.js +0 -126
  294. package/es/jsx/graphicType.js.map +0 -1
  295. package/es/jsx/index.d.ts +0 -2
  296. package/es/jsx/index.js +0 -4
  297. package/es/jsx/index.js.map +0 -1
  298. package/es/jsx/jsx-classic.d.ts +0 -3
  299. package/es/jsx/jsx-classic.js +0 -56
  300. package/es/jsx/jsx-classic.js.map +0 -1
  301. package/es/plugins/builtin-plugin/html-attribute-plugin.d.ts +0 -13
  302. package/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -75
  303. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +0 -1
@@ -1,172 +0,0 @@
1
- import type { IArc3dGraphicAttribute, IArcGraphicAttribute, IAreaGraphicAttribute, ICircleGraphicAttribute, IGlyphGraphicAttribute, IGroupGraphicAttribute, IImageGraphicAttribute, ILineGraphicAttribute, IPathGraphicAttribute, IPolygonGraphicAttribute, IPyramid3dGraphicAttribute, IRect3dGraphicAttribute, IRectGraphicAttribute, IRichTextCharacter, IRichTextGraphicAttribute, IRichTextImageCharacter, ISymbolGraphicAttribute, ITextGraphicAttribute } from '../interface';
2
- import { IGroup, ISymbol } from '../interface';
3
- export declare const REACT_TO_CANOPUS_EVENTS: {
4
- onPointerDown: string;
5
- onPointerUp: string;
6
- onPointerUpOutside: string;
7
- onPointerTap: string;
8
- onPointerOver: string;
9
- onPointerMove: string;
10
- onPointerEnter: string;
11
- onPointerLeave: string;
12
- onPointerOut: string;
13
- onMouseDown: string;
14
- onMouseUp: string;
15
- onMouseUpOutside: string;
16
- onMouseMove: string;
17
- onMouseOver: string;
18
- onMouseOut: string;
19
- onMouseEnter: string;
20
- onMouseLeave: string;
21
- onPinch: string;
22
- onPinchStart: string;
23
- onPinchEnd: string;
24
- onPan: string;
25
- onPanStart: string;
26
- onPanEnd: string;
27
- onDrag: string;
28
- onDragStart: string;
29
- onDragEnter: string;
30
- onDragLeave: string;
31
- onDragOver: string;
32
- onDragEnd: string;
33
- onRightDown: string;
34
- onRightUp: string;
35
- onRightUpOutside: string;
36
- onTouchStart: string;
37
- onTouchEnd: string;
38
- onTouchEndOutside: string;
39
- onTouchMove: string;
40
- onTouchCancel: string;
41
- onPress: string;
42
- onPressUp: string;
43
- onPressEnd: string;
44
- onSwipe: string;
45
- onDrop: string;
46
- onWeel: string;
47
- onClick: string;
48
- onDblClick: string;
49
- };
50
- export declare const REACT_TO_CANOPUS_EVENTS_LIST: string[];
51
- export type IEventParamsType = {
52
- [t in keyof typeof REACT_TO_CANOPUS_EVENTS]?: (d: any) => void;
53
- };
54
- export type IDefaultGraphicParamsType<T> = {
55
- attribute?: T;
56
- } & IEventParamsType;
57
- export declare function VArc(params: IDefaultGraphicParamsType<IArcGraphicAttribute>): import("../interface").IArc;
58
- export declare function VArc3d(params: IDefaultGraphicParamsType<IArc3dGraphicAttribute>): import("../interface").IArc;
59
- export declare function VArea(params: IDefaultGraphicParamsType<IAreaGraphicAttribute>): import("../interface").IArea;
60
- export declare function VCircle(params: IDefaultGraphicParamsType<ICircleGraphicAttribute>): import("../interface").ICircle;
61
- export declare function VGroup(params: IDefaultGraphicParamsType<IGroupGraphicAttribute>): IGroup;
62
- export declare function VGlyph(params: IDefaultGraphicParamsType<IGlyphGraphicAttribute>): import("../interface").IGlyph<Partial<import("../interface").IGraphicAttribute>>;
63
- export declare function VImage(params: IDefaultGraphicParamsType<IImageGraphicAttribute>): import("../interface").IImage;
64
- export declare function VLine(params: IDefaultGraphicParamsType<ILineGraphicAttribute>): import("../interface").ILine;
65
- export declare function VPath(params: IDefaultGraphicParamsType<IPathGraphicAttribute>): import("../interface").IPath;
66
- export declare function VPolygon(params: IDefaultGraphicParamsType<IPolygonGraphicAttribute>): import("../interface").IPolygon;
67
- export declare function VPyramid3d(params: IDefaultGraphicParamsType<IPyramid3dGraphicAttribute>): import("../interface").IPyramid3d;
68
- export declare function VRect(params: IDefaultGraphicParamsType<IRectGraphicAttribute>): import("../interface").IRect;
69
- export declare function VRect3d(params: IDefaultGraphicParamsType<IRect3dGraphicAttribute>): import("../interface").IRect3d;
70
- export declare function VSymbol(params: IDefaultGraphicParamsType<ISymbolGraphicAttribute>): ISymbol;
71
- export declare function VText(params: IDefaultGraphicParamsType<ITextGraphicAttribute>): import("../interface").IText;
72
- export declare function VRichText(params: IDefaultGraphicParamsType<IRichTextGraphicAttribute>): import("../interface").IRichText;
73
- export declare namespace VRichText {
74
- var Text: (params: IDefaultGraphicParamsType<IRichTextCharacter>) => {
75
- attribute?: IRichTextCharacter;
76
- onPointerDown?: (d: any) => void;
77
- onPointerUp?: (d: any) => void;
78
- onPointerUpOutside?: (d: any) => void;
79
- onPointerTap?: (d: any) => void;
80
- onPointerOver?: (d: any) => void;
81
- onPointerMove?: (d: any) => void;
82
- onPointerEnter?: (d: any) => void;
83
- onPointerLeave?: (d: any) => void;
84
- onPointerOut?: (d: any) => void;
85
- onMouseDown?: (d: any) => void;
86
- onMouseUp?: (d: any) => void;
87
- onMouseUpOutside?: (d: any) => void;
88
- onMouseMove?: (d: any) => void;
89
- onMouseOver?: (d: any) => void;
90
- onMouseOut?: (d: any) => void;
91
- onMouseEnter?: (d: any) => void;
92
- onMouseLeave?: (d: any) => void;
93
- onPinch?: (d: any) => void;
94
- onPinchStart?: (d: any) => void;
95
- onPinchEnd?: (d: any) => void;
96
- onPan?: (d: any) => void;
97
- onPanStart?: (d: any) => void;
98
- onPanEnd?: (d: any) => void;
99
- onDrag?: (d: any) => void;
100
- onDragStart?: (d: any) => void;
101
- onDragEnter?: (d: any) => void;
102
- onDragLeave?: (d: any) => void;
103
- onDragOver?: (d: any) => void;
104
- onDragEnd?: (d: any) => void;
105
- onRightDown?: (d: any) => void;
106
- onRightUp?: (d: any) => void;
107
- onRightUpOutside?: (d: any) => void;
108
- onTouchStart?: (d: any) => void;
109
- onTouchEnd?: (d: any) => void;
110
- onTouchEndOutside?: (d: any) => void;
111
- onTouchMove?: (d: any) => void;
112
- onTouchCancel?: (d: any) => void;
113
- onPress?: (d: any) => void;
114
- onPressUp?: (d: any) => void;
115
- onPressEnd?: (d: any) => void;
116
- onSwipe?: (d: any) => void;
117
- onDrop?: (d: any) => void;
118
- onWeel?: (d: any) => void;
119
- onClick?: (d: any) => void;
120
- onDblClick?: (d: any) => void;
121
- type: string;
122
- };
123
- var Image: (params: IDefaultGraphicParamsType<IRichTextImageCharacter>) => {
124
- attribute?: IRichTextImageCharacter;
125
- onPointerDown?: (d: any) => void;
126
- onPointerUp?: (d: any) => void;
127
- onPointerUpOutside?: (d: any) => void;
128
- onPointerTap?: (d: any) => void;
129
- onPointerOver?: (d: any) => void;
130
- onPointerMove?: (d: any) => void;
131
- onPointerEnter?: (d: any) => void;
132
- onPointerLeave?: (d: any) => void;
133
- onPointerOut?: (d: any) => void;
134
- onMouseDown?: (d: any) => void;
135
- onMouseUp?: (d: any) => void;
136
- onMouseUpOutside?: (d: any) => void;
137
- onMouseMove?: (d: any) => void;
138
- onMouseOver?: (d: any) => void;
139
- onMouseOut?: (d: any) => void;
140
- onMouseEnter?: (d: any) => void;
141
- onMouseLeave?: (d: any) => void;
142
- onPinch?: (d: any) => void;
143
- onPinchStart?: (d: any) => void;
144
- onPinchEnd?: (d: any) => void;
145
- onPan?: (d: any) => void;
146
- onPanStart?: (d: any) => void;
147
- onPanEnd?: (d: any) => void;
148
- onDrag?: (d: any) => void;
149
- onDragStart?: (d: any) => void;
150
- onDragEnter?: (d: any) => void;
151
- onDragLeave?: (d: any) => void;
152
- onDragOver?: (d: any) => void;
153
- onDragEnd?: (d: any) => void;
154
- onRightDown?: (d: any) => void;
155
- onRightUp?: (d: any) => void;
156
- onRightUpOutside?: (d: any) => void;
157
- onTouchStart?: (d: any) => void;
158
- onTouchEnd?: (d: any) => void;
159
- onTouchEndOutside?: (d: any) => void;
160
- onTouchMove?: (d: any) => void;
161
- onTouchCancel?: (d: any) => void;
162
- onPress?: (d: any) => void;
163
- onPressUp?: (d: any) => void;
164
- onPressEnd?: (d: any) => void;
165
- onSwipe?: (d: any) => void;
166
- onDrop?: (d: any) => void;
167
- onWeel?: (d: any) => void;
168
- onClick?: (d: any) => void;
169
- onDblClick?: (d: any) => void;
170
- type: string;
171
- };
172
- }
@@ -1,133 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.VRichText = exports.VText = exports.VSymbol = exports.VRect3d = exports.VRect = exports.VPyramid3d = exports.VPolygon = exports.VPath = exports.VLine = exports.VImage = exports.VGlyph = exports.VGroup = exports.VCircle = exports.VArea = exports.VArc3d = exports.VArc = exports.REACT_TO_CANOPUS_EVENTS_LIST = exports.REACT_TO_CANOPUS_EVENTS = void 0;
6
-
7
- const graphic_1 = require("../graphic");
8
-
9
- function VArc(params) {
10
- return (0, graphic_1.createArc)(params ? params.attribute : {});
11
- }
12
-
13
- function VArc3d(params) {
14
- return (0, graphic_1.createArc3d)(params ? params.attribute : {});
15
- }
16
-
17
- function VArea(params) {
18
- return (0, graphic_1.createArea)(params ? params.attribute : {});
19
- }
20
-
21
- function VCircle(params) {
22
- return (0, graphic_1.createCircle)(params ? params.attribute : {});
23
- }
24
-
25
- function VGroup(params) {
26
- return (0, graphic_1.createGroup)(params ? params.attribute : {});
27
- }
28
-
29
- function VGlyph(params) {
30
- return (0, graphic_1.createGlyph)(params ? params.attribute : {});
31
- }
32
-
33
- function VImage(params) {
34
- return (0, graphic_1.createImage)(params ? params.attribute : {});
35
- }
36
-
37
- function VLine(params) {
38
- return (0, graphic_1.createLine)(params ? params.attribute : {});
39
- }
40
-
41
- function VPath(params) {
42
- return (0, graphic_1.createPath)(params ? params.attribute : {});
43
- }
44
-
45
- function VPolygon(params) {
46
- return (0, graphic_1.createPolygon)(params ? params.attribute : {});
47
- }
48
-
49
- function VPyramid3d(params) {
50
- return (0, graphic_1.createPyramid3d)(params ? params.attribute : {});
51
- }
52
-
53
- function VRect(params) {
54
- return (0, graphic_1.createRect)(params ? params.attribute : {});
55
- }
56
-
57
- function VRect3d(params) {
58
- return (0, graphic_1.createRect3d)(params ? params.attribute : {});
59
- }
60
-
61
- function VSymbol(params) {
62
- return (0, graphic_1.createSymbol)(params ? params.attribute : {});
63
- }
64
-
65
- function VText(params) {
66
- return (0, graphic_1.createText)(params ? params.attribute : {});
67
- }
68
-
69
- function VRichText(params) {
70
- return (0, graphic_1.createRichText)(params ? params.attribute : {});
71
- }
72
-
73
- exports.REACT_TO_CANOPUS_EVENTS = {
74
- onPointerDown: "pointerdown",
75
- onPointerUp: "pointerup",
76
- onPointerUpOutside: "pointerupoutside",
77
- onPointerTap: "pointertap",
78
- onPointerOver: "pointerover",
79
- onPointerMove: "pointermove",
80
- onPointerEnter: "pointerenter",
81
- onPointerLeave: "pointerleave",
82
- onPointerOut: "pointerout",
83
- onMouseDown: "mousedown",
84
- onMouseUp: "mouseup",
85
- onMouseUpOutside: "mouseupoutside",
86
- onMouseMove: "mousemove",
87
- onMouseOver: "mouseover",
88
- onMouseOut: "mouseout",
89
- onMouseEnter: "mouseenter",
90
- onMouseLeave: "mouseleave",
91
- onPinch: "pinch",
92
- onPinchStart: "pinchstart",
93
- onPinchEnd: "pinchend",
94
- onPan: "pan",
95
- onPanStart: "panstart",
96
- onPanEnd: "panend",
97
- onDrag: "drag",
98
- onDragStart: "dragstart",
99
- onDragEnter: "dragenter",
100
- onDragLeave: "dragleave",
101
- onDragOver: "dragover",
102
- onDragEnd: "dragend",
103
- onRightDown: "rightdown",
104
- onRightUp: "rightup",
105
- onRightUpOutside: "rightupoutside",
106
- onTouchStart: "touchstart",
107
- onTouchEnd: "touchend",
108
- onTouchEndOutside: "touchendoutside",
109
- onTouchMove: "touchmove",
110
- onTouchCancel: "touchcancel",
111
- onPress: "press",
112
- onPressUp: "pressup",
113
- onPressEnd: "pressend",
114
- onSwipe: "swipe",
115
- onDrop: "drop",
116
- onWeel: "wheel",
117
- onClick: "click",
118
- onDblClick: "dblclick"
119
- }, exports.REACT_TO_CANOPUS_EVENTS_LIST = Object.keys(exports.REACT_TO_CANOPUS_EVENTS),
120
- exports.VArc = VArc, exports.VArc3d = VArc3d, exports.VArea = VArea, exports.VCircle = VCircle,
121
- exports.VGroup = VGroup, exports.VGlyph = VGlyph, exports.VImage = VImage, exports.VLine = VLine,
122
- exports.VPath = VPath, exports.VPolygon = VPolygon, exports.VPyramid3d = VPyramid3d,
123
- exports.VRect = VRect, exports.VRect3d = VRect3d, exports.VSymbol = VSymbol, exports.VText = VText,
124
- exports.VRichText = VRichText, VRichText.Text = function(params) {
125
- return Object.assign({
126
- type: "rich/text"
127
- }, params);
128
- }, VRichText.Image = function(params) {
129
- return Object.assign({
130
- type: "rich/image"
131
- }, params);
132
- };
133
- //# sourceMappingURL=graphicType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/jsx/graphicType.ts"],"names":[],"mappings":";;;AAAA,wCAiBoB;AAuBP,QAAA,uBAAuB,GAAG;IACrC,aAAa,EAAE,aAAa;IAC5B,WAAW,EAAE,WAAW;IACxB,kBAAkB,EAAE,kBAAkB;IACtC,YAAY,EAAE,YAAY;IAC1B,aAAa,EAAE,aAAa;IAC5B,aAAa,EAAE,aAAa;IAC5B,cAAc,EAAE,cAAc;IAC9B,cAAc,EAAE,cAAc;IAC9B,YAAY,EAAE,YAAY;IAC1B,WAAW,EAAE,WAAW;IACxB,SAAS,EAAE,SAAS;IACpB,gBAAgB,EAAE,gBAAgB;IAClC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,WAAW;IACxB,UAAU,EAAE,UAAU;IACtB,YAAY,EAAE,YAAY;IAC1B,YAAY,EAAE,YAAY;IAC1B,OAAO,EAAE,OAAO;IAChB,YAAY,EAAE,YAAY;IAC1B,UAAU,EAAE,UAAU;IACtB,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,UAAU;IACtB,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,MAAM;IACd,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,WAAW;IACxB,UAAU,EAAE,UAAU;IACtB,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,WAAW;IACxB,SAAS,EAAE,SAAS;IACpB,gBAAgB,EAAE,gBAAgB;IAClC,YAAY,EAA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C,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACtD,CAAC;AAFD,0BAEC;AACD,SAAgB,OAAO,CAAC,MAA0D;IAChF,OAAO,IAAA,sBAAY,EAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACtD,CAAC;AAFD,0BAEC;AACD,SAAgB,KAAK,CAAC,MAAwD;IAC5E,OAAO,IAAA,oBAAU,EAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACpD,CAAC;AAFD,sBAEC;AACD,SAAgB,SAAS,CAAC,MAA4D;IACpF,OAAO,IAAA,wBAAc,EAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACxD,CAAC;AAFD,8BAEC;AAED,SAAS,CAAC,IAAI,GAAG,UAAU,MAAqD;IAC9E,uBACE,IAAI,EAAE,WAAW,IACd,MAAM,EACT;AACJ,CAAC,CAAC;AAEF,SAAS,CAAC,KAAK,GAAG,UAAU,MAA0D;IACpF,uBACE,IAAI,EAAE,YAAY,IACf,MAAM,EACT;AACJ,CAAC,CAAC","file":"graphicType.js","sourcesContent":["import {\n createArc,\n createArc3d,\n createArea,\n createCircle,\n createGlyph,\n createGroup,\n createImage,\n createLine,\n createPath,\n createPolygon,\n createPyramid3d,\n createRect,\n createRect3d,\n createRichText,\n createSymbol,\n createText\n} from '../graphic';\nimport type {\n IArc3dGraphicAttribute,\n IArcGraphicAttribute,\n IAreaGraphicAttribute,\n ICircleGraphicAttribute,\n IGlyphGraphicAttribute,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n IPolygonGraphicAttribute,\n IPyramid3dGraphicAttribute,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IRichTextCharacter,\n IRichTextGraphicAttribute,\n IRichTextImageCharacter,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '../interface';\nimport { IArcAttribute, IGraphic, IGroup, ISymbol, ISymbolAttribute } from '../interface';\n\nexport const REACT_TO_CANOPUS_EVENTS = {\n onPointerDown: 'pointerdown',\n onPointerUp: 'pointerup',\n onPointerUpOutside: 'pointerupoutside',\n onPointerTap: 'pointertap',\n onPointerOver: 'pointerover',\n onPointerMove: 'pointermove',\n onPointerEnter: 'pointerenter',\n onPointerLeave: 'pointerleave',\n onPointerOut: 'pointerout',\n onMouseDown: 'mousedown',\n onMouseUp: 'mouseup',\n onMouseUpOutside: 'mouseupoutside',\n onMouseMove: 'mousemove',\n onMouseOver: 'mouseover',\n onMouseOut: 'mouseout',\n onMouseEnter: 'mouseenter',\n onMouseLeave: 'mouseleave',\n onPinch: 'pinch',\n onPinchStart: 'pinchstart',\n onPinchEnd: 'pinchend',\n onPan: 'pan',\n onPanStart: 'panstart',\n onPanEnd: 'panend',\n onDrag: 'drag',\n onDragStart: 'dragstart',\n onDragEnter: 'dragenter',\n onDragLeave: 'dragleave',\n onDragOver: 'dragover',\n onDragEnd: 'dragend',\n onRightDown: 'rightdown',\n onRightUp: 'rightup',\n onRightUpOutside: 'rightupoutside',\n onTouchStart: 'touchstart',\n onTouchEnd: 'touchend',\n onTouchEndOutside: 'touchendoutside',\n onTouchMove: 'touchmove',\n onTouchCancel: 'touchcancel',\n onPress: 'press',\n onPressUp: 'pressup',\n onPressEnd: 'pressend',\n onSwipe: 'swipe',\n onDrop: 'drop',\n onWeel: 'wheel',\n onClick: 'click',\n onDblClick: 'dblclick'\n};\n\nexport const REACT_TO_CANOPUS_EVENTS_LIST = Object.keys(REACT_TO_CANOPUS_EVENTS);\n\nexport type IEventParamsType = {\n [t in keyof typeof REACT_TO_CANOPUS_EVENTS]?: (d: any) => void;\n};\n\nexport type IDefaultGraphicParamsType<T> = {\n attribute?: T;\n} & IEventParamsType;\n\nexport function VArc(params: IDefaultGraphicParamsType<IArcGraphicAttribute>) {\n return createArc(params ? params.attribute : {});\n}\nexport function VArc3d(params: IDefaultGraphicParamsType<IArc3dGraphicAttribute>) {\n return createArc3d(params ? params.attribute : {});\n}\nexport function VArea(params: IDefaultGraphicParamsType<IAreaGraphicAttribute>) {\n return createArea(params ? params.attribute : {});\n}\nexport function VCircle(params: IDefaultGraphicParamsType<ICircleGraphicAttribute>) {\n return createCircle(params ? params.attribute : {});\n}\nexport function VGroup(params: IDefaultGraphicParamsType<IGroupGraphicAttribute>) {\n return createGroup(params ? params.attribute : {});\n}\nexport function VGlyph(params: IDefaultGraphicParamsType<IGlyphGraphicAttribute>) {\n return createGlyph(params ? params.attribute : {});\n}\nexport function VImage(params: IDefaultGraphicParamsType<IImageGraphicAttribute>) {\n return createImage(params ? params.attribute : {});\n}\nexport function VLine(params: IDefaultGraphicParamsType<ILineGraphicAttribute>) {\n return createLine(params ? params.attribute : {});\n}\nexport function VPath(params: IDefaultGraphicParamsType<IPathGraphicAttribute>) {\n return createPath(params ? params.attribute : {});\n}\nexport function VPolygon(params: IDefaultGraphicParamsType<IPolygonGraphicAttribute>) {\n return createPolygon(params ? params.attribute : {});\n}\nexport function VPyramid3d(params: IDefaultGraphicParamsType<IPyramid3dGraphicAttribute>) {\n return createPyramid3d(params ? params.attribute : {});\n}\nexport function VRect(params: IDefaultGraphicParamsType<IRectGraphicAttribute>) {\n return createRect(params ? params.attribute : {});\n}\nexport function VRect3d(params: IDefaultGraphicParamsType<IRect3dGraphicAttribute>) {\n return createRect3d(params ? params.attribute : {});\n}\nexport function VSymbol(params: IDefaultGraphicParamsType<ISymbolGraphicAttribute>) {\n return createSymbol(params ? params.attribute : {});\n}\nexport function VText(params: IDefaultGraphicParamsType<ITextGraphicAttribute>) {\n return createText(params ? params.attribute : {});\n}\nexport function VRichText(params: IDefaultGraphicParamsType<IRichTextGraphicAttribute>) {\n return createRichText(params ? params.attribute : {});\n}\n\nVRichText.Text = function (params: IDefaultGraphicParamsType<IRichTextCharacter>) {\n return {\n type: 'rich/text',\n ...params\n };\n};\n\nVRichText.Image = function (params: IDefaultGraphicParamsType<IRichTextImageCharacter>) {\n return {\n type: 'rich/image',\n ...params\n };\n};\n"]}
@@ -1,2 +0,0 @@
1
- export * from './jsx-classic';
2
- export * from './graphicType';
package/cjs/jsx/index.js DELETED
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
4
- void 0 === k2 && (k2 = k);
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
7
- enumerable: !0,
8
- get: function() {
9
- return m[k];
10
- }
11
- }), Object.defineProperty(o, k2, desc);
12
- } : function(o, m, k, k2) {
13
- void 0 === k2 && (k2 = k), o[k2] = m[k];
14
- }), __exportStar = this && this.__exportStar || function(m, exports) {
15
- for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(exports, p) || __createBinding(exports, m, p);
16
- };
17
-
18
- Object.defineProperty(exports, "__esModule", {
19
- value: !0
20
- }), __exportStar(require("./jsx-classic"), exports), __exportStar(require("./graphicType"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/jsx/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,gDAA8B","file":"index.js","sourcesContent":["export * from './jsx-classic';\nexport * from './graphicType';\n"]}
@@ -1,3 +0,0 @@
1
- import { Group } from '../graphic';
2
- export declare function jsx(type: string | any, config: Record<string, any>, ...children: any): any;
3
- export declare const Fragment: typeof Group;
@@ -1,58 +0,0 @@
1
- "use strict";
2
-
3
- var __rest = this && this.__rest || function(s, e) {
4
- var t = {};
5
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
6
- if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
7
- var i = 0;
8
- for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
9
- }
10
- return t;
11
- };
12
-
13
- Object.defineProperty(exports, "__esModule", {
14
- value: !0
15
- }), exports.Fragment = exports.jsx = void 0;
16
-
17
- const vutils_1 = require("@visactor/vutils"), graphic_1 = require("../graphic"), graphicType_1 = require("./graphicType");
18
-
19
- function flatten(list, out) {
20
- if ((0, vutils_1.isArray)(list)) return list.forEach((i => flatten(i, out)));
21
- out.push(list);
22
- }
23
-
24
- function jsx(type, config, ...children) {
25
- const _a = config || {}, {key: key, attribute: attribute, stateProxy: stateProxy} = _a, props = __rest(_a, [ "key", "attribute", "stateProxy" ]);
26
- let c = type;
27
- (0, vutils_1.isString)(type) && (c = graphic_1.graphicCreator[type]);
28
- const childrenList = [];
29
- children.length && flatten(1 === children.length ? children[0] : children, childrenList);
30
- const g = "Group" === c.name ? new c(attribute) : c(config);
31
- return parseToGraphic(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy),
32
- g;
33
- }
34
-
35
- function parseToGraphic(g, childrenList, props) {
36
- let out, isGraphic = !1;
37
- switch (g.type) {
38
- case "richtext":
39
- case "rich/image":
40
- break;
41
-
42
- case "rich/text":
43
- out = g.attribute || {}, childrenList[0] && (out.text = childrenList[0]);
44
- break;
45
-
46
- default:
47
- isGraphic = !0;
48
- }
49
- isGraphic ? (childrenList.forEach((c => {
50
- c && g.add(c);
51
- })), Object.keys(props).forEach((k => {
52
- const en = graphicType_1.REACT_TO_CANOPUS_EVENTS[k];
53
- en && g.on(en, props[k]);
54
- }))) : "richtext" === g.type && (g.attribute.textConfig = childrenList.map((item => item.attribute)).filter((item => item)));
55
- }
56
-
57
- exports.jsx = jsx, exports.Fragment = graphic_1.Group;
58
- //# sourceMappingURL=jsx-classic.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/jsx/jsx-classic.ts"],"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AS,cAAc,CAAC,CAAM,EAAE,YAAmB,EAAE,KAAU;IAC7D,IAAI,SAAS,GAAY,KAAK,CAAC;IAC/B,IAAI,GAAQ,CAAC;IACb,QAAQ,CAAC,CAAC,IAAI,EAAE;QACd,KAAK,UAAU;YACb,MAAM;QACR,KAAK,WAAW;YACd,GAAG,GAAG,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC;YACxB,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;YAChD,MAAM;QACR,KAAK,YAAY;YACf,MAAM;QACR;YACE,SAAS,GAAG,IAAI,CAAC;KACpB;IAED,IAAI,SAAS,EAAE;QACb,YAAY,CAAC,OAAO,CAAC,CAAC,CAAM,EAAE,EAAE;YAC9B,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAC7B,MAAM,EAAE,GAAG,qCAAuB,CAAC,CAAC,CAAC,CAAC;YACtC,IAAI,EAAE,EAAE;gBACN,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aACpB;QACH,CAAC,CAAC,CAAC;KACJ;SAAM;QACL,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,EAAE;YACzB,CAAC,CAAC,SAAS,CAAC,UAAU,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;SACxF;KACF;AACH,CAAC;AAEY,QAAA,QAAQ,GAAG,eAAK,CAAC","file":"jsx-classic.js","sourcesContent":["import { isArray, isString } from '@visactor/vutils';\nimport { Group, graphicCreator } from '../graphic';\nimport { REACT_TO_CANOPUS_EVENTS } from './graphicType';\n\nfunction flatten(list: any, out: any[]): void {\n if (isArray(list)) {\n return list.forEach(i => flatten(i, out));\n }\n out.push(list);\n}\n\nexport function jsx(type: string | any, config: Record<string, any>, ...children: any) {\n const { key, attribute, stateProxy, ...props } = config || {};\n\n let c = type;\n if (isString(type)) {\n c = graphicCreator[type];\n }\n\n const childrenList: any[] = [];\n if (children.length) {\n flatten(children.length === 1 ? children[0] : children, childrenList);\n }\n\n const g = c.name === 'Group' ? new c(attribute) : c(config);\n parseToGraphic(g, childrenList, props);\n\n if (stateProxy) {\n g.stateProxy = stateProxy;\n }\n\n return g;\n}\n\nfunction parseToGraphic(g: any, childrenList: any[], props: any) {\n let isGraphic: boolean = false;\n let out: any;\n switch (g.type) {\n case 'richtext':\n break;\n case 'rich/text':\n out = g.attribute || {};\n childrenList[0] && (out.text = childrenList[0]);\n break;\n case 'rich/image':\n break;\n default:\n isGraphic = true;\n }\n\n if (isGraphic) {\n childrenList.forEach((c: any) => {\n c && g.add(c);\n });\n\n Object.keys(props).forEach(k => {\n const en = REACT_TO_CANOPUS_EVENTS[k];\n if (en) {\n g.on(en, props[k]);\n }\n });\n } else {\n if (g.type === 'richtext') {\n g.attribute.textConfig = childrenList.map(item => item.attribute).filter(item => item);\n }\n }\n}\n\nexport const Fragment = Group;\n"]}
@@ -1,13 +0,0 @@
1
- import type { IGraphic, IPlugin, IPluginService, IRenderService, IGroup } from '../../interface';
2
- export declare class HtmlAttributePlugin implements IPlugin {
3
- name: 'HtmlAttributePlugin';
4
- activeEvent: 'onRegister';
5
- pluginService: IPluginService;
6
- _uid: number;
7
- key: string;
8
- activate(context: IPluginService): void;
9
- deactivate(context: IPluginService): void;
10
- protected drawHTML(renderService: IRenderService): void;
11
- renderGroupHTML(group: IGroup): void;
12
- renderGraphicHTML(graphic: IGraphic): void;
13
- }
@@ -1,79 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.HtmlAttributePlugin = void 0;
6
-
7
- const generator_1 = require("../../common/generator"), application_1 = require("../../application"), graphic_1 = require("../../graphic");
8
-
9
- class HtmlAttributePlugin {
10
- constructor() {
11
- this.name = "HtmlAttributePlugin", this.activeEvent = "onRegister", this._uid = generator_1.Generator.GenAutoIncrementId(),
12
- this.key = this.name + this._uid;
13
- }
14
- activate(context) {
15
- this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, (stage => {
16
- stage && stage === this.pluginService.stage && this.drawHTML(context.stage.renderService);
17
- }));
18
- }
19
- deactivate(context) {
20
- context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter((item => item.name !== this.key));
21
- }
22
- drawHTML(renderService) {
23
- "browser" === application_1.application.global.env && renderService.renderTreeRoots.sort(((a, b) => {
24
- var _a, _b;
25
- return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : graphic_1.DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : graphic_1.DefaultAttribute.zIndex);
26
- })).forEach((group => {
27
- this.renderGroupHTML(group);
28
- }));
29
- }
30
- renderGroupHTML(group) {
31
- this.renderGraphicHTML(group), group.forEachChildren((g => {
32
- this.renderGraphicHTML(g);
33
- }));
34
- }
35
- renderGraphicHTML(graphic) {
36
- const {html: html} = graphic.attribute;
37
- if (!html) return void (graphic.bindDom && graphic.bindDom.size && (graphic.bindDom.forEach((item => {
38
- item.dom && item.dom.parentElement.removeChild(item.dom);
39
- })), graphic.bindDom.clear()));
40
- const stage = graphic.stage;
41
- if (!stage) return;
42
- const {dom: dom, container: container, width: width, height: height, style: style, anchorType: anchorType = "boundsLeftTop"} = html;
43
- graphic.bindDom || (graphic.bindDom = new Map);
44
- const lastDom = graphic.bindDom.get(dom);
45
- if (lastDom && (!container || container === lastDom.container)) return;
46
- let nativeDom, nativeContainer;
47
- graphic.bindDom.forEach((({wrapGroup: wrapGroup}) => {
48
- application_1.application.global.removeDom(wrapGroup);
49
- })), nativeDom = "string" == typeof dom ? (new DOMParser).parseFromString(dom, "text/xml").firstChild : dom;
50
- const _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
51
- nativeContainer = _container ? "string" == typeof _container ? application_1.application.global.getElementById(_container) : _container : graphic.stage.window.getContainer();
52
- const wrapGroup = application_1.application.global.createDom({
53
- tagName: "div",
54
- width: width,
55
- height: height,
56
- style: style,
57
- parent: nativeContainer
58
- });
59
- wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
60
- dom: nativeDom,
61
- container: container,
62
- wrapGroup: wrapGroup
63
- })), wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute",
64
- nativeContainer.style.position = "relative");
65
- let left = 0, top = 0;
66
- if ("position" === anchorType) {
67
- const matrix = graphic.transMatrix;
68
- left = matrix.e, top = matrix.f;
69
- } else {
70
- const b = graphic.AABBBounds;
71
- left = b.x1, top = b.y1;
72
- }
73
- const containerTL = application_1.application.global.getElementTopLeft(nativeContainer, !1), windowTL = stage.window.getTopLeft(!1), offsetX = left + windowTL.left - containerTL.left, offsetTop = top + windowTL.top - containerTL.top;
74
- wrapGroup.style.left = `${offsetX}px`, wrapGroup.style.top = `${offsetTop}px`;
75
- }
76
- }
77
-
78
- exports.HtmlAttributePlugin = HtmlAttributePlugin;
79
- //# sourceMappingURL=html-attribute-plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugins/builtin-plugin/html-attribute-plugin.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AAEnD,mDAAgD;AAChD,2CAAiD;AAEjD,MAAa,mBAAmB;IAAhC;QACE,SAAI,GAA0B,qBAAqB,CAAC;QACpD,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,qBAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IAyHtC,CAAC;IA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,CAAC,QAAQ,GAAG,UAAU,CAAC;YACtC,eAAe,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;SAC7C;QACD,IAAI,IAAI,GAAW,CAAC,CAAC;QACrB,IAAI,GAAG,GAAW,CAAC,CAAC;QACpB,IAAI,UAAU,KAAK,UAAU,EAAE;YAC7B,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;YACnC,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;YAChB,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC;SAChB;aAAM;YACL,MAAM,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;YAC7B,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC;YACZ,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC;SACZ;QAGD,MAAM,WAAW,GAAG,yBAAW,CAAC,MAAM,CAAC,iBAAiB,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QACjF,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,IAAI,GAAG,QAAQ,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;QACxD,MAAM,SAAS,GAAG,GAAG,GAAG,QAAQ,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC;QAEvD,SAAS,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,OAAO,IAAI,CAAC;QACtC,SAAS,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,SAAS,IAAI,CAAC;IACzC,CAAC;CACF;AA9HD,kDA8HC","file":"html-attribute-plugin.js","sourcesContent":["import { Generator } from '../../common/generator';\nimport type { IGraphic, IPlugin, IPluginService, IRenderService, IDrawContext, IGroup } from '../../interface';\nimport { application } from '../../application';\nimport { DefaultAttribute } from '../../graphic';\n\nexport class HtmlAttributePlugin implements IPlugin {\n name: 'HtmlAttributePlugin' = 'HtmlAttributePlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n context.stage.hooks.afterRender.tap(this.key, stage => {\n if (!(stage && stage === this.pluginService.stage)) {\n return;\n }\n\n this.drawHTML(context.stage.renderService);\n });\n }\n deactivate(context: IPluginService): void {\n context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter(item => {\n return item.name !== this.key;\n });\n }\n\n protected drawHTML(renderService: IRenderService) {\n if (application.global.env === 'browser') {\n renderService.renderTreeRoots\n .sort((a, b) => {\n return (a.attribute.zIndex ?? DefaultAttribute.zIndex) - (b.attribute.zIndex ?? DefaultAttribute.zIndex);\n })\n .forEach(group => {\n this.renderGroupHTML(group as IGroup);\n });\n }\n }\n\n renderGroupHTML(group: IGroup) {\n this.renderGraphicHTML(group);\n group.forEachChildren((g: IGraphic) => {\n this.renderGraphicHTML(g);\n });\n }\n\n renderGraphicHTML(graphic: IGraphic) {\n const { html } = graphic.attribute;\n if (!html) {\n if (graphic.bindDom && graphic.bindDom.size) {\n // 删除dom\n graphic.bindDom.forEach(item => {\n item.dom && item.dom.parentElement.removeChild(item.dom);\n });\n graphic.bindDom.clear();\n }\n return;\n }\n const stage = graphic.stage;\n if (!stage) {\n return;\n }\n const { dom, container, width, height, style, anchorType = 'boundsLeftTop' } = html;\n if (!graphic.bindDom) {\n graphic.bindDom = new Map();\n }\n const lastDom = graphic.bindDom.get(dom);\n // 如果存在了(dom存在,且container没有变化),就跳过\n if (lastDom && !(container && container !== lastDom.container)) {\n return;\n }\n // 清除上一次的dom\n graphic.bindDom.forEach(({ wrapGroup }) => {\n application.global.removeDom(wrapGroup);\n });\n // 转化这个dom为nativeDOM\n let nativeDom: HTMLElement;\n if (typeof dom === 'string') {\n nativeDom = new DOMParser().parseFromString(dom, 'text/xml').firstChild as any;\n } else {\n nativeDom = dom;\n }\n // 获取container的dom,默认为window的container\n let nativeContainer;\n const _container =\n container || (stage.params.enableHtmlAttribute === true ? null : stage.params.enableHtmlAttribute);\n if (_container) {\n if (typeof _container === 'string') {\n nativeContainer = application.global.getElementById(_container);\n } else {\n nativeContainer = _container;\n }\n } else {\n // nativeContainer = application.global.getRootElement();\n nativeContainer = graphic.stage.window.getContainer();\n }\n // 创建wrapGroup\n const wrapGroup = application.global.createDom({ tagName: 'div', width, height, style, parent: nativeContainer });\n if (wrapGroup) {\n wrapGroup.appendChild(nativeDom);\n graphic.bindDom.set(dom, { dom: nativeDom, container, wrapGroup: wrapGroup as any });\n }\n // 事件穿透\n wrapGroup.style.pointerEvents = 'none';\n // 定位wrapGroup\n if (!wrapGroup.style.position) {\n wrapGroup.style.position = 'absolute';\n nativeContainer.style.position = 'relative';\n }\n let left: number = 0;\n let top: number = 0;\n if (anchorType === 'position') {\n const matrix = graphic.transMatrix;\n left = matrix.e;\n top = matrix.f;\n } else {\n const b = graphic.AABBBounds;\n left = b.x1;\n top = b.y1;\n }\n // 查看wrapGroup的位置\n // const wrapGroupTL = application.global.getElementTopLeft(wrapGroup, false);\n const containerTL = application.global.getElementTopLeft(nativeContainer, false);\n const windowTL = stage.window.getTopLeft(false);\n const offsetX = left + windowTL.left - containerTL.left;\n const offsetTop = top + windowTL.top - containerTL.top;\n // wrapGroup.style.transform = `translate(${offsetX}px, ${offsetTop}px)`;\n wrapGroup.style.left = `${offsetX}px`;\n wrapGroup.style.top = `${offsetTop}px`;\n }\n}\n"]}
@@ -1,12 +0,0 @@
1
- import type { IBounds } from '@visactor/vutils';
2
- import type { IContext2d, SymbolType, ISymbolClass } from '../../interface';
3
- export declare function arrow2Down(ctx: IContext2d, r: number, transX: number, transY: number): boolean;
4
- export declare class Arrow2DownSymbol implements ISymbolClass {
5
- type: SymbolType;
6
- pathStr: string;
7
- draw(ctx: IContext2d, size: number, transX: number, transY: number): boolean;
8
- drawOffset(ctx: IContext2d, size: number, transX: number, transY: number, offset: number): boolean;
9
- bounds(size: number, bounds: IBounds): void;
10
- }
11
- declare const _default: Arrow2DownSymbol;
12
- export default _default;
@@ -1,24 +0,0 @@
1
- export function arrow2Down(ctx, r, transX, transY) {
2
- const r2 = 2 * r;
3
- return ctx.moveTo(transX - r2, transY - r), ctx.lineTo(transX, transY + r), ctx.lineTo(transX + r2, transY - r),
4
- !0;
5
- }
6
-
7
- export class Arrow2DownSymbol {
8
- constructor() {
9
- this.type = "arrow2Down", this.pathStr = "M -0.5 -0.25 L 0 0.25 l 0.5 -0.25";
10
- }
11
- draw(ctx, size, transX, transY) {
12
- return arrow2Down(ctx, size / 4, transX, transY);
13
- }
14
- drawOffset(ctx, size, transX, transY, offset) {
15
- return arrow2Down(ctx, size / 4 + offset, transX, transY);
16
- }
17
- bounds(size, bounds) {
18
- const r = size / 2;
19
- bounds.x1 = -r, bounds.x2 = r, bounds.y1 = -r, bounds.y2 = r;
20
- }
21
- }
22
-
23
- export default new Arrow2DownSymbol;
24
- //# sourceMappingURL=arrow2-down.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/graphic/builtin-symbol/arrow2-down.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,UAAU,CAAC,GAAe,EAAE,CAAS,EAAE,MAAc,EAAE,MAAc;IACnF,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACjB,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;IACpC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/B,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;IAEpC,OAAO,IAAI,CAAC;AACd,CAAC;AAGD,MAAM,OAAO,gBAAgB;IAA7B;QACE,SAAI,GAAe,YAAY,CAAC;QAEhC,YAAO,GAAW,mCAAmC,CAAC;IAmBxD,CAAC;IAjBC,IAAI,CAAC,GAAe,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc;QAChE,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QACnB,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,UAAU,CAAC,GAAe,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc,EAAE,MAAc;QACtF,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,MAAM,CAAC;QAC5B,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,IAAY,EAAE,MAAe;QAClC,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QACnB,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACf,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;QACd,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACf,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;IAChB,CAAC;CACF;AAED,eAAe,IAAI,gBAAgB,EAAE,CAAC","file":"arrow2-down.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\n\nexport function arrow2Down(ctx: IContext2d, r: number, transX: number, transY: number) {\n const r2 = r * 2;\n ctx.moveTo(transX - r2, transY - r);\n ctx.lineTo(transX, transY + r);\n ctx.lineTo(transX + r2, transY - r);\n\n return true;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class Arrow2DownSymbol implements ISymbolClass {\n type: SymbolType = 'arrow2Down';\n /* eslint-disable max-len */\n pathStr: string = 'M -0.5 -0.25 L 0 0.25 l 0.5 -0.25';\n\n draw(ctx: IContext2d, size: number, transX: number, transY: number) {\n const r = size / 4;\n return arrow2Down(ctx, r, transX, transY);\n }\n\n drawOffset(ctx: IContext2d, size: number, transX: number, transY: number, offset: number) {\n const r = size / 4 + offset;\n return arrow2Down(ctx, r, transX, transY);\n }\n\n bounds(size: number, bounds: IBounds) {\n const r = size / 2;\n bounds.x1 = -r;\n bounds.x2 = r;\n bounds.y1 = -r;\n bounds.y2 = r;\n }\n}\n\nexport default new Arrow2DownSymbol();\n"]}
@@ -1,12 +0,0 @@
1
- import type { IBounds } from '@visactor/vutils';
2
- import type { IContext2d, SymbolType, ISymbolClass } from '../../interface';
3
- export declare function arrow2Up(ctx: IContext2d, r: number, transX: number, transY: number): boolean;
4
- export declare class Arrow2UpSymbol implements ISymbolClass {
5
- type: SymbolType;
6
- pathStr: string;
7
- draw(ctx: IContext2d, size: number, transX: number, transY: number): boolean;
8
- drawOffset(ctx: IContext2d, size: number, transX: number, transY: number, offset: number): boolean;
9
- bounds(size: number, bounds: IBounds): void;
10
- }
11
- declare const _default: Arrow2UpSymbol;
12
- export default _default;
@@ -1,24 +0,0 @@
1
- export function arrow2Up(ctx, r, transX, transY) {
2
- const r2 = 2 * r;
3
- return ctx.moveTo(transX - r2, transY + r), ctx.lineTo(transX, transY - r), ctx.lineTo(transX + r2, transY + r),
4
- !0;
5
- }
6
-
7
- export class Arrow2UpSymbol {
8
- constructor() {
9
- this.type = "arrow2Up", this.pathStr = "M -0.5 0.25 L 0 -0.25 l 0.5 0.25";
10
- }
11
- draw(ctx, size, transX, transY) {
12
- return arrow2Up(ctx, size / 4, transX, transY);
13
- }
14
- drawOffset(ctx, size, transX, transY, offset) {
15
- return arrow2Up(ctx, size / 4 + offset, transX, transY);
16
- }
17
- bounds(size, bounds) {
18
- const r = size / 2;
19
- bounds.x1 = -r, bounds.x2 = r, bounds.y1 = -r, bounds.y2 = r;
20
- }
21
- }
22
-
23
- export default new Arrow2UpSymbol;
24
- //# sourceMappingURL=arrow2-up.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/graphic/builtin-symbol/arrow2-up.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,QAAQ,CAAC,GAAe,EAAE,CAAS,EAAE,MAAc,EA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import type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\n\nexport function arrow2Up(ctx: IContext2d, r: number, transX: number, transY: number) {\n const r2 = r * 2;\n ctx.moveTo(transX - r2, transY + r);\n ctx.lineTo(transX, transY - r);\n ctx.lineTo(transX + r2, transY + r);\n\n return true;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class Arrow2UpSymbol implements ISymbolClass {\n type: SymbolType = 'arrow2Up';\n /* eslint-disable max-len */\n pathStr: string = 'M -0.5 0.25 L 0 -0.25 l 0.5 0.25';\n\n draw(ctx: IContext2d, size: number, transX: number, transY: number) {\n const r = size / 4;\n return arrow2Up(ctx, r, transX, transY);\n }\n\n drawOffset(ctx: IContext2d, size: number, transX: number, transY: number, offset: number) {\n const r = size / 4 + offset;\n return arrow2Up(ctx, r, transX, transY);\n }\n\n bounds(size: number, bounds: IBounds) {\n const r = size / 2;\n bounds.x1 = -r;\n bounds.x2 = r;\n bounds.y1 = -r;\n bounds.y2 = r;\n }\n}\n\nexport default new Arrow2UpSymbol();\n"]}