-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
scattergl fillcolor incorrect with multiple polygons in same trace when with fill: toself
#2291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
cc @Kully - this is going to be an issue with the Python county choropleth as well. Probably watch this issue and hold off on the WebGL approach until this is fixed: |
I actually found that But I only checked in the Python API |
related: #2450 |
Another example of the USA choropleth from here: https://plot.ly/python/county-choropleth/#the-entire-usa This is switching |
⬆️ Doesn't look like the recent |
There haven't been any scattergl fill changes since the regl push back January. |
Oh, I thought @dy had done some work on |
He's done some work. But none of which is ready to get merged at this stage. |
It is coming, after regl-text. Pls stay tuned) |
A nice pared-down reproduction from @llnns in #2845: Using https://codepen.io/anon/pen/NBvbbv Results in: Also, using the same data with |
Hey, maybe another hint here: It seems that the extra triangle comes from the triangulation function earcut. The block at plotly.js/src/traces/scattergl/index.js Lines 452 to 466 in 1ecef45
pos array:
That it is been pass to earcut function as
Notice that the result has 21 indices, 7 triangles, one more than the 6 needed for the 3 rectangles example. Also, I am not sure if it is intended, but in the |
A very nice example from @ErwanMAS in #3025 Please look . https://codepen.io/erwanmas/pen/dqQrbR The issue is generated by https://github.com/mapbox/earcut in https://github.com/a-vis/regl-line2d . AND earcut doesn't guarantee correctness https://github.com/mapbox/earcut/blob/master/README.md a simple console.log here https://github.com/a-vis/regl-line2d/blob/b9d56d51e1598c4ee7a9a5e0a733e920daf63c2d/index.js#L520 will output only 1 triangle , instead of 2 triangles |
I was trying to use plotly's scattergl to rendering thousands of boxes and hit this old issue. It seems like nobody is working on it so I would like to give it a try. I think this is the cause of the issue:
As a result of above, we end up with a strange shape polygon, use @llnns's example again: I don't think this is a bug in https://github.com/mapbox/earcut , since it does what regl ask it to do: triangulate a single polygon. The solution I am proposing is:
I have a prototype working locally, at least for my usecase (fill=toself). But this fix requires a pull request to both plotly and regl.Line2D, and I am not expert in either javascript nor github, so I would really appreciate some guidance here. |
Hi all, still having this issue. Are there any plans to merge any of the proposed solutions into main plotly? This single bug fix could potentially fix so many of my plotting performance issues, so I'm eagerly looking forward to it! Hopefully it can be prioritized. Another example posted here if needed: https://community.plotly.com/t/feature-request-for-gantt-gl-like-scatter-gl/37925/4 |
This issue has been tagged with A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort. Sponsorship range: $15k-$20k What Sponsorship includes:
Please include the link to this issue when contacting us to discuss. |
Thanks for the update :). Now another feature request for @github, if you're listening - we should have Gofundmes attached to issues! I'd gladly commit a few hundred to this issue if it could be done in a safe and organized way |
I would also like to see this fixed, so +1 for that. However that I feel that sponsership range is pretty excessive considering a bunch of people have already dug out what the root cause appears to be... |
Created two PR to plotlyjs and regl I am happy to help with any further testing, as long as this got fixed. |
@ruijin , thanks for making the pull requests! I'm excited to try them out! |
Hi @ruijin , I tried manually updating the |
Fixed via #5355. |
https://codepen.io/cpsievert/pen/ZvNqjQ
Note that fillcolor renders correctly when
type: scatter
.The text was updated successfully, but these errors were encountered: