Skip to content

Commit 98aebc5

Browse files
committed
drop relative and world position support
1 parent 6700eb5 commit 98aebc5

8 files changed

+0
-261
lines changed

src/traces/surface/attributes.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -78,28 +78,6 @@ function makeContourAttr(axLetter) {
7878
'Must be positive.'
7979
].join(' ')
8080
},
81-
locations: {
82-
valType: 'data_array',
83-
dflt: false,
84-
role: 'info',
85-
description: [
86-
'Specifies the world location(s) of contours on the', axLetter, 'axis.'
87-
].join(' ')
88-
},
89-
relative: {
90-
valType: 'number',
91-
arrayOk: true,
92-
role: 'info',
93-
dflt: 0,
94-
min: 0,
95-
max: 1,
96-
description: [
97-
'Specifies the local location(s) of contours on the', axLetter, 'axis.',
98-
'For exampe 1.0 could also be applied to locate contours on data points.',
99-
'Or 0.5 could also be applied to locate contours between data points.',
100-
'Values less than or equal to zero and greater than one would be ignored.'
101-
].join(' ')
102-
},
10381
project: {
10482
x: makeContourProjAttr('x'),
10583
y: makeContourProjAttr('y'),

src/traces/surface/convert.js

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ function SurfaceTrace(scene, surface, uid) {
3131
this.contourStart = [null, null, null];
3232
this.contourEnd = [null, null, null];
3333
this.contourSize = [0, 0, 0];
34-
this.contourLocations = [[], [], []];
35-
this.contourRelative = [0, 0]; // note: only available on x & y not z.
3634
this.minValues = [Infinity, Infinity, Infinity];
3735
this.maxValues = [-Infinity, -Infinity, -Infinity];
3836
this.dataScaleX = 1.0;
@@ -376,51 +374,6 @@ proto.setContourLevels = function() {
376374
if(this.showContour[i]) {
377375
needsUpdate = true;
378376

379-
if(i < 2) {
380-
var ratios = Array.isArray(this.contourRelative[i]) ?
381-
this.contourRelative[i] : [this.contourRelative[i]];
382-
383-
for(var k = 0; k < ratios.length; k++) {
384-
var ratio = ratios[k];
385-
if(ratio !== 0) {
386-
387-
var len = (i === 0) ?
388-
this.data.z[0].length :
389-
this.data._ylength;
390-
391-
for(var q = (ratio < 1) ? 1 : 0; q < len; q++) {
392-
393-
var here = (i === 0) ?
394-
this.getXat(q, 0) * this.scene.dataScale[i] :
395-
this.getYat(0, q) * this.scene.dataScale[i];
396-
397-
if(ratio < 1) {
398-
var prev = (i === 0) ?
399-
this.getXat(q - 1, 0) * this.scene.dataScale[i] :
400-
this.getYat(0, q - 1) * this.scene.dataScale[i];
401-
402-
value = here * ratio + prev * (1 - ratio);
403-
} else {
404-
value = here;
405-
}
406-
407-
insertIfNewLevel(newLevels[i], value);
408-
useNewLevels[i] = true;
409-
}
410-
}
411-
}
412-
}
413-
414-
var locations = this.contourLocations[i];
415-
if(locations !== false) useNewLevels[i] = true;
416-
if(locations.length) {
417-
for(j = 0; j < locations.length; j++) {
418-
value = locations[j] * this.scene.dataScale[i];
419-
420-
insertIfNewLevel(newLevels[i], value);
421-
}
422-
}
423-
424377
if(
425378
this.contourSize[i] > 0 &&
426379
this.contourStart[i] !== null &&
@@ -653,18 +606,12 @@ proto.update = function(data) {
653606
this.contourStart[i] = contourParams.start;
654607
this.contourEnd[i] = contourParams.end;
655608
this.contourSize[i] = contourParams.size;
656-
657-
this.contourLocations[i] = contourParams.locations;
658-
if(i < 2) this.contourRelative[i] = contourParams.relative;
659609
} else {
660610
this.showContour[i] = false;
661611

662612
this.contourStart[i] = null;
663613
this.contourEnd[i] = null;
664614
this.contourSize[i] = 0;
665-
666-
this.contourLocations[i] = [];
667-
if(i < 2) this.contourRelative[i] = 0;
668615
}
669616

670617
if(contourParams.highlight) {

src/traces/surface/defaults.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
7777
coerce(contourDim + '.color');
7878
coerce(contourDim + '.width');
7979
coerce(contourDim + '.usecolormap');
80-
coerce(contourDim + '.locations');
81-
if(i < 2) coerce(contourDim + '.relative');
8280
}
8381

8482
if(highlight) {
Binary file not shown.
Binary file not shown.

test/image/mocks/gl3d_surface_contour_between-xy-data-points.json

Lines changed: 0 additions & 91 deletions
This file was deleted.

test/image/mocks/gl3d_surface_contour_on-xyz-locations.json

Lines changed: 0 additions & 91 deletions
This file was deleted.

test/jasmine/tests/surface_test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ describe('Test surface', function() {
6262
expect(traceOut.contours.x).toEqual(fullOpts);
6363
expect(traceOut.contours.y).toEqual(Lib.extendDeep({}, fullOpts, {
6464
show: true,
65-
relative: 0,
66-
locations: false,
6765
color: '#444',
6866
width: 2,
6967
usecolormap: false

0 commit comments

Comments
 (0)