Skip to content

Commit d0cf957

Browse files
authored
Merge pull request #4306 from plotly/fix4072-cone-showup
Handle data with identical positions in cone plots
2 parents c8a9f8a + a382f8a commit d0cf957

File tree

3 files changed

+37
-4
lines changed

3 files changed

+37
-4
lines changed

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"delaunay-triangulate": "^1.1.6",
7474
"es6-promise": "^3.0.2",
7575
"fast-isnumeric": "^1.1.3",
76-
"gl-cone3d": "^1.5.0",
76+
"gl-cone3d": "^1.5.1",
7777
"gl-contour2d": "^1.1.6",
7878
"gl-error3d": "^1.0.15",
7979
"gl-heatmap2d": "^1.0.5",

test/jasmine/tests/cone_test.js

+33
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,39 @@ describe('Test cone autorange:', function() {
177177
});
178178
});
179179

180+
describe('Test cone autorange:', function() {
181+
var gd;
182+
183+
beforeEach(function() {
184+
gd = createGraphDiv();
185+
});
186+
187+
afterEach(function() {
188+
Plotly.purge(gd);
189+
destroyGraphDiv();
190+
});
191+
192+
it('@gl should skip identical positions in calculating cone vectorScale', function(done) {
193+
Plotly.plot(gd, {
194+
data: [
195+
{
196+
type: 'cone',
197+
x: [-1, -1, -3, -4],
198+
y: [1, 1, 3, 4],
199+
z: [1, 1, 3, 4],
200+
u: [-1, 2, -3, -4],
201+
v: [1, -2, 3, 4],
202+
w: [1, -2, 3, 4]
203+
}
204+
]
205+
}).then(function() {
206+
expect(gd._fullLayout.scene._scene.glplot.objects[0].vectorScale).toBeCloseTo(0.2857, 4);
207+
})
208+
.catch(failTest)
209+
.then(done);
210+
});
211+
});
212+
180213
describe('Test cone interactions', function() {
181214
var gd;
182215

0 commit comments

Comments
 (0)