ag-charts-community
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
53 lines (52 loc) • 2.19 kB
TypeScript
import type { NormalisedBasePolarAxisOptions, Scale } from 'ag-charts-core';
import type { AxisContext, PolarAxisLayout } from '../../module/axisContext';
import type { BBox } from '../../scene/bbox';
import { Axis } from './axis';
import type { TickInterval } from './axisTick';
export interface PolarAxisPathPoint {
x: number;
y: number;
moveTo: boolean;
radius?: number;
startAngle?: number;
endAngle?: number;
arc?: boolean;
}
export declare abstract class PolarAxis<S extends Scale<D, number, TickInterval<S>> = Scale<any, number, any>, D = any, TOptions extends NormalisedBasePolarAxisOptions = NormalisedBasePolarAxisOptions> extends Axis<S, D, any, TOptions> {
gridAngles: number[] | undefined;
gridRange: number[] | undefined;
get shape(): 'polygon' | 'circle';
/**
* `innerRadiusRatio` is user-facing on radius axes only. The polar chart
* copies the radius axis's value onto the angle axis at layout time
* (`polarChart.updateAxes`), so we keep an instance-level setter; reads
* fall back to `options.innerRadiusRatio` if no override has been written.
*/
private _innerRadiusRatio?;
get innerRadiusRatio(): number;
set innerRadiusRatio(value: number);
defaultTickMinSpacing: number;
abstract calculateRotations(): {
rotation: number;
parallelFlipRotation: number;
regularFlipRotation: number;
};
update(): void;
createAxisContext(): AxisContext;
/**
* Builds the polar-layout snapshot exposed via {@link AxisContext.getPolarLayout}. Each
* concrete polar-axis subclass projects its own outer/inner radius (the angle axis derives
* radii from `gridLength`; the radius axis from `range`) and supplies the per-axis-type
* extras (`ticks` for angle axes, `gridAngles` for radius axes).
*/
protected abstract computePolarLayout(): PolarAxisLayout;
updatePosition(): void;
computeLabelsBBox(_options: {
hideWhenNecessary: boolean;
}, _seriesRect: BBox): BBox | null;
computeRange(): void;
getAxisLinePoints(): {
points: PolarAxisPathPoint[];
closePath: boolean;
} | undefined;
}