7176ea863309b27a6b332a854915db003ae4bcfeb103d9387a0c3d241e3c654180af005d3b35cf3aa0ee4eb80d9f742b340e83bf1f1014dd7dfb4c5fb3ddca 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import Axis from '../Axis.js';
  2. import { DimensionName, OrdinalSortInfo } from '../../util/types.js';
  3. import Scale from '../../scale/Scale.js';
  4. import CartesianAxisModel, { CartesianAxisPosition } from './AxisModel.js';
  5. import Grid from './Grid.js';
  6. import { OptionAxisType } from '../axisCommonTypes.js';
  7. interface Axis2D {
  8. /**
  9. * Transform global coord to local coord,
  10. * i.e. let localCoord = axis.toLocalCoord(80);
  11. */
  12. toLocalCoord(coord: number): number;
  13. /**
  14. * Transform global coord to local coord,
  15. * i.e. let globalCoord = axis.toLocalCoord(40);
  16. */
  17. toGlobalCoord(coord: number): number;
  18. }
  19. declare class Axis2D extends Axis {
  20. /**
  21. * Axis position
  22. * - 'top'
  23. * - 'bottom'
  24. * - 'left'
  25. * - 'right'
  26. */
  27. readonly position: CartesianAxisPosition;
  28. /**
  29. * Index of axis, can be used as key
  30. * Injected outside.
  31. */
  32. index: number;
  33. /**
  34. * Axis model. Injected outside
  35. */
  36. model: CartesianAxisModel;
  37. /**
  38. * Injected outside.
  39. */
  40. grid: Grid;
  41. constructor(dim: DimensionName, scale: Scale, coordExtent: [number, number], axisType?: OptionAxisType, position?: CartesianAxisPosition);
  42. /**
  43. * Implemented in <module:echarts/coord/cartesian/Grid>.
  44. * @return If not on zero of other axis, return null/undefined.
  45. * If no axes, return an empty array.
  46. */
  47. getAxesOnZeroOf: () => Axis2D[];
  48. isHorizontal(): boolean;
  49. /**
  50. * Each item cooresponds to this.getExtent(), which
  51. * means globalExtent[0] may greater than globalExtent[1],
  52. * unless `asc` is input.
  53. *
  54. * @param {boolean} [asc]
  55. * @return {Array.<number>}
  56. */
  57. getGlobalExtent(asc?: boolean): [number, number];
  58. pointToData(point: number[], clamp?: boolean): number;
  59. /**
  60. * Set ordinalSortInfo
  61. * @param info new OrdinalSortInfo
  62. */
  63. setCategorySortInfo(info: OrdinalSortInfo): boolean;
  64. }
  65. export default Axis2D;