-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
Option for <canvas> padding #71
Comments
sounds doable. |
this is now possible to do externally: https://leeoniya.github.io/uPlot/demos/pad-scale.html i probably won't add a built-in padding feature because the heuristics can get pretty opinionated and complex, depending on the data & requirements. another neat thing is the elegant (imo) external impl of mousewheel zooming: |
there were a couple rounding issues that should be fixed now. it's never gonna be perfect since all interactive elements are in the DOM while the grid + trendlines are on canvas (which follows devicePixelRatio). feel free to PR any improvements, though.
i've moved the dot sizing logic to JS and it's now relative to series line width: |
@silverwind as of 0bbe163, the custom padding should no longer be necessary. now that the canvas goes extends outside the plotting area, it was a matter of adjusting the clipping regions for the paths and [new!] points. if you look at https://leeoniya.github.io/uPlot/demos/pad-scale.html, there's no longer anything custom there. i'll remove this demo before 1.0, since it no longer demonstrates anything. i might re-internalize |
Very minor issue here with a chart with a line
width
of 4 where the line and highlight dot is partially cut off on0
values:Maybe have a option to define a
padding
on the<canvas>
area? I'd define a 2px padding in this case to accommodate the line width.The text was updated successfully, but these errors were encountered: