-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
plotGlPixelRatio has no effect on scattergl #5497
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
Looking at https://www.khronos.org/webgl/wiki/HandlingHighDPI, I wonder if we need to use a larger canvas size here: plotly.js/src/plot_api/plot_api.js Lines 225 to 227 in 7347bed
This doesn't work on its own, but something like: fullLayout._glcanvas
.attr('width', fullLayout.width * config.plotGlPixelRatio)
.attr('height', fullLayout.height * config.plotGlPixelRatio)
.style('width', fullLayout.width)
.style('height', fullLayout.height); In this case, I think we would not want to use a constant marker size (#5093). But I don't understand this very well. And not sure why it wouldn't be an issue with gl3d plots. |
Looks like this is what scatter3d is doing: var nextWidth = Math.ceil(width * scene.pixelRatio)|0
var nextHeight = Math.ceil(height * scene.pixelRatio)|0
if(nextWidth !== canvas.width || nextHeight !== canvas.height) {
canvas.width = nextWidth
canvas.height = nextHeight
var style = canvas.style
style.position = style.position || 'absolute'
style.left = '0px'
style.top = '0px'
style.width = width + 'px'
style.height = height + 'px'
dirty = true
} |
In that case perhaps we also need to patch |
I think I have a solution... Will open WIP PR in a bit. Edit: only needs plotly.js updates |
demo
The text was updated successfully, but these errors were encountered: