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

Date axis #846

Merged
merged 3 commits into from
Jan 22, 2020
Merged

Date axis #846

merged 3 commits into from
Jan 22, 2020

Conversation

jameshadfield
Copy link
Member

@jameshadfield jameshadfield commented Jan 22, 2020

Here we change the concept of minor grid lines for temporal trees to represent "sensible" periods of time rather than fitting a fixed number between major grid points. This will greatly aid in epidemiological understanding of trees. Major grid lines are also chosen using a new heuristic which attempts to pick sensible periods, and is responsive to screen sizes to avoid a squashed grid on small screens.

No modifications are made to the calculation of grids for divergence trees.

Examples:

image
☝️ minor grid lines represent days here

image
☝️ small screens look better, and the minor gridlines are still meaningful (here each minor grid is 1 week)

image
☝️ large screens can show lots of information. Here minor gridlines represent months.

image
☝️ a potentially unwanted side effect -- here weeks don't fit nicely into multi-month major gridlines, so the spacing of minor gridlines is less aesthetically pleasing. I'd argue it's more epidemiologically informative. This can be changed - for instance here we could have minor grid lines show months instead.

image
☝️ a improvement common to a lot of datasets - minor gridlines represent months

image
☝️ often you see fewer grid lines, but they are easier to understand

Here we change the concept of minor grid lines for temporal trees to represent "sensible" periods of time rather than fitting a fixed number between major grid points. This will greatly aid in epidemiological understanding of trees. Major grid lines are also chosen using a new heuristic which attempts to pick sensible periods, and is responsive to screen sizes to avoid a squashed grid on small screens.

No modifications are made to the calculation of grids for divergence trees.
@jameshadfield jameshadfield requested a review from trvrb January 22, 2020 05:02
@trvrb
Copy link
Member

trvrb commented Jan 22, 2020

This is fantastic @jameshadfield! I think a huge improvement. Comparing old behavior and new behavior side by side, I'm completely sold.

I just made one small addition to slightly lighten grid lines. I was actually meaning to propose this for a while, but this ended being a nice time. I think this looks better especially when there are lots of minor lines corresponding to days.

@emmahodcroft
Copy link
Member

This is amazing James!! Thanks so much. I have spent far too long adjusting figures to make the date-markers appear in reasonable places. So happy you tackled it! :D

@jameshadfield jameshadfield merged commit 1757103 into master Jan 22, 2020
@jameshadfield jameshadfield deleted the date-axis branch January 22, 2020 22:33
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.

3 participants