base.d.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import { IGroup } from '@antv/g-base';
  2. import GroupComponent from '../abstract/group-component';
  3. import { CrosshairBaseCfg, Point } from '../types';
  4. declare abstract class CrosshairBase<T extends CrosshairBaseCfg = CrosshairBaseCfg> extends GroupComponent {
  5. getDefaultCfg(): {
  6. name: string;
  7. type: string;
  8. line: {};
  9. text: any;
  10. textBackground: {};
  11. capture: boolean;
  12. defaultCfg: {
  13. line: {
  14. style: {
  15. lineWidth: number;
  16. stroke: string;
  17. };
  18. };
  19. text: {
  20. position: string;
  21. offset: number;
  22. autoRotate: boolean;
  23. content: any;
  24. style: {
  25. fill: string;
  26. textAlign: string;
  27. textBaseline: string;
  28. fontFamily: string;
  29. };
  30. };
  31. textBackground: {
  32. padding: number;
  33. style: {
  34. stroke: string;
  35. };
  36. };
  37. };
  38. container: any;
  39. shapesMap: {};
  40. group: any;
  41. isRegister: boolean;
  42. isUpdating: boolean;
  43. isInit: boolean;
  44. id: string;
  45. locationType: string;
  46. offsetX: number;
  47. offsetY: number;
  48. animate: boolean;
  49. updateAutoRender: boolean;
  50. animateOption: {
  51. appear: any;
  52. update: {
  53. duration: number;
  54. easing: string;
  55. };
  56. enter: {
  57. duration: number;
  58. easing: string;
  59. };
  60. leave: {
  61. duration: number;
  62. easing: string;
  63. };
  64. };
  65. events: any;
  66. visible: boolean;
  67. };
  68. protected renderInner(group: IGroup): void;
  69. /**
  70. * @protected
  71. * 获取文本点的位置
  72. * @return {Point} 文本的位置
  73. */
  74. protected abstract getTextPoint(): Point;
  75. protected abstract getRotateAngle(): number;
  76. protected renderText(group: IGroup): void;
  77. protected abstract getLinePath(): any[];
  78. protected renderLine(group: IGroup): void;
  79. private renderBackground;
  80. }
  81. export default CrosshairBase;