@visactor/vrender-components 0.18.11-alpha.7 → 0.18.11

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 (291) hide show
  1. package/cjs/axis/base.js +21 -9
  2. package/cjs/axis/base.js.map +1 -1
  3. package/cjs/axis/circle.js +1 -1
  4. package/cjs/axis/circle.js.map +1 -1
  5. package/cjs/axis/grid/base.js +1 -5
  6. package/cjs/axis/grid/base.js.map +1 -1
  7. package/cjs/axis/index.d.ts +1 -0
  8. package/cjs/axis/index.js +1 -1
  9. package/cjs/axis/index.js.map +1 -1
  10. package/cjs/axis/line.js +5 -5
  11. package/cjs/axis/line.js.map +1 -1
  12. package/cjs/axis/mixin/circle.js +2 -4
  13. package/cjs/axis/mixin/circle.js.map +1 -1
  14. package/cjs/axis/overlap/auto-limit.js +8 -13
  15. package/cjs/axis/overlap/auto-limit.js.map +1 -1
  16. package/cjs/axis/util.d.ts +5 -2
  17. package/cjs/axis/util.js +18 -5
  18. package/cjs/axis/util.js.map +1 -1
  19. package/cjs/checkbox/checkbox.d.ts +1 -1
  20. package/cjs/checkbox/checkbox.js +9 -10
  21. package/cjs/checkbox/checkbox.js.map +1 -1
  22. package/cjs/index.d.ts +2 -1
  23. package/cjs/index.js +3 -2
  24. package/cjs/index.js.map +1 -1
  25. package/cjs/indicator/indicator.js +3 -3
  26. package/cjs/indicator/indicator.js.map +1 -1
  27. package/cjs/label/arc.d.ts +2 -2
  28. package/cjs/label/base.d.ts +2 -2
  29. package/cjs/label/base.js +3 -1
  30. package/cjs/label/base.js.map +1 -1
  31. package/cjs/legend/color/color.js +7 -5
  32. package/cjs/legend/color/color.js.map +1 -1
  33. package/cjs/legend/discrete/discrete.js +4 -2
  34. package/cjs/legend/discrete/discrete.js.map +1 -1
  35. package/cjs/legend/size/size.js +6 -4
  36. package/cjs/legend/size/size.js.map +1 -1
  37. package/cjs/marker/area.d.ts +4 -14
  38. package/cjs/marker/area.js +21 -34
  39. package/cjs/marker/area.js.map +1 -1
  40. package/cjs/marker/base.d.ts +3 -21
  41. package/cjs/marker/base.js +5 -40
  42. package/cjs/marker/base.js.map +1 -1
  43. package/cjs/marker/config.d.ts +6 -79
  44. package/cjs/marker/config.js +37 -77
  45. package/cjs/marker/config.js.map +1 -1
  46. package/cjs/marker/index.d.ts +0 -2
  47. package/cjs/marker/index.js +1 -2
  48. package/cjs/marker/index.js.map +1 -1
  49. package/cjs/marker/line.d.ts +12 -24
  50. package/cjs/marker/line.js +45 -111
  51. package/cjs/marker/line.js.map +1 -1
  52. package/cjs/marker/point.d.ts +3 -8
  53. package/cjs/marker/point.js +9 -33
  54. package/cjs/marker/point.js.map +1 -1
  55. package/cjs/marker/register.d.ts +0 -2
  56. package/cjs/marker/register.js +2 -11
  57. package/cjs/marker/register.js.map +1 -1
  58. package/cjs/marker/type.d.ts +12 -102
  59. package/cjs/marker/type.js +2 -8
  60. package/cjs/marker/type.js.map +1 -1
  61. package/cjs/marker/util.js +3 -0
  62. package/cjs/marker/util.js.map +1 -0
  63. package/cjs/pager/pager.js +2 -2
  64. package/cjs/pager/pager.js.map +1 -1
  65. package/cjs/player/base-player.d.ts +2 -0
  66. package/cjs/player/base-player.js +11 -6
  67. package/cjs/player/base-player.js.map +1 -1
  68. package/cjs/player/continuous-player.d.ts +1 -1
  69. package/cjs/player/continuous-player.js +6 -4
  70. package/cjs/player/continuous-player.js.map +1 -1
  71. package/cjs/player/controller/controller.js +4 -4
  72. package/cjs/player/controller/controller.js.map +1 -1
  73. package/cjs/player/discrete-player.d.ts +1 -1
  74. package/cjs/player/discrete-player.js +6 -4
  75. package/cjs/player/discrete-player.js.map +1 -1
  76. package/cjs/radio/index.d.ts +2 -0
  77. package/cjs/radio/index.js +21 -0
  78. package/cjs/radio/index.js.map +1 -0
  79. package/cjs/radio/radio.d.ts +16 -0
  80. package/cjs/radio/radio.js +88 -0
  81. package/cjs/radio/radio.js.map +1 -0
  82. package/cjs/radio/register.d.ts +1 -0
  83. package/cjs/radio/register.js +15 -0
  84. package/cjs/radio/register.js.map +1 -0
  85. package/cjs/radio/type.d.ts +21 -0
  86. package/cjs/radio/type.js +6 -0
  87. package/cjs/radio/type.js.map +1 -0
  88. package/cjs/segment/index.d.ts +0 -1
  89. package/cjs/segment/index.js +1 -2
  90. package/cjs/segment/index.js.map +1 -1
  91. package/cjs/segment/register.d.ts +1 -2
  92. package/cjs/segment/register.js +3 -8
  93. package/cjs/segment/register.js.map +1 -1
  94. package/cjs/segment/segment.d.ts +7 -9
  95. package/cjs/segment/segment.js +8 -12
  96. package/cjs/segment/segment.js.map +1 -1
  97. package/cjs/segment/type.d.ts +4 -24
  98. package/cjs/segment/type.js.map +1 -1
  99. package/cjs/slider/slider.d.ts +2 -0
  100. package/cjs/slider/slider.js +53 -38
  101. package/cjs/slider/slider.js.map +1 -1
  102. package/cjs/slider/type.d.ts +1 -0
  103. package/cjs/slider/type.js.map +1 -1
  104. package/cjs/tag/tag.d.ts +0 -5
  105. package/cjs/tag/tag.js +5 -14
  106. package/cjs/tag/tag.js.map +1 -1
  107. package/cjs/util/text.d.ts +1 -1
  108. package/cjs/util/text.js +6 -7
  109. package/cjs/util/text.js.map +1 -1
  110. package/es/axis/base.js +23 -13
  111. package/es/axis/base.js.map +1 -1
  112. package/es/axis/circle.js +2 -2
  113. package/es/axis/circle.js.map +1 -1
  114. package/es/axis/grid/base.js +2 -6
  115. package/es/axis/grid/base.js.map +1 -1
  116. package/es/axis/index.d.ts +1 -0
  117. package/es/axis/index.js +2 -0
  118. package/es/axis/index.js.map +1 -1
  119. package/es/axis/line.js +5 -5
  120. package/es/axis/line.js.map +1 -1
  121. package/es/axis/mixin/circle.js +2 -3
  122. package/es/axis/mixin/circle.js.map +1 -1
  123. package/es/axis/overlap/auto-limit.js +9 -13
  124. package/es/axis/overlap/auto-limit.js.map +1 -1
  125. package/es/axis/util.d.ts +5 -2
  126. package/es/axis/util.js +15 -1
  127. package/es/axis/util.js.map +1 -1
  128. package/es/checkbox/checkbox.d.ts +1 -1
  129. package/es/checkbox/checkbox.js +9 -10
  130. package/es/checkbox/checkbox.js.map +1 -1
  131. package/es/index.d.ts +2 -1
  132. package/es/index.js +3 -1
  133. package/es/index.js.map +1 -1
  134. package/es/indicator/indicator.js +3 -3
  135. package/es/indicator/indicator.js.map +1 -1
  136. package/es/label/arc.d.ts +2 -2
  137. package/es/label/base.d.ts +2 -2
  138. package/es/label/base.js +3 -1
  139. package/es/label/base.js.map +1 -1
  140. package/es/legend/color/color.js +7 -5
  141. package/es/legend/color/color.js.map +1 -1
  142. package/es/legend/discrete/discrete.js +4 -2
  143. package/es/legend/discrete/discrete.js.map +1 -1
  144. package/es/legend/size/size.js +6 -4
  145. package/es/legend/size/size.js.map +1 -1
  146. package/es/marker/area.d.ts +4 -14
  147. package/es/marker/area.js +19 -36
  148. package/es/marker/area.js.map +1 -1
  149. package/es/marker/base.d.ts +3 -21
  150. package/es/marker/base.js +4 -43
  151. package/es/marker/base.js.map +1 -1
  152. package/es/marker/config.d.ts +6 -79
  153. package/es/marker/config.js +37 -79
  154. package/es/marker/config.js.map +1 -1
  155. package/es/marker/index.d.ts +0 -2
  156. package/es/marker/index.js +0 -4
  157. package/es/marker/index.js.map +1 -1
  158. package/es/marker/line.d.ts +12 -24
  159. package/es/marker/line.js +48 -116
  160. package/es/marker/line.js.map +1 -1
  161. package/es/marker/point.d.ts +3 -8
  162. package/es/marker/point.js +6 -34
  163. package/es/marker/point.js.map +1 -1
  164. package/es/marker/register.d.ts +0 -2
  165. package/es/marker/register.js +2 -10
  166. package/es/marker/register.js.map +1 -1
  167. package/es/marker/type.d.ts +12 -102
  168. package/es/marker/type.js +0 -9
  169. package/es/marker/type.js.map +1 -1
  170. package/es/marker/util.js +3 -0
  171. package/es/marker/util.js.map +1 -0
  172. package/es/pager/pager.js +2 -2
  173. package/es/pager/pager.js.map +1 -1
  174. package/es/player/base-player.d.ts +2 -0
  175. package/es/player/base-player.js +11 -6
  176. package/es/player/base-player.js.map +1 -1
  177. package/es/player/continuous-player.d.ts +1 -1
  178. package/es/player/continuous-player.js +6 -4
  179. package/es/player/continuous-player.js.map +1 -1
  180. package/es/player/controller/controller.js +5 -5
  181. package/es/player/controller/controller.js.map +1 -1
  182. package/es/player/discrete-player.d.ts +1 -1
  183. package/es/player/discrete-player.js +6 -4
  184. package/es/player/discrete-player.js.map +1 -1
  185. package/es/radio/index.d.ts +2 -0
  186. package/es/radio/index.js +4 -0
  187. package/es/radio/index.js.map +1 -0
  188. package/es/radio/radio.d.ts +16 -0
  189. package/es/radio/radio.js +87 -0
  190. package/es/radio/radio.js.map +1 -0
  191. package/es/radio/register.d.ts +1 -0
  192. package/es/radio/register.js +6 -0
  193. package/es/radio/register.js.map +1 -0
  194. package/es/radio/type.d.ts +21 -0
  195. package/es/radio/type.js +2 -0
  196. package/es/radio/type.js.map +1 -0
  197. package/es/segment/index.d.ts +0 -1
  198. package/es/segment/index.js +0 -2
  199. package/es/segment/index.js.map +1 -1
  200. package/es/segment/register.d.ts +1 -2
  201. package/es/segment/register.js +2 -6
  202. package/es/segment/register.js.map +1 -1
  203. package/es/segment/segment.d.ts +7 -9
  204. package/es/segment/segment.js +8 -11
  205. package/es/segment/segment.js.map +1 -1
  206. package/es/segment/type.d.ts +4 -24
  207. package/es/segment/type.js.map +1 -1
  208. package/es/slider/slider.d.ts +2 -0
  209. package/es/slider/slider.js +50 -36
  210. package/es/slider/slider.js.map +1 -1
  211. package/es/slider/type.d.ts +1 -0
  212. package/es/slider/type.js.map +1 -1
  213. package/es/tag/tag.d.ts +0 -5
  214. package/es/tag/tag.js +5 -14
  215. package/es/tag/tag.js.map +1 -1
  216. package/es/util/text.d.ts +1 -1
  217. package/es/util/text.js +6 -7
  218. package/es/util/text.js.map +1 -1
  219. package/package.json +5 -5
  220. package/cjs/marker/animate/animate.d.ts +0 -13
  221. package/cjs/marker/animate/animate.js +0 -92
  222. package/cjs/marker/animate/animate.js.map +0 -1
  223. package/cjs/marker/animate/call-in.d.ts +0 -4
  224. package/cjs/marker/animate/call-in.js +0 -27
  225. package/cjs/marker/animate/call-in.js.map +0 -1
  226. package/cjs/marker/animate/clip-in.d.ts +0 -4
  227. package/cjs/marker/animate/clip-in.js +0 -23
  228. package/cjs/marker/animate/clip-in.js.map +0 -1
  229. package/cjs/marker/animate/common.d.ts +0 -9
  230. package/cjs/marker/animate/common.js +0 -48
  231. package/cjs/marker/animate/common.js.map +0 -1
  232. package/cjs/marker/animate/fade-in.d.ts +0 -7
  233. package/cjs/marker/animate/fade-in.js +0 -30
  234. package/cjs/marker/animate/fade-in.js.map +0 -1
  235. package/cjs/marker/animate/fade-out.d.ts +0 -7
  236. package/cjs/marker/animate/fade-out.js +0 -30
  237. package/cjs/marker/animate/fade-out.js.map +0 -1
  238. package/cjs/marker/animate/index.js +0 -3
  239. package/cjs/marker/animate/index.js.map +0 -1
  240. package/cjs/marker/arc-area.d.ts +0 -55
  241. package/cjs/marker/arc-area.js +0 -131
  242. package/cjs/marker/arc-area.js.map +0 -1
  243. package/cjs/marker/arc-line.d.ts +0 -25
  244. package/cjs/marker/arc-line.js +0 -106
  245. package/cjs/marker/arc-line.js.map +0 -1
  246. package/cjs/marker/common-line.d.ts +0 -22
  247. package/cjs/marker/common-line.js +0 -56
  248. package/cjs/marker/common-line.js.map +0 -1
  249. package/cjs/segment/arc-segment.d.ts +0 -13
  250. package/cjs/segment/arc-segment.js +0 -51
  251. package/cjs/segment/arc-segment.js.map +0 -1
  252. package/cjs/util/interaction.d.ts +0 -4
  253. package/cjs/util/interaction.js +0 -37
  254. package/cjs/util/interaction.js.map +0 -1
  255. package/es/marker/animate/animate.d.ts +0 -13
  256. package/es/marker/animate/animate.js +0 -92
  257. package/es/marker/animate/animate.js.map +0 -1
  258. package/es/marker/animate/call-in.d.ts +0 -4
  259. package/es/marker/animate/call-in.js +0 -17
  260. package/es/marker/animate/call-in.js.map +0 -1
  261. package/es/marker/animate/clip-in.d.ts +0 -4
  262. package/es/marker/animate/clip-in.js +0 -15
  263. package/es/marker/animate/clip-in.js.map +0 -1
  264. package/es/marker/animate/common.d.ts +0 -9
  265. package/es/marker/animate/common.js +0 -39
  266. package/es/marker/animate/common.js.map +0 -1
  267. package/es/marker/animate/fade-in.d.ts +0 -7
  268. package/es/marker/animate/fade-in.js +0 -20
  269. package/es/marker/animate/fade-in.js.map +0 -1
  270. package/es/marker/animate/fade-out.d.ts +0 -7
  271. package/es/marker/animate/fade-out.js +0 -20
  272. package/es/marker/animate/fade-out.js.map +0 -1
  273. package/es/marker/animate/index.js +0 -3
  274. package/es/marker/animate/index.js.map +0 -1
  275. package/es/marker/arc-area.d.ts +0 -55
  276. package/es/marker/arc-area.js +0 -143
  277. package/es/marker/arc-area.js.map +0 -1
  278. package/es/marker/arc-line.d.ts +0 -25
  279. package/es/marker/arc-line.js +0 -114
  280. package/es/marker/arc-line.js.map +0 -1
  281. package/es/marker/common-line.d.ts +0 -22
  282. package/es/marker/common-line.js +0 -58
  283. package/es/marker/common-line.js.map +0 -1
  284. package/es/segment/arc-segment.d.ts +0 -13
  285. package/es/segment/arc-segment.js +0 -49
  286. package/es/segment/arc-segment.js.map +0 -1
  287. package/es/util/interaction.d.ts +0 -4
  288. package/es/util/interaction.js +0 -30
  289. package/es/util/interaction.js.map +0 -1
  290. /package/cjs/marker/{animate/index.d.ts → util.d.ts} +0 -0
  291. /package/es/marker/{animate/index.d.ts → util.d.ts} +0 -0
@@ -2,20 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.MarkArea = exports.registerMarkAreaAnimate = void 0;
5
+ }), exports.MarkArea = void 0;
6
6
 
7
- const vrender_core_1 = require("@visactor/vrender-core"), vutils_1 = require("@visactor/vutils"), tag_1 = require("../tag"), base_1 = require("./base"), config_1 = require("./config"), limit_shape_1 = require("../util/limit-shape"), register_1 = require("./register"), constant_1 = require("../constant"), animate_1 = require("./animate/animate");
7
+ const vrender_core_1 = require("@visactor/vrender-core"), vutils_1 = require("@visactor/vutils"), tag_1 = require("../tag"), base_1 = require("./base"), config_1 = require("./config"), limit_shape_1 = require("../util/limit-shape"), register_1 = require("./register");
8
8
 
9
- function registerMarkAreaAnimate() {
10
- MarkArea._animate = animate_1.markAreaAnimate;
11
- }
12
-
13
- (0, register_1.loadMarkAreaComponent)(), exports.registerMarkAreaAnimate = registerMarkAreaAnimate;
9
+ (0, register_1.loadMarkAreaComponent)();
14
10
 
15
11
  class MarkArea extends base_1.Marker {
16
- markerAnimate(state) {
17
- MarkArea._animate && MarkArea._animate(this._area, this._label, this._animationConfig, state);
18
- }
19
12
  getArea() {
20
13
  return this._area;
21
14
  }
@@ -24,24 +17,22 @@ class MarkArea extends base_1.Marker {
24
17
  }
25
18
  constructor(attributes, options) {
26
19
  super((null == options ? void 0 : options.skipDefault) ? attributes : (0, vutils_1.merge)({}, MarkArea.defaultAttributes, attributes)),
27
- this.name = "markArea", this.defaultUpdateAnimation = animate_1.DefaultUpdateMarkAreaAnimation,
28
- this.defaultExitAnimation = animate_1.DefaultExitMarkerAnimation;
20
+ this.name = "markArea";
29
21
  }
30
- getPointAttrByPosition(position) {
31
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
32
- 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);
33
- return position.includes("left") || position.includes("Left") ? {
34
- x: x1 + (position.includes("inside") ? .5 : -.5) * labelWidth,
22
+ _getPositionByDirection(area, direction) {
23
+ const {x1: x1, x2: x2, y1: y1, y2: y2} = this._area.AABBBounds;
24
+ return direction.includes("left") || direction.includes("Left") ? {
25
+ x: x1,
35
26
  y: (y1 + y2) / 2
36
- } : position.includes("right") || position.includes("Right") ? {
37
- x: x2 + (position.includes("inside") ? -.5 : .5) * labelWidth,
27
+ } : direction.includes("right") || direction.includes("Right") ? {
28
+ x: x2,
38
29
  y: (y1 + y2) / 2
39
- } : position.includes("top") || position.includes("Top") ? {
30
+ } : direction.includes("top") || direction.includes("Top") ? {
40
31
  x: (x1 + x2) / 2,
41
- y: y1 + (position.includes("inside") ? .5 : -.5) * labelHeight
42
- } : position.includes("bottom") || position.includes("Bottom") ? {
32
+ y: y1
33
+ } : direction.includes("bottom") || direction.includes("Bottom") ? {
43
34
  x: (x1 + x2) / 2,
44
- y: y2 + (position.includes("inside") ? -.5 : .5) * labelHeight
35
+ y: y2
45
36
  } : {
46
37
  x: (x1 + x2) / 2,
47
38
  y: (y1 + y2) / 2
@@ -50,8 +41,10 @@ class MarkArea extends base_1.Marker {
50
41
  setLabelPos() {
51
42
  var _a;
52
43
  if (this._label && this._area) {
53
- const {label: label = {}} = this.attribute, labelPosition = null !== (_a = label.position) && void 0 !== _a ? _a : "middle", labelPoint = this.getPointAttrByPosition(labelPosition);
54
- if (this._label.setAttributes(Object.assign({}, labelPoint)), this.attribute.limitRect && label.confine) {
44
+ const {label: label = {}} = this.attribute, labelPosition = null !== (_a = label.position) && void 0 !== _a ? _a : "middle", labelPoint = this._getPositionByDirection(this._area, labelPosition);
45
+ if (this._label.setAttributes(Object.assign(Object.assign({}, labelPoint), {
46
+ textStyle: Object.assign(Object.assign({}, config_1.DEFAULT_MARK_AREA_TEXT_STYLE_MAP[labelPosition]), label.textStyle)
47
+ })), this.attribute.limitRect && label.confine) {
55
48
  const {x: x, y: y, width: width, height: height} = this.attribute.limitRect;
56
49
  (0, limit_shape_1.limitShapeInBounds)(this._label, {
57
50
  x1: x,
@@ -63,17 +56,11 @@ class MarkArea extends base_1.Marker {
63
56
  }
64
57
  }
65
58
  initMarker(container) {
66
- const {points: points, label: label, areaStyle: areaStyle, state: state} = this.attribute, area = vrender_core_1.graphicCreator.polygon(Object.assign({
59
+ const {points: points, label: label, areaStyle: areaStyle} = this.attribute, area = vrender_core_1.graphicCreator.polygon(Object.assign({
67
60
  points: points
68
61
  }, areaStyle));
69
- area.states = (0, vutils_1.merge)({}, constant_1.DEFAULT_STATES, null == state ? void 0 : state.area),
70
- area.name = "mark-area-polygon", this._area = area, container.add(area);
71
- const markLabel = new tag_1.Tag(Object.assign(Object.assign({}, label), {
72
- state: {
73
- panel: (0, vutils_1.merge)({}, constant_1.DEFAULT_STATES, null == state ? void 0 : state.labelBackground),
74
- text: (0, vutils_1.merge)({}, constant_1.DEFAULT_STATES, null == state ? void 0 : state.label)
75
- }
76
- }));
62
+ area.name = "mark-area-area", this._area = area, container.add(area);
63
+ const markLabel = new tag_1.Tag(Object.assign({}, label));
77
64
  markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel),
78
65
  this.setLabelPos();
79
66
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/marker/area.ts"],"names":[],"mappings":";;;AAE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AC;QACrB,MAAM,CAAC,OAAO,CAAC,CAAC,KAAY,EAAE,EAAE;YAC9B,IAAI,CAAC,IAAA,sBAAa,EAAE,KAAe,CAAC,CAAC,CAAC,IAAI,CAAC,IAAA,sBAAa,EAAE,KAAe,CAAC,CAAC,CAAC,EAAE;gBAC5E,SAAS,GAAG,KAAK,CAAC;gBAClB,OAAO;aACR;QACH,CAAC,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;IACnB,CAAC;;AAzJH,4BA0JC;AAxJQ,0BAAiB,GAAG,gCAAuB,CAAC","file":"area.js","sourcesContent":["import type { IGroup, INode, IPolygon } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '@visactor/vrender-core';\nimport { isValidNumber, 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_AREA_THEME } from './config';\nimport type { CommonMarkAreaAnimationType, IMarkAreaLabelPosition, MarkAreaAttrs, MarkerAnimationState } from './type';\nimport { limitShapeInBounds } from '../util/limit-shape';\nimport type { ComponentOptions } from '../interface';\nimport { loadMarkAreaComponent } from './register';\nimport type { Point } from '../core/type';\nimport { DEFAULT_STATES } from '../constant';\nimport { DefaultExitMarkerAnimation, DefaultUpdateMarkAreaAnimation, markAreaAnimate } from './animate/animate';\n\nloadMarkAreaComponent();\n\nexport function registerMarkAreaAnimate() {\n MarkArea._animate = markAreaAnimate;\n}\n\nexport class MarkArea extends Marker<MarkAreaAttrs, CommonMarkAreaAnimationType> {\n name = 'markArea';\n static defaultAttributes = DEFAULT_MARK_AREA_THEME;\n\n /** animate */\n defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation;\n defaultExitAnimation = DefaultExitMarkerAnimation;\n protected markerAnimate(state: MarkerAnimationState) {\n if (MarkArea._animate) {\n MarkArea._animate(this._area, this._label, this._animationConfig, state);\n }\n }\n\n private _area!: IPolygon;\n getArea() {\n return this._area;\n }\n\n getLabel() {\n return this._label;\n }\n\n constructor(attributes: MarkAreaAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, MarkArea.defaultAttributes, attributes));\n }\n\n protected getPointAttrByPosition(position: IMarkAreaLabelPosition) {\n const { x1, x2, y1, y2 } = this._area.AABBBounds;\n // labelHeight\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 // labelWidth\n const labelRectWidth = Math.abs(\n (this._label.getTextShape().AABBBounds?.x2 ?? 0) - (this._label.getTextShape()?.AABBBounds.x1 ?? 0)\n );\n const labelTextWidth = Math.abs(\n (this._label.getBgRect().AABBBounds?.x2 ?? 0) - (this._label.getBgRect()?.AABBBounds.x1 ?? 0)\n );\n const labelWidth = Math.max(labelRectWidth, labelTextWidth);\n\n if (position.includes('left') || position.includes('Left')) {\n return {\n x: x1 + (position.includes('inside') ? 0.5 : -0.5) * labelWidth,\n y: (y1 + y2) / 2\n };\n }\n if (position.includes('right') || position.includes('Right')) {\n return {\n x: x2 + (position.includes('inside') ? -0.5 : 0.5) * labelWidth,\n y: (y1 + y2) / 2\n };\n }\n if (position.includes('top') || position.includes('Top')) {\n return {\n x: (x1 + x2) / 2,\n y: y1 + (position.includes('inside') ? 0.5 : -0.5) * labelHeight\n };\n }\n if (position.includes('bottom') || position.includes('Bottom')) {\n return {\n x: (x1 + x2) / 2,\n y: y2 + (position.includes('inside') ? -0.5 : 0.5) * labelHeight\n };\n }\n\n return {\n x: (x1 + x2) / 2,\n y: (y1 + y2) / 2\n };\n }\n\n protected setLabelPos() {\n if (this._label && this._area) {\n const { label = {} } = this.attribute as MarkAreaAttrs;\n const labelPosition = label.position ?? 'middle';\n const labelPoint = this.getPointAttrByPosition(labelPosition as IMarkAreaLabelPosition);\n this._label.setAttributes({\n ...labelPoint\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 { points, label, areaStyle, state } = this.attribute as MarkAreaAttrs;\n const area = graphicCreator.polygon({\n points: points,\n ...areaStyle\n });\n area.states = merge({}, DEFAULT_STATES, state?.area);\n area.name = 'mark-area-polygon';\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 { points, label, areaStyle } = this.attribute as MarkAreaAttrs;\n if (this._area) {\n this._area.setAttributes({\n points: points,\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 const { points } = this.attribute as MarkAreaAttrs;\n if (!points || points.length < 3) {\n return false;\n }\n let validFlag = true;\n points.forEach((point: Point) => {\n if (!isValidNumber((point as Point).x) || !isValidNumber((point as Point).y)) {\n validFlag = false;\n return;\n }\n });\n return validFlag;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/marker/area.ts"],"names":[],"mappings":";;;AACA,yDAAwD;AACxD,6CAAwD;AAExD,gCAA6B;AAC7B,iCAAgC;AAChC,qCAAqF;AAErF,qDAAyD;AAEzD,yCAAmD;AAGnD,IAAA,gCAAqB,GAAE,CAAC;AACxB,MAAa,QAAS,SAAQ,aAAqB;IAIjD,OAAO;QACL,OAAO,IAAI,CAA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AE,KAAe,CAAC,CAAC,CAAC,EAAE;gBAC5E,SAAS,GAAG,KAAK,CAAC;gBAClB,OAAO;aACR;QACH,CAAC,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;IACnB,CAAC;;AA7HH,4BA8HC;AA5HQ,0BAAiB,GAAG,gCAAuB,CAAC","file":"area.js","sourcesContent":["import type { IGroup, INode, IPolygon } from '@visactor/vrender-core';\nimport { graphicCreator } from '@visactor/vrender-core';\nimport { isValidNumber, merge } from '@visactor/vutils';\nimport type { TagAttributes } from '../tag';\nimport { Tag } from '../tag';\nimport { Marker } from './base';\nimport { DEFAULT_MARK_AREA_TEXT_STYLE_MAP, DEFAULT_MARK_AREA_THEME } from './config';\nimport type { MarkAreaAttrs } from './type';\nimport { limitShapeInBounds } from '../util/limit-shape';\nimport type { ComponentOptions } from '../interface';\nimport { loadMarkAreaComponent } from './register';\nimport type { Point } from '../core/type';\n\nloadMarkAreaComponent();\nexport class MarkArea extends Marker<MarkAreaAttrs> {\n name = 'markArea';\n static defaultAttributes = DEFAULT_MARK_AREA_THEME;\n private _area!: IPolygon;\n getArea() {\n return this._area;\n }\n\n getLabel() {\n return this._label;\n }\n\n constructor(attributes: MarkAreaAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, MarkArea.defaultAttributes, attributes));\n }\n\n private _getPositionByDirection(area: IPolygon, direction: string) {\n const { x1, x2, y1, y2 } = this._area.AABBBounds;\n\n if (direction.includes('left') || direction.includes('Left')) {\n return {\n x: x1,\n y: (y1 + y2) / 2\n };\n }\n if (direction.includes('right') || direction.includes('Right')) {\n return {\n x: x2,\n y: (y1 + y2) / 2\n };\n }\n if (direction.includes('top') || direction.includes('Top')) {\n return {\n x: (x1 + x2) / 2,\n y: y1\n };\n }\n if (direction.includes('bottom') || direction.includes('Bottom')) {\n return {\n x: (x1 + x2) / 2,\n y: y2\n };\n }\n\n return {\n x: (x1 + x2) / 2,\n y: (y1 + y2) / 2\n };\n }\n\n protected setLabelPos() {\n if (this._label && this._area) {\n const { label = {} } = this.attribute as MarkAreaAttrs;\n const labelPosition = label.position ?? 'middle';\n const labelPoint = this._getPositionByDirection(this._area, labelPosition);\n this._label.setAttributes({\n ...labelPoint,\n textStyle: {\n ...DEFAULT_MARK_AREA_TEXT_STYLE_MAP[labelPosition],\n ...label.textStyle\n }\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 { points, label, areaStyle } = this.attribute as MarkAreaAttrs;\n const area = graphicCreator.polygon({\n points: points,\n ...areaStyle\n });\n area.name = 'mark-area-area';\n this._area = area;\n container.add(area);\n\n const markLabel = new Tag({\n ...(label as TagAttributes)\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 { points, label, areaStyle } = this.attribute as MarkAreaAttrs;\n if (this._area) {\n this._area.setAttributes({\n points: points,\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 const { points } = this.attribute as MarkAreaAttrs;\n if (!points || points.length < 3) {\n return false;\n }\n let validFlag = true;\n points.forEach((point: Point) => {\n if (!isValidNumber((point as Point).x) || !isValidNumber((point as Point).y)) {\n validFlag = false;\n return;\n }\n });\n return validFlag;\n }\n}\n"]}
@@ -1,36 +1,18 @@
1
- import type { IGroup, IImage, IRichText, ISymbol } from '@visactor/vrender-core';
1
+ import type { IGroup } from '@visactor/vrender-core';
2
2
  import { AbstractComponent } from '../core/base';
3
3
  import type { Tag } from '../tag';
4
- import type { MarkerAnimationState, MarkerAttrs, MarkerExitAnimation, MarkerUpdateAnimation } from './type';
5
- export declare abstract class Marker<T extends MarkerAttrs<AnimationAttr>, AnimationAttr> extends AbstractComponent<Required<T>> {
4
+ import type { MarkerAttrs } from './type';
5
+ export declare abstract class Marker<T extends MarkerAttrs> extends AbstractComponent<Required<T>> {
6
6
  name: string;
7
7
  private _containerClip;
8
8
  private _container;
9
9
  protected _label: Tag;
10
- static _animate?: (marker: any, label: Tag | IRichText | ISymbol | IImage, animationConfig: any, state: MarkerAnimationState) => void;
11
- defaultUpdateAnimation: MarkerUpdateAnimation<AnimationAttr>;
12
- defaultExitAnimation: MarkerExitAnimation;
13
- protected _animationConfig?: {
14
- enter: MarkerUpdateAnimation<AnimationAttr>;
15
- exit: MarkerExitAnimation;
16
- update: MarkerUpdateAnimation<AnimationAttr>;
17
- };
18
- private _lastHover;
19
- private _lastSelect;
20
10
  protected abstract setLabelPos(): any;
21
11
  protected abstract initMarker(container: IGroup): any;
22
12
  protected abstract updateMarker(): any;
23
13
  protected abstract isValidPoints(): any;
24
- protected abstract markerAnimate(state: MarkerAnimationState): void;
25
- private transAnimationConfig;
26
14
  setAttribute(key: string, value: any, forceUpdateTag?: boolean | undefined): void;
27
- private _bindEvent;
28
- private _releaseEvent;
29
- private _onHover;
30
- private _onUnHover;
31
- private _onClick;
32
15
  private _initContainer;
33
16
  private _updateContainer;
34
17
  protected render(): void;
35
- release(): void;
36
18
  }
@@ -4,46 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.Marker = void 0;
6
6
 
7
- const vrender_core_1 = require("@visactor/vrender-core"), base_1 = require("../core/base"), interaction_1 = require("../util/interaction"), vutils_1 = require("@visactor/vutils");
7
+ const vrender_core_1 = require("@visactor/vrender-core"), base_1 = require("../core/base");
8
8
 
9
9
  class Marker extends base_1.AbstractComponent {
10
10
  constructor() {
11
- super(...arguments), this.name = "marker", this._onHover = e => {
12
- this._lastHover = (0, interaction_1.dispatchHoverState)(e, this._container, this._lastHover);
13
- }, this._onUnHover = e => {
14
- this._lastHover = (0, interaction_1.dispatchUnHoverState)(e, this._container, this._lastHover);
15
- }, this._onClick = e => {
16
- this._lastSelect = (0, interaction_1.dispatchClickState)(e, this._container, this._lastSelect);
17
- };
18
- }
19
- transAnimationConfig() {
20
- var _a, _b, _c;
21
- if (!1 !== this.attribute.animation) {
22
- const animation = (0, vutils_1.isObject)(this.attribute.animation) ? this.attribute.animation : {};
23
- this._animationConfig = {
24
- enter: (0, vutils_1.merge)({}, this.defaultUpdateAnimation, animation, null !== (_a = this.attribute.animationEnter) && void 0 !== _a ? _a : {}),
25
- exit: (0, vutils_1.merge)({}, this.defaultExitAnimation, animation, null !== (_b = this.attribute.animationExit) && void 0 !== _b ? _b : {}),
26
- update: (0, vutils_1.merge)({}, this.defaultUpdateAnimation, animation, null !== (_c = this.attribute.animationUpdate) && void 0 !== _c ? _c : {})
27
- };
28
- }
11
+ super(...arguments), this.name = "marker";
29
12
  }
30
13
  setAttribute(key, value, forceUpdateTag) {
31
14
  super.setAttribute(key, value, forceUpdateTag), "visible" === key && this.render();
32
15
  }
33
- _bindEvent() {
34
- var _a, _b, _c;
35
- if (!this.attribute.interactive) return;
36
- const {hover: hover, select: select} = this.attribute;
37
- hover && (null === (_a = this._container) || void 0 === _a || _a.addEventListener("pointermove", this._onHover),
38
- null === (_b = this._container) || void 0 === _b || _b.addEventListener("pointerout", this._onUnHover)),
39
- select && (null === (_c = this._container) || void 0 === _c || _c.addEventListener("pointerdown", this._onClick));
40
- }
41
- _releaseEvent() {
42
- var _a, _b, _c;
43
- null === (_a = this._container) || void 0 === _a || _a.removeEventListener("pointermove", this._onHover),
44
- null === (_b = this._container) || void 0 === _b || _b.removeEventListener("pointerout", this._onUnHover),
45
- null === (_c = this._container) || void 0 === _c || _c.removeEventListener("pointerdown", this._onClick);
46
- }
47
16
  _initContainer() {
48
17
  var _a, _b;
49
18
  const {limitRect: limitRect = {}, clipInRange: clipInRange} = this.attribute;
@@ -76,16 +45,12 @@ class Marker extends base_1.AbstractComponent {
76
45
  }
77
46
  render() {
78
47
  var _a;
79
- this.transAnimationConfig(), this.setAttribute("pickable", !1);
48
+ this.setAttribute("pickable", !1);
80
49
  const markerVisible = null === (_a = this.attribute.visible) || void 0 === _a || _a;
81
50
  !1 === this.attribute.interactive && this.setAttribute("childrenPickable", !1),
82
51
  markerVisible && this.isValidPoints() ? this._container ? (this._updateContainer(),
83
- this.updateMarker(), this.markerAnimate("update")) : (this._initContainer(), this.initMarker(this._container),
84
- this.markerAnimate("enter")) : (this.markerAnimate("exit"), this._container = null,
85
- this.removeAllChild(!0)), this._releaseEvent(), this._bindEvent();
86
- }
87
- release() {
88
- this.markerAnimate("exit"), super.release(), this._releaseEvent(), this._container = null;
52
+ this.updateMarker()) : (this._initContainer(), this.initMarker(this._container)) : (this._container = null,
53
+ this.removeAllChild(!0));
89
54
  }
90
55
  }
91
56
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/marker/base.ts"],"names":[],"mappings":";;;AAEA,yDAAwD;AACxD,uCAAiD;AAGjD,qDAAmG;AACnG,6CAAmD;AAEnD,MAAsB,MAA4D,SAAQ,wBAEzF;IAFD;;QAGE,SAAI,GAAG,QAAQ,CAAC;QAkFR,aAAQ,GAAG,CAAC,CAAwB,EAAE,EAAE;YAC9C,IAAI,CAAC,UAAU,GAAG,IAAA,gCAAkB,EAAC,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC5E,CAAC,CAAC;QAEM,eAAU,GAAG,CAAC,CAAwB,EAAE,EAAE;YAChD,IAAI,CAAC,UAAU,GAAG,IAAA,kCAAoB,EAAC,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9E,CAAC,CAAC;QAEM,aAAQ,GAAG,CAAC,CAAwB,EAAE,EAAE;YAC9C,IAAI,CAAC,WAAW,GAAG,IAAA,gCAAkB,EAAC,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9E,CAA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I,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBACjC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;aAC7B;iBAAM;gBACL,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACxB,IAAI,CAAC,YAAY,EAAE,CAAC;gBACpB,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;aAC9B;SACF;aAAM;YACL,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC3B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;SAC3B;QAGD,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,OAAO;QACL,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC3B,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;CACF;AAnLD,wBAmLC","file":"base.js","sourcesContent":["import type { FederatedPointerEvent, IGraphic, IGroup, IImage, IRichText, ISymbol } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '@visactor/vrender-core';\nimport { AbstractComponent } from '../core/base';\nimport type { Tag } from '../tag';\nimport type { MarkerAnimationState, MarkerAttrs, MarkerExitAnimation, MarkerUpdateAnimation } from './type';\nimport { dispatchClickState, dispatchHoverState, dispatchUnHoverState } from '../util/interaction';\nimport { isObject, merge } from '@visactor/vutils';\n\nexport abstract class Marker<T extends MarkerAttrs<AnimationAttr>, AnimationAttr> extends AbstractComponent<\n Required<T>\n> {\n name = 'marker';\n\n private _containerClip!: IGroup;\n private _container!: IGroup;\n\n protected _label!: Tag;\n\n /** animate */\n static _animate?: (\n marker: any,\n label: Tag | IRichText | ISymbol | IImage,\n animationConfig: any,\n state: MarkerAnimationState\n ) => void;\n\n defaultUpdateAnimation!: MarkerUpdateAnimation<AnimationAttr>;\n defaultExitAnimation!: MarkerExitAnimation;\n\n protected _animationConfig?: {\n enter: MarkerUpdateAnimation<AnimationAttr>;\n exit: MarkerExitAnimation;\n update: MarkerUpdateAnimation<AnimationAttr>;\n };\n\n private _lastHover: IGraphic;\n private _lastSelect: IGraphic;\n\n protected abstract setLabelPos(): any;\n protected abstract initMarker(container: IGroup): any;\n protected abstract updateMarker(): any;\n protected abstract isValidPoints(): any;\n protected abstract markerAnimate(state: MarkerAnimationState): void;\n\n private transAnimationConfig(): void {\n if (this.attribute.animation !== false) {\n const animation = isObject(this.attribute.animation) ? this.attribute.animation : {};\n this._animationConfig = {\n enter: merge(\n {},\n this.defaultUpdateAnimation,\n animation,\n this.attribute.animationEnter ?? {}\n ) as MarkerUpdateAnimation<AnimationAttr>,\n exit: merge({}, this.defaultExitAnimation, animation, this.attribute.animationExit ?? {}),\n update: merge(\n {},\n this.defaultUpdateAnimation,\n animation,\n this.attribute.animationUpdate ?? {}\n ) as MarkerUpdateAnimation<AnimationAttr>\n };\n }\n }\n setAttribute(key: string, value: any, forceUpdateTag?: boolean | undefined): void {\n super.setAttribute(key, value, forceUpdateTag);\n if (key === 'visible') {\n this.render();\n }\n }\n\n private _bindEvent() {\n if (!this.attribute.interactive) {\n return;\n }\n const { hover, select } = this.attribute;\n\n if (hover) {\n this._container?.addEventListener('pointermove', this._onHover as EventListenerOrEventListenerObject);\n this._container?.addEventListener('pointerout', this._onUnHover as EventListenerOrEventListenerObject);\n }\n\n if (select) {\n this._container?.addEventListener('pointerdown', this._onClick as EventListenerOrEventListenerObject);\n }\n }\n\n private _releaseEvent() {\n this._container?.removeEventListener('pointermove', this._onHover as EventListenerOrEventListenerObject);\n this._container?.removeEventListener('pointerout', this._onUnHover as EventListenerOrEventListenerObject);\n this._container?.removeEventListener('pointerdown', this._onClick as EventListenerOrEventListenerObject);\n }\n\n private _onHover = (e: FederatedPointerEvent) => {\n this._lastHover = dispatchHoverState(e, this._container, this._lastHover);\n };\n\n private _onUnHover = (e: FederatedPointerEvent) => {\n this._lastHover = dispatchUnHoverState(e, this._container, this._lastHover);\n };\n\n private _onClick = (e: FederatedPointerEvent) => {\n this._lastSelect = dispatchClickState(e, this._container, this._lastSelect);\n };\n\n private _initContainer() {\n const { limitRect = {} as T['limitRect'], clipInRange } = this.attribute;\n let group;\n if (clipInRange) {\n // 如果用户配置了剪切\n const groupClip = graphicCreator.group({\n ...limitRect,\n clip: true,\n pickable: false\n });\n group = graphicCreator.group({\n x: -(limitRect.x ?? 0),\n y: -(limitRect.y ?? 0),\n pickable: false\n });\n groupClip.add(group);\n this._containerClip = groupClip;\n this.add(groupClip);\n } else {\n group = graphicCreator.group({\n x: 0,\n y: 0,\n pickable: false\n });\n this.add(group);\n }\n group.name = 'marker-container';\n this._container = group;\n }\n\n private _updateContainer() {\n const { limitRect = {} as T['limitRect'], clipInRange } = this.attribute;\n if (this._containerClip) {\n this._containerClip.setAttributes({\n ...limitRect\n });\n }\n\n this._container.setAttributes({\n x: clipInRange ? -(limitRect.x ?? 0) : 0,\n y: clipInRange ? -(limitRect.y ?? 0) : 0\n });\n }\n\n protected render() {\n this.transAnimationConfig();\n\n // 因为标注本身不规则,所以默认将组件的 group 设置为不可拾取\n this.setAttribute('pickable', false);\n\n const markerVisible = this.attribute.visible ?? true;\n if (this.attribute.interactive === false) {\n this.setAttribute('childrenPickable', false);\n }\n\n if (markerVisible && this.isValidPoints()) {\n if (!this._container) {\n this._initContainer();\n this.initMarker(this._container);\n this.markerAnimate('enter');\n } else {\n this._updateContainer();\n this.updateMarker();\n this.markerAnimate('update');\n }\n } else {\n this.markerAnimate('exit');\n this._container = null;\n this.removeAllChild(true);\n }\n\n // 先把之前的event都release掉,否则会重复触发\n this._releaseEvent();\n this._bindEvent();\n }\n\n release(): void {\n this.markerAnimate('exit');\n super.release();\n this._releaseEvent();\n this._container = null;\n }\n}\n"]}
1
+ {"version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C,cAAc,CAAC,IAAI,CAAC,CAAC;SAC3B;IACH,CAAC;CACF;AArFD,wBAqFC","file":"base.js","sourcesContent":["import type { IGroup } from '@visactor/vrender-core';\nimport { graphicCreator } from '@visactor/vrender-core';\nimport { AbstractComponent } from '../core/base';\nimport type { Tag } from '../tag';\nimport type { MarkerAttrs } from './type';\n\nexport abstract class Marker<T extends MarkerAttrs> extends AbstractComponent<Required<T>> {\n name = 'marker';\n private _containerClip!: IGroup;\n private _container!: IGroup;\n\n protected _label!: Tag;\n\n protected abstract setLabelPos(): any;\n protected abstract initMarker(container: IGroup): any;\n protected abstract updateMarker(): any;\n protected abstract isValidPoints(): any;\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean | undefined): void {\n super.setAttribute(key, value, forceUpdateTag);\n if (key === 'visible') {\n this.render();\n }\n }\n\n private _initContainer() {\n const { limitRect = {} as T['limitRect'], clipInRange } = this.attribute;\n let group;\n if (clipInRange) {\n // 如果用户配置了剪切\n const groupClip = graphicCreator.group({\n ...limitRect,\n clip: true,\n pickable: false\n });\n group = graphicCreator.group({\n x: -(limitRect.x ?? 0),\n y: -(limitRect.y ?? 0),\n pickable: false\n });\n groupClip.add(group);\n this._containerClip = groupClip;\n this.add(groupClip);\n } else {\n group = graphicCreator.group({\n x: 0,\n y: 0,\n pickable: false\n });\n this.add(group);\n }\n group.name = 'marker-container';\n this._container = group;\n }\n\n private _updateContainer() {\n const { limitRect = {} as T['limitRect'], clipInRange } = this.attribute;\n if (this._containerClip) {\n this._containerClip.setAttributes({\n ...limitRect\n });\n }\n\n this._container.setAttributes({\n x: clipInRange ? -(limitRect.x ?? 0) : 0,\n y: clipInRange ? -(limitRect.y ?? 0) : 0\n });\n }\n\n protected render() {\n // 因为标注本身不规则,所以默认将组件的 group 设置为不可拾取\n this.setAttribute('pickable', false);\n\n const markerVisible = this.attribute.visible ?? true;\n if (this.attribute.interactive === false) {\n this.setAttribute('childrenPickable', false);\n }\n\n if (markerVisible && this.isValidPoints()) {\n if (!this._container) {\n this._initContainer();\n this.initMarker(this._container);\n } else {\n this._updateContainer();\n this.updateMarker();\n }\n } else {\n this._container = null;\n this.removeAllChild(true);\n }\n }\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  import type { TextAlignType, TextBaselineType } from '@visactor/vrender-core';
2
- import { IMarkAreaLabelPosition, IMarkLineLabelPosition, IMarkCommonArcLabelPosition } from './type';
2
+ import { IMarkAreaLabelPosition, IMarkLineLabelPosition } from './type';
3
3
  export declare const DEFAULT_MARK_LINE_THEME: {
4
- interactive: boolean;
5
4
  startSymbol: {
6
5
  visible: boolean;
7
6
  symbolType: string;
@@ -28,8 +27,6 @@ export declare const DEFAULT_MARK_LINE_THEME: {
28
27
  fontSize: number;
29
28
  fontWeight: string;
30
29
  fontStyle: string;
31
- textAlign: string;
32
- textBaseline: string;
33
30
  };
34
31
  padding: number[];
35
32
  panel: {
@@ -45,53 +42,13 @@ export declare const DEFAULT_MARK_LINE_THEME: {
45
42
  lineDash: number[];
46
43
  };
47
44
  };
48
- export declare const DEFAULT_MARK_ARC_LINE_THEME: {
49
- interactive: boolean;
50
- startSymbol: {
51
- visible: boolean;
52
- symbolType: string;
53
- size: number;
54
- fill: string;
55
- lineWidth: number;
56
- };
57
- endSymbol: {
58
- visible: boolean;
59
- symbolType: string;
60
- size: number;
61
- fill: string;
62
- lineWidth: number;
63
- };
64
- label: {
65
- position: IMarkCommonArcLabelPosition;
66
- refX: number;
67
- refY: number;
68
- refAngle: number;
69
- textStyle: {
70
- fill: string;
71
- stroke: string;
72
- lineWidth: number;
73
- fontSize: number;
74
- fontWeight: string;
75
- fontStyle: string;
76
- textAlign: string;
77
- textBaseline: string;
78
- };
79
- padding: number[];
80
- panel: {
81
- visible: boolean;
82
- cornerRadius: number;
83
- fill: string;
84
- fillOpacity: number;
85
- };
86
- };
87
- lineStyle: {
88
- stroke: string;
89
- lineWidth: number;
90
- lineDash: number[];
45
+ export declare const DEFAULT_MARK_LINE_TEXT_STYLE_MAP: {
46
+ [K: string]: {
47
+ textAlign: TextAlignType;
48
+ textBaseline: TextBaselineType;
91
49
  };
92
50
  };
93
51
  export declare const DEFAULT_MARK_AREA_THEME: {
94
- interactive: boolean;
95
52
  label: {
96
53
  position: IMarkAreaLabelPosition;
97
54
  textStyle: {
@@ -101,35 +58,6 @@ export declare const DEFAULT_MARK_AREA_THEME: {
101
58
  fontSize: number;
102
59
  fontWeight: string;
103
60
  fontStyle: string;
104
- textAlign: string;
105
- textBaseline: string;
106
- };
107
- padding: number[];
108
- panel: {
109
- visible: boolean;
110
- cornerRadius: number;
111
- fill: string;
112
- fillOpacity: number;
113
- };
114
- };
115
- areaStyle: {
116
- fill: string;
117
- visible: boolean;
118
- };
119
- };
120
- export declare const DEFAULT_MARK_ARC_AREA_THEME: {
121
- interactive: boolean;
122
- label: {
123
- position: IMarkCommonArcLabelPosition;
124
- textStyle: {
125
- fill: string;
126
- stroke: string;
127
- lineWidth: number;
128
- fontSize: number;
129
- fontWeight: string;
130
- fontStyle: string;
131
- textAlign: string;
132
- textBaseline: string;
133
61
  };
134
62
  padding: number[];
135
63
  panel: {
@@ -144,14 +72,13 @@ export declare const DEFAULT_MARK_ARC_AREA_THEME: {
144
72
  visible: boolean;
145
73
  };
146
74
  };
147
- export declare const DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP: {
75
+ export declare const DEFAULT_MARK_AREA_TEXT_STYLE_MAP: {
148
76
  [K: string]: {
149
77
  textAlign: TextAlignType;
150
78
  textBaseline: TextBaselineType;
151
79
  };
152
80
  };
153
81
  export declare const DEFAULT_MARK_POINT_THEME: {
154
- interactive: boolean;
155
82
  itemLine: {
156
83
  visible: boolean;
157
84
  decorativeLine: {
@@ -2,12 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.DEFAULT_MARK_POINT_TEXT_STYLE_MAP = exports.DEFAULT_MARK_POINT_THEME = exports.DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP = exports.DEFAULT_MARK_ARC_AREA_THEME = exports.DEFAULT_MARK_AREA_THEME = exports.DEFAULT_MARK_ARC_LINE_THEME = exports.DEFAULT_MARK_LINE_THEME = void 0;
5
+ }), exports.DEFAULT_MARK_POINT_TEXT_STYLE_MAP = exports.DEFAULT_MARK_POINT_THEME = exports.DEFAULT_MARK_AREA_TEXT_STYLE_MAP = exports.DEFAULT_MARK_AREA_THEME = exports.DEFAULT_MARK_LINE_TEXT_STYLE_MAP = exports.DEFAULT_MARK_LINE_THEME = void 0;
6
6
 
7
7
  const type_1 = require("./type");
8
8
 
9
9
  exports.DEFAULT_MARK_LINE_THEME = {
10
- interactive: !0,
11
10
  startSymbol: {
12
11
  visible: !1,
13
12
  symbolType: "triangle",
@@ -33,9 +32,7 @@ exports.DEFAULT_MARK_LINE_THEME = {
33
32
  lineWidth: 0,
34
33
  fontSize: 10,
35
34
  fontWeight: "normal",
36
- fontStyle: "normal",
37
- textAlign: "center",
38
- textBaseline: "middle"
35
+ fontStyle: "normal"
39
36
  },
40
37
  padding: [ 2, 2, 4, 4 ],
41
38
  panel: {
@@ -50,52 +47,44 @@ exports.DEFAULT_MARK_LINE_THEME = {
50
47
  lineWidth: 1,
51
48
  lineDash: [ 2 ]
52
49
  }
53
- }, exports.DEFAULT_MARK_ARC_LINE_THEME = {
54
- interactive: !0,
55
- startSymbol: {
56
- visible: !1,
57
- symbolType: "triangle",
58
- size: 12,
59
- fill: "rgba(46, 47, 50)",
60
- lineWidth: 0
50
+ }, exports.DEFAULT_MARK_LINE_TEXT_STYLE_MAP = {
51
+ start: {
52
+ textAlign: "right",
53
+ textBaseline: "middle"
61
54
  },
62
- endSymbol: {
63
- visible: !0,
64
- symbolType: "triangle",
65
- size: 12,
66
- fill: "rgba(46, 47, 50)",
67
- lineWidth: 0
55
+ insideStartTop: {
56
+ textAlign: "left",
57
+ textBaseline: "bottom"
68
58
  },
69
- label: {
70
- position: type_1.IMarkCommonArcLabelPosition.arcOuterMiddle,
71
- refX: 0,
72
- refY: 0,
73
- refAngle: 0,
74
- textStyle: {
75
- fill: "#fff",
76
- stroke: "#fff",
77
- lineWidth: 0,
78
- fontSize: 10,
79
- fontWeight: "normal",
80
- fontStyle: "normal",
81
- textAlign: "center",
82
- textBaseline: "middle"
83
- },
84
- padding: [ 2, 2, 4, 4 ],
85
- panel: {
86
- visible: !0,
87
- cornerRadius: 0,
88
- fill: "rgb(48, 115, 242)",
89
- fillOpacity: .8
90
- }
59
+ insideStartBottom: {
60
+ textAlign: "left",
61
+ textBaseline: "top"
91
62
  },
92
- lineStyle: {
93
- stroke: "#b2bacf",
94
- lineWidth: 1,
95
- lineDash: [ 2 ]
63
+ middle: {
64
+ textAlign: "center",
65
+ textBaseline: "middle"
66
+ },
67
+ insideMiddleTop: {
68
+ textAlign: "center",
69
+ textBaseline: "bottom"
70
+ },
71
+ insideMiddleBottom: {
72
+ textAlign: "center",
73
+ textBaseline: "top"
74
+ },
75
+ end: {
76
+ textAlign: "left",
77
+ textBaseline: "middle"
78
+ },
79
+ insideEndTop: {
80
+ textAlign: "right",
81
+ textBaseline: "bottom"
82
+ },
83
+ insideEndBottom: {
84
+ textAlign: "right",
85
+ textBaseline: "top"
96
86
  }
97
87
  }, exports.DEFAULT_MARK_AREA_THEME = {
98
- interactive: !0,
99
88
  label: {
100
89
  position: type_1.IMarkAreaLabelPosition.right,
101
90
  textStyle: {
@@ -104,35 +93,7 @@ exports.DEFAULT_MARK_LINE_THEME = {
104
93
  lineWidth: 0,
105
94
  fontSize: 10,
106
95
  fontWeight: "normal",
107
- fontStyle: "normal",
108
- textAlign: "center",
109
- textBaseline: "middle"
110
- },
111
- padding: [ 2, 2, 4, 4 ],
112
- panel: {
113
- visible: !0,
114
- cornerRadius: 0,
115
- fill: "rgb(48, 115, 242)",
116
- fillOpacity: .8
117
- }
118
- },
119
- areaStyle: {
120
- fill: "#b2bacf",
121
- visible: !0
122
- }
123
- }, exports.DEFAULT_MARK_ARC_AREA_THEME = {
124
- interactive: !0,
125
- label: {
126
- position: type_1.IMarkCommonArcLabelPosition.arcOuterMiddle,
127
- textStyle: {
128
- fill: "#fff",
129
- stroke: "#fff",
130
- lineWidth: 0,
131
- fontSize: 10,
132
- fontWeight: "normal",
133
- fontStyle: "normal",
134
- textAlign: "center",
135
- textBaseline: "middle"
96
+ fontStyle: "normal"
136
97
  },
137
98
  padding: [ 2, 2, 4, 4 ],
138
99
  panel: {
@@ -146,7 +107,7 @@ exports.DEFAULT_MARK_LINE_THEME = {
146
107
  fill: "#b2bacf",
147
108
  visible: !0
148
109
  }
149
- }, exports.DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP = {
110
+ }, exports.DEFAULT_MARK_AREA_TEXT_STYLE_MAP = {
150
111
  left: {
151
112
  textAlign: "right",
152
113
  textBaseline: "middle"
@@ -184,7 +145,6 @@ exports.DEFAULT_MARK_LINE_THEME = {
184
145
  textBaseline: "middle"
185
146
  }
186
147
  }, exports.DEFAULT_MARK_POINT_THEME = {
187
- interactive: !0,
188
148
  itemLine: {
189
149
  visible: !0,
190
150
  decorativeLine: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/marker/config.ts"],"names":[],"mappings":";;;AACA,iCAAqG;AAExF,QAAA,uBAAuB,GAAG;IACrC,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE;QACX,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC;KACb;IACD,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC;KACb;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,6BAAsB,CAAC,GAAG;QACpC,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,CAAC;QACX,SAAS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, TextBaselineType } from '@visactor/vrender-core';\nimport { IMarkAreaLabelPosition, IMarkLineLabelPosition, IMarkCommonArcLabelPosition } from './type';\n\nexport const DEFAULT_MARK_LINE_THEME = {\n interactive: true,\n startSymbol: {\n visible: false,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n endSymbol: {\n visible: true,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n label: {\n position: IMarkLineLabelPosition.end,\n refX: 0,\n refY: 0,\n refAngle: 0,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal',\n textAlign: 'center',\n textBaseline: 'middle'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n lineStyle: {\n stroke: '#b2bacf',\n lineWidth: 1,\n lineDash: [2]\n }\n};\n\nexport const DEFAULT_MARK_ARC_LINE_THEME = {\n interactive: true,\n startSymbol: {\n visible: false,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n endSymbol: {\n visible: true,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n label: {\n position: IMarkCommonArcLabelPosition.arcOuterMiddle,\n refX: 0,\n refY: 0,\n refAngle: 0,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal',\n textAlign: 'center',\n textBaseline: 'middle'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n lineStyle: {\n stroke: '#b2bacf',\n lineWidth: 1,\n lineDash: [2]\n }\n};\n\nexport const DEFAULT_MARK_AREA_THEME = {\n interactive: true,\n label: {\n position: IMarkAreaLabelPosition.right,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal',\n textAlign: 'center',\n textBaseline: 'middle'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n areaStyle: {\n fill: '#b2bacf',\n visible: true\n }\n};\n\nexport const DEFAULT_MARK_ARC_AREA_THEME = {\n interactive: true,\n label: {\n position: IMarkCommonArcLabelPosition.arcOuterMiddle,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal',\n textAlign: 'center',\n textBaseline: 'middle'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n areaStyle: {\n fill: '#b2bacf',\n visible: true\n }\n};\n\nexport const DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n left: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n insideLeft: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n\n right: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideRight: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n\n top: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n insideTop: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n\n bottom: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n insideBottom: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n\n middle: {\n textAlign: 'center',\n textBaseline: 'middle'\n }\n};\n\nexport const DEFAULT_MARK_POINT_THEME = {\n interactive: true,\n itemLine: {\n visible: true,\n decorativeLine: {\n visible: false,\n length: 30\n },\n startSymbol: {\n visible: true,\n clip: true,\n symbolType: 'circle',\n size: 20,\n style: {\n fill: false,\n stroke: 'rgba(46, 47, 50)'\n }\n },\n endSymbol: {\n visible: false,\n clip: true,\n symbolType: 'triangle',\n size: 12,\n style: {\n fill: false,\n stroke: 'rgba(46, 47, 50)'\n }\n },\n lineStyle: {\n stroke: '#000',\n lineWidth: 1\n }\n },\n itemContent: {\n type: 'text',\n position: 'middle',\n refX: 10,\n symbolStyle: {\n symbolType: 'star',\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8,\n size: 20\n },\n textStyle: {\n dx: 0,\n dy: 0\n },\n imageStyle: {\n width: 80,\n height: 80\n },\n richTextStyle: {\n width: 100,\n height: 100\n }\n }\n};\n\nexport const DEFAULT_MARK_POINT_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n top: {\n textAlign: 'left',\n textBaseline: 'bottom'\n },\n bottom: {\n textAlign: 'left',\n textBaseline: 'top'\n },\n middle: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideTop: {\n textAlign: 'right',\n textBaseline: 'bottom'\n },\n insideBottom: {\n textAlign: 'right',\n textBaseline: 'top'\n },\n insideMiddle: {\n textAlign: 'right',\n textBaseline: 'middle'\n }\n};\n"]}
1
+ {"version":3,"sources":["../src/marker/config.ts"],"names":[],"mappings":";;;AACA,iCAAwE;AAE3D,QAAA,uBAAuB,GAAG;IACrC,WAAW,EAAE;QACX,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC;KACb;IACD,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC;KACb;IACD,KAAK,EAAE;QACL,QAAQ,EAAE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,YAAY,EAAE,QAAQ;KACvB;IACD,SAAS,EAAE;QACT,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,QAAQ;KACvB;IACD,YAAY,EAAE;QACZ,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,KAAK;KACpB;IACD,YAAY,EAAE;QACZ,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,QAAQ;KACvB;CACF,CAAC","file":"config.js","sourcesContent":["import type { TextAlignType, TextBaselineType } from '@visactor/vrender-core';\nimport { IMarkAreaLabelPosition, IMarkLineLabelPosition } from './type';\n\nexport const DEFAULT_MARK_LINE_THEME = {\n startSymbol: {\n visible: false,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n endSymbol: {\n visible: true,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n label: {\n position: IMarkLineLabelPosition.end,\n refX: 0,\n refY: 0,\n refAngle: 0,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n lineStyle: {\n stroke: '#b2bacf',\n lineWidth: 1,\n lineDash: [2]\n }\n};\n\nexport const DEFAULT_MARK_LINE_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n start: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n insideStartTop: {\n textAlign: 'left',\n textBaseline: 'bottom'\n },\n insideStartBottom: {\n textAlign: 'left',\n textBaseline: 'top'\n },\n\n middle: {\n textAlign: 'center',\n textBaseline: 'middle'\n },\n insideMiddleTop: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n insideMiddleBottom: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n\n end: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideEndTop: {\n textAlign: 'right',\n textBaseline: 'bottom'\n },\n insideEndBottom: {\n textAlign: 'right',\n textBaseline: 'top'\n }\n};\n\nexport const DEFAULT_MARK_AREA_THEME = {\n label: {\n position: IMarkAreaLabelPosition.right,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n areaStyle: {\n fill: '#b2bacf',\n visible: true\n }\n};\n\nexport const DEFAULT_MARK_AREA_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n left: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n insideLeft: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n\n right: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideRight: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n\n top: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n insideTop: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n\n bottom: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n insideBottom: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n\n middle: {\n textAlign: 'center',\n textBaseline: 'middle'\n }\n};\n\nexport const DEFAULT_MARK_POINT_THEME = {\n itemLine: {\n visible: true,\n decorativeLine: {\n visible: false,\n length: 30\n },\n startSymbol: {\n visible: true,\n clip: true,\n symbolType: 'circle',\n size: 20,\n style: {\n fill: false,\n stroke: 'rgba(46, 47, 50)'\n }\n },\n endSymbol: {\n visible: false,\n clip: true,\n symbolType: 'triangle',\n size: 12,\n style: {\n fill: false,\n stroke: 'rgba(46, 47, 50)'\n }\n },\n lineStyle: {\n stroke: '#000',\n lineWidth: 1\n }\n },\n itemContent: {\n type: 'text',\n position: 'middle',\n refX: 10,\n symbolStyle: {\n symbolType: 'star',\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8,\n size: 20\n },\n textStyle: {\n dx: 0,\n dy: 0\n },\n imageStyle: {\n width: 80,\n height: 80\n },\n richTextStyle: {\n width: 100,\n height: 100\n }\n }\n};\n\nexport const DEFAULT_MARK_POINT_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n top: {\n textAlign: 'left',\n textBaseline: 'bottom'\n },\n bottom: {\n textAlign: 'left',\n textBaseline: 'top'\n },\n middle: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideTop: {\n textAlign: 'right',\n textBaseline: 'bottom'\n },\n insideBottom: {\n textAlign: 'right',\n textBaseline: 'top'\n },\n insideMiddle: {\n textAlign: 'right',\n textBaseline: 'middle'\n }\n};\n"]}
@@ -1,6 +1,4 @@
1
1
  export * from './type';
2
2
  export * from './line';
3
3
  export * from './area';
4
- export * from './arc-line';
5
- export * from './arc-area';
6
4
  export * from './point';