davidbau / covid-19-chart

Chart of current COVID-19 time series data. Enables a variety of county- state- and nation-level comparisons and data exploration.
https://covid19chart.org/
18 stars 4 forks source link

Ability to show more states #7

Closed PySimpleGUI closed 4 years ago

PySimpleGUI commented 4 years ago

LOVE what you've done! Very nice.

I may have to borrow your excellent ideas and make a version of my program that has additional views including a single graph.

I don't mind being overwhelmed with data. Rather be overwhelmed than not have enough.

Maybe provide another option to choose the number of states to graph? I don't know how my state is doing for example because it's not (yet) in the top 10.

Here's my graphs by country for example. I don't always want to see that many, but it's nice to be able to.

image

davidbau commented 4 years ago

Currently in "advanced" mode (link on the bottom) you can get a "top" textbox that you can push up from 10 to 15 to show more states. And I've just added a searchbox that you can use to make a custom list of states, countries, and counties.

But it might be neat to show more than 15 states. The only thing stopping it is some CSS! If you show 20 states, you can see that the colors past number 15 are missing.

If somebody has an eye for color, and some time to pick more colors, it would be great to expand the css to make more available. All that's needed is some more classes like this one to be added to custom-chart.css.

.ct-label {
  fill: rgba(255,255,255,0.8);
  color: rgba(255,255,255,0.8);
}
.ct-legend .ct-series-4:before {
    background-color: #756d6f;
    border-color: #756d6f;
}
.ct-series-e .ct-bar, .ct-series-e .ct-line, .ct-series-e .ct-point, .ct-series-e .ct-slice-donut {
    stroke: #756d6f;
}
PySimpleGUI commented 4 years ago

I've got 140 curated color "themes", groups of colors that I use color GUIs. You set a color theme for a window and it'll use the theme's colors to set the colors used by various widgets. I don't know how well they will mix though as I've not tried anything where multiple themes are used in the same window.

Would having any of these color definitions be of any help?

Here's what I mean visually:

image

davidbau commented 4 years ago

What would help a ton would be a pull request. :-)

If anybody interested has time to clone a copy of this repo and modify custom-chart.css, you can test to see if colors you add look good and how many lines they work well for. I'm not sure what the issues will be one you try it out (e.g., will it work better with some transparency? thinner lines?) - the goal is to have the chart looking as clear as possible.

davidebbo commented 4 years ago

Strange thing: changing a color in custom-chart.css affects the legend color, but not the graph color. e.g. try setting:

.ct-legend .ct-series-0:before {
   background-color: #ffffff;
   border-color: #ffffff;
}

The US legend becomes white but not the US graph. Where are the graph colors coming from?

davidebbo commented 4 years ago

I see, it comes from https://cdnjs.cloudflare.com/ajax/libs/chartist/0.11.4/chartist.min.css, which we don't have a copy of. I'll make some change that doesn't require copying it.

davidbau commented 4 years ago

Thanks @davidebbo for the fix! Here are all 50 states on one plot, plus DC, Puerto Rico, and Guam. https://covid19chart.org/#/?top=53 - we all are seeing similar exponential growth - New York is a bit higher, but actually not so different from the rest of the states - mostly it's just a couple weeks ahead.

image

PySimpleGUI commented 4 years ago

THANK YOU!!!!!

This is awesome to see! I love it.

Now that there is enough data on a per state level, I guess I need to change my tool to not just show countries but also show the states.

Question 1

Are you totaling up the info on a per-state basis. It was broken out by country, but I think that stopped.

Question 2

When is the starting date? I see "since 30th case. Does this mean that the bottom is not a normal linear timescale? The graphs are not synchronized in time but instead each line begins at a potentially different date than the others?

Comment - OMG the checkboxes rock!!! Awesome change.

davidbau commented 4 years ago

Q1. You can adjust things with the controls on the left.

Select Intl to see countries, US to see US states. "Advanced options" lets you make a totally custom chart, like the one I sent you with all the states.

Q2. Starting date is one of the options you can pick. 3/1/20 starts on a date. >=30 or >=100 starts after that many cases.

On Sat, Mar 28, 2020 at 7:38 AM PySimpleGUI notifications@github.com wrote:

THANK YOU!!!!!

This is awesome to see! I love it.

Now that there is enough data on a per state level, I guess I need to change my tool to not just show countries but also show the states. Question 1

Are you totaling up the info on a per-state basis. It was broken out by country, but I think that stopped. Question 2

When is the starting date? I see "since 30th case. Does this mean that the bottom is not a normal linear timescale? The graphs are not synchronized in time but instead each line begins at a potentially different date than the others?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/davidbau/covid-19-chart/issues/7#issuecomment-605434920, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2MN2A6BD2UMZXLKN4UC3DRJXOTLANCNFSM4LVELNBA .