()
| 242 | } |
| 243 | |
| 244 | buildTicks() { |
| 245 | const opts = this.options; |
| 246 | const tickOpts = opts.ticks; |
| 247 | |
| 248 | // Figure out what the max number of ticks we can support it is based on the size of |
| 249 | // the axis area. For now, we say that the minimum tick spacing in pixels must be 40 |
| 250 | // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on |
| 251 | // the graph. Make sure we always have at least 2 ticks |
| 252 | let maxTicks = this.getTickLimit(); |
| 253 | maxTicks = Math.max(2, maxTicks); |
| 254 | |
| 255 | const numericGeneratorOptions = { |
| 256 | maxTicks, |
| 257 | bounds: opts.bounds, |
| 258 | min: opts.min, |
| 259 | max: opts.max, |
| 260 | precision: tickOpts.precision, |
| 261 | step: tickOpts.stepSize, |
| 262 | count: tickOpts.count, |
| 263 | maxDigits: this._maxDigits(), |
| 264 | horizontal: this.isHorizontal(), |
| 265 | minRotation: tickOpts.minRotation || 0, |
| 266 | includeBounds: tickOpts.includeBounds !== false |
| 267 | }; |
| 268 | const dataRange = this._range || this; |
| 269 | const ticks = generateTicks(numericGeneratorOptions, dataRange); |
| 270 | |
| 271 | // At this point, we need to update our max and min given the tick values, |
| 272 | // since we probably have expanded the range of the scale |
| 273 | if (opts.bounds === 'ticks') { |
| 274 | _setMinAndMaxByKey(ticks, this, 'value'); |
| 275 | } |
| 276 | |
| 277 | if (opts.reverse) { |
| 278 | ticks.reverse(); |
| 279 | |
| 280 | this.start = this.max; |
| 281 | this.end = this.min; |
| 282 | } else { |
| 283 | this.start = this.min; |
| 284 | this.end = this.max; |
| 285 | } |
| 286 | |
| 287 | return ticks; |
| 288 | } |
| 289 | |
| 290 | /** |
| 291 | * @protected |
nothing calls this directly
no test coverage detected