Skip to content
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

Use Pluto tree viewer for Set data type (issue 893) #926

Merged
merged 7 commits into from Mar 16, 2021
Merged

Use Pluto tree viewer for Set data type (issue 893) #926

merged 7 commits into from Mar 16, 2021

Conversation

vladflore
Copy link
Contributor

Hey @fonsp ,

When you get to this please have a look and let me know if this PR is on the right track or is already a total mess :).

This PR relates to issue #893

Thanks,
Vlad

@fonsp
Copy link
Owner

fonsp commented Feb 18, 2021

Hey @vladflore, the code so far looks good! Can you post a screenshot?

@vladflore
Copy link
Contributor Author

Yes, I can do that, will do it a bit later this day though :)

@vladflore
Copy link
Contributor Author

vladflore commented Feb 18, 2021

Here is a gif of how it looks like:

pluto-tree-viewer-set

Let me know if you need anything else.

Best,
Vlad

@fonsp
Copy link
Owner

fonsp commented Feb 18, 2021

Thanks! It looks like you made all the necessary changes to the backend (Julia), but we still need to change the appearance, so that people can tell that the object is a set, and not an array.

Of course, our main inspiration is the julia REPL, where sets are displayed like:

julia> Set([1,2,3]) |> print      # 'non-verbose' mode
Set([2, 3, 1])

julia> Set([1,2,3])               # 'verbose' mode
Set{Int64} with 3 elements:
  2
  3
  1

I think that our collapsed form should look exactly like the non-verbose mode, i.e. Set (or Set{Int64}) as prefix, ([ and ]) as begin and end, and , as delimiter.

Secondly, when expanded, we should not show the indices (1:, 2:, etc) because Sets are unordered objects.


@vladflore To figure out how to do this, try to find out how Pluto displays the prefix, begin, end, delimiter and indices for arrays and dictionaries. Take a look at treeview.css, and use the developer tools of your browser to analyze and write CSS. https://developers.google.com/web/tools/chrome-devtools/css You should be able to do this without fully understanding CSS&JS 🌝

@fonsp
Copy link
Owner

fonsp commented Feb 18, 2021

Also, can you test this on a Set with 100 elements? e.g. Set(1:100)

Make sure that the elements are truncated, and that you can click to see more items. (Just like with the vector collect(1:100)).

Tag me with @fonsp when you want to discuss~

@fonsp fonsp marked this pull request as draft February 18, 2021 19:34
@vladflore
Copy link
Contributor Author

Hey @fonsp ,

I made the changes you mentioned. Thanks for the tips and hints! Please have a look when you have the time and let me know if I need to change something else.

Here is a gif of the current status:

pluto-tree-viewer-set

Best,
Vlad

@vladflore vladflore marked this pull request as ready for review February 19, 2021 13:56
Base automatically changed from master to main March 11, 2021 21:33
@fonsp
Copy link
Owner

fonsp commented Mar 16, 2021

Really nice, thanks @vladflore ! What do you want to work on next? 🌝

@fonsp fonsp linked an issue Mar 16, 2021 that may be closed by this pull request
@fonsp fonsp merged commit 9c11a58 into fonsp:main Mar 16, 2021
@fonsp
Copy link
Owner

fonsp commented Apr 2, 2021

Released in Pluto 0.14!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Built-in array viewer for Set
2 participants