UNPKG

8.7 kBTypeScriptView Raw
1/**
2 * Module, defining Axis Renderer for radial axes.
3 */
4/**
5 * ============================================================================
6 * IMPORTS
7 * ============================================================================
8 * @hidden
9 */
10import { AxisRendererY, IAxisRendererYProperties, IAxisRendererYAdapters, IAxisRendererYEvents } from "./AxisRendererY";
11import { AxisTick } from "./AxisTick";
12import { RadarChart } from "../types/RadarChart";
13import { IPoint } from "../../core/defs/IPoint";
14import { Grid } from "./Grid";
15import { AxisBreak } from "./AxisBreak";
16import { MutableValueDisposer } from "../../core/utils/Disposer";
17import { Percent } from "../../core/utils/Percent";
18import { Sprite } from "../../core/Sprite";
19/**
20 * ============================================================================
21 * REQUISITES
22 * ============================================================================
23 * @hidden
24 */
25/**
26 * Defines properties for [[AxisRendererRadial]].
27 */
28export interface IAxisRendererRadialProperties extends IAxisRendererYProperties {
29 /**
30 * Start angle of the radial axis in degrees. (0-360)
31 */
32 startAngle?: number;
33 /**
34 * End angle of the radial axis in degrees. (0-360)
35 */
36 endAngle?: number;
37 /**
38 * A grid type to display: "circles" or "polygons".
39 *
40 * @default "circles"
41 */
42 gridType?: "circles" | "polygons";
43 /**
44 * An angle of the axis in degrees. (0-360)
45 */
46 axisAngle?: number;
47 /**
48 * Outer radius of the radial axis.
49 *
50 * Can either be absolute (pixels) or relative ([[Percent]]).
51 */
52 radius?: number | Percent;
53 /**
54 * Inner radius of the radial axis.
55 *
56 * Can either be absolute (pixels) or relative ([[Percent]]).
57 */
58 innerRadius?: number | Percent;
59}
60/**
61 * Defines events for [[AxisRendererRadial]].
62 */
63export interface IAxisRendererRadialEvents extends IAxisRendererYEvents {
64}
65/**
66 * Defines adapters for [[AxisRenderer]].
67 *
68 * @see {@link Adapter}
69 */
70export interface IAxisRendererRadialAdapters extends IAxisRendererYAdapters, IAxisRendererRadialProperties {
71}
72/**
73 * ============================================================================
74 * MAIN CLASS
75 * ============================================================================
76 * @hidden
77 */
78/**
79 * A renderer for radial axis.
80 */
81export declare class AxisRendererRadial extends AxisRendererY {
82 /**
83 * Defines available properties.
84 */
85 _properties: IAxisRendererRadialProperties;
86 /**
87 * Defines available adapters.
88 */
89 _adapter: IAxisRendererRadialAdapters;
90 /**
91 * Defines available events.
92 */
93 _events: IAxisRendererRadialEvents;
94 /**
95 * A related chart.
96 */
97 protected _chart: MutableValueDisposer<RadarChart>;
98 /**
99 * @ignore
100 */
101 pixelRadiusReal: number;
102 /**
103 * @ignore
104 */
105 _chartType: RadarChart;
106 /**
107 * Constructor.
108 *
109 * @param axis Related axis
110 */
111 constructor();
112 /**
113 * Validates Axis renderer.
114 *
115 * @ignore Exclude from docs
116 */
117 validate(): void;
118 /**
119 * Returns actual length of the Axis, in pixels.
120 *
121 * @return Length (px)
122 */
123 readonly axisLength: number;
124 /**
125 * Outer radius of the axis.
126 *
127 * Can be absolute (px) or relative ([[Percent]]).
128 *
129 * @param value Outer radius
130 */
131 /**
132 * @return Outer radius
133 */
134 radius: number | Percent;
135 /**
136 * Outer radius in pixels.
137 *
138 * @return Outer radius (px)
139 */
140 readonly pixelRadius: number;
141 /**
142 * Inner radius of the axis.
143 *
144 * Can be absolute (px) or relative ([[Percent]]).
145 *
146 * @param value Outer radius
147 */
148 /**
149 * @return Inner radius
150 */
151 innerRadius: number | Percent;
152 /**
153 * Inner radius in pixels.
154 *
155 * @return Inner radius (px)
156 */
157 readonly pixelInnerRadius: number;
158 /**
159 * Converts relative position on axis to point coordinates.
160 *
161 * @param position Position (0-1)
162 * @param position2 Position (0-1) Position on the second axis
163 * @return Point
164 */
165 positionToPoint(position: number, position2?: number): IPoint;
166 /**
167 * Updates and positions the axis line element.
168 *
169 * @ignore Exclude from docs
170 */
171 updateAxisLine(): void;
172 /**
173 * Updates and positions a grid element.
174 *
175 * @ignore Exclude from docs
176 * @param grid Grid element
177 * @param position Starting position
178 * @param endPosition End position
179 */
180 updateGridElement(grid: Grid, position: number, endPosition: number): void;
181 /**
182 * Updates and positions a label element.
183 *
184 * @ignore Exclude from docs
185 * @param label Label element
186 * @param position Starting position
187 * @param endPosition Ending position
188 */
189 updateLabelElement(label: this["_labelType"], position: number, endPosition: number, location?: number): void;
190 /**
191 * Updates and positions the base grid element.
192 *
193 * @ignore Exclude from docs
194 */
195 updateBaseGridElement(): void;
196 /**
197 * Checks if point is within bounds of a container.
198 *
199 * @ignore Exclude from docs
200 * @param point Point coordinates
201 * @return Fits?
202 */
203 fitsToBounds(point: IPoint): boolean;
204 /**
205 * Start angle of the axis in degrees. (0-360)
206 *
207 * @param value Start angle
208 */
209 /**
210 * @return Start angle
211 */
212 startAngle: number;
213 /**
214 * End angle of the axis in degrees. (0-360)
215 *
216 * @param value End angle
217 */
218 /**
219 * @return End angle
220 */
221 endAngle: number;
222 /**
223 * Angle of the radial axis in degrees. (0-360)
224 *
225 * @param value Axis angle
226 */
227 /**
228 * @return Axis angle
229 */
230 axisAngle: number;
231 /**
232 * Grid type for radial axis.
233 *
234 * A grid on radia axis can either be perfect circles ("circles"), or
235 * straight lines ("polygons").
236 *
237 * @default "circles"
238 * @param value Grid type
239 */
240 /**
241 * Grid type
242 */
243 gridType: "circles" | "polygons";
244 /**
245 * [getPositionRangePath description]
246 *
247 * @ignore Exclude from docs
248 * @todo Description
249 * @param startPosition Starting position
250 * @param endPosition End position
251 * @return SVG path
252 */
253 getPositionRangePath(startPosition: number, endPosition: number): string;
254 /**
255 * Updates and positions an axis break element.
256 *
257 * @ignore Exclude from docs
258 * @param axisBreak Break element
259 */
260 updateBreakElement(axisBreak: AxisBreak): void;
261 /**
262 * Creates visual elements for and axis break.
263 *
264 * @ignore Exclude from docs
265 * @param axisBreak Axis break
266 */
267 createBreakSprites(axisBreak: AxisBreak): void;
268 /**
269 * Updates some of the Axis tooltip's visual properties, related to
270 * rendering of the Axis.
271 *
272 * @todo Description (review)
273 * @ignore Exclude from docs
274 */
275 updateTooltip(): void;
276 /**
277 * Updates and positions a tick element.
278 *
279 * @ignore Exclude from docs
280 * @param tick Tick element
281 * @param position Position
282 */
283 updateTickElement(tick: AxisTick, position: number, endPosition: number): void;
284 /**
285 * Updates and positions axis bullet.
286 *
287 * @ignore Exclude from docs
288 * @param bullet AxisBullet element
289 * @param position Starting position
290 * @param endPosition End position
291 */
292 updateBullet(bullet: Sprite, position: number, endPosition: number): void;
293 /**
294 * Converts a position on the axis to a coordinate in pixels.
295 *
296 * @ignore Exclude from docs
297 * @param position Position (0-1)
298 * @return Coordinate (px)
299 */
300 positionToCoordinate(position: number): number;
301 /**
302 * Converts a point at specific coordinates to a relative position (0-1)
303 * on the axis.
304 *
305 * @param point Point
306 * @return Position (0-1)
307 */
308 pointToPosition(point: IPoint): number;
309 /**
310 * A chart, associated with the Axis.
311 *
312 * @ignore Exclude from docs
313 * @param value Chart
314 */
315 /**
316 * @ignore Exclude from docs
317 * @return Chart
318 */
319 chart: RadarChart;
320}