Closed frankvgompel closed 2 months ago
you need to format the data yourself. egui already has examples in demo for table/grid, polars dataframe implements iterators / indexing etc.. and you can use it as the source data for table / grid widgets. look at https://egui.rs for the table demo and it will also have a source link at the bottom of the demo widget.
this is not a feature request btw. just a question.
this is not a feature request btw. just a question.
Well, I asked if it was possible to support so you might consider my question elevated into a feature request. Anyway thanks, I have already been working on a general dataframe table but new to Rust and struggling (also with Polars btw).
But since you say I have to format the data myself, could you at least give some info why the console is able to pretty-print a polars dataframe but it seems egui isn't?
But since you say I have to format the data myself, could you at least give some info why the console is able to pretty-print a polars dataframe but it seems egui isn't?
These kinds of questions are better answered in discord. Both egui and plars got their own discord servers where you can get help.
Anyway, this could be an issue with fonts. First, terminal fonts are monospace, so the columns always align. I think ui label doesn't do that. Second, polars could be printing different strings in egui vs terminals based on the env as seen here https://pola-rs.github.io/polars/src/polars_core/fmt.rs.html#353 . In particular, the chars used for egui dont seem like ... or === which seem to be used for console. Because egui already supports those chars.
I am on mobile, so hard to test atm.
An integration between Polars and Table
is best left to a 3rd party crate
https://github.com/emilk/egui/discussions/2222
Is this possible? I am actually rebuilding a project I did in Python with Streamlit. Gives great possibilities for data dashboards. Perhaps worth looking into.