Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions draftlogs/XXXX_fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix `scatter3d` allocating glyph outline vertices for markers without an outline, which cuts the vertex count of a circle marker from 104 to 60 [[#XXXX](https://github.com/plotly/plotly.js/pull/XXXX)]
4 changes: 2 additions & 2 deletions stackgl_modules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20379,7 +20379,7 @@ proto.update = function(options) {
var glyphBounds = glyphData.bounds

triVertexCount += glyphMesh.cells.length * 3
lineVertexCount += glyphLines.edges.length * 2
if(this.lineWidth > 0) lineVertexCount += glyphLines.edges.length * 2
}
}

Expand Down Expand Up @@ -20575,7 +20575,7 @@ proto.update = function(options) {
}
}

var cells = glyphLines.edges
var cells = this.lineWidth > 0 ? glyphLines.edges : []
var verts = glyphLines.positions

for(var j=0; j<cells.length; ++j) {
Expand Down
5 changes: 2 additions & 3 deletions stackgl_modules/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion stackgl_modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"gl-line3d": "^1.2.2",
"gl-mesh3d": "^2.3.2",
"gl-plot3d": "^2.4.7",
"gl-scatter3d": "^1.4.1",
"gl-scatter3d": "github:settylab/gl-scatter3d#10592af307626abf5d7e96318d92b95bb19b4a77",
"gl-shader": "4.3.1",
"gl-spikes3d": "^1.0.11",
"gl-streamtube3d": "^1.4.2",
Expand Down
34 changes: 34 additions & 0 deletions test/jasmine/tests/scatter3d_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,40 @@ describe('Test scatter3d interactions:', function() {
.then(done, done.fail);
});

it('@gl should allocate glyph outline vertices only when marker.line.width is above 0', function(done) {
var obj;
var fillCount;

Plotly.newPlot(gd, [{
type: 'scatter3d',
mode: 'markers',
x: [1, 2, 3],
y: [2, 3, 1],
z: [3, 1, 2],
marker: {symbol: 'square', size: 10}
}])
.then(function() {
obj = gd._fullLayout.scene._scene.glplot.objects[0];

fillCount = obj.vertexCount;

expect(fillCount).toBeGreaterThan(0, '# of fill vertices');
expect(obj.lineVertexCount).toBe(0, '# of outline vertices, no outline');

return Plotly.restyle(gd, 'marker.line.width', 2);
})
.then(function() {
expect(obj.vertexCount).toBe(fillCount, '# of fill vertices');
expect(obj.lineVertexCount).toBeGreaterThan(0, '# of outline vertices, with outline');

return Plotly.restyle(gd, 'marker.line.width', 0);
})
.then(function() {
expect(obj.lineVertexCount).toBe(0, '# of outline vertices, outline removed');
})
.then(done, done.fail);
});

it('@gl should only accept texts for textposition otherwise textposition is set to middle center before passing to webgl', function(done) {
Plotly.newPlot(gd, [{
type: 'scatter3d',
Expand Down
Loading