QuantumSavory / CSSMakieLayout.jl

MIT License
16 stars 2 forks source link

Normalized size across monitors (retina) #2

Open AlexisRenchon opened 1 year ago

AlexisRenchon commented 1 year ago

Hello!

I am an active user of WGLMakie and JSServe, I wrote a small package, ParamViz.jl, unregistered as well for now, that I use to deploy web apps on a package docs.

An issue I am running into, is that WGLMakie figures are set in pixels, and therefore vary with the resolution of the monitor. On some monitors, my figures appear very big, and others, very small. I wish I could have my figures be a proportion of the monitor or web page... It is an issue Simon Danish (author of Makie and JSServe) is aware of, but fixing it is not a priority.

I imagine css would help, and it seems your package can do just that? I am not sure though, but I hope your package helps, I will experiment and let you know how it goes!

adrianariton commented 1 year ago

Yes, I ran into this problem to and I am to fix it soon in a future version of the library. The problem has to do with the feature of pixel doubling of retina screens, meaning the figures appear 2 times smaller than the intended resolution.

In retina screens each pixels is comprised of a 2x2 grid of smaller "virtual" pixels. The figure resolution is measured in the terms of the small pixels and that's why they appear half the size of what they are supposed to be on a normal screen.

I have come up with something to bypass it:

Let me know if you find a cleaner way to do this. Any contributions are greatly appreciated!

AlexisRenchon commented 1 year ago

Thanks a lot! I'm sure Simon would be interested in a solution too.

SimonDanisch commented 12 months ago

This will be fixed in the next breaking release, which will hopefully happen soon: https://github.com/MakieOrg/Makie.jl/pull/3113