Description
Allow the scale
, minScale
and maxScale
options to take a value of 'auto'
(this should become the default value for scale
.)
When specified, a value of 'auto'
should choose a reasonable zoom level for that option, based on the date range of the data supplied to the plugin (and probably also the initial width of the right panel). For example, maxScale: 'auto'
for a Gantt whose data span just one week would probably limit the max zoom to the 'days'
scale, since that zoom level would fit the entire chart, and it would just look silly on the 'weeks'
and 'months'
scales.
scale: 'auto'
would probably be something like max(minScale, maxScale minus a level)
. minScale: 'auto'
would likely keep track of the granularity of the smallest item in the chart; for example, if your shortest task spans a day or two, you probably won't need the 'hours'
scale, so we'd want to set the minimum chart resolution to 'days'
.
If useCookie
is true
, then the cookie-set initial scale would still override the scale: 'auto'
setting, though new max and min scales might be set (if the data have changed).
I have an early-stage proof-of-concept buried in some of my own code, but I should be able to pony up a pull request "soon"..