Option for <canvas> padding
See original GitHub issueVery minor issue here with a chart with a line width
of 4 where the line and highlight dot is partially cut off on 0
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.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Understand margins, paddings, and borders - How to Canvas
Margins and padding both work similarly to create space between elements and content in our Canvas courses, but they do so differently.
Read more >Canvas padding attributes ✏️ - CodePen
Use + & - buttons to adjust canvas padding on top, left, bottom and right! - 0 +. + 0 -.
Read more >Solved: New RCE: Image Padding - Instructure Community
To my knowledge, there isn't any way in the Canvas UI (User Interface) to apply image padding to multiple images across the board....
Read more >Understanding margins, paddings, and borders - YouTube
Margins and padding both work similarly to create space between elements and content in our Canvas courses, but they do so differently.
Read more >Adding Padding to Images in Canvas - YouTube
A brief tutorial on adding padding to images in Canvas's HTML editor. ... Setting up a Quiz in Canvas. Jenn Kepka. Jenn Kepka....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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:
Math.max(5, width * 2 - 1)
. additionally,series.class
now exists and will get tacked onto the cursor points & legend, so you can tweak those further in css as required. at some point it might be good to add full customization like providing ready-to-go dom elements for the cursor points, but that’ll likely be considered when i give more thought to https://github.com/leeoniya/uPlot/issues/10, post 1.0.@silverwind as of 0bbe1638ebc461a75a1caa97d79ef1b105b93196, 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
uPlot.rangeNum()
, since it was first exposed specifically for this purpose.