We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 15c06fa commit 2d393ddCopy full SHA for 2d393dd
src/traces/image/calc.js
@@ -9,6 +9,7 @@
9
'use strict';
10
11
var Axes = require('../../plots/cartesian/axes');
12
+var maxRowLength = require('../../lib').maxRowLength;
13
14
module.exports = function calc(gd, trace) {
15
var xa = Axes.getFromId(gd, trace.xaxis || 'x');
@@ -17,7 +18,7 @@ module.exports = function calc(gd, trace) {
17
18
var x0 = trace.x0 - trace.dx / 2;
19
var y0 = trace.y0 - trace.dy / 2;
20
var h = trace.z.length;
- var w = trace.z[0].length;
21
+ var w = maxRowLength(trace.z);
22
23
trace._extremes[xa._id] = Axes.findExtremes(xa, [x0, x0 + w * trace.dx]);
24
trace._extremes[ya._id] = Axes.findExtremes(ya, [y0, y0 + h * trace.dy]);
0 commit comments