@visactor/vrender-components 0.18.11 → 0.19.0-alpha.0

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 (221) hide show
  1. package/cjs/axis/base.js +4 -20
  2. package/cjs/axis/base.js.map +1 -1
  3. package/cjs/brush/brush.js +1 -2
  4. package/cjs/brush/type.js +2 -1
  5. package/cjs/index.d.ts +1 -2
  6. package/cjs/index.js +2 -3
  7. package/cjs/index.js.map +1 -1
  8. package/cjs/label/arc.d.ts +2 -2
  9. package/cjs/label/base.d.ts +2 -2
  10. package/cjs/label/index.js +2 -1
  11. package/cjs/label/line.js +1 -1
  12. package/cjs/label/polygon.js +1 -1
  13. package/cjs/label/rect.js +1 -1
  14. package/cjs/label/register.js +1 -1
  15. package/cjs/label/symbol.js +1 -1
  16. package/cjs/label/type.js +1 -1
  17. package/cjs/legend/base.js +1 -1
  18. package/cjs/legend/constant.js +1 -1
  19. package/cjs/legend/index.js +1 -1
  20. package/cjs/legend/register.js +1 -1
  21. package/cjs/legend/type.js +1 -2
  22. package/cjs/legend/util.js +1 -1
  23. package/cjs/marker/animate/animate.d.ts +13 -0
  24. package/cjs/marker/animate/animate.js +92 -0
  25. package/cjs/marker/animate/animate.js.map +1 -0
  26. package/cjs/marker/animate/call-in.d.ts +4 -0
  27. package/cjs/marker/animate/call-in.js +27 -0
  28. package/cjs/marker/animate/call-in.js.map +1 -0
  29. package/cjs/marker/animate/clip-in.d.ts +4 -0
  30. package/cjs/marker/animate/clip-in.js +23 -0
  31. package/cjs/marker/animate/clip-in.js.map +1 -0
  32. package/cjs/marker/animate/common.d.ts +9 -0
  33. package/cjs/marker/animate/common.js +48 -0
  34. package/cjs/marker/animate/common.js.map +1 -0
  35. package/cjs/marker/animate/fade-in.d.ts +7 -0
  36. package/cjs/marker/animate/fade-in.js +30 -0
  37. package/cjs/marker/animate/fade-in.js.map +1 -0
  38. package/cjs/marker/animate/fade-out.d.ts +7 -0
  39. package/cjs/marker/animate/fade-out.js +30 -0
  40. package/cjs/marker/animate/fade-out.js.map +1 -0
  41. package/cjs/marker/animate/index.js +3 -0
  42. package/cjs/marker/animate/index.js.map +1 -0
  43. package/cjs/marker/arc-area.d.ts +55 -0
  44. package/cjs/marker/arc-area.js +131 -0
  45. package/cjs/marker/arc-area.js.map +1 -0
  46. package/cjs/marker/arc-line.d.ts +25 -0
  47. package/cjs/marker/arc-line.js +106 -0
  48. package/cjs/marker/arc-line.js.map +1 -0
  49. package/cjs/marker/area.d.ts +14 -4
  50. package/cjs/marker/area.js +34 -21
  51. package/cjs/marker/area.js.map +1 -1
  52. package/cjs/marker/base.d.ts +21 -3
  53. package/cjs/marker/base.js +40 -5
  54. package/cjs/marker/base.js.map +1 -1
  55. package/cjs/marker/common-line.d.ts +22 -0
  56. package/cjs/marker/common-line.js +56 -0
  57. package/cjs/marker/common-line.js.map +1 -0
  58. package/cjs/marker/config.d.ts +79 -6
  59. package/cjs/marker/config.js +77 -37
  60. package/cjs/marker/config.js.map +1 -1
  61. package/cjs/marker/index.d.ts +2 -0
  62. package/cjs/marker/index.js +2 -1
  63. package/cjs/marker/index.js.map +1 -1
  64. package/cjs/marker/line.d.ts +24 -12
  65. package/cjs/marker/line.js +111 -45
  66. package/cjs/marker/line.js.map +1 -1
  67. package/cjs/marker/point.d.ts +8 -3
  68. package/cjs/marker/point.js +33 -9
  69. package/cjs/marker/point.js.map +1 -1
  70. package/cjs/marker/register.d.ts +2 -0
  71. package/cjs/marker/register.js +11 -2
  72. package/cjs/marker/register.js.map +1 -1
  73. package/cjs/marker/type.d.ts +102 -12
  74. package/cjs/marker/type.js +8 -2
  75. package/cjs/marker/type.js.map +1 -1
  76. package/cjs/segment/arc-segment.d.ts +13 -0
  77. package/cjs/segment/arc-segment.js +51 -0
  78. package/cjs/segment/arc-segment.js.map +1 -0
  79. package/cjs/segment/index.d.ts +1 -0
  80. package/cjs/segment/index.js +2 -1
  81. package/cjs/segment/index.js.map +1 -1
  82. package/cjs/segment/register.d.ts +2 -1
  83. package/cjs/segment/register.js +8 -3
  84. package/cjs/segment/register.js.map +1 -1
  85. package/cjs/segment/segment.d.ts +9 -7
  86. package/cjs/segment/segment.js +12 -8
  87. package/cjs/segment/segment.js.map +1 -1
  88. package/cjs/segment/type.d.ts +24 -4
  89. package/cjs/segment/type.js.map +1 -1
  90. package/cjs/tag/tag.d.ts +5 -0
  91. package/cjs/tag/tag.js +11 -2
  92. package/cjs/tag/tag.js.map +1 -1
  93. package/cjs/util/interaction.d.ts +4 -0
  94. package/cjs/util/interaction.js +37 -0
  95. package/cjs/util/interaction.js.map +1 -0
  96. package/es/axis/base.js +7 -21
  97. package/es/axis/base.js.map +1 -1
  98. package/es/brush/brush.js +1 -2
  99. package/es/brush/type.js +2 -1
  100. package/es/index.d.ts +1 -2
  101. package/es/index.js +1 -3
  102. package/es/index.js.map +1 -1
  103. package/es/label/arc.d.ts +2 -2
  104. package/es/label/base.d.ts +2 -2
  105. package/es/label/index.js +2 -1
  106. package/es/label/line.js +1 -1
  107. package/es/label/polygon.js +1 -1
  108. package/es/label/rect.js +1 -1
  109. package/es/label/register.js +1 -1
  110. package/es/label/symbol.js +1 -1
  111. package/es/label/type.js +1 -1
  112. package/es/legend/base.js +1 -1
  113. package/es/legend/constant.js +1 -1
  114. package/es/legend/index.js +1 -1
  115. package/es/legend/register.js +1 -1
  116. package/es/legend/type.js +1 -2
  117. package/es/legend/util.js +1 -1
  118. package/es/marker/animate/animate.d.ts +13 -0
  119. package/es/marker/animate/animate.js +92 -0
  120. package/es/marker/animate/animate.js.map +1 -0
  121. package/es/marker/animate/call-in.d.ts +4 -0
  122. package/es/marker/animate/call-in.js +17 -0
  123. package/es/marker/animate/call-in.js.map +1 -0
  124. package/es/marker/animate/clip-in.d.ts +4 -0
  125. package/es/marker/animate/clip-in.js +15 -0
  126. package/es/marker/animate/clip-in.js.map +1 -0
  127. package/es/marker/animate/common.d.ts +9 -0
  128. package/es/marker/animate/common.js +39 -0
  129. package/es/marker/animate/common.js.map +1 -0
  130. package/es/marker/animate/fade-in.d.ts +7 -0
  131. package/es/marker/animate/fade-in.js +20 -0
  132. package/es/marker/animate/fade-in.js.map +1 -0
  133. package/es/marker/animate/fade-out.d.ts +7 -0
  134. package/es/marker/animate/fade-out.js +20 -0
  135. package/es/marker/animate/fade-out.js.map +1 -0
  136. package/es/marker/animate/index.js +3 -0
  137. package/es/marker/animate/index.js.map +1 -0
  138. package/es/marker/arc-area.d.ts +55 -0
  139. package/es/marker/arc-area.js +143 -0
  140. package/es/marker/arc-area.js.map +1 -0
  141. package/es/marker/arc-line.d.ts +25 -0
  142. package/es/marker/arc-line.js +114 -0
  143. package/es/marker/arc-line.js.map +1 -0
  144. package/es/marker/area.d.ts +14 -4
  145. package/es/marker/area.js +36 -19
  146. package/es/marker/area.js.map +1 -1
  147. package/es/marker/base.d.ts +21 -3
  148. package/es/marker/base.js +43 -4
  149. package/es/marker/base.js.map +1 -1
  150. package/es/marker/common-line.d.ts +22 -0
  151. package/es/marker/common-line.js +58 -0
  152. package/es/marker/common-line.js.map +1 -0
  153. package/es/marker/config.d.ts +79 -6
  154. package/es/marker/config.js +79 -37
  155. package/es/marker/config.js.map +1 -1
  156. package/es/marker/index.d.ts +2 -0
  157. package/es/marker/index.js +4 -0
  158. package/es/marker/index.js.map +1 -1
  159. package/es/marker/line.d.ts +24 -12
  160. package/es/marker/line.js +116 -48
  161. package/es/marker/line.js.map +1 -1
  162. package/es/marker/point.d.ts +8 -3
  163. package/es/marker/point.js +34 -6
  164. package/es/marker/point.js.map +1 -1
  165. package/es/marker/register.d.ts +2 -0
  166. package/es/marker/register.js +10 -2
  167. package/es/marker/register.js.map +1 -1
  168. package/es/marker/type.d.ts +102 -12
  169. package/es/marker/type.js +9 -0
  170. package/es/marker/type.js.map +1 -1
  171. package/es/segment/arc-segment.d.ts +13 -0
  172. package/es/segment/arc-segment.js +49 -0
  173. package/es/segment/arc-segment.js.map +1 -0
  174. package/es/segment/index.d.ts +1 -0
  175. package/es/segment/index.js +2 -0
  176. package/es/segment/index.js.map +1 -1
  177. package/es/segment/register.d.ts +2 -1
  178. package/es/segment/register.js +6 -2
  179. package/es/segment/register.js.map +1 -1
  180. package/es/segment/segment.d.ts +9 -7
  181. package/es/segment/segment.js +11 -8
  182. package/es/segment/segment.js.map +1 -1
  183. package/es/segment/type.d.ts +24 -4
  184. package/es/segment/type.js.map +1 -1
  185. package/es/tag/tag.d.ts +5 -0
  186. package/es/tag/tag.js +11 -2
  187. package/es/tag/tag.js.map +1 -1
  188. package/es/util/interaction.d.ts +4 -0
  189. package/es/util/interaction.js +30 -0
  190. package/es/util/interaction.js.map +1 -0
  191. package/package.json +5 -5
  192. package/cjs/marker/util.js +0 -3
  193. package/cjs/marker/util.js.map +0 -1
  194. package/cjs/radio/index.d.ts +0 -2
  195. package/cjs/radio/index.js +0 -21
  196. package/cjs/radio/index.js.map +0 -1
  197. package/cjs/radio/radio.d.ts +0 -16
  198. package/cjs/radio/radio.js +0 -88
  199. package/cjs/radio/radio.js.map +0 -1
  200. package/cjs/radio/register.d.ts +0 -1
  201. package/cjs/radio/register.js +0 -15
  202. package/cjs/radio/register.js.map +0 -1
  203. package/cjs/radio/type.d.ts +0 -21
  204. package/cjs/radio/type.js +0 -6
  205. package/cjs/radio/type.js.map +0 -1
  206. package/es/marker/util.js +0 -3
  207. package/es/marker/util.js.map +0 -1
  208. package/es/radio/index.d.ts +0 -2
  209. package/es/radio/index.js +0 -4
  210. package/es/radio/index.js.map +0 -1
  211. package/es/radio/radio.d.ts +0 -16
  212. package/es/radio/radio.js +0 -87
  213. package/es/radio/radio.js.map +0 -1
  214. package/es/radio/register.d.ts +0 -1
  215. package/es/radio/register.js +0 -6
  216. package/es/radio/register.js.map +0 -1
  217. package/es/radio/type.d.ts +0 -21
  218. package/es/radio/type.js +0 -2
  219. package/es/radio/type.js.map +0 -1
  220. /package/cjs/marker/{util.d.ts → animate/index.d.ts} +0 -0
  221. /package/es/marker/{util.d.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AI,CAAC,GAAG,EAAE;QACR,OAAO;KACR;IAGD,cAAc,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAG5D,cAAc,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC3D,CAAC","file":"common.js","sourcesContent":["import type { EasingType, IGraphic } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\n\n/** fade-in */\nexport function graphicFadeIn(graphic: IGraphic, delay: number, duration: number, easing: EasingType) {\n if (!graphic) {\n return;\n }\n\n graphic.setAttributes({\n fillOpacity: 0,\n strokeOpacity: 0\n });\n\n graphic.animate().wait(delay).to({ fillOpacity: 1, strokeOpacity: 1 }, duration, easing);\n}\n\nexport function segmentFadeIn(segment: Segment, delay: number, duration: number, easing: EasingType) {\n if (!segment) {\n return;\n }\n\n // start symbol\n graphicFadeIn(segment.startSymbol, delay, duration, easing);\n\n // line\n segment.lines.forEach(line => graphicFadeIn(line, delay, duration, easing));\n graphicFadeIn((segment as ArcSegment).line, delay, duration, easing);\n\n // end symbol\n graphicFadeIn(segment.endSymbol, delay, duration, easing);\n}\n\nexport function tagFadeIn(tag: Tag, delay: number, duration: number, easing: EasingType) {\n if (!tag) {\n return;\n }\n\n // text\n graphicFadeIn(tag.getTextShape(), delay, duration, easing);\n\n // text background\n graphicFadeIn(tag.getBgRect(), delay, duration, easing);\n}\n\n/** fade-out */\nexport function graphicFadeOut(graphic: IGraphic, delay: number, duration: number, easing: EasingType) {\n if (!graphic) {\n return;\n }\n\n graphic.setAttributes({\n fillOpacity: graphic.attribute?.fillOpacity ?? 1,\n strokeOpacity: graphic.attribute?.strokeOpacity ?? 1\n });\n\n graphic.animate().wait(delay).to({ fillOpacity: 0, strokeOpacity: 0 }, duration, easing);\n}\n\nexport function segmentFadeOut(segment: Segment | ArcSegment, delay: number, duration: number, easing: EasingType) {\n if (!segment) {\n return;\n }\n\n // start symbol\n graphicFadeOut(segment.startSymbol, delay, duration, easing);\n\n // line\n segment.lines.forEach(line => graphicFadeOut(line, delay, duration, easing));\n graphicFadeOut((segment as ArcSegment).line, delay, duration, easing);\n\n // end symbol\n graphicFadeOut(segment.endSymbol, delay, duration, easing);\n}\n\nexport function tagFadeOut(tag: Tag, delay: number, duration: number, easing: EasingType) {\n if (!tag) {\n return;\n }\n\n // text\n graphicFadeOut(tag.getTextShape(), delay, duration, easing);\n\n // text background\n graphicFadeOut(tag.getBgRect(), delay, duration, easing);\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { EasingType, IArc, IImage, ILine, IPolygon, IRichText, ISymbol } from '@visactor/vrender-core';
2
+ import type { ArcSegment, Segment } from '../../segment';
3
+ import type { Tag } from '../../tag';
4
+ export declare function commonLineFadeIn(line: Segment | ArcSegment, label: Tag, duration: number, delay: number, easing: EasingType): void;
5
+ export declare function areaFadeIn(area: IPolygon, label: Tag, duration: number, delay: number, easing: EasingType): void;
6
+ export declare function arcAreaFadeIn(area: IArc, label: Tag, duration: number, delay: number, easing: EasingType): void;
7
+ export declare function pointFadeIn(itemLine: Segment, decorativeLine: ILine, item: Tag | IRichText | ISymbol | IImage, duration: number, delay: number, easing: EasingType): void;
@@ -0,0 +1,20 @@
1
+ import { graphicFadeIn, segmentFadeIn, tagFadeIn } from "./common";
2
+
3
+ export function commonLineFadeIn(line, label, duration, delay, easing) {
4
+ segmentFadeIn(line, delay, duration, easing), tagFadeIn(label, delay, duration, easing);
5
+ }
6
+
7
+ export function areaFadeIn(area, label, duration, delay, easing) {
8
+ graphicFadeIn(area, delay, duration, easing), tagFadeIn(label, delay, duration, easing);
9
+ }
10
+
11
+ export function arcAreaFadeIn(area, label, duration, delay, easing) {
12
+ graphicFadeIn(area, delay, duration, easing), tagFadeIn(label, delay, duration, easing);
13
+ }
14
+
15
+ export function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
16
+ var _a;
17
+ segmentFadeIn(itemLine, delay, duration, easing), graphicFadeIn(decorativeLine, delay, duration, easing),
18
+ (null === (_a = item.getTextShape) || void 0 === _a ? void 0 : _a.call(item)) ? tagFadeIn(item, delay, duration, easing) : graphicFadeIn(item, delay, duration, easing);
19
+ }
20
+ //# sourceMappingURL=fade-in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/marker/animate/fade-in.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEnE,MAAM,UAAU,gBAAgB,CAC9B,IAA0B,EAC1B,KAAU,EACV,QAAgB,EAChB,KAAa,EACb,MAAkB;IAElB,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7C,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAc,EAAE,KAAU,EAAE,QAAgB,EAAE,KAAa,EAAE,MAAkB;IACxG,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7C,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAU,EAAE,KAAU,EAAE,QAAgB,EAAE,KAAa,EAAE,MAAkB;IACvG,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7C,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,QAAiB,EACjB,cAAqB,EACrB,IAAwC,EACxC,QAAgB,EAChB,KAAa,EACb,MAAkB;;IAElB,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjD,aAAa,CAAC,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACvD,IAAI,MAAA,IAAI,CAAC,YAAY,oDAAI,EAAE;QAEzB,SAAS,CAAC,IAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KACjD;SAAM;QAEL,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAC9C;AACH,CAAC","file":"fade-in.js","sourcesContent":["import type { EasingType, IArc, IImage, ILine, IPolygon, IRichText, ISymbol } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport { graphicFadeIn, segmentFadeIn, tagFadeIn } from './common';\n\nexport function commonLineFadeIn(\n line: Segment | ArcSegment,\n label: Tag,\n duration: number,\n delay: number,\n easing: EasingType\n) {\n segmentFadeIn(line, delay, duration, easing);\n tagFadeIn(label, delay, duration, easing);\n}\n\nexport function areaFadeIn(area: IPolygon, label: Tag, duration: number, delay: number, easing: EasingType) {\n graphicFadeIn(area, delay, duration, easing);\n tagFadeIn(label, delay, duration, easing);\n}\n\nexport function arcAreaFadeIn(area: IArc, label: Tag, duration: number, delay: number, easing: EasingType) {\n graphicFadeIn(area, delay, duration, easing);\n tagFadeIn(label, delay, duration, easing);\n}\n\nexport function pointFadeIn(\n itemLine: Segment,\n decorativeLine: ILine,\n item: Tag | IRichText | ISymbol | IImage,\n duration: number,\n delay: number,\n easing: EasingType\n) {\n segmentFadeIn(itemLine, delay, duration, easing);\n graphicFadeIn(decorativeLine, delay, duration, easing);\n if (item.getTextShape?.()) {\n // tag\n tagFadeIn(item as Tag, delay, duration, easing);\n } else {\n // symbol / richText / image\n graphicFadeIn(item, delay, duration, easing);\n }\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { EasingType, IArc, IImage, ILine, IPolygon, IRichText, ISymbol } from '@visactor/vrender-core';
2
+ import type { ArcSegment, Segment } from '../../segment';
3
+ import type { Tag } from '../../tag';
4
+ export declare function commonLineFadeOut(line: Segment | ArcSegment, label: Tag, duration: number, delay: number, easing: EasingType): void;
5
+ export declare function areaFadeOut(area: IPolygon, label: Tag, duration: number, delay: number, easing: EasingType): void;
6
+ export declare function arcAreaFadeOut(area: IArc, label: Tag, duration: number, delay: number, easing: EasingType): void;
7
+ export declare function pointFadeOut(itemLine: Segment, decorativeLine: ILine, item: Tag | IRichText | ISymbol | IImage, duration: number, delay: number, easing: EasingType): void;
@@ -0,0 +1,20 @@
1
+ import { graphicFadeOut, segmentFadeOut, tagFadeOut } from "./common";
2
+
3
+ export function commonLineFadeOut(line, label, duration, delay, easing) {
4
+ segmentFadeOut(line, delay, duration, easing), tagFadeOut(label, delay, duration, easing);
5
+ }
6
+
7
+ export function areaFadeOut(area, label, duration, delay, easing) {
8
+ graphicFadeOut(area, delay, duration, easing), tagFadeOut(label, delay, duration, easing);
9
+ }
10
+
11
+ export function arcAreaFadeOut(area, label, duration, delay, easing) {
12
+ graphicFadeOut(area, delay, duration, easing), tagFadeOut(label, delay, duration, easing);
13
+ }
14
+
15
+ export function pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing) {
16
+ var _a;
17
+ segmentFadeOut(itemLine, delay, duration, easing), graphicFadeOut(decorativeLine, delay, duration, easing),
18
+ (null === (_a = item.getTextShape) || void 0 === _a ? void 0 : _a.call(item)) ? tagFadeOut(item, delay, duration, easing) : graphicFadeOut(item, delay, duration, easing);
19
+ }
20
+ //# sourceMappingURL=fade-out.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/marker/animate/fade-out.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtE,MAAM,UAAU,iBAAiB,CAC/B,IAA0B,EAC1B,KAAU,EACV,QAAgB,EAChB,KAAa,EACb,MAAkB;IAElB,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9C,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAc,EAAE,KAAU,EAAE,QAAgB,EAAE,KAAa,EAAE,MAAkB;IACzG,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9C,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAU,EAAE,KAAU,EAAE,QAAgB,EAAE,KAAa,EAAE,MAAkB;IACxG,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9C,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,QAAiB,EACjB,cAAqB,EACrB,IAAwC,EACxC,QAAgB,EAChB,KAAa,EACb,MAAkB;;IAElB,cAAc,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClD,cAAc,CAAC,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACxD,IAAI,MAAA,IAAI,CAAC,YAAY,oDAAI,EAAE;QAEzB,UAAU,CAAC,IAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAClD;SAAM;QAEL,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAC/C;AACH,CAAC","file":"fade-out.js","sourcesContent":["import type { EasingType, IArc, IImage, ILine, IPolygon, IRichText, ISymbol } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport { graphicFadeOut, segmentFadeOut, tagFadeOut } from './common';\n\nexport function commonLineFadeOut(\n line: Segment | ArcSegment,\n label: Tag,\n duration: number,\n delay: number,\n easing: EasingType\n) {\n segmentFadeOut(line, delay, duration, easing);\n tagFadeOut(label, delay, duration, easing);\n}\n\nexport function areaFadeOut(area: IPolygon, label: Tag, duration: number, delay: number, easing: EasingType) {\n graphicFadeOut(area, delay, duration, easing);\n tagFadeOut(label, delay, duration, easing);\n}\n\nexport function arcAreaFadeOut(area: IArc, label: Tag, duration: number, delay: number, easing: EasingType) {\n graphicFadeOut(area, delay, duration, easing);\n tagFadeOut(label, delay, duration, easing);\n}\n\nexport function pointFadeOut(\n itemLine: Segment,\n decorativeLine: ILine,\n item: Tag | IRichText | ISymbol | IImage,\n duration: number,\n delay: number,\n easing: EasingType\n) {\n segmentFadeOut(itemLine, delay, duration, easing);\n graphicFadeOut(decorativeLine, delay, duration, easing);\n if (item.getTextShape?.()) {\n // tag\n tagFadeOut(item as Tag, delay, duration, easing);\n } else {\n // symbol / richText / image\n graphicFadeOut(item, delay, duration, easing);\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/marker/animate/index.ts"],"names":[],"mappings":"","file":"index.js","sourcesContent":[""]}
@@ -0,0 +1,55 @@
1
+ import type { IArc, IGroup } from '@visactor/vrender-core';
2
+ import { Tag } from '../tag';
3
+ import { Marker } from './base';
4
+ import type { CommonMarkAreaAnimationType, MarkerAnimationState } from './type';
5
+ import { IMarkCommonArcLabelPosition, type MarkArcAreaAttrs } from './type';
6
+ import type { ComponentOptions } from '../interface';
7
+ export declare function registerMarkArcAreaAnimate(): void;
8
+ export declare class MarkArcArea extends Marker<MarkArcAreaAttrs, CommonMarkAreaAnimationType> {
9
+ name: string;
10
+ static defaultAttributes: {
11
+ interactive: boolean;
12
+ label: {
13
+ position: IMarkCommonArcLabelPosition;
14
+ textStyle: {
15
+ fill: string;
16
+ stroke: string;
17
+ lineWidth: number;
18
+ fontSize: number;
19
+ fontWeight: string;
20
+ fontStyle: string;
21
+ textAlign: string;
22
+ textBaseline: string;
23
+ };
24
+ padding: number[];
25
+ panel: {
26
+ visible: boolean;
27
+ cornerRadius: number;
28
+ fill: string;
29
+ fillOpacity: number;
30
+ };
31
+ };
32
+ areaStyle: {
33
+ fill: string;
34
+ visible: boolean;
35
+ };
36
+ };
37
+ private _area;
38
+ defaultUpdateAnimation: never;
39
+ defaultExitAnimation: import("./type").MarkerExitAnimation;
40
+ protected markerAnimate(state: MarkerAnimationState): void;
41
+ getArea(): IArc;
42
+ getLabel(): Tag;
43
+ constructor(attributes: MarkArcAreaAttrs, options?: ComponentOptions);
44
+ protected getPointAttrByPosition(position: IMarkCommonArcLabelPosition): {
45
+ position: {
46
+ x: number;
47
+ y: number;
48
+ };
49
+ angle: number;
50
+ };
51
+ protected setLabelPos(): void;
52
+ protected initMarker(container: IGroup): void;
53
+ protected updateMarker(): void;
54
+ protected isValidPoints(): boolean;
55
+ }
@@ -0,0 +1,143 @@
1
+ import { graphicCreator } from "@visactor/vrender-core";
2
+
3
+ import { merge } from "@visactor/vutils";
4
+
5
+ import { Tag } from "../tag";
6
+
7
+ import { Marker } from "./base";
8
+
9
+ import { DEFAULT_MARK_ARC_AREA_THEME } from "./config";
10
+
11
+ import { IMarkCommonArcLabelPosition } from "./type";
12
+
13
+ import { limitShapeInBounds } from "../util/limit-shape";
14
+
15
+ import { loadMarkArcAreaComponent } from "./register";
16
+
17
+ import { DEFAULT_STATES } from "../constant";
18
+
19
+ import { DefaultExitMarkerAnimation, DefaultUpdateMarkAreaAnimation, markArcAreaAnimate } from "./animate/animate";
20
+
21
+ loadMarkArcAreaComponent();
22
+
23
+ export function registerMarkArcAreaAnimate() {
24
+ MarkArcArea._animate = markArcAreaAnimate;
25
+ }
26
+
27
+ export class MarkArcArea extends Marker {
28
+ markerAnimate(state) {
29
+ MarkArcArea._animate && MarkArcArea._animate(this._area, this._label, this._animationConfig, state);
30
+ }
31
+ getArea() {
32
+ return this._area;
33
+ }
34
+ getLabel() {
35
+ return this._label;
36
+ }
37
+ constructor(attributes, options) {
38
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArcArea.defaultAttributes, attributes)),
39
+ this.name = "markArcArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation,
40
+ this.defaultExitAnimation = DefaultExitMarkerAnimation;
41
+ }
42
+ getPointAttrByPosition(position) {
43
+ var _a, _b, _c, _d, _e, _f, _g, _h;
44
+ const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle, label: label} = this.attribute, {refX: refX = 0, refY: refY = 0} = label, labelRectHeight = Math.abs((null !== (_b = null === (_a = this._label.getTextShape().AABBBounds) || void 0 === _a ? void 0 : _a.y2) && void 0 !== _b ? _b : 0) - (null !== (_d = null === (_c = this._label.getTextShape()) || void 0 === _c ? void 0 : _c.AABBBounds.y1) && void 0 !== _d ? _d : 0)), labelTextHeight = Math.abs((null !== (_f = null === (_e = this._label.getBgRect().AABBBounds) || void 0 === _e ? void 0 : _e.y2) && void 0 !== _f ? _f : 0) - (null !== (_h = null === (_g = this._label.getBgRect()) || void 0 === _g ? void 0 : _g.AABBBounds.y1) && void 0 !== _h ? _h : 0)), labelHeight = Math.max(labelRectHeight, labelTextHeight);
45
+ let radius, angle, orthogonalOffsetDirection;
46
+ switch (position) {
47
+ case IMarkCommonArcLabelPosition.center:
48
+ radius = (innerRadius + outerRadius) / 2, angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = 0;
49
+ break;
50
+
51
+ case IMarkCommonArcLabelPosition.arcInnerStart:
52
+ radius = innerRadius, angle = startAngle, orthogonalOffsetDirection = -1;
53
+ break;
54
+
55
+ case IMarkCommonArcLabelPosition.arcOuterStart:
56
+ radius = outerRadius, angle = startAngle, orthogonalOffsetDirection = 1;
57
+ break;
58
+
59
+ case IMarkCommonArcLabelPosition.arcInnerEnd:
60
+ radius = innerRadius, angle = endAngle, orthogonalOffsetDirection = -1;
61
+ break;
62
+
63
+ case IMarkCommonArcLabelPosition.arcOuterEnd:
64
+ radius = outerRadius, angle = endAngle, orthogonalOffsetDirection = 1;
65
+ break;
66
+
67
+ case IMarkCommonArcLabelPosition.arcInnerMiddle:
68
+ radius = innerRadius, angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = -1;
69
+ break;
70
+
71
+ case IMarkCommonArcLabelPosition.arcOuterMiddle:
72
+ radius = outerRadius, angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = 1;
73
+ break;
74
+
75
+ default:
76
+ radius = innerRadius, angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = -1;
77
+ }
78
+ return {
79
+ position: {
80
+ x: center.x + (radius + orthogonalOffsetDirection * labelHeight / 2 + refY) * Math.cos(angle) + refX * Math.cos(angle - Math.PI / 2),
81
+ y: center.y + (radius + orthogonalOffsetDirection * labelHeight / 2 + refY) * Math.sin(angle) + refX * Math.sin(angle - Math.PI / 2)
82
+ },
83
+ angle: angle
84
+ };
85
+ }
86
+ setLabelPos() {
87
+ var _a;
88
+ if (this._label && this._area) {
89
+ const {label: label = {}} = this.attribute, {position: labelPosition = "arcInnerMiddle", autoRotate: autoRotate = !0} = label, labelAttr = this.getPointAttrByPosition(labelPosition);
90
+ if (this._label.setAttributes(Object.assign(Object.assign({}, labelAttr.position), {
91
+ angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a = label.refAngle) && void 0 !== _a ? _a : 0) : 0
92
+ })), this.attribute.limitRect && label.confine) {
93
+ const {x: x, y: y, width: width, height: height} = this.attribute.limitRect;
94
+ limitShapeInBounds(this._label, {
95
+ x1: x,
96
+ y1: y,
97
+ x2: x + width,
98
+ y2: y + height
99
+ });
100
+ }
101
+ }
102
+ }
103
+ initMarker(container) {
104
+ const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle, areaStyle: areaStyle, label: label, state: state} = this.attribute, area = graphicCreator.arc(Object.assign({
105
+ x: center.x,
106
+ y: center.y,
107
+ innerRadius: innerRadius,
108
+ outerRadius: outerRadius,
109
+ startAngle: startAngle,
110
+ endAngle: endAngle
111
+ }, areaStyle));
112
+ area.states = merge({}, DEFAULT_STATES, null == state ? void 0 : state.area), area.name = "polar-mark-area-area",
113
+ this._area = area, container.add(area);
114
+ const markLabel = new Tag(Object.assign(Object.assign({}, label), {
115
+ state: {
116
+ panel: merge({}, DEFAULT_STATES, null == state ? void 0 : state.labelBackground),
117
+ text: merge({}, DEFAULT_STATES, null == state ? void 0 : state.label)
118
+ }
119
+ }));
120
+ markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel),
121
+ this.setLabelPos();
122
+ }
123
+ updateMarker() {
124
+ const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle, areaStyle: areaStyle, label: label} = this.attribute;
125
+ this._area && this._area.setAttributes(Object.assign({
126
+ x: center.x,
127
+ y: center.y,
128
+ innerRadius: innerRadius,
129
+ outerRadius: outerRadius,
130
+ startAngle: startAngle,
131
+ endAngle: endAngle
132
+ }, areaStyle)), this._area && this._label.setAttributes(Object.assign({
133
+ dx: 0,
134
+ dy: 0
135
+ }, label)), this.setLabelPos();
136
+ }
137
+ isValidPoints() {
138
+ return !0;
139
+ }
140
+ }
141
+
142
+ MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;
143
+ //# sourceMappingURL=arc-area.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/marker/arc-area.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM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EAAE,KAAK,EAAE,GAAG,IAAI;aACtF,SAA6B,CAAC;QACjC,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,CAAC,aAAa,iBACtB,CAAC,EAAE,MAAM,CAAC,CAAC,EACX,CAAC,EAAE,MAAM,CAAC,CAAC,EACX,WAAW;gBACX,WAAW;gBACX,UAAU;gBACV,QAAQ,IACL,SAAS,EACZ,CAAC;SACJ;QACD,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,MAAM,CAAC,aAAa,iBACvB,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,IACD,KAAuB,EAC3B,CAAC;SACJ;QACD,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAES,aAAa;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;;AAnLM,6BAAiB,GAAG,2BAA2B,CAAC","file":"arc-area.js","sourcesContent":["import type { IArc, IGroup, INode } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '@visactor/vrender-core';\nimport { merge } from '@visactor/vutils';\nimport type { TagAttributes } from '../tag';\n// eslint-disable-next-line no-duplicate-imports\nimport { Tag } from '../tag';\nimport { Marker } from './base';\nimport { DEFAULT_MARK_ARC_AREA_THEME } from './config';\nimport type { CommonMarkAreaAnimationType, MarkerAnimationState } from './type';\n// eslint-disable-next-line no-duplicate-imports\nimport { IMarkCommonArcLabelPosition, type MarkArcAreaAttrs } from './type';\nimport { limitShapeInBounds } from '../util/limit-shape';\nimport type { ComponentOptions } from '../interface';\nimport { loadMarkArcAreaComponent } from './register';\nimport { DEFAULT_STATES } from '../constant';\nimport { DefaultExitMarkerAnimation, DefaultUpdateMarkAreaAnimation, markArcAreaAnimate } from './animate/animate';\n\nloadMarkArcAreaComponent();\n\nexport function registerMarkArcAreaAnimate() {\n MarkArcArea._animate = markArcAreaAnimate;\n}\n\nexport class MarkArcArea extends Marker<MarkArcAreaAttrs, CommonMarkAreaAnimationType> {\n name = 'markArcArea';\n static defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;\n private _area!: IArc;\n\n /** animate */\n defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation;\n defaultExitAnimation = DefaultExitMarkerAnimation;\n protected markerAnimate(state: MarkerAnimationState) {\n if (MarkArcArea._animate) {\n MarkArcArea._animate(this._area, this._label, this._animationConfig, state);\n }\n }\n\n getArea() {\n return this._area;\n }\n\n getLabel() {\n return this._label;\n }\n\n constructor(attributes: MarkArcAreaAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, MarkArcArea.defaultAttributes, attributes));\n }\n\n protected getPointAttrByPosition(position: IMarkCommonArcLabelPosition) {\n const { center, innerRadius, outerRadius, startAngle, endAngle, label } = this.attribute as MarkArcAreaAttrs;\n const { refX = 0, refY = 0 } = label;\n // eslint-disable-next-line max-len\n const labelRectHeight = Math.abs(\n (this._label.getTextShape().AABBBounds?.y2 ?? 0) - (this._label.getTextShape()?.AABBBounds.y1 ?? 0)\n );\n // eslint-disable-next-line max-len\n const labelTextHeight = Math.abs(\n (this._label.getBgRect().AABBBounds?.y2 ?? 0) - (this._label.getBgRect()?.AABBBounds.y1 ?? 0)\n );\n const labelHeight = Math.max(labelRectHeight, labelTextHeight);\n\n let radius;\n let angle;\n // tag在正交方向是向内偏移,还是向外偏移\n // 不偏移: 0, 内: -1, 外: 1\n let orthogonalOffsetDirection;\n\n switch (position) {\n case IMarkCommonArcLabelPosition.center:\n radius = (innerRadius + outerRadius) / 2;\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = 0;\n break;\n case IMarkCommonArcLabelPosition.arcInnerStart:\n radius = innerRadius;\n angle = startAngle;\n orthogonalOffsetDirection = -1;\n break;\n case IMarkCommonArcLabelPosition.arcOuterStart:\n radius = outerRadius;\n angle = startAngle;\n orthogonalOffsetDirection = 1;\n break;\n case IMarkCommonArcLabelPosition.arcInnerEnd:\n radius = innerRadius;\n angle = endAngle;\n orthogonalOffsetDirection = -1;\n break;\n case IMarkCommonArcLabelPosition.arcOuterEnd:\n radius = outerRadius;\n angle = endAngle;\n orthogonalOffsetDirection = 1;\n break;\n case IMarkCommonArcLabelPosition.arcInnerMiddle:\n radius = innerRadius;\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = -1;\n break;\n case IMarkCommonArcLabelPosition.arcOuterMiddle:\n radius = outerRadius;\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = 1;\n break;\n default: // default arcInnerMiddle\n radius = innerRadius;\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = -1;\n }\n\n return {\n position: {\n x:\n center.x +\n (radius + (orthogonalOffsetDirection * labelHeight) / 2 + refY) * Math.cos(angle) +\n refX * Math.cos(angle - Math.PI / 2),\n y:\n center.y +\n (radius + (orthogonalOffsetDirection * labelHeight) / 2 + refY) * Math.sin(angle) +\n refX * Math.sin(angle - Math.PI / 2)\n },\n angle\n };\n }\n\n protected setLabelPos() {\n if (this._label && this._area) {\n const { label = {} } = this.attribute as MarkArcAreaAttrs;\n const { position: labelPosition = 'arcInnerMiddle', autoRotate = true } = label;\n const labelAttr = this.getPointAttrByPosition(labelPosition as IMarkCommonArcLabelPosition);\n\n this._label.setAttributes({\n ...labelAttr.position,\n angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (label.refAngle ?? 0) : 0\n });\n\n if (this.attribute.limitRect && label.confine) {\n const { x, y, width, height } = this.attribute.limitRect;\n limitShapeInBounds(this._label, {\n x1: x,\n y1: y,\n x2: x + width,\n y2: y + height\n });\n }\n }\n }\n\n protected initMarker(container: IGroup) {\n const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle, label, state } = this\n .attribute as MarkArcAreaAttrs;\n const area = graphicCreator.arc({\n x: center.x,\n y: center.y,\n innerRadius,\n outerRadius,\n startAngle,\n endAngle,\n ...areaStyle\n });\n area.states = merge({}, DEFAULT_STATES, state?.area);\n area.name = 'polar-mark-area-area';\n this._area = area;\n container.add(area);\n\n const markLabel = new Tag({\n ...(label as TagAttributes),\n state: {\n panel: merge({}, DEFAULT_STATES, state?.labelBackground),\n text: merge({}, DEFAULT_STATES, state?.label)\n }\n });\n markLabel.name = 'mark-area-label';\n this._label = markLabel;\n container.add(markLabel as unknown as INode);\n this.setLabelPos();\n }\n\n protected updateMarker() {\n const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle, label } = this\n .attribute as MarkArcAreaAttrs;\n if (this._area) {\n this._area.setAttributes({\n x: center.x,\n y: center.y,\n innerRadius,\n outerRadius,\n startAngle,\n endAngle,\n ...areaStyle\n });\n }\n if (this._area) {\n this._label.setAttributes({\n dx: 0,\n dy: 0, // 需要进行复位\n ...(label as TagAttributes)\n });\n }\n this.setLabelPos();\n }\n\n protected isValidPoints() {\n return true;\n }\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import { ArcSegment } from '../segment';
2
+ import { MarkCommonLine } from './common-line';
3
+ import type { ComponentOptions } from '../interface';
4
+ import type { IArcGraphicAttribute } from '@visactor/vrender-core';
5
+ import { IMarkCommonArcLabelPosition } from './type';
6
+ import type { MarkArcLineAttrs, MarkerAnimationState } from './type';
7
+ export declare function registerMarkArcLineAnimate(): void;
8
+ export declare class MarkArcLine extends MarkCommonLine<IArcGraphicAttribute, IMarkCommonArcLabelPosition> {
9
+ name: string;
10
+ static defaultAttributes: Partial<MarkArcLineAttrs>;
11
+ protected _line: ArcSegment;
12
+ protected markerAnimate(state: MarkerAnimationState): void;
13
+ constructor(attributes: MarkArcLineAttrs, options?: ComponentOptions);
14
+ protected getPointAttrByPosition(direction: IMarkCommonArcLabelPosition): {
15
+ position: {
16
+ x: number;
17
+ y: number;
18
+ };
19
+ angle: number;
20
+ };
21
+ protected getRotateByAngle(angle: number): number;
22
+ protected createSegment(): ArcSegment;
23
+ protected setLineAttributes(): void;
24
+ protected isValidPoints(): boolean;
25
+ }
@@ -0,0 +1,114 @@
1
+ import { merge } from "@visactor/vutils";
2
+
3
+ import { ArcSegment } from "../segment";
4
+
5
+ import { loadMarkArcLineComponent } from "./register";
6
+
7
+ import { DEFAULT_STATES } from "../constant";
8
+
9
+ import { MarkCommonLine } from "./common-line";
10
+
11
+ import { IMarkCommonArcLabelPosition } from "./type";
12
+
13
+ import { DEFAULT_MARK_ARC_LINE_THEME } from "./config";
14
+
15
+ import { commonMarkLineAnimate } from "./animate/animate";
16
+
17
+ loadMarkArcLineComponent();
18
+
19
+ export function registerMarkArcLineAnimate() {
20
+ MarkArcLine._animate = commonMarkLineAnimate;
21
+ }
22
+
23
+ export class MarkArcLine extends MarkCommonLine {
24
+ markerAnimate(state) {
25
+ MarkArcLine._animate && MarkArcLine._animate(this._line, this._label, this._animationConfig, state);
26
+ }
27
+ constructor(attributes, options) {
28
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArcLine.defaultAttributes, attributes)),
29
+ this.name = "markArcLine";
30
+ }
31
+ getPointAttrByPosition(direction) {
32
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
33
+ const {center: center, radius: radius, startAngle: startAngle, endAngle: endAngle, label: label} = this.attribute, {refX: refX = 0, refY: refY = 0} = label, labelRectHeight = Math.abs((null !== (_c = null === (_b = null === (_a = this._label.getTextShape()) || void 0 === _a ? void 0 : _a.AABBBounds) || void 0 === _b ? void 0 : _b.y2) && void 0 !== _c ? _c : 0) - (null !== (_e = null === (_d = this._label.getTextShape()) || void 0 === _d ? void 0 : _d.AABBBounds.y1) && void 0 !== _e ? _e : 0)), labelTextHeight = Math.abs((null !== (_h = null === (_g = null === (_f = this._label.getBgRect()) || void 0 === _f ? void 0 : _f.AABBBounds) || void 0 === _g ? void 0 : _g.y2) && void 0 !== _h ? _h : 0) - (null !== (_k = null === (_j = this._label.getBgRect()) || void 0 === _j ? void 0 : _j.AABBBounds.y1) && void 0 !== _k ? _k : 0)), labelHeight = Math.max(labelRectHeight, labelTextHeight);
34
+ let angle, orthogonalOffsetDirection;
35
+ switch (direction) {
36
+ case IMarkCommonArcLabelPosition.center:
37
+ angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = 0;
38
+ break;
39
+
40
+ case IMarkCommonArcLabelPosition.arcInnerStart:
41
+ angle = startAngle, orthogonalOffsetDirection = -1;
42
+ break;
43
+
44
+ case IMarkCommonArcLabelPosition.arcOuterStart:
45
+ angle = startAngle, orthogonalOffsetDirection = 1;
46
+ break;
47
+
48
+ case IMarkCommonArcLabelPosition.arcInnerEnd:
49
+ angle = endAngle, orthogonalOffsetDirection = -1;
50
+ break;
51
+
52
+ case IMarkCommonArcLabelPosition.arcOuterEnd:
53
+ angle = endAngle, orthogonalOffsetDirection = 1;
54
+ break;
55
+
56
+ case IMarkCommonArcLabelPosition.arcInnerMiddle:
57
+ angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = -1;
58
+ break;
59
+
60
+ case IMarkCommonArcLabelPosition.arcOuterMiddle:
61
+ angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = 1;
62
+ break;
63
+
64
+ default:
65
+ angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = -1;
66
+ }
67
+ return {
68
+ position: {
69
+ x: center.x + (radius + orthogonalOffsetDirection * labelHeight / 2 + refY) * Math.cos(angle) + refX * Math.cos(angle - Math.PI / 2),
70
+ y: center.y + (radius + orthogonalOffsetDirection * labelHeight / 2 + refY) * Math.sin(angle) + refX * Math.sin(angle - Math.PI / 2)
71
+ },
72
+ angle: angle
73
+ };
74
+ }
75
+ getRotateByAngle(angle) {
76
+ var _a;
77
+ return angle - Math.PI / 2 + (null !== (_a = this.attribute.label.refAngle) && void 0 !== _a ? _a : 0);
78
+ }
79
+ createSegment() {
80
+ const {center: center, radius: radius, startAngle: startAngle, endAngle: endAngle, startSymbol: startSymbol, endSymbol: endSymbol, lineStyle: lineStyle, state: state} = this.attribute;
81
+ return new ArcSegment({
82
+ center: center,
83
+ radius: radius,
84
+ startAngle: startAngle,
85
+ endAngle: endAngle,
86
+ startSymbol: startSymbol,
87
+ endSymbol: endSymbol,
88
+ lineStyle: lineStyle,
89
+ state: {
90
+ line: merge({}, DEFAULT_STATES, null == state ? void 0 : state.line),
91
+ startSymbol: merge({}, DEFAULT_STATES, null == state ? void 0 : state.lineStartSymbol),
92
+ endSymbol: merge({}, DEFAULT_STATES, null == state ? void 0 : state.lineEndSymbol)
93
+ }
94
+ });
95
+ }
96
+ setLineAttributes() {
97
+ const {center: center, radius: radius, startAngle: startAngle, endAngle: endAngle, startSymbol: startSymbol, endSymbol: endSymbol, lineStyle: lineStyle} = this.attribute;
98
+ this._line && this._line.setAttributes({
99
+ center: center,
100
+ radius: radius,
101
+ startAngle: startAngle,
102
+ endAngle: endAngle,
103
+ startSymbol: startSymbol,
104
+ endSymbol: endSymbol,
105
+ lineStyle: lineStyle
106
+ });
107
+ }
108
+ isValidPoints() {
109
+ return !0;
110
+ }
111
+ }
112
+
113
+ MarkArcLine.defaultAttributes = DEFAULT_MARK_ARC_LINE_THEME;
114
+ //# sourceMappingURL=arc-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/marker/arc-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAGrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,wBAAwB,EAAE,CAAC;AAE3B,MAAM,UAAU,0BAA0B;IACxC,WAAW,CAAC,QAAQ,GAAG,qBAAqB,CAAC;AAC/C,CAAC;AACD,MAAM,OAAO,WAAY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,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,CAAC;aAC3D;SACF,CAAC,CAAC;IACL,CAAC;IAES,iBAAiB;QACzB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI;aACrF,SAA6B,CAAC;QACjC,IAAI,IAAI,CAAC,KAAK,EAAE;YACb,IAAI,CAAC,KAAa,CAAC,aAAa,CAAC;gBAChC,MAAM;gBACN,MAAM;gBACN,UAAU;gBACV,QAAQ;gBACR,WAAW;gBACX,SAAS;gBACT,SAAS;aACV,CAAC,CAAC;SACJ;IACH,CAAC;IAES,aAAa;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;;AAvHM,6BAAiB,GAA8B,2BAA0D,CAAC","file":"arc-line.js","sourcesContent":["import { merge } from '@visactor/vutils';\nimport { ArcSegment } from '../segment';\nimport { loadMarkArcLineComponent } from './register';\nimport { DEFAULT_STATES } from '../constant';\nimport { MarkCommonLine } from './common-line';\nimport type { ComponentOptions } from '../interface';\nimport type { IArcGraphicAttribute } from '@visactor/vrender-core';\nimport { IMarkCommonArcLabelPosition } from './type';\n// eslint-disable-next-line no-duplicate-imports\nimport type { MarkArcLineAttrs, MarkerAnimationState } from './type';\nimport { DEFAULT_MARK_ARC_LINE_THEME } from './config';\nimport { commonMarkLineAnimate } from './animate/animate';\n\nloadMarkArcLineComponent();\n\nexport function registerMarkArcLineAnimate() {\n MarkArcLine._animate = commonMarkLineAnimate;\n}\nexport class MarkArcLine extends MarkCommonLine<IArcGraphicAttribute, IMarkCommonArcLabelPosition> {\n name = 'markArcLine';\n // eslint-disable-next-line max-len\n static defaultAttributes: Partial<MarkArcLineAttrs> = DEFAULT_MARK_ARC_LINE_THEME as unknown as MarkArcLineAttrs;\n protected _line!: ArcSegment;\n\n protected markerAnimate(state: MarkerAnimationState) {\n if (MarkArcLine._animate) {\n MarkArcLine._animate(this._line, this._label, this._animationConfig, state);\n }\n }\n\n constructor(attributes: MarkArcLineAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, MarkArcLine.defaultAttributes, attributes));\n }\n\n protected getPointAttrByPosition(direction: IMarkCommonArcLabelPosition) {\n const { center, radius, startAngle, endAngle, label } = this.attribute as MarkArcLineAttrs;\n const { refX = 0, refY = 0 } = label;\n const labelRectHeight = Math.abs(\n (this._label.getTextShape()?.AABBBounds?.y2 ?? 0) - (this._label.getTextShape()?.AABBBounds.y1 ?? 0)\n );\n const labelTextHeight = Math.abs(\n (this._label.getBgRect()?.AABBBounds?.y2 ?? 0) - (this._label.getBgRect()?.AABBBounds.y1 ?? 0)\n );\n const labelHeight = Math.max(labelRectHeight, labelTextHeight);\n\n let angle;\n // tag在正交方向是向内偏移,还是向外偏移\n // 不偏移: 0, 内: -1, 外: 1\n let orthogonalOffsetDirection;\n\n switch (direction) {\n case IMarkCommonArcLabelPosition.center:\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = 0;\n break;\n case IMarkCommonArcLabelPosition.arcInnerStart:\n angle = startAngle;\n orthogonalOffsetDirection = -1;\n break;\n case IMarkCommonArcLabelPosition.arcOuterStart:\n angle = startAngle;\n orthogonalOffsetDirection = 1;\n break;\n case IMarkCommonArcLabelPosition.arcInnerEnd:\n angle = endAngle;\n orthogonalOffsetDirection = -1;\n break;\n case IMarkCommonArcLabelPosition.arcOuterEnd:\n angle = endAngle;\n orthogonalOffsetDirection = 1;\n break;\n case IMarkCommonArcLabelPosition.arcInnerMiddle:\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = -1;\n break;\n case IMarkCommonArcLabelPosition.arcOuterMiddle:\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = 1;\n break;\n default: // default arcInnerMiddle\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = -1;\n }\n\n return {\n position: {\n x:\n center.x +\n (radius + (orthogonalOffsetDirection * labelHeight) / 2 + refY) * Math.cos(angle) +\n refX * Math.cos(angle - Math.PI / 2),\n y:\n center.y +\n (radius + (orthogonalOffsetDirection * labelHeight) / 2 + refY) * Math.sin(angle) +\n refX * Math.sin(angle - Math.PI / 2)\n },\n angle\n };\n }\n\n protected getRotateByAngle(angle: number): number {\n return angle - Math.PI / 2 + (this.attribute.label.refAngle ?? 0);\n }\n\n protected createSegment() {\n const { center, radius, startAngle, endAngle, startSymbol, endSymbol, lineStyle, state } = this\n .attribute as MarkArcLineAttrs;\n return new ArcSegment({\n center,\n radius,\n startAngle,\n endAngle,\n startSymbol,\n endSymbol,\n lineStyle,\n state: {\n line: merge({}, DEFAULT_STATES, state?.line),\n startSymbol: merge({}, DEFAULT_STATES, state?.lineStartSymbol),\n endSymbol: merge({}, DEFAULT_STATES, state?.lineEndSymbol)\n }\n });\n }\n\n protected setLineAttributes() {\n const { center, radius, startAngle, endAngle, startSymbol, endSymbol, lineStyle } = this\n .attribute as MarkArcLineAttrs;\n if (this._line) {\n (this._line as any).setAttributes({\n center,\n radius,\n startAngle,\n endAngle,\n startSymbol,\n endSymbol,\n lineStyle\n });\n }\n }\n\n protected isValidPoints() {\n return true;\n }\n}\n"]}
@@ -1,13 +1,15 @@
1
1
  import type { IGroup, IPolygon } from '@visactor/vrender-core';
2
2
  import { Tag } from '../tag';
3
3
  import { Marker } from './base';
4
- import type { MarkAreaAttrs } from './type';
4
+ import type { CommonMarkAreaAnimationType, IMarkAreaLabelPosition, MarkAreaAttrs, MarkerAnimationState } from './type';
5
5
  import type { ComponentOptions } from '../interface';
6
- export declare class MarkArea extends Marker<MarkAreaAttrs> {
6
+ export declare function registerMarkAreaAnimate(): void;
7
+ export declare class MarkArea extends Marker<MarkAreaAttrs, CommonMarkAreaAnimationType> {
7
8
  name: string;
8
9
  static defaultAttributes: {
10
+ interactive: boolean;
9
11
  label: {
10
- position: import("./type").IMarkAreaLabelPosition;
12
+ position: IMarkAreaLabelPosition;
11
13
  textStyle: {
12
14
  fill: string;
13
15
  stroke: string;
@@ -15,6 +17,8 @@ export declare class MarkArea extends Marker<MarkAreaAttrs> {
15
17
  fontSize: number;
16
18
  fontWeight: string;
17
19
  fontStyle: string;
20
+ textAlign: string;
21
+ textBaseline: string;
18
22
  };
19
23
  padding: number[];
20
24
  panel: {
@@ -29,11 +33,17 @@ export declare class MarkArea extends Marker<MarkAreaAttrs> {
29
33
  visible: boolean;
30
34
  };
31
35
  };
36
+ defaultUpdateAnimation: never;
37
+ defaultExitAnimation: import("./type").MarkerExitAnimation;
38
+ protected markerAnimate(state: MarkerAnimationState): void;
32
39
  private _area;
33
40
  getArea(): IPolygon;
34
41
  getLabel(): Tag;
35
42
  constructor(attributes: MarkAreaAttrs, options?: ComponentOptions);
36
- private _getPositionByDirection;
43
+ protected getPointAttrByPosition(position: IMarkAreaLabelPosition): {
44
+ x: number;
45
+ y: number;
46
+ };
37
47
  protected setLabelPos(): void;
38
48
  protected initMarker(container: IGroup): void;
39
49
  protected updateMarker(): void;
package/es/marker/area.js CHANGED
@@ -6,15 +6,26 @@ import { Tag } from "../tag";
6
6
 
7
7
  import { Marker } from "./base";
8
8
 
9
- import { DEFAULT_MARK_AREA_TEXT_STYLE_MAP, DEFAULT_MARK_AREA_THEME } from "./config";
9
+ import { DEFAULT_MARK_AREA_THEME } from "./config";
10
10
 
11
11
  import { limitShapeInBounds } from "../util/limit-shape";
12
12
 
13
13
  import { loadMarkAreaComponent } from "./register";
14
14
 
15
+ import { DEFAULT_STATES } from "../constant";
16
+
17
+ import { DefaultExitMarkerAnimation, DefaultUpdateMarkAreaAnimation, markAreaAnimate } from "./animate/animate";
18
+
15
19
  loadMarkAreaComponent();
16
20
 
21
+ export function registerMarkAreaAnimate() {
22
+ MarkArea._animate = markAreaAnimate;
23
+ }
24
+
17
25
  export class MarkArea extends Marker {
26
+ markerAnimate(state) {
27
+ MarkArea._animate && MarkArea._animate(this._area, this._label, this._animationConfig, state);
28
+ }
18
29
  getArea() {
19
30
  return this._area;
20
31
  }
@@ -23,22 +34,24 @@ export class MarkArea extends Marker {
23
34
  }
24
35
  constructor(attributes, options) {
25
36
  super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArea.defaultAttributes, attributes)),
26
- this.name = "markArea";
37
+ this.name = "markArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation,
38
+ this.defaultExitAnimation = DefaultExitMarkerAnimation;
27
39
  }
28
- _getPositionByDirection(area, direction) {
29
- const {x1: x1, x2: x2, y1: y1, y2: y2} = this._area.AABBBounds;
30
- return direction.includes("left") || direction.includes("Left") ? {
31
- x: x1,
40
+ getPointAttrByPosition(position) {
41
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
42
+ const {x1: x1, x2: x2, y1: y1, y2: y2} = this._area.AABBBounds, labelRectHeight = Math.abs((null !== (_b = null === (_a = this._label.getTextShape().AABBBounds) || void 0 === _a ? void 0 : _a.y2) && void 0 !== _b ? _b : 0) - (null !== (_d = null === (_c = this._label.getTextShape()) || void 0 === _c ? void 0 : _c.AABBBounds.y1) && void 0 !== _d ? _d : 0)), labelTextHeight = Math.abs((null !== (_f = null === (_e = this._label.getBgRect().AABBBounds) || void 0 === _e ? void 0 : _e.y2) && void 0 !== _f ? _f : 0) - (null !== (_h = null === (_g = this._label.getBgRect()) || void 0 === _g ? void 0 : _g.AABBBounds.y1) && void 0 !== _h ? _h : 0)), labelHeight = Math.max(labelRectHeight, labelTextHeight), labelRectWidth = Math.abs((null !== (_k = null === (_j = this._label.getTextShape().AABBBounds) || void 0 === _j ? void 0 : _j.x2) && void 0 !== _k ? _k : 0) - (null !== (_m = null === (_l = this._label.getTextShape()) || void 0 === _l ? void 0 : _l.AABBBounds.x1) && void 0 !== _m ? _m : 0)), labelTextWidth = Math.abs((null !== (_p = null === (_o = this._label.getBgRect().AABBBounds) || void 0 === _o ? void 0 : _o.x2) && void 0 !== _p ? _p : 0) - (null !== (_r = null === (_q = this._label.getBgRect()) || void 0 === _q ? void 0 : _q.AABBBounds.x1) && void 0 !== _r ? _r : 0)), labelWidth = Math.max(labelRectWidth, labelTextWidth);
43
+ return position.includes("left") || position.includes("Left") ? {
44
+ x: x1 + (position.includes("inside") ? .5 : -.5) * labelWidth,
32
45
  y: (y1 + y2) / 2
33
- } : direction.includes("right") || direction.includes("Right") ? {
34
- x: x2,
46
+ } : position.includes("right") || position.includes("Right") ? {
47
+ x: x2 + (position.includes("inside") ? -.5 : .5) * labelWidth,
35
48
  y: (y1 + y2) / 2
36
- } : direction.includes("top") || direction.includes("Top") ? {
49
+ } : position.includes("top") || position.includes("Top") ? {
37
50
  x: (x1 + x2) / 2,
38
- y: y1
39
- } : direction.includes("bottom") || direction.includes("Bottom") ? {
51
+ y: y1 + (position.includes("inside") ? .5 : -.5) * labelHeight
52
+ } : position.includes("bottom") || position.includes("Bottom") ? {
40
53
  x: (x1 + x2) / 2,
41
- y: y2
54
+ y: y2 + (position.includes("inside") ? -.5 : .5) * labelHeight
42
55
  } : {
43
56
  x: (x1 + x2) / 2,
44
57
  y: (y1 + y2) / 2
@@ -47,10 +60,8 @@ export class MarkArea extends Marker {
47
60
  setLabelPos() {
48
61
  var _a;
49
62
  if (this._label && this._area) {
50
- const {label: label = {}} = this.attribute, labelPosition = null !== (_a = label.position) && void 0 !== _a ? _a : "middle", labelPoint = this._getPositionByDirection(this._area, labelPosition);
51
- if (this._label.setAttributes(Object.assign(Object.assign({}, labelPoint), {
52
- textStyle: Object.assign(Object.assign({}, DEFAULT_MARK_AREA_TEXT_STYLE_MAP[labelPosition]), label.textStyle)
53
- })), this.attribute.limitRect && label.confine) {
63
+ const {label: label = {}} = this.attribute, labelPosition = null !== (_a = label.position) && void 0 !== _a ? _a : "middle", labelPoint = this.getPointAttrByPosition(labelPosition);
64
+ if (this._label.setAttributes(Object.assign({}, labelPoint)), this.attribute.limitRect && label.confine) {
54
65
  const {x: x, y: y, width: width, height: height} = this.attribute.limitRect;
55
66
  limitShapeInBounds(this._label, {
56
67
  x1: x,
@@ -62,11 +73,17 @@ export class MarkArea extends Marker {
62
73
  }
63
74
  }
64
75
  initMarker(container) {
65
- const {points: points, label: label, areaStyle: areaStyle} = this.attribute, area = graphicCreator.polygon(Object.assign({
76
+ const {points: points, label: label, areaStyle: areaStyle, state: state} = this.attribute, area = graphicCreator.polygon(Object.assign({
66
77
  points: points
67
78
  }, areaStyle));
68
- area.name = "mark-area-area", this._area = area, container.add(area);
69
- const markLabel = new Tag(Object.assign({}, label));
79
+ area.states = merge({}, DEFAULT_STATES, null == state ? void 0 : state.area), area.name = "mark-area-polygon",
80
+ this._area = area, container.add(area);
81
+ const markLabel = new Tag(Object.assign(Object.assign({}, label), {
82
+ state: {
83
+ panel: merge({}, DEFAULT_STATES, null == state ? void 0 : state.labelBackground),
84
+ text: merge({}, DEFAULT_STATES, null == state ? void 0 : state.label)
85
+ }
86
+ }));
70
87
  markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel),
71
88
  this.setLabelPos();
72
89
  }