You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the canvas element is scaled by window.devicePixelRatio and then scaled back down by the CSS properties the results look better on HiDPI displays. Given the small nature of most sparklines, this is pretty huge. #nopun
Here are two images from my use case. First with stock code...
I'd be happy to complete the work on this (hover over is broken) and write it using more compatible code (e.g. no const) if this project is still active (last commit 2013). Otherwise I'll probably fork and put my changes up there.
The text was updated successfully, but these errors were encountered:
@anandmehrotra I don't have a dist, but i I'm now using a heavily modified version of this lib in one of my projects here: https://github.com/SauceLLC/sauce4strava/blob/master/src/site/sparkline.js It has the above changes plus a bunch other enhancements and things like value based gradient fills. You can clone and grep through that project for examples of how to use some of the extended funcs.
If the canvas element is scaled by
window.devicePixelRatio
and then scaled back down by the CSS properties the results look better on HiDPI displays. Given the small nature of most sparklines, this is pretty huge. #nopunHere are two images from my use case. First with stock code...
And here with a modified
_calculatePixelDims
...Those results come from this incomplete patch:
I'd be happy to complete the work on this (hover over is broken) and write it using more compatible code (e.g. no
const
) if this project is still active (last commit 2013). Otherwise I'll probably fork and put my changes up there.The text was updated successfully, but these errors were encountered: