Is there a way to change how specific types are displayed? #2679
-
Specifically I had problems with how StructArrays are displayed with custom struct types, but I wanted to know if there was a simple way to customize how things are displayed in general. Issues related to StructArrays have been fixed to the point where everything displays without error, but the interactive inspector only works for NamedTuple StructArrays (#792 #1935 #2324). The interactive inspector is nice, but I don't need it. If I could display I tried implementing a Here is an example of how it works right now:
Displays:
The specific change I want is to not have the If someone could help me or direct me to solving the general or specific problem I'd appreciate it! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Overriding Outside of the interactive inspector stuff, this doesn't seem to have anything to do with pluto. |
Beta Was this translation helpful? Give feedback.
Overriding
Base.show
works and affects how pluto displays StructArrays. I was overriding the wrong method before.You have to overwride
function Base.show(io::IO, ::MIME"text/plain", v::MyVector{<:MyType})
.See this answer: https://stackoverflow.com/questions/58962304/how-to-overload-base-show-for-custom-array-types
Outside of the interactive inspector stuff, this doesn't seem to have anything to do with pluto.