Skip to content

[FEATURE]: Large and translucent point clouds in scatter3d and scattergl #12

Backlog

Description

@katosh

Description

AnnZarro is an open viewer for single-cell data. It draws 1 million to 100 million points with plotly.js. At that size, plotly.js main (df22b38) reaches these limits:

Conditions: Apple M3 Max, headless Chromium on ANGLE Metal, 1200 x 800 px. Each plot holds ten traces of opaque markers of size 3 with Float32Array input, and hover is off in 2D. Each number is one run, unless the item says median.

Why should this feature be added?

Each limit has a cause in the code, and a change that removes the cause.

  • Marker meshes. A scatter3d circle marker is a glyph mesh of 104 vertices, 60 for the fill and 44 for the outline. That is 4,160 bytes of vertex data per marker, and a trace of 2,000,000 markers exceeds the typed array limit. One point sprite per circle marker is sufficient, and a marker without an outline needs no outline vertices.
  • The outline. The outline is a GL line, and Chrome with ANGLE draws a GL line 1 pixel wide. A fragment shader can draw the ring of a point sprite with the width that marker.line.width sets.
  • One array per point. convert.js builds one small array for each scatter3d point. Typed x, y and z can go to the GPU as one Float32Array. An edit that keeps the positions then uploads no position.
  • Transparency. The scene blends translucent markers in draw order. A fixed number of depth layers per pixel can weight each fragment by the markers in front of it. Then the draw order has no effect, and the scene sorts nothing.
  • The pick pass. The scene draws the pick pass in each frame, but only a pointer event reads the pick buffer. The scene can draw the pass when an event asks for it.
  • scattergl copies. calc and regl-scatter2d copy each point several times and upload 16 bytes of positions per point, also for a recolor or a reorder. A Float32Array can go to the GPU one time with 8 bytes per point. A trace of 100,000 points or more also gets a hover tree at every calc (see [BUG]: scattergl hover is slow above 100k points plotly/plotly.js#8134). The first hover can build that tree.
  • Constrained axes. A range change under scaleanchor sets the recalc flag. With fixed ranges, a replot applies the constraint, and no recalc is necessary.
  • Tens of millions of points. One full draw of 50,000,000 points takes too long for a pan frame. A thinned preview can follow the pointer, and the full picture can follow at rest.
  • WebGL contexts. Each scattergl graph creates two WebGL contexts, and the second context shows only selected points. The graph can create that context when a selection starts.
  • Marked points. Points in front hide marked points inside a dense cloud, such as a selection. A trace attribute can keep one trace on top, without a depth test.

Which of these changes do you want in plotly.js, and in which form? We have a prototype for each one on our fork. After your choice, we open small pull requests, one per change. Thank you for your time.

Mocks/Designs

Four line charts of the time to open and of the GPU buffers against the point count, with a red X where the plot fails
plotly.js main alone: time to the first frame and GPU buffers against the number of points. The red X marks where the plot stops. In 3D, that is a RangeError from 2M points per trace. In 2D, the tab crashes at 50M points. Not run: 100M and more in 3D, and 1M, 2M and 100M in 2D.

Notes

Contribution

  • I want to open a pull request for this issue after it gets the ready-for-pr label
  • I can review or test a pull request from someone else

Activity

  1. changed the title [-][DRAFT for plotly.js] [FEATURE]: Large and translucent point clouds in scatter3d and scattergl[/-] [+]Issue to file: [FEATURE]: Large and translucent point clouds in scatter3d and scattergl (overview)[/+] on Dec 5, 2026
  2. changed the title [-]Issue to file: [FEATURE]: Large and translucent point clouds in scatter3d and scattergl (overview)[/-] [+][FEATURE]: Large and translucent point clouds in scatter3d and scattergl[/+] on Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions