Add chart method for getting initial scale bounds#585
Conversation
|
Guess to keep it in line with the main chartjs docs it's best to create a sub cat under the developer section call it API and put it in there |
|
Added a suggestion, but I did not try this - so it might not make sense. |
Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
👍 Can do
I can imagine getting the original bounds will still be useful, but you're right, having the higher level API there as well would also be useful. I'll have a go at adding that as well, although I might only get round to that on Monday or something. |
|
A isZoomedOrPanned() might be helpful, it may also address my problem where trying to reset all of the charts on a page at once breaks (see my Discussion #583) |
|
I've added documentation for all methods added on the Chart.js instance. I also noticed while doing that, that the @kurkle, does that work for you? |
|
Looks like there are some linting errors (due to the fixed types and incorrect usage in the exports.ts)
|
|
I think I've fixed that issue, there was also a linting error in the documentation somewhere that I believe I've fixed now as well. |
kurkle
left a comment
There was a problem hiding this comment.
coveralls.io is in maintenance currently, that's why the CI fails. I'd expect it to become available later today.
|
@kurkle, looks like it's back up and running again. Is there an easy way to rerun the failed jobs, or do I need to push a new commit or something? |
Based on the discussion in #584, this adds a new method,
getInitialScaleBoundsthat returns an object mapping scale IDs to {min, max} values.I've added tests and type definitions. I couldn't see anywhere obvious to document this in the guide, but I think exporting it from
index.d.tsat least adds some basic type doc stuff, right?