From 546b97c69cc3ff5aa56e682ce011d53edc3d3188 Mon Sep 17 00:00:00 2001 From: Tanishdete333 Date: Sun, 1 Nov 2026 10:20:36 +0530 Subject: [PATCH 1/2] Fix scatterpolargl point snapping --- src/traces/scatterpolargl/calc.js | 3 +++ test/jasmine/tests/scatterpolargl_test.js | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/traces/scatterpolargl/calc.js b/src/traces/scatterpolargl/calc.js index fd653403c7c..3927964ea6b 100644 --- a/src/traces/scatterpolargl/calc.js +++ b/src/traces/scatterpolargl/calc.js @@ -27,6 +27,9 @@ module.exports = function calc(gd, trace) { // only compute 'style' options in calc, as position options // depend on the radial range and must be set in plot var opts = stash.opts = convert.style(gd, trace); + if(opts.marker) { + opts.marker.snap = len; +} // For graphs with very large number of points and array marker.size, // use average marker size instead to speed things up. diff --git a/test/jasmine/tests/scatterpolargl_test.js b/test/jasmine/tests/scatterpolargl_test.js index f964ed4bef5..959d6fba3a7 100644 --- a/test/jasmine/tests/scatterpolargl_test.js +++ b/test/jasmine/tests/scatterpolargl_test.js @@ -171,6 +171,26 @@ describe('Test scatterpolargl interactions:', function() { }); } + it('@gl should set marker.snap to the number of points', function(done) { + gd = createGraphDiv(); + + Lib.seedPseudoRandom(); + var N = 12000; + var r = []; + var theta = []; + for(var i = 0; i < N; i++) { + r.push(Lib.pseudoRandom()); + theta.push(Lib.pseudoRandom() * 360); + } + + Plotly.newPlot(gd, [{type: 'scatterpolargl', mode: 'markers', r: r, theta: theta}]) + .then(function() { + var scene = gd._fullLayout.polar._subplot._scene; + expect(scene.markerOptions[0].snap).toBe(N); + }) + .then(done, done.fail); + }); + it('@gl should be able to toggle from svg to gl', function(done) { gd = createGraphDiv(); From 0cf5d9d046b4e29defe47f7956b37b21d4417320 Mon Sep 17 00:00:00 2001 From: Tanishdete333 Date: Sun, 1 Nov 2026 10:53:02 +0530 Subject: [PATCH 2/2] Add draftlog for PR #8159 --- draftlogs/8159_fix.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 draftlogs/8159_fix.md diff --git a/draftlogs/8159_fix.md b/draftlogs/8159_fix.md new file mode 100644 index 00000000000..155fcbccbef --- /dev/null +++ b/draftlogs/8159_fix.md @@ -0,0 +1 @@ +- Set the marker snapping threshold for `scatterpolargl` traces to the number of points in the trace [[#8159](https://github.com/plotly/plotly.js/pull/8159)]