base.d.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import { IGroup } from '@antv/g-base';
  2. import GroupComponent from '../abstract/group-component';
  3. import { ILocation } from '../interfaces';
  4. import { BBox, LegendBaseCfg, Point, PointLocationCfg } from '../types';
  5. declare abstract class LegendBase<T extends LegendBaseCfg = LegendBaseCfg> extends GroupComponent implements ILocation<PointLocationCfg> {
  6. getDefaultCfg(): {
  7. name: string;
  8. /**
  9. * 布局方式: horizontal,vertical
  10. * @type {String}
  11. */
  12. layout: string;
  13. locationType: string;
  14. x: number;
  15. y: number;
  16. offsetX: number;
  17. offsetY: number;
  18. title: any;
  19. background: any;
  20. container: any;
  21. shapesMap: {};
  22. group: any;
  23. capture: boolean;
  24. isRegister: boolean;
  25. isUpdating: boolean;
  26. isInit: boolean;
  27. id: string;
  28. type: string;
  29. animate: boolean;
  30. updateAutoRender: boolean;
  31. animateOption: {
  32. appear: any;
  33. update: {
  34. duration: number;
  35. easing: string;
  36. };
  37. enter: {
  38. duration: number;
  39. easing: string;
  40. };
  41. leave: {
  42. duration: number;
  43. easing: string;
  44. };
  45. };
  46. events: any;
  47. defaultCfg: {};
  48. visible: boolean;
  49. };
  50. getLayoutBBox(): BBox;
  51. setLocation(cfg: PointLocationCfg): void;
  52. protected resetLocation(): void;
  53. protected applyOffset(): void;
  54. protected getDrawPoint(): Point;
  55. protected setDrawPoint(point: Point): void;
  56. protected renderInner(group: IGroup): void;
  57. protected abstract drawLegendContent(group: any): any;
  58. protected drawBackground(group: IGroup): void;
  59. protected drawTitle(group: IGroup): void;
  60. private resetDraw;
  61. }
  62. export default LegendBase;