StructArrays.jl icon indicating copy to clipboard operation
StructArrays.jl copied to clipboard

Juno proper Base.show for StructArrays

Open aminya opened this issue 6 years ago • 2 comments

I want StructArrays to be shown like Arrays, but overloading this doesn't help:

Base.show(io, x::StructArray{T,T1,T2,T3}) where {T, T1,T2,T3} = Base.show(io, Array(x))

aminya avatar Jan 03 '20 08:01 aminya

You may try variants of this

julia> Base.show(io::IO, ::MIME{Symbol("text/plain")}, x::StructArray) = show(io, Array(x))

jishnub avatar May 11 '20 16:05 jishnub

Is there a way to make Juno show StructArrays like Arrays? I need it for exploring data inside the workspace. This issue was meant for Juno mainly.

I tried this but it does not work:

import TreeViews: hastreeview, numberofnodes, treelabel, treenode
Base.show(io::IO, ::MIME"application/prs.juno.inline", x::StructArray) = show(io, Array(x))
hastreeview(::StructArray) = true
numberofnodes(x::StructArray) = length(Array(x))

aminya avatar May 30 '20 23:05 aminya