Skip to content

Commit 199418b

Browse files
committed
avoid name conflicts between fastImage and fast zsmooth
1 parent 3a501ef commit 199418b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/traces/image/plot.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ module.exports = function plot(gd, plotinfo, cdimage, imageLayer) {
2626
var plotGroup = d3.select(this);
2727
var cd0 = cd[0];
2828
var trace = cd0.trace;
29-
var fastImage = supportsPixelatedImage && !trace._hasZ && trace._hasSource && xa.type === 'linear' && ya.type === 'linear';
30-
trace._fastImage = fastImage;
29+
var realImage = supportsPixelatedImage && !trace._hasZ && trace._hasSource && xa.type === 'linear' && ya.type === 'linear';
30+
trace._realImage = realImage;
3131

3232
var z = cd0.z;
3333
var x0 = cd0.x0;
@@ -73,7 +73,7 @@ module.exports = function plot(gd, plotinfo, cdimage, imageLayer) {
7373
}
7474

7575
// Reduce image size when zoomed in to save memory
76-
if(!fastImage) {
76+
if(!realImage) {
7777
var extra = 0.5; // half the axis size
7878
left = Math.max(-extra * xa._length, left);
7979
right = Math.min((1 + extra) * xa._length, right);
@@ -138,7 +138,7 @@ module.exports = function plot(gd, plotinfo, cdimage, imageLayer) {
138138

139139
var style = (trace.zsmooth === false) ? constants.pixelatedStyle : '';
140140

141-
if(fastImage) {
141+
if(realImage) {
142142
var xRange = Lib.simpleMap(xa.range, xa.r2l);
143143
var yRange = Lib.simpleMap(ya.range, ya.r2l);
144144

@@ -194,7 +194,7 @@ module.exports = function plot(gd, plotinfo, cdimage, imageLayer) {
194194
canvas = drawMagnifiedPixelsOnCanvas(function(i, j) {return z[j][i];});
195195
href = canvas.toDataURL('image/png');
196196
} else if(trace._hasSource) {
197-
if(fastImage) {
197+
if(realImage) {
198198
href = trace.source;
199199
} else {
200200
var context = trace._canvas.el.getContext('2d');

test/jasmine/tests/image_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ describe('image plot', function() {
410410
var mockCopy = Lib.extendDeep({}, mock);
411411
Plotly.newPlot(gd, mockCopy)
412412
.then(function(gd) {
413-
expect(gd.calcdata[0][0].trace._fastImage).toBeTruthy();
413+
expect(gd.calcdata[0][0].trace._realImage).toBeTruthy();
414414
})
415415
.then(done, done.fail);
416416
});
@@ -424,11 +424,11 @@ describe('image plot', function() {
424424
var mockCopy = Lib.extendDeep({}, mock);
425425
Plotly.newPlot(gd, mockCopy)
426426
.then(function(gd) {
427-
expect(gd.calcdata[0][0].trace._fastImage).toBe(true);
427+
expect(gd.calcdata[0][0].trace._realImage).toBe(true);
428428
return Plotly.relayout(gd, attr[0], attr[1]);
429429
})
430430
.then(function(gd) {
431-
expect(gd.calcdata[0][0].trace._fastImage).toBe(false, 'when ' + attr[0] + ' is ' + attr[1]);
431+
expect(gd.calcdata[0][0].trace._realImage).toBe(false, 'when ' + attr[0] + ' is ' + attr[1]);
432432
})
433433
.then(done, done.fail);
434434
});

0 commit comments

Comments
 (0)