Skip to content

Commit 9a9de77

Browse files
committed
remove zsmooth that doesn't apply to contourcarpet
1 parent 7e075f5 commit 9a9de77

File tree

1 file changed

+4
-41
lines changed

1 file changed

+4
-41
lines changed

src/traces/contourcarpet/calc.js

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,15 @@ function heatmappishCalc(gd, trace) {
126126
// prepare the raw data
127127
// run makeCalcdata on x and y even for heatmaps, in case of category mappings
128128
var carpet = trace.carpetTrace;
129-
var aax = carpet.aaxis,
130-
bax = carpet.baxis,
131-
isContour = Registry.traceIs(trace, 'contour'),
132-
zsmooth = isContour ? 'best' : trace.zsmooth,
133-
a,
129+
var aax = carpet.aaxis;
130+
var bax = carpet.baxis;
131+
var a,
134132
a0,
135133
da,
136134
b,
137135
b0,
138136
db,
139-
z,
140-
i;
137+
z;
141138

142139
// cancel minimum tick spacings (only applies to bars and boxes)
143140
aax._minDtick = 0;
@@ -157,40 +154,6 @@ function heatmappishCalc(gd, trace) {
157154
trace._emptypoints = findEmpties(z);
158155
trace._interpz = interp2d(z, trace._emptypoints, trace._interpz);
159156

160-
function noZsmooth(msg) {
161-
zsmooth = trace._input.zsmooth = trace.zsmooth = false;
162-
Lib.notifier('cannot fast-zsmooth: ' + msg);
163-
}
164-
165-
// check whether we really can smooth (ie all boxes are about the same size)
166-
if(zsmooth === 'fast') {
167-
if(aax.type === 'log' || bax.type === 'log') {
168-
noZsmooth('log axis found');
169-
}
170-
else {
171-
if(a.length) {
172-
var avgda = (a[a.length - 1] - a[0]) / (a.length - 1),
173-
maxErrX = Math.abs(avgda / 100);
174-
for(i = 0; i < a.length - 1; i++) {
175-
if(Math.abs(a[i + 1] - a[i] - avgda) > maxErrX) {
176-
noZsmooth('a scale is not linear');
177-
break;
178-
}
179-
}
180-
}
181-
if(b.length && zsmooth === 'fast') {
182-
var avgdy = (b[b.length - 1] - b[0]) / (b.length - 1),
183-
maxErrY = Math.abs(avgdy / 100);
184-
for(i = 0; i < b.length - 1; i++) {
185-
if(Math.abs(b[i + 1] - b[i] - avgdy) > maxErrY) {
186-
noZsmooth('b scale is not linear');
187-
break;
188-
}
189-
}
190-
}
191-
}
192-
}
193-
194157
// create arrays of brick boundaries, to be used by autorange and heatmap.plot
195158
var xlen = maxRowLength(z),
196159
xIn = trace.xtype === 'scaled' ? '' : a,

0 commit comments

Comments
 (0)