| 249 | } |
| 250 | |
| 251 | private _layoutAxes(): void { |
| 252 | const rect = this._rect; |
| 253 | const axes = this._axesMap; |
| 254 | const dimensions = this.dimensions; |
| 255 | const layoutInfo = this._makeLayoutInfo(); |
| 256 | const layout = layoutInfo.layout; |
| 257 | |
| 258 | axes.each(function (axis) { |
| 259 | const axisExtent = [0, layoutInfo.axisLength]; |
| 260 | const idx = axis.inverse ? 1 : 0; |
| 261 | axis.setExtent(axisExtent[idx], axisExtent[1 - idx]); |
| 262 | }); |
| 263 | |
| 264 | each(dimensions, function (dim, idx) { |
| 265 | const posInfo = (layoutInfo.axisExpandable |
| 266 | ? layoutAxisWithExpand : layoutAxisWithoutExpand |
| 267 | )(idx, layoutInfo); |
| 268 | |
| 269 | const positionTable = { |
| 270 | horizontal: { |
| 271 | x: posInfo.position, |
| 272 | y: layoutInfo.axisLength |
| 273 | }, |
| 274 | vertical: { |
| 275 | x: 0, |
| 276 | y: posInfo.position |
| 277 | } |
| 278 | }; |
| 279 | const rotationTable = { |
| 280 | horizontal: mathPI / 2, |
| 281 | vertical: 0 |
| 282 | }; |
| 283 | |
| 284 | const position = [ |
| 285 | positionTable[layout].x + rect.x, |
| 286 | positionTable[layout].y + rect.y |
| 287 | ]; |
| 288 | |
| 289 | const rotation = rotationTable[layout]; |
| 290 | const transform = matrix.create(); |
| 291 | matrix.rotate(transform, transform, rotation); |
| 292 | matrix.translate(transform, transform, position); |
| 293 | |
| 294 | // TODO |
| 295 | // tick layout info |
| 296 | |
| 297 | // TODO |
| 298 | // update dimensions info based on axis order. |
| 299 | |
| 300 | this._axesLayout[dim] = { |
| 301 | position: position, |
| 302 | rotation: rotation, |
| 303 | transform: transform, |
| 304 | axisNameAvailableWidth: posInfo.axisNameAvailableWidth, |
| 305 | axisLabelShow: posInfo.axisLabelShow, |
| 306 | nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth, |
| 307 | tickDirection: 1, |
| 308 | labelDirection: 1 |