UNPKG

6.61 kBTypeScriptView Raw
1/**
2 * Module, defining Axis Renderer for vertical axes.
3 */
4/**
5 * ============================================================================
6 * IMPORTS
7 * ============================================================================
8 * @hidden
9 */
10import { AxisRenderer, IAxisRendererProperties, IAxisRendererAdapters, IAxisRendererEvents } from "./AxisRenderer";
11import { Sprite } from "../../core/Sprite";
12import { IPoint } from "../../core/defs/IPoint";
13import { Axis } from "./Axis";
14import { Grid } from "./Grid";
15import { AxisTick } from "./AxisTick";
16import { AxisLabel } from "./AxisLabel";
17import { AxisBreak } from "./AxisBreak";
18/**
19 * ============================================================================
20 * REQUISITES
21 * ============================================================================
22 * @hidden
23 */
24/**
25 * Defines properties for [[AxisRendererY]].
26 */
27export interface IAxisRendererYProperties extends IAxisRendererProperties {
28}
29/**
30 * Defines events for [[AxisRendererY]].
31 */
32export interface IAxisRendererYEvents extends IAxisRendererEvents {
33}
34/**
35 * Defines adapters for [[AxisRenderer]].
36 *
37 * @see {@link Adapter}
38 */
39export interface IAxisRendererYAdapters extends IAxisRendererAdapters, IAxisRendererYProperties {
40}
41/**
42 * ============================================================================
43 * MAIN CLASS
44 * ============================================================================
45 * @hidden
46 */
47/**
48 * A renderer for vertical axis.
49 *
50 * @see {@link IAxisRendererYEvents} for a list of available events
51 * @see {@link IAxisRendererYAdapters} for a list of available Adapters
52 */
53export declare class AxisRendererY extends AxisRenderer {
54 /**
55 * Defines available properties.
56 */
57 _properties: IAxisRendererYProperties;
58 /**
59 * Defines available adapters.
60 */
61 _adapter: IAxisRendererYAdapters;
62 /**
63 * Defines available events.
64 */
65 _events: IAxisRendererYEvents;
66 /**
67 * Constructor.
68 *
69 * @param axis Related axis
70 */
71 constructor();
72 /**
73 * @ignore
74 */
75 setAxis(axis: Axis): void;
76 /**
77 * @ignore
78 */
79 updateGridContainer(): void;
80 /**
81 * @ignore
82 */
83 toAxisPosition(value: number): number;
84 /**
85 * Called when rendered is attached to an Axis, as well as a property of
86 * Axis that might affect the appearance is updated.
87 *
88 * E.g. `axis.opposite`, `axis.inside`, etc.
89 *
90 * This method is called **before** draw, so that any related setting
91 * changed in this method can be changed.
92 *
93 * @todo Description (review)
94 * @ignore Exclude from docs
95 */
96 processRenderer(): void;
97 /**
98 * Updates some of the Axis tooltip's visual properties, related to
99 * rendering of the Axis.
100 *
101 * @todo Description (review)
102 * @ignore Exclude from docs
103 */
104 updateTooltip(): void;
105 /**
106 * Returns actual length of the Axis, in pixels.
107 *
108 * @return Length (px)
109 */
110 readonly axisLength: number;
111 /**
112 * Converts relative position on axis to point coordinates.
113 *
114 * @param position Position (0-1)
115 * @param position2 Position (0-1) Position on the second axis
116 * @return Point
117 */
118 positionToPoint(position: number, position2?: number): IPoint;
119 /**
120 * Converts a point at specific coordinates to a relative position (0-1)
121 * on the axis.
122 *
123 * @param point Point
124 * @return Position (0-1)
125 */
126 pointToPosition(point: IPoint): number;
127 /**
128 * Converts a coordinate in pixels to a relative position. (0-1)
129 *
130 * @param coordinate Coordinate (px)
131 * @param coordinate2 Coordinate of a second axis, only needed for complex axes systems, like timeline (px)
132 * @return Position (0-1)
133 */
134 coordinateToPosition(coordinate: number, coordinate2?: number): number;
135 /**
136 * [getPositionRangePath description]
137 *
138 * @ignore Exclude from docs
139 * @todo Description
140 * @param startPosition Starting position
141 * @param endPosition End position
142 * @return SVG path
143 */
144 getPositionRangePath(startPosition: number, endPosition: number): string;
145 /**
146 * Updates and positions a grid element.
147 *
148 * @ignore Exclude from docs
149 * @param grid Grid element
150 * @param position Starting position
151 * @param endPosition End position
152 */
153 updateGridElement(grid: Grid, position: number, endPosition: number): void;
154 /**
155 * Updates and positions a tick element.
156 *
157 * @ignore Exclude from docs
158 * @param tick Tick element
159 * @param position Starting position
160 * @param endPosition End position
161 */
162 updateTickElement(tick: AxisTick, position: number, endPosition: number): void;
163 /**
164 * Updates and positions the axis line element.
165 *
166 * @ignore Exclude from docs
167 */
168 updateAxisLine(): void;
169 /**
170 * Updates and positions the base grid element.
171 *
172 * @ignore Exclude from docs
173 */
174 updateBaseGridElement(): void;
175 /**
176 * Updates and positions a label element.
177 *
178 * @ignore Exclude from docs
179 * @param label Label element
180 * @param position Starting position
181 * @param endPosition Ending position
182 */
183 updateLabelElement(label: AxisLabel, position: number, endPosition: number, location?: number): void;
184 /**
185 * Updates and positions an axis break element.
186 *
187 * @ignore Exclude from docs
188 * @param axisBreak Break element
189 */
190 updateBreakElement(axisBreak: AxisBreak): void;
191 /**
192 * Creates visual elements for and axis break.
193 *
194 * @ignore Exclude from docs
195 * @param axisBreak Axis break
196 */
197 createBreakSprites(axisBreak: AxisBreak): void;
198 /**
199 * Converts a position on the axis to a coordinate in pixels.
200 *
201 * @ignore Exclude from docs
202 * @param position Position (0-1)
203 * @return Coordinate (px)
204 */
205 positionToCoordinate(position: number): number;
206 /**
207 * Updates and positions axis bullets.
208 *
209 * @ignore Exclude from docs
210 * @param bullet AxisBullet element
211 * @param position Starting position
212 * @param endPosition End position
213 */
214 updateBullet(bullet: Sprite, position: number, endPosition: number): void;
215}