queryverse / ElectronDisplay.jl

An Electron.jl based figure and table display.
Other
85 stars 17 forks source link

Add TableTraits.jl support #12

Closed davidanthoff closed 5 years ago

davidanthoff commented 5 years ago

@tkf This slightly extends your work on the grid: it should now work for any source that implements the TableTraits.jl interface. So DataFrames, IndexedTables, JuliaDB etc. should in theory all work now (I only tested DataFrame).

tkf commented 5 years ago

Thanks, this is a nice addition. While trying this branch out, I noticed that displaying some "poorly typed" DataFrames are problematic because it cannot be converted into a proper dataresource:

julia> electrondisplay(DataFrame(a=Any[1:5;]))
ERROR: MethodError: no method matching julia_type_to_schema_type(::Type{Any})

Maybe it's OK to convert them to strings as it's only for display?

davidanthoff commented 5 years ago

Yes, that is a great suggestion! https://github.com/queryverse/TableShowUtils.jl/pull/10 should do the trick.