brownplt / code.pyret.org

Website for serving Pyret to folks.
Other
24 stars 45 forks source link

pyret thumbnails of box-plots accidentally emphasize some lines over others #401

Closed schanzer closed 5 months ago

schanzer commented 3 years ago

From an issue @flannery-denny originally posted in the curriculum repo, which I suspect is a scaling algorithm issue:

See this file with this code box-plot(table, "a") screenshots below

Screen Shot 2021-08-27 at 8 19 02 AM Screen Shot 2021-08-27 at 8 19 09 AM Screen Shot 2021-08-27 at 8 23 44 AM

My hunch is that one of the vertical lines, when scaled, is falling on a pixel boundary. As a result, we get two pixels of gray instead of one pixel of black. This has the result of making it appear that one vertical line is "emphasized" over the others. I wonder if toggling imageSmoothingEnabled would make a difference?

blerner commented 5 months ago

This doesn't replicate on my laptop, in either Chrome or Firefox (the plots are columns a, b, c and d in order): image

It's worth pointing out that your suggested fix of setting imageSmoothingEnabled is moot, since the _default value is already true` as pointed out by that very doc link!

I'm not sure how you're seeing what you're seeing, but I suspect it's very much laptop-and-OS-dependent, and therefore not readily fixable. Worth closing?

schanzer commented 5 months ago

@blerner yeah, let's close