Skip to content

Commit 5becba0

Browse files
committed
udpdate jsdoc for Axes.getAutoRange
1 parent 4c250c3 commit 5becba0

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

src/plots/cartesian/autorange.js

+27-18
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,33 @@ module.exports = {
2323
concatExtremes: concatExtremes
2424
};
2525

26-
// Find the autorange for this axis
27-
//
28-
// TODO update!!
29-
// assumes ax._min and ax._max have already been set by calling axes.expand
30-
// using calcdata from all traces. These are arrays of objects:
31-
// {
32-
// val: calcdata value,
33-
// pad: extra pixels beyond this value,
34-
// extrapad: bool, does this point want 5% extra padding
35-
// }
36-
//
37-
// Returns an array of [min, max]. These are calcdata for log and category axes
38-
// and data for linear and date axes.
39-
//
40-
// TODO: we want to change log to data as well, but it's hard to do this
41-
// maintaining backward compatibility. category will always have to use calcdata
42-
// though, because otherwise values between categories (or outside all categories)
43-
// would be impossible.
26+
/**
27+
* getAutoRange
28+
*
29+
* Collects all _extremes values corresponding to a given axis
30+
* and computes its auto range.
31+
*
32+
* getAutoRange uses return values from findExtremes where:
33+
*
34+
* {
35+
* val: calcdata value,
36+
* pad: extra pixels beyond this value,
37+
* extrapad: bool, does this point want 5% extra padding
38+
* }
39+
*
40+
* @param {object} gd:
41+
* graph div object with filled in fullData and fullLayout,
42+
* @param {object} ax:
43+
* full axis object
44+
* @return {array}
45+
* an array of [min, max]. These are calcdata for log and category axes
46+
* and data for linear and date axes.
47+
*
48+
* TODO: we want to change log to data as well, but it's hard to do this
49+
* maintaining backward compatibility. category will always have to use calcdata
50+
* though, because otherwise values between categories (or outside all categories)
51+
* would be impossible.
52+
*/
4453
function getAutoRange(gd, ax) {
4554
var i, j;
4655
var newRange = [];

0 commit comments

Comments
 (0)