Repository navigation
[FEATURE]: Add scatterternarygl trace for ternary plot #7058
Description
Activity
- changed the title
[-][Feature request] Support scattergl trace for ternary plot[/-][+]add scattergl trace for ternary plot[/+]on Aug 9, 2024 To the Plotly team,
Here is a prototype of
scatterternarygl, a new webgl trace type for ternary plots.I may open a draft PR when I have some time. I would open it as a draft since this introduces a new trace type, and I think some discussion with the Plotly team would be helpful before moving forward.
Below is a demo with 1 million points. I used marker styles similar to those in the WebGL vs SVG in JavaScript example:
PixPin_2026-09-07_19-33-30.mp4
Hover interactions remain very smooth.
Reacted by Robert Claus- changed the title
[-]add scattergl trace for ternary plot[/-][+][FEATURE]: Add scattergl trace for ternary plot[/+]on Sep 8, 2026 - changed the title
[-][FEATURE]: Add scattergl trace for ternary plot[/-][+][FEATURE]: Add `scatterternarygl` trace for ternary plot[/+]on Sep 21, 2026 There is no
hoveronattribute forscattergl. Sincescatterternaryglreuses much of thescatterglimplementation, it will not supporthoveroneither. I have no intention of supporting it specifically in the scatterternarygl PR, as this should be addressed upstream.This means that we can render a Basic Filled Ternary Plot with
scatterternarygl, but there will be no hover effects on the filled area.This was reported a long time ago and is still an open issue: #2887
Hopefully, support for the
hoveronattribute inscatterglcan be prioritized, since this limitation affects three WebGL-based traces (scattergl,scatterpolargl,scatterternarygl) and makes their behavior inconsistent with the corresponding SVG traces (scatter,scatterpolar,scatterternary).While implementing this PR, I found several bugs in
scattergl, whichscatterternaryglbuilds on.The issues I found are:
- [BUG]:
scattergltext is hidden behind selected markers #8081 - [BUG]:
scatterglincorrectly handles numeric and numeric-string marker variants #8070 - [BUG]:
axis.layer/axis.zerolinelayer:'above traces'do not render abovescattergltraces #8075 - [BUG]:
scatterandscatterglshow different hover labels for overlapping data points #8077 - Fill doesnt work when curves are of type scattergl #7383
Among these, the fill issue described in #7383 is the most severe and visually noticeable, as it affects all filled-area plots in
scatterternarygl.For #8075, I plan to address it directly in
scatterternarygl, since that logic is not reused fromscattergland therefore needs to be implemented separately.The other issues also affect
scatterternarygl, because the relevant functionality is reused directly fromscattergl.- [BUG]:
At this point, what bugs are blocking your work on
scatterternarygl?At this point, what bugs are blocking your work on
scatterternarygl?No, so far I've only found some bugs listed above during my implementation. They don't affect the core functionality, and those bugs are all inherited from
scattergl(scatterternaryheavily reuses code fromscatter, whilescatterternaryglfollows the similar way by reusing code fromscattergl)I've already submitted a PR #8083 and waiting for some initial feedback.
Reacted by Cameron DeCoster
Hello,
Currently the Ternary Plot only supports
scatterternarytrace, I am developing an open source glass web database where ternary visualizations are very usefull. However, I can sense that there's a performace lag when I have more points to render.This amount of data is fine and can be zoomed and panned without lag (around 300 points):

But with this, a bit lag while hovering and zooming (around 3000 points):

And below is of course very laggy (around 30000 points):

I found one comment #1385 (comment) from an old issue asking the same thing. It seems that it is not so easy to implement. Despite this, I would like to open this new issue to continue the discussion.