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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build listing UI improvements #232

Merged
merged 29 commits into from
Jan 6, 2021
Merged

Build listing UI improvements #232

merged 29 commits into from
Jan 6, 2021

Conversation

eharkins
Copy link
Contributor

Description of proposed changes

As discussed in various issues listed below, on slack, and in nextstrain meetings, the list of sars-cov-2 builds is getting rather long and would benefit from changes to the interface to make it take up less space and allow you to get the build you are looking for (or just browse) more effectively and faster.

This is just a start which steals the collapsing-menu code from the sit-reps listing directly below the builds listing on the same page, but already saves a decent chunk of space (I added some duplicate builds to fill out a row):
Screen Shot 2020-11-24 at 4 53 09 PM

I wanted to just create this PR so that we can get some 馃憤 or 馃憥 before taking it further in any particular direction.

I also thought it would be worth mentioning that if all we wanted was a collapsible listing like this, read the docs does this pretty well as part of their table of contents, so we could just move such listings into a top-level docs heading at docs.nextstrain.org or a separate read the docs project (you could imagine builds.nextstrain.org or something like that).

Related issue(s)

#62
#180
#182
#206

Testing

Locally with gatsby

@tsibley tsibley temporarily deployed to nextstrain-s-dataset-ui-crhpxa November 25, 2020 01:20 Inactive
@eharkins
Copy link
Contributor Author

Also want to note that the code used to do this can be abstracted out better so that it may be reused for listing builds for different pathogens. Just waiting to do that until we were closer to choosing a particular approach (although these things can probably happen at the same time).

@emmahodcroft
Copy link
Member

emmahodcroft commented Nov 25, 2020

I really like how this is developing - the layout is more compact and being able to collapse regions really helps to get an overview and just focus on whatever part you want to focus on!

Just a couple of suggestions off the top of my head: The expand/collapse animation is a bit too slow for me - if you are clicking through a number of EU countries or US states, it gets a little irritating.

I also wonder if an 'expand all' for some categories - like Europe or USA states might be useful? If I imagine I'm going to be clicking between many different EU countries for example, I may want to just expand them all so I can click around more easily. We probably wouldn't want that for, say, all builds in all regions, though - just some 'subsections' (I hope that makes sense!).

this improves the collapsible build
selection menus on /sars-cov-2 in
the following two ways:
1. change animation time to 100ms
2. auto-expand when it is reasonable
to do so (i.e. when there are fewer
than 5 dropdowns at that same level)
@eharkins eharkins temporarily deployed to nextstrain-s-dataset-ui-crhpxa November 26, 2020 01:02 Inactive
@eharkins
Copy link
Contributor Author

@emmahodcroft thanks for the feedback!

9551913 addresses:

  1. the animation time; this should be much faster
  2. the collapsible menu problem; since we use a javascript library to make these menus, it would be non-trivial to make a collapse / expand all feature. If this is important, we can certainly make it happen, but instead I am trying a simple approach of just auto-expanding menus when it seems reasonable to do so (i.e. when there are fewer than 5 dropdowns at that same level - since e.g. expanding all countries in Europe might be overkill). Hopefully between this and reducing the animation time, the overall experience is improved to make an expand-all less necessary; there are definitely other improvements to make that might help with this general goal of more quickly navigating these menus both in cases where you are looking for something particular and just browsing.

@eharkins
Copy link
Contributor Author

Some styling improvements still to come here as well.

@emmahodcroft
Copy link
Member

the collapsible menu problem; since we use a javascript library to make these menus, it would be non-trivial to make a collapse / expand all feature. If this is important, we can certainly make it happen, but instead I am trying a simple approach of just auto-expanding menus when it seems reasonable to do so (i.e. when there are fewer than 5 dropdowns at that same level - since e.g. expanding all countries in Europe might be overkill). Hopefully between this and reducing the animation time, the overall experience is improved to make an expand-all less necessary; there are definitely other improvements to make that might help with this general goal of more quickly navigating these menus both in cases where you are looking for something particular and just browsing.

Thanks for clarifying Eli, that makes sense! I hadn't thought about this from a computational point of view!

eharkins and others added 19 commits December 4, 2020 18:56
known bugs at this point:
map scrolling vertical limit
same coordinate builds
mobile view
general styling improvements
Gatsby wouldn't build with the older libraries -- see mapbox/mapbox-gl-js#4593 for full context. Note that dev mode worked.

Avoided v5 of react-mapbox-gl as I encountered this bug: alex3165/react-mapbox-gl#904

This commit also adds updates the package-lock and removes a linting error which prevented TravisCI passing
move zoom control bottom right
map width is more reactive to browser width
legend styling improvements
clicking on the build map marker
now is the way to get to the build
and you must find the build in the
dropdown menu below to visit
the build.org.url
changes coloring of map markers to just be nextstrain vs non-nextstrain.
also some styling of map markers and legend is added
use the region, country, division, location
breakdown to distinguish builds by level.
This is mapped to the size of the circle on
the map.
This uses a react-mapbox-gl component to cluster
builds on the map. Only community builds are
clustered in this way. Clicking a cluster will
zoom to the bounds of the builds it contains.
Cluster tooltips don't show the contents of the
cluster (this is possible, just adds complexity
to implementation). Important to note that
clusters will never separate if two markers
(builds) have the same coordinates. Since
programmatically adding small differences to
identical coordinates is non-trivial, we do
this manually in the yaml file for now. We
should add a console warning so that this
doesn't happen by mistake.
eharkins and others added 6 commits January 5, 2021 16:33
this is done manually by just adjusting
coordinates for now. this is pretty easy
to do if you are willing to spend the time
fiddling with it. writing a programmatic
way to add jitter would be better since
it doesn't require folks who are adding
builds to consider this at all, but it might
be tricky to make sure there were no
collisions. Even better would be allowing
duplicate coordinates and using cluster
tooltips to allow you to see what's "inside"
each cluster and navigate to those builds
through the tooltip without having to separate
them on the map. Doing that (within the current
implementation) requires managing react
component state of the cluster, so we are
skipping it for now.
[build-map] cluster community builds on the map;
@jameshadfield jameshadfield merged commit da813fc into master Jan 6, 2021
@jameshadfield jameshadfield deleted the dataset-ui branch January 6, 2021 04:50
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.

None yet

4 participants