Repository navigation
Conversation
A circle marker is a vectorized glyph mesh of 60 to 104 vertices, about 4,160 bytes in the vertex buffers. With scene.markerrender set to disc or auto, circle and circle-open markers draw as one gl.POINTS vertex with a round cutout in the fragment shader, with an outline ring for marker.line.width. Other symbols, projections on the axes and sprites larger than the point size limit keep the glyph path. The default is glyph, so rendering does not change unless the attribute is set. gl-scatter3d is pinned to a fork commit, and stackgl_modules/index.js is rebuilt from it.
The value disc draws a glyph where a disc cannot draw the marker, and auto is the same as disc for now. The first description left both out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This adds
scene.markerrender. The valuediscdraws ascatter3dcircle marker as one vertex instead of 60 to 104. That cuts the vertex buffer from 4,160 to 36 bytes per marker. A disc also drawsmarker.line.widthas requested, which addresses plotly#3796 for circle markers. The default isglyph, so nothing changes unless a user opts in.Vertex buffer bytes per marker, glyph and disc.
Today each circle marker is a glyph mesh of 60 fill and 44 outline vertices. At 1 million markers the vertex buffers hold 4.16 GB. The outline is a GL line, and Chrome with ANGLE caps a GL line at 1 px (plotly#3796).
Glyph, hard disc and soft disc at marker sizes 3, 20 and 60, enlarged 2x at pixel ratio 2. The box shows one edge at 8x.
A disc is one
gl.POINTSsprite. The fragment shader cuts out the round shape and the outline ring. Alpha-to-coverage smooths the edge on an opaquescene.bgcolor. A transparent canvas andPlotly.toImageblend a rim. Other symbols, axis projections and markers above the GPU point size limit keep the glyph path.AnnZarro, a viewer for single-cell data, motivates the change. I am glad to rework, split or drop any part.
Addresses plotly#3796 for circle markers with
scene.markerrender: 'disc'.Closes #XXXX
Changes
scene.markerrender:glyph(default),discandauto.autois currently the same asdisc.stackgl_modules/package.jsonpins agl-scatter3dfork commit that draws the discs, as in 58d0503 (the gl-vis pull request follows)Plotly.toImagemarks the scene so that exports get soft edgesdraftlogs/XXXX_add.mdTesting
scatter3d_test.jsandgl3dlayout_test.jscover vertex counts, fallbacks, outlines, the default and hoverglyph, seven scenes render the same pixels asmainat pixel ratios 1 and 2, and hover ids matchscatter3d,gl3dlayout,gl3d_hover_click,gl3d_plot_interact,plot_schemaandtoimagefail the same four specs onmainand on this branch in headless Chromenpm run lint,npm run typecheck,npm run test-syntaxandnpm run schema-typegen-diff-checkpassNotes
glyphkeeps every baseline. A default ofautomoves about 52 image baselines.mainand 4,831,937 bytes on this branchscene.oitpin different gl-scatter3d commits. The second of the two to merge pins settylab/gl-scatter3d 308dcbb and takes one spec. That commit holds the two changes and a disc shader for the OIT passes. Translucent discs underscene.oit: 'auto'need that shader. The branchpr/disc-oitholds this state, built and tested.Checklist
ready-for-prlabel, and it has no assignee or lists me as an assigneemainin my forkdist/package-lock.jsononly for a dependency changedraftlogs/as draftlogs/README.md describes, or I will add one after the pull request opens