7562794fc8133c4018b0cd148a3be4cd9a11386ca938e97455485a5e091c1aaba6f347add0d231e2dc832a75b352f22080259d5a7b42db71ccae1a2592b466 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import RadiusAxis from './RadiusAxis.js';
  2. import AngleAxis from './AngleAxis.js';
  3. import PolarModel from './PolarModel.js';
  4. import { CoordinateSystem, CoordinateSystemMaster, CoordinateSystemClipArea } from '../CoordinateSystem.js';
  5. import GlobalModel from '../../model/Global.js';
  6. import { ParsedModelFinder } from '../../util/model.js';
  7. import { ScaleDataValue } from '../../util/types.js';
  8. import ExtensionAPI from '../../core/ExtensionAPI.js';
  9. export declare const polarDimensions: string[];
  10. interface Polar {
  11. update(ecModel: GlobalModel, api: ExtensionAPI): void;
  12. }
  13. declare class Polar implements CoordinateSystem, CoordinateSystemMaster {
  14. readonly name: string;
  15. readonly dimensions: string[];
  16. readonly type = "polar";
  17. /**
  18. * x of polar center
  19. */
  20. cx: number;
  21. /**
  22. * y of polar center
  23. */
  24. cy: number;
  25. private _radiusAxis;
  26. private _angleAxis;
  27. axisPointerEnabled: boolean;
  28. model: PolarModel;
  29. constructor(name: string);
  30. /**
  31. * If contain coord
  32. */
  33. containPoint(point: number[]): boolean;
  34. /**
  35. * If contain data
  36. */
  37. containData(data: number[]): boolean;
  38. getAxis(dim: 'radius' | 'angle'): AngleAxis | RadiusAxis;
  39. getAxes(): (AngleAxis | RadiusAxis)[];
  40. /**
  41. * Get axes by type of scale
  42. */
  43. getAxesByScale(scaleType: 'ordinal' | 'interval' | 'time' | 'log'): (AngleAxis | RadiusAxis)[];
  44. getAngleAxis(): AngleAxis;
  45. getRadiusAxis(): RadiusAxis;
  46. getOtherAxis(axis: AngleAxis | RadiusAxis): AngleAxis | RadiusAxis;
  47. /**
  48. * Base axis will be used on stacking.
  49. *
  50. */
  51. getBaseAxis(): AngleAxis | RadiusAxis;
  52. getTooltipAxes(dim: 'radius' | 'angle' | 'auto'): {
  53. baseAxes: (AngleAxis | RadiusAxis)[];
  54. otherAxes: (AngleAxis | RadiusAxis)[];
  55. };
  56. /**
  57. * Convert a single data item to (x, y) point.
  58. * Parameter data is an array which the first element is radius and the second is angle
  59. */
  60. dataToPoint(data: ScaleDataValue[], clamp?: boolean): number[];
  61. /**
  62. * Convert a (x, y) point to data
  63. */
  64. pointToData(point: number[], clamp?: boolean): number[];
  65. /**
  66. * Convert a (x, y) point to (radius, angle) coord
  67. */
  68. pointToCoord(point: number[]): number[];
  69. /**
  70. * Convert a (radius, angle) coord to (x, y) point
  71. */
  72. coordToPoint(coord: number[]): number[];
  73. /**
  74. * Get ring area of cartesian.
  75. * Area will have a contain function to determine if a point is in the coordinate system.
  76. */
  77. getArea(): PolarArea;
  78. convertToPixel(ecModel: GlobalModel, finder: ParsedModelFinder, value: ScaleDataValue[]): number[];
  79. convertFromPixel(ecModel: GlobalModel, finder: ParsedModelFinder, pixel: number[]): number[];
  80. }
  81. interface PolarArea extends CoordinateSystemClipArea {
  82. cx: number;
  83. cy: number;
  84. r0: number;
  85. r: number;
  86. startAngle: number;
  87. endAngle: number;
  88. clockwise: boolean;
  89. }
  90. export default Polar;