base.d.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { GUI } from '../../core';
  2. import { Group, Path } from '../../shapes';
  3. import type { Point } from '../../types';
  4. import { Tag } from '../tag';
  5. import type { CrosshairBaseStyleProps, CrosshairBaseOptions } from './types';
  6. export declare abstract class CrosshairBase<T extends CrosshairBaseStyleProps> extends GUI<T> {
  7. static tag: string;
  8. /**
  9. * 指针位置
  10. */
  11. protected pointer: Point;
  12. protected shapesGroup: Group;
  13. protected tagShape: Tag;
  14. protected crosshairShape: Path;
  15. /**
  16. * 获得 pointer 的相对坐标
  17. */
  18. protected get localPointer(): number[];
  19. /**
  20. * 获得 crosshair 的 path
  21. */
  22. protected abstract get crosshairPath(): any[];
  23. private get tagStyle();
  24. private get crosshairStyle();
  25. constructor(options: CrosshairBaseOptions);
  26. render(attributes: CrosshairBaseStyleProps, container: Group): void;
  27. /**
  28. * 设置当前指针的位置
  29. * 1. 线条类型 调整位置即可
  30. * 2. circle 和 polygon 需要重新计算 path
  31. */
  32. setPointer(pointer: Point): void;
  33. /**
  34. * 调整tag
  35. */
  36. protected abstract adjustLayout(): void;
  37. }