plotters
plotters copied to clipboard
More shorthand functions and ergonomics
What is the feature ?
I'm trying out this library for the first time and there's some places where it would be delightful to have shorthand functions:
- Shorthand functions for Pos:
Pos::top_right,Pos::bottom_right,Pos::bottom_centeretc.. - Short way to set colors for components. Currently, lots of boilerplate is required for e.g. white-on-black plotos
- a cool start would be to have IntoTextStyle implementation for
(FontFamily, T, RGBAColor)
- a cool start would be to have IntoTextStyle implementation for
- A direct way to create an RGBAColor
- A more sensible default font size than one pixel see here
- Common trait derives for RGBColor, i.e. Copy, Clone, Eq, PartialEq, Default, Hash
From<RGBColor>impl for RGBAColor- Expose BitMapBackendError to allow handling those errors
Why this feature is useful and how people would use the feature ?
More shorthand functions and ergonomics are always good, I think
Thanks for the suggestions and sorry for the delay. I haven't got a chance to look at the issue since a few month ago.
Most of suggestion seems really helpful, but I would like to understand more about few things:
1. Shorthand functions for Pos: `Pos::top_right`, `Pos::bottom_right`, `Pos::bottom_center` etc..
What is this particularly for ? Since we have positioning enums used in both ChartBuilder and legends, which one are you referring or both?
Thanks!
Just put the items here for tracking purposes.
-
[x] Short way to set colors for components: e.g. IntoTextStyle implementation for
(FontFamily, T, RGBAColor) -
[x] A direct way to create an RGBAColor
-
[x] Default font size? (This might be a chance to revisit #73 )
-
[x] RGBColor should impl more traits
-
[x] From<RGBColor> for RGBAColor
-
[x] BitmapBackendError visibility
1. Shorthand functions for Pos: `Pos::top_right`, `Pos::bottom_right`, `Pos::bottom_center` etc..What is this particularly for ? Since we have positioning enums used in both ChartBuilder and legends, which one are you referring or both?
Looking back at it, I think I had in mind a shorthand for Pos::new(HPos::XXX, VPos::XXX). So,
Pos::new(HPos::Center, VPos::Center)=>Pos::CenterPos::new(HPos::Top, VPos::Right)=>Pos::TopRight
Something like that. On second thought, I'm not sure if this would be worth it.
Also, please excuse my tone in the first message I posted. I was in a bad mood and wanted to show it, sorry
I am not sure what is meant by "Expose BitMapBackendError to allow handling those errors". The error seems already publicly exposed.
Oh now it apparently is
It wasn't in 0.3.1 https://docs.rs/plotters-bitmap/0.3.1/plotters_bitmap/?search=BitMapBackendError
Would be nice to add this to the 0.3.2 changelog
I think the list is complete now. Feel free to close this issue or comment if something is still missing :)