Closed bananaturtlesandwich closed 1 year ago
Sorry for not noticing this earlier, not sure why I didn't just do this. I'll take a look at it after I get some coffee. Changes made in the new version should be easy to implement.
I made the following minor changes:
.data
to .get_data
so it doesn't conflict with the current function naming scheme, where a function without a prefix like get_
or set_
is often a setter that consumes itself..set_data
to allow more flexability and be more similar to the egui data set methods.lib.rs
and README.md
I really appreciate the time you took to contribute! Anything else you can suggest? Any changes you don't like?
Also just adapted the code to 0.3.0, went pretty smoothly
Just realised a few things
set_data
- might as well just give a mutable reference.set_data
funciton. Callback provides a nice isolated scope for you to modify the data but it's kinda unusual and perhaps overly complicated.I'll decide everything tomorrow I need to wake up in 8 hours and go to work though so not the best time to fix this lol
Gotcha thx for answering - for the first thing the only reason egui does that is because there was a deadlock issue which that resolved - that's not going to happen here so a mutable reference is just better I think
* you should probably put the builtin chart types behind a feature since most people won't use them * std::time::Instant doesn't exist on wasm so the timechart stuff won't work there (the above would avoid this problem but wouldn't allow any future builtins or you could put the type in the example or you could use the instant crate but you don't really want another dependency so I think probably just put in the example)
I'm not quite sure how I'm going to get it working with wasm yet, apparently plotter supports it but it also requires backends to implement the Error trait, which is in the standard library only. I'll have to look at it when I have more time; I'm currently on lunch break, I'm a little confused.
wasm isn't no_std
it just doesn't have the time and fs modules due to platform agnostics
Also you uncapitalised some of the code in the readme :p
Also you uncapitalised some of the code in the readme :p
I know there is a typo in the commit but it is fixed. Melatonin kicking in and I wanted to knock this out of the way lol
It's kinda embarrassing how many times I try to yank a block in vim and accidentally hit 'u'. And even more embarrassing in that I don't even notice it most of the time until I get compile errors.
I'll work on making charts a separate feature in another branch, I think this code achieves the goal it was set for though and I'll go ahead and merge it. Thanks again!
Thanks!
std::any::Any
set_data
which takes a callback similar to egui'sui.input()