Skip to content

image trace type #4289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Oct 24, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
image: use maxRowLength to find the width of z
  • Loading branch information
antoinerg committed Oct 23, 2019
commit 2d393ddab83a5492afaf8a2c2690ddd7da3cb15f
3 changes: 2 additions & 1 deletion src/traces/image/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
'use strict';

var Axes = require('../../plots/cartesian/axes');
var maxRowLength = require('../../lib').maxRowLength;

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

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