(refs, isVertical)
| 259 | const gs = gd._fullLayout._size; |
| 260 | |
| 261 | function getBounds(refs, isVertical) { |
| 262 | // Retrieve all existing axes from the references |
| 263 | const axes = (Array.isArray(refs) ? refs : [refs]).map((r) => Axes.getFromId(gd, r)).filter(Boolean); |
| 264 | |
| 265 | // If no valid axes, return the bounds of the larger plot area |
| 266 | if (!axes.length) { |
| 267 | return isVertical ? [gs.t, gs.t + gs.h] : [gs.l, gs.l + gs.w]; |
| 268 | } |
| 269 | |
| 270 | // Otherwise, we find all find and return the smallest start point |
| 271 | // and largest end point to be used as the clip bounds |
| 272 | const startBounds = axes.map(function (ax) { |
| 273 | return ax._offset; |
| 274 | }); |
| 275 | const endBounds = axes.map(function (ax) { |
| 276 | return ax._offset + ax._length; |
| 277 | }); |
| 278 | return [Math.min(...startBounds), Math.max(...endBounds)]; |
| 279 | } |
| 280 | |
| 281 | const xb = getBounds(xref, false); |
| 282 | const yb = getBounds(yref, true); |
no outgoing calls
no test coverage detected
searching dependent graphs…