Skip to content

Commit 2d393dd

Browse files
committed
image: use maxRowLength to find the width of z
1 parent 15c06fa commit 2d393dd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/traces/image/calc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
'use strict';
1010

1111
var Axes = require('../../plots/cartesian/axes');
12+
var maxRowLength = require('../../lib').maxRowLength;
1213

1314
module.exports = function calc(gd, trace) {
1415
var xa = Axes.getFromId(gd, trace.xaxis || 'x');
@@ -17,7 +18,7 @@ module.exports = function calc(gd, trace) {
1718
var x0 = trace.x0 - trace.dx / 2;
1819
var y0 = trace.y0 - trace.dy / 2;
1920
var h = trace.z.length;
20-
var w = trace.z[0].length;
21+
var w = maxRowLength(trace.z);
2122

2223
trace._extremes[xa._id] = Axes.findExtremes(xa, [x0, x0 + w * trace.dx]);
2324
trace._extremes[ya._id] = Axes.findExtremes(ya, [y0, y0 + h * trace.dy]);

0 commit comments

Comments
 (0)