Skip to content
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

NumOrString trait not implemented for f32 #47

Closed
crystal-growth opened this issue Jan 8, 2022 · 0 comments
Closed

NumOrString trait not implemented for f32 #47

crystal-growth opened this issue Jan 8, 2022 · 0 comments

Comments

@crystal-growth
Copy link

NumOfString trait implementation is missing for f32 type, preventing from using it in defining axis ranges:

let (xmin:f32, xmax:f32) = some_func();
...
let layout = plotly::Layout::new()
 .x_axis(Axis::new().range(vec![xmin, xmax]).auto_range(false))

results in compilation error:

the trait `ptly::plotly::private::NumOrString` is not implemented for `f32`

requiring manually casting f32 to f64:

...
.x_axis(Axis::new().range(vec![xmin as f64, xmax as f64]).auto_range(false))
...

that looks less ergonomic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants