GenieFramework / StippleUI.jl

StippleUI is a library of reactive UI elements for Stipple.jl.
MIT License
82 stars 15 forks source link

Tables column names overriden #121

Open jeremiedb opened 7 months ago

jeremiedb commented 7 months ago

Not a bug per se as it seems a deisgn choice, but the introduction of the override of column names in DataTableOptions in v0.22.9: https://github.com/GenieFramework/StippleUI.jl/blob/584f88f756b4b35ec292811eac3db613f1b10362/src/Tables.jl#L158 happened to be undesirable for our applications. I would personally favor in general limited stylistic side effects from functions by default. Could adding a kw arg in DataTableOptions for specifying custom column names as Vector{String} cover those custom names needs, or having an opt-in "clean_colnames" boolean indicator?

hhaensel commented 7 months ago

I agree that uppercasing is a bit surprising, maybe we re-think/revise this or offer a kwarg to replace label_clean by a customer function, e.g. x -> string(x) or identify.

Meanwhile there's an easy solution to this that you can implement yourself, assuming that you are using DataFrames

mycolumns(df) = [Column(string(name), sortable = true, label = string(name)) for name in names(df)]
puredatatable(df) = DataTable(df, DataTableOptions(columns = mycolumns(df)))

dt = puredatatable(df)