e06b8829b1ee6869fe9d98ca9840cc9a754a78f4b7f94284ef6d02aa3853130797aab2b526d0951279b6be1bb562dd09c9d78831e50622c97d3a4ef3370f55 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import { LayoutRect } from '../../util/layout.js';
  2. import Cartesian2D from './Cartesian2D.js';
  3. import Axis2D from './Axis2D.js';
  4. import { ParsedModelFinder } from '../../util/model.js';
  5. import GridModel from './GridModel.js';
  6. import GlobalModel from '../../model/Global.js';
  7. import ExtensionAPI from '../../core/ExtensionAPI.js';
  8. import { CoordinateSystemMaster } from '../CoordinateSystem.js';
  9. import { ScaleDataValue } from '../../util/types.js';
  10. declare type Cartesian2DDimensionName = 'x' | 'y';
  11. declare type FinderAxisIndex = {
  12. xAxisIndex?: number;
  13. yAxisIndex?: number;
  14. };
  15. declare class Grid implements CoordinateSystemMaster {
  16. readonly type: string;
  17. private _coordsMap;
  18. private _coordsList;
  19. private _axesMap;
  20. private _axesList;
  21. private _rect;
  22. readonly model: GridModel;
  23. readonly axisPointerEnabled = true;
  24. name: string;
  25. static dimensions: string[];
  26. readonly dimensions: string[];
  27. constructor(gridModel: GridModel, ecModel: GlobalModel, api: ExtensionAPI);
  28. getRect(): LayoutRect;
  29. update(ecModel: GlobalModel, api: ExtensionAPI): void;
  30. /**
  31. * Resize the grid
  32. */
  33. resize(gridModel: GridModel, api: ExtensionAPI, ignoreContainLabel?: boolean): void;
  34. getAxis(dim: Cartesian2DDimensionName, axisIndex?: number): Axis2D;
  35. getAxes(): Axis2D[];
  36. /**
  37. * Usage:
  38. * grid.getCartesian(xAxisIndex, yAxisIndex);
  39. * grid.getCartesian(xAxisIndex);
  40. * grid.getCartesian(null, yAxisIndex);
  41. * grid.getCartesian({xAxisIndex: ..., yAxisIndex: ...});
  42. *
  43. * When only xAxisIndex or yAxisIndex given, find its first cartesian.
  44. */
  45. getCartesian(finder: FinderAxisIndex): Cartesian2D;
  46. getCartesian(xAxisIndex?: number, yAxisIndex?: number): Cartesian2D;
  47. getCartesians(): Cartesian2D[];
  48. /**
  49. * @implements
  50. */
  51. convertToPixel(ecModel: GlobalModel, finder: ParsedModelFinder, value: ScaleDataValue | ScaleDataValue[]): number | number[];
  52. /**
  53. * @implements
  54. */
  55. convertFromPixel(ecModel: GlobalModel, finder: ParsedModelFinder, value: number | number[]): number | number[];
  56. private _findConvertTarget;
  57. /**
  58. * @implements
  59. */
  60. containPoint(point: number[]): boolean;
  61. /**
  62. * Initialize cartesian coordinate systems
  63. */
  64. private _initCartesian;
  65. /**
  66. * Update cartesian properties from series.
  67. */
  68. private _updateScale;
  69. /**
  70. * @param dim 'x' or 'y' or 'auto' or null/undefined
  71. */
  72. getTooltipAxes(dim: Cartesian2DDimensionName | 'auto'): {
  73. baseAxes: Axis2D[];
  74. otherAxes: Axis2D[];
  75. };
  76. static create(ecModel: GlobalModel, api: ExtensionAPI): Grid[];
  77. }
  78. export default Grid;