From a382f8a547b1442fec53723d6fbe96a72be98282 Mon Sep 17 00:00:00 2001
From: archmoj <mojtaba@plot.ly>
Date: Thu, 24 Oct 2019 18:52:19 -0400
Subject: [PATCH] cone skip points close to each other when compute scale - add
 jasmine test to lock issue 4072 - bump gl-cone3d 1.5.1

---
 package-lock.json               |  6 +++---
 package.json                    |  2 +-
 test/jasmine/tests/cone_test.js | 33 +++++++++++++++++++++++++++++++++
 3 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index c420ab4bf87..445c84c0ef6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -4450,9 +4450,9 @@
       }
     },
     "gl-cone3d": {
-      "version": "1.5.0",
-      "resolved": "https://registry.npmjs.org/gl-cone3d/-/gl-cone3d-1.5.0.tgz",
-      "integrity": "sha512-Hkdx04QvqbzkHAP1nt4jkJD9F9hwJBqZR6ty2DbnQgkgWfIC2sRksDbzFkwPQ3HscTBNLdnuPIBBZ3123jBBVg==",
+      "version": "1.5.1",
+      "resolved": "https://registry.npmjs.org/gl-cone3d/-/gl-cone3d-1.5.1.tgz",
+      "integrity": "sha512-R8m2lPfVN5ip/IPzykvMNgUUGWTkp9rMuCrVknKIkhjH+gaQeGfwF3+WrB0kwq3FRWvlYWcfdvabv37sZ2rKYA==",
       "requires": {
         "colormap": "^2.3.1",
         "gl-buffer": "^2.1.2",
diff --git a/package.json b/package.json
index 27000503d22..26a110f6bc4 100644
--- a/package.json
+++ b/package.json
@@ -73,7 +73,7 @@
     "delaunay-triangulate": "^1.1.6",
     "es6-promise": "^3.0.2",
     "fast-isnumeric": "^1.1.3",
-    "gl-cone3d": "^1.5.0",
+    "gl-cone3d": "^1.5.1",
     "gl-contour2d": "^1.1.6",
     "gl-error3d": "^1.0.15",
     "gl-heatmap2d": "^1.0.5",
diff --git a/test/jasmine/tests/cone_test.js b/test/jasmine/tests/cone_test.js
index e7813358416..7a2d5233839 100644
--- a/test/jasmine/tests/cone_test.js
+++ b/test/jasmine/tests/cone_test.js
@@ -177,6 +177,39 @@ describe('Test cone autorange:', function() {
     });
 });
 
+describe('Test cone autorange:', function() {
+    var gd;
+
+    beforeEach(function() {
+        gd = createGraphDiv();
+    });
+
+    afterEach(function() {
+        Plotly.purge(gd);
+        destroyGraphDiv();
+    });
+
+    it('@gl should skip identical positions in calculating cone vectorScale', function(done) {
+        Plotly.plot(gd, {
+            data: [
+                {
+                    type: 'cone',
+                    x: [-1, -1, -3, -4],
+                    y: [1, 1, 3, 4],
+                    z: [1, 1, 3, 4],
+                    u: [-1, 2, -3, -4],
+                    v: [1, -2, 3, 4],
+                    w: [1, -2, 3, 4]
+                }
+            ]
+        }).then(function() {
+            expect(gd._fullLayout.scene._scene.glplot.objects[0].vectorScale).toBeCloseTo(0.2857, 4);
+        })
+        .catch(failTest)
+        .then(done);
+    });
+});
+
 describe('Test cone interactions', function() {
     var gd;