@visactor/vrender-components 0.18.10-alpha.2 → 0.18.10-alpha.4

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 (101) 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 -1
  6. package/cjs/index.js +1 -1
  7. package/cjs/index.js.map +1 -1
  8. package/{es/marker/polar/area.d.ts → cjs/marker/arc-area.d.ts} +8 -8
  9. package/cjs/marker/{polar/area.js → arc-area.js} +18 -18
  10. package/cjs/marker/arc-area.js.map +1 -0
  11. package/cjs/marker/arc-line.d.ts +23 -0
  12. package/cjs/marker/{polar/arc-line.js → arc-line.js} +22 -26
  13. package/cjs/marker/arc-line.js.map +1 -0
  14. package/{es/marker/cartesian → cjs/marker}/area.d.ts +8 -8
  15. package/cjs/marker/{cartesian/area.js → area.js} +19 -19
  16. package/cjs/marker/area.js.map +1 -0
  17. package/cjs/marker/base.d.ts +1 -0
  18. package/cjs/marker/base.js +12 -26
  19. package/cjs/marker/base.js.map +1 -1
  20. package/cjs/marker/{base-line.d.ts → common-line.d.ts} +3 -2
  21. package/cjs/marker/{base-line.js → common-line.js} +11 -9
  22. package/cjs/marker/common-line.js.map +1 -0
  23. package/cjs/marker/config.d.ts +9 -9
  24. package/cjs/marker/config.js +9 -9
  25. package/cjs/marker/config.js.map +1 -1
  26. package/cjs/marker/index.d.ts +4 -4
  27. package/cjs/marker/index.js +3 -3
  28. package/cjs/marker/index.js.map +1 -1
  29. package/cjs/marker/line.d.ts +28 -0
  30. package/cjs/marker/{cartesian/line.js → line.js} +36 -40
  31. package/cjs/marker/line.js.map +1 -0
  32. package/cjs/marker/register.d.ts +4 -5
  33. package/cjs/marker/register.js +8 -12
  34. package/cjs/marker/register.js.map +1 -1
  35. package/cjs/marker/type.d.ts +23 -33
  36. package/cjs/marker/type.js +21 -22
  37. package/cjs/marker/type.js.map +1 -1
  38. package/cjs/util/interaction.d.ts +4 -0
  39. package/cjs/util/interaction.js +37 -0
  40. package/cjs/util/interaction.js.map +1 -0
  41. package/es/axis/base.js +7 -21
  42. package/es/axis/base.js.map +1 -1
  43. package/es/brush/brush.js +1 -2
  44. package/es/brush/type.js +2 -1
  45. package/es/index.d.ts +1 -1
  46. package/es/index.js +1 -1
  47. package/es/index.js.map +1 -1
  48. package/{cjs/marker/polar/area.d.ts → es/marker/arc-area.d.ts} +8 -8
  49. package/es/marker/{polar/area.js → arc-area.js} +23 -23
  50. package/es/marker/arc-area.js.map +1 -0
  51. package/es/marker/arc-line.d.ts +23 -0
  52. package/es/marker/{polar/arc-line.js → arc-line.js} +26 -30
  53. package/es/marker/arc-line.js.map +1 -0
  54. package/{cjs/marker/cartesian → es/marker}/area.d.ts +8 -8
  55. package/es/marker/{cartesian/area.js → area.js} +23 -23
  56. package/es/marker/area.js.map +1 -0
  57. package/es/marker/base.d.ts +1 -0
  58. package/es/marker/base.js +12 -30
  59. package/es/marker/base.js.map +1 -1
  60. package/es/marker/{base-line.d.ts → common-line.d.ts} +3 -2
  61. package/es/marker/{base-line.js → common-line.js} +9 -7
  62. package/es/marker/common-line.js.map +1 -0
  63. package/es/marker/config.d.ts +9 -9
  64. package/es/marker/config.js +9 -9
  65. package/es/marker/config.js.map +1 -1
  66. package/es/marker/index.d.ts +4 -4
  67. package/es/marker/index.js +4 -4
  68. package/es/marker/index.js.map +1 -1
  69. package/es/marker/line.d.ts +28 -0
  70. package/es/marker/{cartesian/line.js → line.js} +40 -44
  71. package/es/marker/line.js.map +1 -0
  72. package/es/marker/register.d.ts +4 -5
  73. package/es/marker/register.js +4 -8
  74. package/es/marker/register.js.map +1 -1
  75. package/es/marker/type.d.ts +23 -33
  76. package/es/marker/type.js +22 -23
  77. package/es/marker/type.js.map +1 -1
  78. package/es/util/interaction.d.ts +4 -0
  79. package/es/util/interaction.js +30 -0
  80. package/es/util/interaction.js.map +1 -0
  81. package/package.json +5 -5
  82. package/cjs/marker/base-line.js.map +0 -1
  83. package/cjs/marker/cartesian/area.js.map +0 -1
  84. package/cjs/marker/cartesian/line.d.ts +0 -27
  85. package/cjs/marker/cartesian/line.js.map +0 -1
  86. package/cjs/marker/polar/arc-line.d.ts +0 -22
  87. package/cjs/marker/polar/arc-line.js.map +0 -1
  88. package/cjs/marker/polar/area.js.map +0 -1
  89. package/cjs/marker/polar/line.d.ts +0 -1
  90. package/cjs/marker/polar/line.js +0 -3
  91. package/cjs/marker/polar/line.js.map +0 -1
  92. package/es/marker/base-line.js.map +0 -1
  93. package/es/marker/cartesian/area.js.map +0 -1
  94. package/es/marker/cartesian/line.d.ts +0 -27
  95. package/es/marker/cartesian/line.js.map +0 -1
  96. package/es/marker/polar/arc-line.d.ts +0 -22
  97. package/es/marker/polar/arc-line.js.map +0 -1
  98. package/es/marker/polar/area.js.map +0 -1
  99. package/es/marker/polar/line.d.ts +0 -1
  100. package/es/marker/polar/line.js +0 -3
  101. package/es/marker/polar/line.js.map +0 -1
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.CartesianMarkArea = 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");
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");
8
8
 
9
- (0, register_1.loadCartesianMarkAreaComponent)();
9
+ (0, register_1.loadMarkAreaComponent)();
10
10
 
11
- class CartesianMarkArea extends base_1.Marker {
11
+ class MarkArea extends base_1.Marker {
12
12
  getArea() {
13
13
  return this._area;
14
14
  }
@@ -16,24 +16,24 @@ class CartesianMarkArea extends base_1.Marker {
16
16
  return this._label;
17
17
  }
18
18
  constructor(attributes, options) {
19
- super((null == options ? void 0 : options.skipDefault) ? attributes : (0, vutils_1.merge)({}, CartesianMarkArea.defaultAttributes, attributes)),
20
- this.name = "cartesianMarkArea";
19
+ super((null == options ? void 0 : options.skipDefault) ? attributes : (0, vutils_1.merge)({}, MarkArea.defaultAttributes, attributes)),
20
+ this.name = "markArea";
21
21
  }
22
- getPositionByDirection(direction) {
22
+ getPointAttrByPosition(position) {
23
23
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
24
24
  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);
25
- return direction.includes("left") || direction.includes("Left") ? {
26
- x: x1 + (direction.includes("inside") ? .5 : -.5) * labelWidth,
25
+ return position.includes("left") || position.includes("Left") ? {
26
+ x: x1 + (position.includes("inside") ? .5 : -.5) * labelWidth,
27
27
  y: (y1 + y2) / 2
28
- } : direction.includes("right") || direction.includes("Right") ? {
29
- x: x2 + (direction.includes("inside") ? -.5 : .5) * labelWidth,
28
+ } : position.includes("right") || position.includes("Right") ? {
29
+ x: x2 + (position.includes("inside") ? -.5 : .5) * labelWidth,
30
30
  y: (y1 + y2) / 2
31
- } : direction.includes("top") || direction.includes("Top") ? {
31
+ } : position.includes("top") || position.includes("Top") ? {
32
32
  x: (x1 + x2) / 2,
33
- y: y1 + (direction.includes("inside") ? .5 : -.5) * labelHeight
34
- } : direction.includes("bottom") || direction.includes("Bottom") ? {
33
+ y: y1 + (position.includes("inside") ? .5 : -.5) * labelHeight
34
+ } : position.includes("bottom") || position.includes("Bottom") ? {
35
35
  x: (x1 + x2) / 2,
36
- y: y2 + (direction.includes("inside") ? -.5 : .5) * labelHeight
36
+ y: y2 + (position.includes("inside") ? -.5 : .5) * labelHeight
37
37
  } : {
38
38
  x: (x1 + x2) / 2,
39
39
  y: (y1 + y2) / 2
@@ -42,7 +42,7 @@ class CartesianMarkArea extends base_1.Marker {
42
42
  setLabelPos() {
43
43
  var _a;
44
44
  if (this._label && this._area) {
45
- const {label: label = {}} = this.attribute, labelPosition = null !== (_a = label.position) && void 0 !== _a ? _a : "middle", labelPoint = this.getPositionByDirection(labelPosition);
45
+ const {label: label = {}} = this.attribute, labelPosition = null !== (_a = label.position) && void 0 !== _a ? _a : "middle", labelPoint = this.getPointAttrByPosition(labelPosition);
46
46
  if (this._label.setAttributes(Object.assign({}, labelPoint)), this.attribute.limitRect && label.confine) {
47
47
  const {x: x, y: y, width: width, height: height} = this.attribute.limitRect;
48
48
  (0, limit_shape_1.limitShapeInBounds)(this._label, {
@@ -59,14 +59,14 @@ class CartesianMarkArea extends base_1.Marker {
59
59
  points: points
60
60
  }, areaStyle));
61
61
  area.states = (0, vutils_1.merge)({}, constant_1.DEFAULT_STATES, null == state ? void 0 : state.area),
62
- area.name = "mark-polygon-polygon", this._area = area, container.add(area);
62
+ area.name = "mark-area-polygon", this._area = area, container.add(area);
63
63
  const markLabel = new tag_1.Tag(Object.assign(Object.assign({}, label), {
64
64
  state: {
65
65
  panel: (0, vutils_1.merge)({}, constant_1.DEFAULT_STATES, null == state ? void 0 : state.labelBackground),
66
66
  text: (0, vutils_1.merge)({}, constant_1.DEFAULT_STATES, null == state ? void 0 : state.label)
67
67
  }
68
68
  }));
69
- markLabel.name = "mark-polygon-label", this._label = markLabel, container.add(markLabel),
69
+ markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel),
70
70
  this.setLabelPos();
71
71
  }
72
72
  updateMarker() {
@@ -88,5 +88,5 @@ class CartesianMarkArea extends base_1.Marker {
88
88
  }
89
89
  }
90
90
 
91
- exports.CartesianMarkArea = CartesianMarkArea, CartesianMarkArea.defaultAttributes = config_1.DEFAULT_CARTESIAN_MARK_AREA_THEME;
91
+ exports.MarkArea = MarkArea, MarkArea.defaultAttributes = config_1.DEFAULT_MARK_AREA_THEME;
92
92
  //# sourceMappingURL=area.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/marker/area.ts"],"names":[],"mappings":";;;AAEA,yDAAwD;AACxD,6CAAwD;AAGxD,gCAA6B;AAC7B,iCAAgC;AAChC,qCAAmD;AAEnD,qDAAyD;AAEzD,yCAAmD;AAEnD,0CAA6C;AAE7C,IAAA,gCAAqB,GAAE,CAAC;AACxB,MAAa,QAAS,SAAQ,aAAqB;IAIjD,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,YAAY,UAAy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CAAC;QACrE,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,CAAC,aAAa,iBACtB,MAAM,EAAE,MAAM,IACX,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,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,SAA0B,CAAC;QACnD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAChC,OAAO,KAAK,CAAC;SACd;QACD,IAAI,SAAS,GAAG,IAAI,CAAC;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;;AA/IH,4BAgJC;AA9IQ,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 { IMarkAreaLabelPosition, MarkAreaAttrs } 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';\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 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"]}
@@ -15,6 +15,7 @@ export declare abstract class Marker<T extends MarkerAttrs> extends AbstractComp
15
15
  protected abstract isValidPoints(): any;
16
16
  setAttribute(key: string, value: any, forceUpdateTag?: boolean | undefined): void;
17
17
  private _bindEvent;
18
+ private _releaseEvent;
18
19
  private _onHover;
19
20
  private _onUnHover;
20
21
  private _onClick;
@@ -4,32 +4,16 @@ 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"), constant_1 = require("../constant"), util_1 = require("../util"), vutils_1 = require("@visactor/vutils");
7
+ const vrender_core_1 = require("@visactor/vrender-core"), base_1 = require("../core/base"), interaction_1 = require("../util/interaction");
8
8
 
9
9
  class Marker extends base_1.AbstractComponent {
10
10
  constructor() {
11
11
  super(...arguments), this.name = "marker", this._onHover = e => {
12
- const target = e.target;
13
- target !== this._lastHover && target.name && !(0, vutils_1.isEmpty)(target.states) && (target.addState(constant_1.StateValue.hover, !0),
14
- (0, util_1.traverseGroup)(this._container, (node => {
15
- node !== target && node.name && !(0, vutils_1.isEmpty)(node.states) && node.addState(constant_1.StateValue.hoverReverse, !0);
16
- })), this._lastHover = target);
12
+ this._lastHover = (0, interaction_1.dispatchHoverState)(e, this._container, this._lastHover);
17
13
  }, this._onUnHover = e => {
18
- this._lastHover && ((0, util_1.traverseGroup)(this._container, (node => {
19
- node.name && !(0, vutils_1.isEmpty)(node.states) && (node.removeState(constant_1.StateValue.hoverReverse),
20
- node.removeState(constant_1.StateValue.hover));
21
- })), this._lastHover = null);
14
+ this._lastHover = (0, interaction_1.dispatchUnHoverState)(e, this._container, this._lastHover);
22
15
  }, this._onClick = e => {
23
- const target = e.target;
24
- if (this._lastSelect === target && target.hasState(constant_1.StateValue.selected)) return this._lastSelect = null,
25
- void (0, util_1.traverseGroup)(this._container, (node => {
26
- node.name && !(0, vutils_1.isEmpty)(node.states) && (node.removeState(constant_1.StateValue.selectedReverse),
27
- node.removeState(constant_1.StateValue.selected));
28
- }));
29
- target.name && !(0, vutils_1.isEmpty)(target.states) && (target.addState(constant_1.StateValue.selected, !0),
30
- (0, util_1.traverseGroup)(this._container, (node => {
31
- node !== target && node.name && !(0, vutils_1.isEmpty)(node.states) && node.addState(constant_1.StateValue.selectedReverse, !0);
32
- })), this._lastSelect = target);
16
+ this._lastSelect = (0, interaction_1.dispatchClickState)(e, this._container, this._lastSelect);
33
17
  };
34
18
  }
35
19
  setAttribute(key, value, forceUpdateTag) {
@@ -43,6 +27,12 @@ class Marker extends base_1.AbstractComponent {
43
27
  null === (_b = this._container) || void 0 === _b || _b.addEventListener("pointerout", this._onUnHover)),
44
28
  select && (null === (_c = this._container) || void 0 === _c || _c.addEventListener("pointerdown", this._onClick));
45
29
  }
30
+ _releaseEvent() {
31
+ var _a, _b, _c;
32
+ null === (_a = this._container) || void 0 === _a || _a.removeEventListener("pointermove", this._onHover),
33
+ null === (_b = this._container) || void 0 === _b || _b.removeEventListener("pointerout", this._onUnHover),
34
+ null === (_c = this._container) || void 0 === _c || _c.removeEventListener("pointerdown", this._onClick);
35
+ }
46
36
  _initContainer() {
47
37
  var _a, _b;
48
38
  const {limitRect: limitRect = {}, clipInRange: clipInRange} = this.attribute;
@@ -80,14 +70,10 @@ class Marker extends base_1.AbstractComponent {
80
70
  !1 === this.attribute.interactive && this.setAttribute("childrenPickable", !1),
81
71
  markerVisible && this.isValidPoints() ? this._container ? (this._updateContainer(),
82
72
  this.updateMarker()) : (this._initContainer(), this.initMarker(this._container)) : (this._container = null,
83
- this.removeAllChild(!0)), this._bindEvent();
73
+ this.removeAllChild(!0)), this._releaseEvent(), this._bindEvent();
84
74
  }
85
75
  release() {
86
- var _a, _b, _c;
87
- super.release(), null === (_a = this._container) || void 0 === _a || _a.removeEventListener("pointermove", this._onHover),
88
- null === (_b = this._container) || void 0 === _b || _b.removeEventListener("pointerout", this._onUnHover),
89
- null === (_c = this._container) || void 0 === _c || _c.removeEventListener("pointerdown", this._onClick),
90
- this._container = null;
76
+ super.release(), this._releaseEvent(), this._container = null;
91
77
  }
92
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AAE,KAAK,CAAC,CAAC;SAC9C;QAED,IAAI,aAAa,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;YACzC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;gBACpB,IAAI,CAAC,cAAc,EAAE,CAAC;gBACtB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;aAClC;iBAAM;gBACL,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACxB,IAAI,CAAC,YAAY,EAAE,CAAC;aACrB;SACF;aAAM;YACL,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;SAC3B;QAED,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,OAAO;;QACL,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,MAAA,IAAI,CAAC,UAAU,0CAAE,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,QAA8C,CAAC,CAAC;QACzG,MAAA,IAAI,CAAC,UAAU,0CAAE,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,UAAgD,CAAC,CAAC;QAC1G,MAAA,IAAI,CAAC,UAAU,0CAAE,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,QAA8C,CAAC,CAAC;QACzG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;CACF;AAnKD,wBAmKC","file":"base.js","sourcesContent":["import type { FederatedPointerEvent, IGraphic, IGroup } 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 { MarkerAttrs } from './type';\nimport { StateValue } from '../constant';\nimport { traverseGroup } from '../util';\nimport { isEmpty } from '@visactor/vutils';\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 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\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 _onHover = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGraphic;\n if (target !== this._lastHover && target.name && !isEmpty(target.states)) {\n target.addState(StateValue.hover, true);\n traverseGroup(this._container, (node: IGraphic) => {\n if (node !== target && node.name && !isEmpty(node.states)) {\n node.addState(StateValue.hoverReverse, true);\n }\n });\n this._lastHover = target;\n }\n };\n\n private _onUnHover = (e: FederatedPointerEvent) => {\n if (this._lastHover) {\n traverseGroup(this._container, (node: IGraphic) => {\n if (node.name && !isEmpty(node.states)) {\n node.removeState(StateValue.hoverReverse);\n node.removeState(StateValue.hover);\n }\n });\n this._lastHover = null;\n }\n };\n\n private _onClick = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGraphic;\n if (this._lastSelect === target && target.hasState(StateValue.selected)) {\n // 取消选中\n this._lastSelect = null;\n traverseGroup(this._container, (node: IGraphic) => {\n if (node.name && !isEmpty(node.states)) {\n node.removeState(StateValue.selectedReverse);\n node.removeState(StateValue.selected);\n }\n });\n return;\n }\n\n if (target.name && !isEmpty(target.states)) {\n target.addState(StateValue.selected, true);\n traverseGroup(this._container, (node: IGraphic) => {\n if (node !== target && node.name && !isEmpty(node.states)) {\n node.addState(StateValue.selectedReverse, true);\n }\n });\n this._lastSelect = target;\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 this._bindEvent();\n }\n\n release(): void {\n super.release();\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 this._container = null;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/marker/base.ts"],"names":[],"mappings":";;;AAEA,yDAAwD;AACxD,uCAAiD;AAMjD,qDAAmG;AAEnG,MAAsB,MAA8B,SAAQ,wBAA8B;IAA1F;;QACE,SAAI,GAAG,QAAQ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,cAAc,CAAC,IAAI,CAAC,CAAC;SAC3B;QAGD,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,OAAO;QACL,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;CACF;AAnID,wBAmIC","file":"base.js","sourcesContent":["import type { FederatedPointerEvent, IGraphic, IGroup } 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 { MarkerAttrs } from './type';\nimport { StateValue } from '../constant';\nimport { traverseGroup } from '../util';\nimport { isEmpty } from '@visactor/vutils';\nimport { dispatchClickState, dispatchHoverState, dispatchUnHoverState } from '../util/interaction';\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 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\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 // 因为标注本身不规则,所以默认将组件的 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 // 先把之前的event都release掉,否则会重复触发\n this._releaseEvent();\n this._bindEvent();\n }\n\n release(): void {\n super.release();\n this._releaseEvent();\n this._container = null;\n }\n}\n"]}
@@ -3,12 +3,13 @@ import type { ArcSegment, Segment } from '../segment';
3
3
  import { Tag } from '../tag';
4
4
  import type { CommonMarkLineAttrs } from './type';
5
5
  import { Marker } from './base';
6
- export declare abstract class BaseMarkLine<T> extends Marker<CommonMarkLineAttrs<T>> {
6
+ export declare abstract class MarkCommonLine<LineAttr, LabelPosition> extends Marker<CommonMarkLineAttrs<LineAttr, LabelPosition>> {
7
7
  name: string;
8
8
  protected _line: Segment | ArcSegment;
9
9
  protected abstract createSegment(): any;
10
10
  protected abstract setLineAttributes(): any;
11
- protected abstract getPositionByDirection(direction: any): any;
11
+ protected abstract getPointAttrByPosition(position: any): any;
12
+ protected abstract getRotateByAngle(angle: number): number;
12
13
  getLine(): Segment | ArcSegment;
13
14
  getLabel(): Tag;
14
15
  protected setLabelPos(): void;
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.BaseMarkLine = void 0;
5
+ }), exports.MarkCommonLine = void 0;
6
6
 
7
7
  const vutils_1 = require("@visactor/vutils"), tag_1 = require("../tag"), limit_shape_1 = require("../util/limit-shape"), constant_1 = require("../constant"), base_1 = require("./base");
8
8
 
9
- class BaseMarkLine extends base_1.Marker {
9
+ class MarkCommonLine extends base_1.Marker {
10
10
  constructor() {
11
- super(...arguments), this.name = "baseMarkLine";
11
+ super(...arguments), this.name = "markCommonLine";
12
12
  }
13
13
  getLine() {
14
14
  return this._line;
@@ -17,8 +17,10 @@ class BaseMarkLine extends base_1.Marker {
17
17
  return this._label;
18
18
  }
19
19
  setLabelPos() {
20
- const {label: label = {}, limitRect: limitRect} = this.attribute, {position: position = "end", refX: refX = 0, refY: refY = 0, confine: confine} = label, labelPoint = this.getPositionByDirection(position);
21
- if (this._label.setAttributes(Object.assign({}, labelPoint)), limitRect && confine) {
20
+ const {label: label = {}, limitRect: limitRect} = this.attribute, {position: position, confine: confine, autoRotate: autoRotate = !0} = label, labelPoint = this.getPointAttrByPosition(position);
21
+ if (this._label.setAttributes(Object.assign(Object.assign({}, labelPoint.position), {
22
+ angle: autoRotate ? this.getRotateByAngle(labelPoint.angle) : 0
23
+ })), limitRect && confine) {
22
24
  const {x: x, y: y, width: width, height: height} = limitRect;
23
25
  (0, limit_shape_1.limitShapeInBounds)(this._label, {
24
26
  x1: x,
@@ -30,14 +32,14 @@ class BaseMarkLine extends base_1.Marker {
30
32
  }
31
33
  initMarker(container) {
32
34
  const {label: label, state: state} = this.attribute, line = this.createSegment();
33
- line.name = "cartesian-mark-line-line", this._line = line, container.add(line);
35
+ line.name = "mark-common-line-line", this._line = line, container.add(line);
34
36
  const markLabel = new tag_1.Tag(Object.assign(Object.assign({}, label), {
35
37
  state: {
36
38
  panel: (0, vutils_1.merge)({}, constant_1.DEFAULT_STATES, null == state ? void 0 : state.labelBackground),
37
39
  text: (0, vutils_1.merge)({}, constant_1.DEFAULT_STATES, null == state ? void 0 : state.label)
38
40
  }
39
41
  }));
40
- markLabel.name = "cartesian-mark-line-label", this._label = markLabel, container.add(markLabel),
42
+ markLabel.name = "mark-common-line-label", this._label = markLabel, container.add(markLabel),
41
43
  this.setLabelPos();
42
44
  }
43
45
  updateMarker() {
@@ -49,5 +51,5 @@ class BaseMarkLine extends base_1.Marker {
49
51
  }
50
52
  }
51
53
 
52
- exports.BaseMarkLine = BaseMarkLine;
53
- //# sourceMappingURL=base-line.js.map
54
+ exports.MarkCommonLine = MarkCommonLine;
55
+ //# sourceMappingURL=common-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/marker/common-line.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AAIzC,gCAA6B;AAE7B,qDAAyD;AACzD,0CAA6C;AAC7C,iCAAgC;AAEhC,MAAsB,cAAwC,SAAQ,aAErE;IAFD;;QAGE,SAAI,GAAG,gBAAgB,CAAC;IAsE1B,CAAC;IA7DC,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CA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EAAE,yBAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,CAAC;gBACxD,IAAI,EAAE,IAAA,cAAK,EAAC,EAAE,EAAE,yBAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CAAC;aAC9C,IACD,CAAC;QACH,SAAS,CAAC,IAAI,GAAG,wBAAwB,CAAC;QAC1C,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,SAAS,CAAC,GAAG,CAAC,SAA6B,CAAC,CAAC;QAC7C,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAES,YAAY;QACpB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,SAAyD,CAAC;QAEjF,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAEzB,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,aAAa,iBACvB,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,IACD,KAAuB,EAC3B,CAAC;SACJ;QAED,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;CACF;AAzED,wCAyEC","file":"common-line.js","sourcesContent":["import type { IGroup, INode } from '@visactor/vrender-core';\nimport { merge } from '@visactor/vutils';\nimport type { ArcSegment, Segment } from '../segment';\nimport type { TagAttributes } from '../tag';\n// eslint-disable-next-line no-duplicate-imports\nimport { Tag } from '../tag';\nimport type { CommonMarkLineAttrs } from './type';\nimport { limitShapeInBounds } from '../util/limit-shape';\nimport { DEFAULT_STATES } from '../constant';\nimport { Marker } from './base';\n\nexport abstract class MarkCommonLine<LineAttr, LabelPosition> extends Marker<\n CommonMarkLineAttrs<LineAttr, LabelPosition>\n> {\n name = 'markCommonLine';\n\n protected _line!: Segment | ArcSegment;\n\n protected abstract createSegment(): any;\n protected abstract setLineAttributes(): any;\n protected abstract getPointAttrByPosition(position: any): any;\n protected abstract getRotateByAngle(angle: number): number;\n\n getLine() {\n return this._line;\n }\n getLabel() {\n return this._label;\n }\n\n protected setLabelPos() {\n const { label = {}, limitRect } = this.attribute;\n const { position, confine, autoRotate = true } = label;\n const labelPoint = this.getPointAttrByPosition(position);\n this._label.setAttributes({\n ...labelPoint.position,\n angle: autoRotate ? this.getRotateByAngle(labelPoint.angle) : 0\n });\n if (limitRect && confine) {\n const { x, y, width, height } = limitRect;\n limitShapeInBounds(this._label, {\n x1: x,\n y1: y,\n x2: x + width,\n y2: y + height\n });\n }\n }\n\n protected initMarker(container: IGroup) {\n const { label, state } = this.attribute as CommonMarkLineAttrs<LineAttr, LabelPosition>;\n const line = this.createSegment();\n line.name = 'mark-common-line-line';\n this._line = line;\n container.add(line as unknown as INode);\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-common-line-label';\n this._label = markLabel;\n container.add(markLabel as unknown as INode);\n this.setLabelPos();\n }\n\n protected updateMarker() {\n const { label } = this.attribute as CommonMarkLineAttrs<LineAttr, LabelPosition>;\n\n this.setLineAttributes();\n\n if (this._label) {\n this._label.setAttributes({\n dx: 0,\n dy: 0, // 需要进行复位\n ...(label as TagAttributes)\n });\n }\n\n this.setLabelPos();\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { TextAlignType, TextBaselineType } from '@visactor/vrender-core';
2
- import { ICartesianMarkAreaLabelPosition, ICartesianMarkLineLabelPosition, IPolarMarkLabelPosition } from './type';
3
- export declare const DEFAULT_CARTESIAN_MARK_LINE_THEME: {
2
+ import { IMarkAreaLabelPosition, IMarkLineLabelPosition, IMarkCommonArcLabelPosition } from './type';
3
+ export declare const DEFAULT_MARK_LINE_THEME: {
4
4
  interactive: boolean;
5
5
  startSymbol: {
6
6
  visible: boolean;
@@ -17,7 +17,7 @@ export declare const DEFAULT_CARTESIAN_MARK_LINE_THEME: {
17
17
  lineWidth: number;
18
18
  };
19
19
  label: {
20
- position: ICartesianMarkLineLabelPosition;
20
+ position: IMarkLineLabelPosition;
21
21
  refX: number;
22
22
  refY: number;
23
23
  refAngle: number;
@@ -45,7 +45,7 @@ export declare const DEFAULT_CARTESIAN_MARK_LINE_THEME: {
45
45
  lineDash: number[];
46
46
  };
47
47
  };
48
- export declare const DEFAULT_POLAR_MARK_LINE_THEME: {
48
+ export declare const DEFAULT_MARK_ARC_LINE_THEME: {
49
49
  interactive: boolean;
50
50
  startSymbol: {
51
51
  visible: boolean;
@@ -62,7 +62,7 @@ export declare const DEFAULT_POLAR_MARK_LINE_THEME: {
62
62
  lineWidth: number;
63
63
  };
64
64
  label: {
65
- position: IPolarMarkLabelPosition;
65
+ position: IMarkCommonArcLabelPosition;
66
66
  refX: number;
67
67
  refY: number;
68
68
  refAngle: number;
@@ -90,10 +90,10 @@ export declare const DEFAULT_POLAR_MARK_LINE_THEME: {
90
90
  lineDash: number[];
91
91
  };
92
92
  };
93
- export declare const DEFAULT_CARTESIAN_MARK_AREA_THEME: {
93
+ export declare const DEFAULT_MARK_AREA_THEME: {
94
94
  interactive: boolean;
95
95
  label: {
96
- position: ICartesianMarkAreaLabelPosition;
96
+ position: IMarkAreaLabelPosition;
97
97
  textStyle: {
98
98
  fill: string;
99
99
  stroke: string;
@@ -117,10 +117,10 @@ export declare const DEFAULT_CARTESIAN_MARK_AREA_THEME: {
117
117
  visible: boolean;
118
118
  };
119
119
  };
120
- export declare const DEFAULT_POLAR_MARK_AREA_THEME: {
120
+ export declare const DEFAULT_MARK_ARC_AREA_THEME: {
121
121
  interactive: boolean;
122
122
  label: {
123
- position: IPolarMarkLabelPosition;
123
+ position: IMarkCommonArcLabelPosition;
124
124
  textStyle: {
125
125
  fill: string;
126
126
  stroke: string;
@@ -2,11 +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_POLAR_MARK_AREA_THEME = exports.DEFAULT_CARTESIAN_MARK_AREA_THEME = exports.DEFAULT_POLAR_MARK_LINE_THEME = exports.DEFAULT_CARTESIAN_MARK_LINE_THEME = void 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;
6
6
 
7
7
  const type_1 = require("./type");
8
8
 
9
- exports.DEFAULT_CARTESIAN_MARK_LINE_THEME = {
9
+ exports.DEFAULT_MARK_LINE_THEME = {
10
10
  interactive: !0,
11
11
  startSymbol: {
12
12
  visible: !1,
@@ -23,7 +23,7 @@ exports.DEFAULT_CARTESIAN_MARK_LINE_THEME = {
23
23
  lineWidth: 0
24
24
  },
25
25
  label: {
26
- position: type_1.ICartesianMarkLineLabelPosition.end,
26
+ position: type_1.IMarkLineLabelPosition.end,
27
27
  refX: 0,
28
28
  refY: 0,
29
29
  refAngle: 0,
@@ -50,7 +50,7 @@ exports.DEFAULT_CARTESIAN_MARK_LINE_THEME = {
50
50
  lineWidth: 1,
51
51
  lineDash: [ 2 ]
52
52
  }
53
- }, exports.DEFAULT_POLAR_MARK_LINE_THEME = {
53
+ }, exports.DEFAULT_MARK_ARC_LINE_THEME = {
54
54
  interactive: !0,
55
55
  startSymbol: {
56
56
  visible: !1,
@@ -67,7 +67,7 @@ exports.DEFAULT_CARTESIAN_MARK_LINE_THEME = {
67
67
  lineWidth: 0
68
68
  },
69
69
  label: {
70
- position: type_1.IPolarMarkLabelPosition.arcOuterMiddle,
70
+ position: type_1.IMarkCommonArcLabelPosition.arcOuterMiddle,
71
71
  refX: 0,
72
72
  refY: 0,
73
73
  refAngle: 0,
@@ -94,10 +94,10 @@ exports.DEFAULT_CARTESIAN_MARK_LINE_THEME = {
94
94
  lineWidth: 1,
95
95
  lineDash: [ 2 ]
96
96
  }
97
- }, exports.DEFAULT_CARTESIAN_MARK_AREA_THEME = {
97
+ }, exports.DEFAULT_MARK_AREA_THEME = {
98
98
  interactive: !0,
99
99
  label: {
100
- position: type_1.ICartesianMarkAreaLabelPosition.right,
100
+ position: type_1.IMarkAreaLabelPosition.right,
101
101
  textStyle: {
102
102
  fill: "#fff",
103
103
  stroke: "#fff",
@@ -120,10 +120,10 @@ exports.DEFAULT_CARTESIAN_MARK_LINE_THEME = {
120
120
  fill: "#b2bacf",
121
121
  visible: !0
122
122
  }
123
- }, exports.DEFAULT_POLAR_MARK_AREA_THEME = {
123
+ }, exports.DEFAULT_MARK_ARC_AREA_THEME = {
124
124
  interactive: !0,
125
125
  label: {
126
- position: type_1.IPolarMarkLabelPosition.arcOuterMiddle,
126
+ position: type_1.IMarkCommonArcLabelPosition.arcOuterMiddle,
127
127
  textStyle: {
128
128
  fill: "#fff",
129
129
  stroke: "#fff",
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/marker/config.ts"],"names":[],"mappings":";;;AACA,iCAAmH;AAEtG,QAAA,iCAAiC,GAAG;IAC/C,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,sCAA+B,CAAC,GAAG;QAC7C,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,CAAC;QACX,SAA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extAlignType, TextBaselineType } from '@visactor/vrender-core';\nimport { ICartesianMarkAreaLabelPosition, ICartesianMarkLineLabelPosition, IPolarMarkLabelPosition } from './type';\n\nexport const DEFAULT_CARTESIAN_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: ICartesianMarkLineLabelPosition.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_POLAR_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: IPolarMarkLabelPosition.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_CARTESIAN_MARK_AREA_THEME = {\n interactive: true,\n label: {\n position: ICartesianMarkAreaLabelPosition.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_POLAR_MARK_AREA_THEME = {\n interactive: true,\n label: {\n position: IPolarMarkLabelPosition.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,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;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ACZ,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, 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,6 +1,6 @@
1
1
  export * from './type';
2
- export * from './cartesian/line';
3
- export * from './cartesian/area';
4
- export * from './polar/arc-line';
5
- export * from './polar/area';
2
+ export * from './line';
3
+ export * from './area';
4
+ export * from './arc-line';
5
+ export * from './arc-area';
6
6
  export * from './point';
@@ -17,7 +17,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), __exportStar(require("./type"), exports), __exportStar(require("./cartesian/line"), exports),
21
- __exportStar(require("./cartesian/area"), exports), __exportStar(require("./polar/arc-line"), exports),
22
- __exportStar(require("./polar/area"), exports), __exportStar(require("./point"), exports);
20
+ }), __exportStar(require("./type"), exports), __exportStar(require("./line"), exports),
21
+ __exportStar(require("./area"), exports), __exportStar(require("./arc-line"), exports),
22
+ __exportStar(require("./arc-area"), exports), __exportStar(require("./point"), exports);
23
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/marker/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,mDAAiC;AACjC,mDAAiC;AACjC,mDAAiC;AAEjC,+CAA6B;AAC7B,0CAAwB","file":"index.js","sourcesContent":["export * from './type';\nexport * from './cartesian/line';\nexport * from './cartesian/area';\nexport * from './polar/arc-line';\n// export * from './polar/line';\nexport * from './polar/area';\nexport * from './point';\n"]}
1
+ {"version":3,"sources":["../src/marker/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,6CAA2B;AAE3B,6CAA2B;AAC3B,0CAAwB","file":"index.js","sourcesContent":["export * from './type';\nexport * from './line';\nexport * from './area';\nexport * from './arc-line';\n// export * from './polar/line';\nexport * from './arc-area';\nexport * from './point';\n"]}
@@ -0,0 +1,28 @@
1
+ import { IMarkLineLabelPosition } from './type';
2
+ import type { MarkLineAttrs } from './type';
3
+ import type { ComponentOptions } from '../interface';
4
+ import { MarkCommonLine } from './common-line';
5
+ import type { ArcSegment } from '../segment';
6
+ import { Segment } from '../segment';
7
+ import type { ILineGraphicAttribute } from '@visactor/vrender-core';
8
+ export declare class MarkLine extends MarkCommonLine<ILineGraphicAttribute, IMarkLineLabelPosition> {
9
+ name: string;
10
+ static defaultAttributes: Partial<MarkLineAttrs>;
11
+ protected _line: Segment | ArcSegment;
12
+ constructor(attributes: MarkLineAttrs, options?: ComponentOptions);
13
+ protected getLabelOffsetByPosition(position: IMarkLineLabelPosition): {
14
+ offsetX: number;
15
+ offsetY: number;
16
+ };
17
+ protected getPointAttrByPosition(position: IMarkLineLabelPosition): {
18
+ position: {
19
+ x: number;
20
+ y: number;
21
+ };
22
+ angle: number;
23
+ };
24
+ protected getRotateByAngle(angle: number): number;
25
+ protected createSegment(): Segment;
26
+ protected setLineAttributes(): void;
27
+ protected isValidPoints(): boolean;
28
+ }