-
-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing and inconsistent array-of-dicts display #2417
Comments
@ReubenJ something for you? 😗 |
Ok, just to make sure I understand, we want these three: [Dict(1 => 2), Dict(3 => 4)] [Dict(1 => 2), Dict(3 => 4)] |> StructArray StructArray(rand(10^1) + im * rand(10^1)) to all display in the vector form like so: and these: StructArray((a = [rand(Bool, 3) for i = 1:3, j = 1:2], b = [rand(Bool) for i = 1:3, j = 1:2])) [1 2; 2 3; 3 4] to display in the Matrix form like so: Did I get that right? |
Sounds right to me! |
Looks great! |
@ReubenJ Can you make a PR? |
@fonsp sorry for the delay on this. I've come back a couple of times to try and figure out a fix, but I've not come across anything clever so far. I would ideally avoid adding a button/switch to change between table and tree views, but I don't see any way to detect whether something like a Any ideas? Or is the display toggle a good enough solution? |
These three arrays of dicts are displayed in totally different ways:
Structurally they are the same, and REPL shows them in very similar ways.
I would expect all of them to display as the first one, with the Pluto explorer. The second seems outright wrong, and the third just confusing and inconvenient.
More generally, I often find the table viewer too "eager" to engage. Maybe, there should be an override toggle (display as table or with interactive explorer) in each cell output? It would be useful both ways: sometimes tables don't get recognized.
Notebook file
The text was updated successfully, but these errors were encountered: