line.d.ts 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. import { vec2 } from '@antv/matrix-util';
  2. import { ILocation } from '../interfaces';
  3. import { BBox, LineAxisCfg, Point, RegionLocationCfg } from '../types';
  4. import AxisBase from './base';
  5. declare class Line extends AxisBase<LineAxisCfg> implements ILocation<RegionLocationCfg> {
  6. getDefaultCfg(): {
  7. type: string;
  8. locationType: string;
  9. /**
  10. * 起始点, x, y
  11. * @type {object}
  12. */
  13. start: any;
  14. /**
  15. * 结束点, x, y
  16. * @type {object}
  17. */
  18. end: any;
  19. name: string;
  20. ticks: any[];
  21. line: {};
  22. tickLine: {};
  23. subTickLine: any;
  24. title: any;
  25. label: {};
  26. verticalFactor: number;
  27. verticalLimitLength: any;
  28. overlapOrder: string[];
  29. tickStates: {};
  30. optimize: {};
  31. defaultCfg: {
  32. line: {
  33. style: {
  34. lineWidth: number;
  35. stroke: string;
  36. };
  37. };
  38. tickLine: {
  39. style: {
  40. lineWidth: number;
  41. stroke: string;
  42. };
  43. alignTick: boolean;
  44. length: number;
  45. displayWithLabel: boolean;
  46. };
  47. subTickLine: {
  48. style: {
  49. lineWidth: number;
  50. stroke: string;
  51. };
  52. count: number;
  53. length: number;
  54. };
  55. label: {
  56. autoRotate: boolean;
  57. autoHide: boolean;
  58. autoEllipsis: boolean;
  59. style: {
  60. fontSize: number;
  61. fill: string;
  62. fontFamily: string;
  63. fontWeight: string;
  64. };
  65. offset: number;
  66. offsetX: number;
  67. offsetY: number;
  68. };
  69. title: {
  70. autoRotate: boolean;
  71. spacing: number;
  72. position: string;
  73. style: {
  74. fontSize: number;
  75. fill: string;
  76. textBaseline: string;
  77. fontFamily: string;
  78. textAlign: string;
  79. };
  80. iconStyle: {
  81. fill: string;
  82. stroke: string;
  83. };
  84. description: string;
  85. };
  86. tickStates: {
  87. active: {
  88. labelStyle: {
  89. fontWeight: number;
  90. };
  91. tickLineStyle: {
  92. lineWidth: number;
  93. };
  94. };
  95. inactive: {
  96. labelStyle: {
  97. fill: string;
  98. };
  99. };
  100. };
  101. optimize: {
  102. enable: boolean;
  103. threshold: number;
  104. };
  105. };
  106. theme: {};
  107. container: any;
  108. shapesMap: {};
  109. group: any;
  110. capture: boolean;
  111. isRegister: boolean;
  112. isUpdating: boolean;
  113. isInit: boolean;
  114. id: string;
  115. offsetX: number;
  116. offsetY: number;
  117. animate: boolean;
  118. updateAutoRender: boolean;
  119. animateOption: {
  120. appear: any;
  121. update: {
  122. duration: number;
  123. easing: string;
  124. };
  125. enter: {
  126. duration: number;
  127. easing: string;
  128. };
  129. leave: {
  130. duration: number;
  131. easing: string;
  132. };
  133. };
  134. events: any;
  135. visible: boolean;
  136. };
  137. getLinePath(): any[];
  138. protected getInnerLayoutBBox(): BBox;
  139. protected isVertical(): boolean;
  140. protected isHorizontal(): boolean;
  141. protected getTickPoint(tickValue: number): Point;
  142. protected getSideVector(offset: number): vec2;
  143. protected getAxisVector(): [number, number];
  144. protected processOverlap(labelGroup: any): void;
  145. /**
  146. * 是否可以执行某一 overlap
  147. * @param name
  148. */
  149. private canProcessOverlap;
  150. private autoProcessOverlap;
  151. }
  152. export default Line;