@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
@@ -1,14 +1,14 @@
1
1
  import type { IGroup, IPolygon } from '@visactor/vrender-core';
2
- import { Tag } from '../../tag';
3
- import { Marker } from '../base';
4
- import type { CartesianMarkAreaAttrs } from '../type';
5
- import type { ComponentOptions } from '../../interface';
6
- export declare class CartesianMarkArea extends Marker<CartesianMarkAreaAttrs> {
2
+ import { Tag } from '../tag';
3
+ import { Marker } from './base';
4
+ import type { IMarkAreaLabelPosition, MarkAreaAttrs } from './type';
5
+ import type { ComponentOptions } from '../interface';
6
+ export declare class MarkArea extends Marker<MarkAreaAttrs> {
7
7
  name: string;
8
8
  static defaultAttributes: {
9
9
  interactive: boolean;
10
10
  label: {
11
- position: import("../type").ICartesianMarkAreaLabelPosition;
11
+ position: IMarkAreaLabelPosition;
12
12
  textStyle: {
13
13
  fill: string;
14
14
  stroke: string;
@@ -35,8 +35,8 @@ export declare class CartesianMarkArea extends Marker<CartesianMarkAreaAttrs> {
35
35
  private _area;
36
36
  getArea(): IPolygon;
37
37
  getLabel(): Tag;
38
- constructor(attributes: CartesianMarkAreaAttrs, options?: ComponentOptions);
39
- protected getPositionByDirection(direction: string): {
38
+ constructor(attributes: MarkAreaAttrs, options?: ComponentOptions);
39
+ protected getPointAttrByPosition(position: IMarkAreaLabelPosition): {
40
40
  x: number;
41
41
  y: number;
42
42
  };
@@ -2,21 +2,21 @@ import { graphicCreator } from "@visactor/vrender-core";
2
2
 
3
3
  import { isValidNumber, merge } from "@visactor/vutils";
4
4
 
5
- import { Tag } from "../../tag";
5
+ import { Tag } from "../tag";
6
6
 
7
- import { Marker } from "../base";
7
+ import { Marker } from "./base";
8
8
 
9
- import { DEFAULT_CARTESIAN_MARK_AREA_THEME } from "../config";
9
+ import { DEFAULT_MARK_AREA_THEME } from "./config";
10
10
 
11
- import { limitShapeInBounds } from "../../util/limit-shape";
11
+ import { limitShapeInBounds } from "../util/limit-shape";
12
12
 
13
- import { loadCartesianMarkAreaComponent } from "../register";
13
+ import { loadMarkAreaComponent } from "./register";
14
14
 
15
- import { DEFAULT_STATES } from "../../constant";
15
+ import { DEFAULT_STATES } from "../constant";
16
16
 
17
- loadCartesianMarkAreaComponent();
17
+ loadMarkAreaComponent();
18
18
 
19
- export class CartesianMarkArea extends Marker {
19
+ export class MarkArea extends Marker {
20
20
  getArea() {
21
21
  return this._area;
22
22
  }
@@ -24,24 +24,24 @@ export class CartesianMarkArea extends Marker {
24
24
  return this._label;
25
25
  }
26
26
  constructor(attributes, options) {
27
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, CartesianMarkArea.defaultAttributes, attributes)),
28
- this.name = "cartesianMarkArea";
27
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArea.defaultAttributes, attributes)),
28
+ this.name = "markArea";
29
29
  }
30
- getPositionByDirection(direction) {
30
+ getPointAttrByPosition(position) {
31
31
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
32
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 direction.includes("left") || direction.includes("Left") ? {
34
- x: x1 + (direction.includes("inside") ? .5 : -.5) * labelWidth,
33
+ return position.includes("left") || position.includes("Left") ? {
34
+ x: x1 + (position.includes("inside") ? .5 : -.5) * labelWidth,
35
35
  y: (y1 + y2) / 2
36
- } : direction.includes("right") || direction.includes("Right") ? {
37
- x: x2 + (direction.includes("inside") ? -.5 : .5) * labelWidth,
36
+ } : position.includes("right") || position.includes("Right") ? {
37
+ x: x2 + (position.includes("inside") ? -.5 : .5) * labelWidth,
38
38
  y: (y1 + y2) / 2
39
- } : direction.includes("top") || direction.includes("Top") ? {
39
+ } : position.includes("top") || position.includes("Top") ? {
40
40
  x: (x1 + x2) / 2,
41
- y: y1 + (direction.includes("inside") ? .5 : -.5) * labelHeight
42
- } : direction.includes("bottom") || direction.includes("Bottom") ? {
41
+ y: y1 + (position.includes("inside") ? .5 : -.5) * labelHeight
42
+ } : position.includes("bottom") || position.includes("Bottom") ? {
43
43
  x: (x1 + x2) / 2,
44
- y: y2 + (direction.includes("inside") ? -.5 : .5) * labelHeight
44
+ y: y2 + (position.includes("inside") ? -.5 : .5) * labelHeight
45
45
  } : {
46
46
  x: (x1 + x2) / 2,
47
47
  y: (y1 + y2) / 2
@@ -50,7 +50,7 @@ export class CartesianMarkArea extends Marker {
50
50
  setLabelPos() {
51
51
  var _a;
52
52
  if (this._label && this._area) {
53
- const {label: label = {}} = this.attribute, labelPosition = null !== (_a = label.position) && void 0 !== _a ? _a : "middle", labelPoint = this.getPositionByDirection(labelPosition);
53
+ const {label: label = {}} = this.attribute, labelPosition = null !== (_a = label.position) && void 0 !== _a ? _a : "middle", labelPoint = this.getPointAttrByPosition(labelPosition);
54
54
  if (this._label.setAttributes(Object.assign({}, labelPoint)), this.attribute.limitRect && label.confine) {
55
55
  const {x: x, y: y, width: width, height: height} = this.attribute.limitRect;
56
56
  limitShapeInBounds(this._label, {
@@ -66,7 +66,7 @@ export class CartesianMarkArea extends Marker {
66
66
  const {points: points, label: label, areaStyle: areaStyle, state: state} = this.attribute, area = graphicCreator.polygon(Object.assign({
67
67
  points: points
68
68
  }, areaStyle));
69
- area.states = merge({}, DEFAULT_STATES, null == state ? void 0 : state.area), area.name = "mark-polygon-polygon",
69
+ area.states = merge({}, DEFAULT_STATES, null == state ? void 0 : state.area), area.name = "mark-area-polygon",
70
70
  this._area = area, container.add(area);
71
71
  const markLabel = new Tag(Object.assign(Object.assign({}, label), {
72
72
  state: {
@@ -74,7 +74,7 @@ export class CartesianMarkArea extends Marker {
74
74
  text: merge({}, DEFAULT_STATES, null == state ? void 0 : state.label)
75
75
  }
76
76
  }));
77
- markLabel.name = "mark-polygon-label", this._label = markLabel, container.add(markLabel),
77
+ markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel),
78
78
  this.setLabelPos();
79
79
  }
80
80
  updateMarker() {
@@ -96,5 +96,5 @@ export class CartesianMarkArea extends Marker {
96
96
  }
97
97
  }
98
98
 
99
- CartesianMarkArea.defaultAttributes = DEFAULT_CARTESIAN_MARK_AREA_THEME;
99
+ MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME;
100
100
  //# sourceMappingURL=area.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/marker/area.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,qBAAqB,EAAE,CAAC;AACxB,MAAM,OAAO,QAAS,SAAQ,MAAqB;IAIjD,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,YAAY,UAAyB,EAAE,OAA0B;QAC/D,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,CAAC,iBAAiB,EAAE,UAAU,CA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AAC,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,aAAa,CAAE,KAAe,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAE,KAAe,CAAC,CAAC,CAAC,EAAE;gBAC5E,SAAS,GAAG,KAAK,CAAC;gBAClB,OAAO;aACR;QACH,CAAC,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;IACnB,CAAC;;AA7IM,0BAAiB,GAAG,uBAAuB,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;
package/es/marker/base.js CHANGED
@@ -2,36 +2,16 @@ import { graphicCreator } from "@visactor/vrender-core";
2
2
 
3
3
  import { AbstractComponent } from "../core/base";
4
4
 
5
- import { StateValue } from "../constant";
6
-
7
- import { traverseGroup } from "../util";
8
-
9
- import { isEmpty } from "@visactor/vutils";
5
+ import { dispatchClickState, dispatchHoverState, dispatchUnHoverState } from "../util/interaction";
10
6
 
11
7
  export class Marker extends AbstractComponent {
12
8
  constructor() {
13
9
  super(...arguments), this.name = "marker", this._onHover = e => {
14
- const target = e.target;
15
- target !== this._lastHover && target.name && !isEmpty(target.states) && (target.addState(StateValue.hover, !0),
16
- traverseGroup(this._container, (node => {
17
- node !== target && node.name && !isEmpty(node.states) && node.addState(StateValue.hoverReverse, !0);
18
- })), this._lastHover = target);
10
+ this._lastHover = dispatchHoverState(e, this._container, this._lastHover);
19
11
  }, this._onUnHover = e => {
20
- this._lastHover && (traverseGroup(this._container, (node => {
21
- node.name && !isEmpty(node.states) && (node.removeState(StateValue.hoverReverse),
22
- node.removeState(StateValue.hover));
23
- })), this._lastHover = null);
12
+ this._lastHover = dispatchUnHoverState(e, this._container, this._lastHover);
24
13
  }, this._onClick = e => {
25
- const target = e.target;
26
- if (this._lastSelect === target && target.hasState(StateValue.selected)) return this._lastSelect = null,
27
- void traverseGroup(this._container, (node => {
28
- node.name && !isEmpty(node.states) && (node.removeState(StateValue.selectedReverse),
29
- node.removeState(StateValue.selected));
30
- }));
31
- target.name && !isEmpty(target.states) && (target.addState(StateValue.selected, !0),
32
- traverseGroup(this._container, (node => {
33
- node !== target && node.name && !isEmpty(node.states) && node.addState(StateValue.selectedReverse, !0);
34
- })), this._lastSelect = target);
14
+ this._lastSelect = dispatchClickState(e, this._container, this._lastSelect);
35
15
  };
36
16
  }
37
17
  setAttribute(key, value, forceUpdateTag) {
@@ -45,6 +25,12 @@ export class Marker extends AbstractComponent {
45
25
  null === (_b = this._container) || void 0 === _b || _b.addEventListener("pointerout", this._onUnHover)),
46
26
  select && (null === (_c = this._container) || void 0 === _c || _c.addEventListener("pointerdown", this._onClick));
47
27
  }
28
+ _releaseEvent() {
29
+ var _a, _b, _c;
30
+ null === (_a = this._container) || void 0 === _a || _a.removeEventListener("pointermove", this._onHover),
31
+ null === (_b = this._container) || void 0 === _b || _b.removeEventListener("pointerout", this._onUnHover),
32
+ null === (_c = this._container) || void 0 === _c || _c.removeEventListener("pointerdown", this._onClick);
33
+ }
48
34
  _initContainer() {
49
35
  var _a, _b;
50
36
  const {limitRect: limitRect = {}, clipInRange: clipInRange} = this.attribute;
@@ -82,14 +68,10 @@ export class Marker extends AbstractComponent {
82
68
  !1 === this.attribute.interactive && this.setAttribute("childrenPickable", !1),
83
69
  markerVisible && this.isValidPoints() ? this._container ? (this._updateContainer(),
84
70
  this.updateMarker()) : (this._initContainer(), this.initMarker(this._container)) : (this._container = null,
85
- this.removeAllChild(!0)), this._bindEvent();
71
+ this.removeAllChild(!0)), this._releaseEvent(), this._bindEvent();
86
72
  }
87
73
  release() {
88
- var _a, _b, _c;
89
- super.release(), null === (_a = this._container) || void 0 === _a || _a.removeEventListener("pointermove", this._onHover),
90
- null === (_b = this._container) || void 0 === _b || _b.removeEventListener("pointerout", this._onUnHover),
91
- null === (_c = this._container) || void 0 === _c || _c.removeEventListener("pointerdown", this._onClick),
92
- this._container = null;
74
+ super.release(), this._releaseEvent(), this._container = null;
93
75
  }
94
76
  }
95
77
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/marker/base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,OAAgB,MAA8B,SAAQ,iBAA8B;IAA1F;;QACE,SAAI,GAAG,QAAQ,CAAC;QAoCR,aAAQ,GAAG,CAAC,CAAwB,EAAE,EAAE;YAC9C,MAA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AC;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","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,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMjD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEnG,MAAM,OAAgB,MAA8B,SAAQ,iBAA8B;IAA1F;;QACE,SAAI,GAAG,QAAQ,CAAC;QA0CR,aAAQ,GAAG,CAAC,CAAwB,EAAE,EAAE;YAC9C,IAAI,CAAC,UAAU,GAAG,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC5E,CAAC,CAAC;QAEM,eAAU,GAAG,CAAC,CAAwB,EAAE,EAAE;YAChD,IAAI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F","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;
@@ -8,9 +8,9 @@ import { DEFAULT_STATES } from "../constant";
8
8
 
9
9
  import { Marker } from "./base";
10
10
 
11
- export class BaseMarkLine extends Marker {
11
+ export class MarkCommonLine extends Marker {
12
12
  constructor() {
13
- super(...arguments), this.name = "baseMarkLine";
13
+ super(...arguments), this.name = "markCommonLine";
14
14
  }
15
15
  getLine() {
16
16
  return this._line;
@@ -19,8 +19,10 @@ export class BaseMarkLine extends Marker {
19
19
  return this._label;
20
20
  }
21
21
  setLabelPos() {
22
- const {label: label = {}, limitRect: limitRect} = this.attribute, {position: position = "end", refX: refX = 0, refY: refY = 0, confine: confine} = label, labelPoint = this.getPositionByDirection(position);
23
- if (this._label.setAttributes(Object.assign({}, labelPoint)), limitRect && confine) {
22
+ const {label: label = {}, limitRect: limitRect} = this.attribute, {position: position, confine: confine, autoRotate: autoRotate = !0} = label, labelPoint = this.getPointAttrByPosition(position);
23
+ if (this._label.setAttributes(Object.assign(Object.assign({}, labelPoint.position), {
24
+ angle: autoRotate ? this.getRotateByAngle(labelPoint.angle) : 0
25
+ })), limitRect && confine) {
24
26
  const {x: x, y: y, width: width, height: height} = limitRect;
25
27
  limitShapeInBounds(this._label, {
26
28
  x1: x,
@@ -32,14 +34,14 @@ export class BaseMarkLine extends Marker {
32
34
  }
33
35
  initMarker(container) {
34
36
  const {label: label, state: state} = this.attribute, line = this.createSegment();
35
- line.name = "cartesian-mark-line-line", this._line = line, container.add(line);
37
+ line.name = "mark-common-line-line", this._line = line, container.add(line);
36
38
  const markLabel = new Tag(Object.assign(Object.assign({}, label), {
37
39
  state: {
38
40
  panel: merge({}, DEFAULT_STATES, null == state ? void 0 : state.labelBackground),
39
41
  text: merge({}, DEFAULT_STATES, null == state ? void 0 : state.label)
40
42
  }
41
43
  }));
42
- markLabel.name = "cartesian-mark-line-label", this._label = markLabel, container.add(markLabel),
44
+ markLabel.name = "mark-common-line-label", this._label = markLabel, container.add(markLabel),
43
45
  this.setLabelPos();
44
46
  }
45
47
  updateMarker() {
@@ -50,4 +52,4 @@ export class BaseMarkLine extends Marker {
50
52
  }, label)), this.setLabelPos();
51
53
  }
52
54
  }
53
- //# sourceMappingURL=base-line.js.map
55
+ //# sourceMappingURL=common-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/marker/common-line.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAIzC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,OAAgB,cAAwC,SAAQ,MAErE;IAFD;;QAGE,SAAI,GAAG,gBAAgB,CAAC;IAsE1B,CAAC;IA7DC,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IACD,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAES,WAAW;QACnB,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QACjD,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QACvD,MAAM,UAAU,GAAG,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,CAAC,aAAa,iCACpB,UAAU,CAAC,QAA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Y;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","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;
@@ -1,6 +1,6 @@
1
- import { ICartesianMarkAreaLabelPosition, ICartesianMarkLineLabelPosition, IPolarMarkLabelPosition } from "./type";
1
+ import { IMarkAreaLabelPosition, IMarkLineLabelPosition, IMarkCommonArcLabelPosition } from "./type";
2
2
 
3
- export const DEFAULT_CARTESIAN_MARK_LINE_THEME = {
3
+ export const DEFAULT_MARK_LINE_THEME = {
4
4
  interactive: !0,
5
5
  startSymbol: {
6
6
  visible: !1,
@@ -17,7 +17,7 @@ export const DEFAULT_CARTESIAN_MARK_LINE_THEME = {
17
17
  lineWidth: 0
18
18
  },
19
19
  label: {
20
- position: ICartesianMarkLineLabelPosition.end,
20
+ position: IMarkLineLabelPosition.end,
21
21
  refX: 0,
22
22
  refY: 0,
23
23
  refAngle: 0,
@@ -46,7 +46,7 @@ export const DEFAULT_CARTESIAN_MARK_LINE_THEME = {
46
46
  }
47
47
  };
48
48
 
49
- export const DEFAULT_POLAR_MARK_LINE_THEME = {
49
+ export const DEFAULT_MARK_ARC_LINE_THEME = {
50
50
  interactive: !0,
51
51
  startSymbol: {
52
52
  visible: !1,
@@ -63,7 +63,7 @@ export const DEFAULT_POLAR_MARK_LINE_THEME = {
63
63
  lineWidth: 0
64
64
  },
65
65
  label: {
66
- position: IPolarMarkLabelPosition.arcOuterMiddle,
66
+ position: IMarkCommonArcLabelPosition.arcOuterMiddle,
67
67
  refX: 0,
68
68
  refY: 0,
69
69
  refAngle: 0,
@@ -92,10 +92,10 @@ export const DEFAULT_POLAR_MARK_LINE_THEME = {
92
92
  }
93
93
  };
94
94
 
95
- export const DEFAULT_CARTESIAN_MARK_AREA_THEME = {
95
+ export const DEFAULT_MARK_AREA_THEME = {
96
96
  interactive: !0,
97
97
  label: {
98
- position: ICartesianMarkAreaLabelPosition.right,
98
+ position: IMarkAreaLabelPosition.right,
99
99
  textStyle: {
100
100
  fill: "#fff",
101
101
  stroke: "#fff",
@@ -120,10 +120,10 @@ export const DEFAULT_CARTESIAN_MARK_AREA_THEME = {
120
120
  }
121
121
  };
122
122
 
123
- export const DEFAULT_POLAR_MARK_AREA_THEME = {
123
+ export const DEFAULT_MARK_ARC_AREA_THEME = {
124
124
  interactive: !0,
125
125
  label: {
126
- position: IPolarMarkLabelPosition.arcOuterMiddle,
126
+ position: 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,OAAO,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AAEnH,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE;QACX,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,EAAE;QACR,IAAI,EAA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IACD,MAAM,EAAE;QACN,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,MAAM,EAAE;QACN,SAAS,EAAE,MAAM;QACjB,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 { 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 textBase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AAE,EAAE,CAAC;YACL,EAAE,EAAE,CAAC;SACN;QACD,UAAU,EAAE;YACV,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACX;QACD,aAAa,EAAE;YACb,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;SACZ;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAK1C;IACF,GAAG,EAAE;QACH,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,QAAQ;KACvB;IACD,MAAM,EAAE;QACN,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,MAAM,EAAE;QACN,SAAS,EAAE,MAAM;QACjB,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, 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';
@@ -1,12 +1,12 @@
1
1
  export * from "./type";
2
2
 
3
- export * from "./cartesian/line";
3
+ export * from "./line";
4
4
 
5
- export * from "./cartesian/area";
5
+ export * from "./area";
6
6
 
7
- export * from "./polar/arc-line";
7
+ export * from "./arc-line";
8
8
 
9
- export * from "./polar/area";
9
+ export * from "./arc-area";
10
10
 
11
11
  export * from "./point";
12
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/marker/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC","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,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAE3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC","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
+ }