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

fix: remove mobile update link; robots.txt #185

Merged
merged 23 commits into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a4bea8a
[CodeFactor] Apply fixes
code-factor Apr 9, 2020
9c77d5e
han: coverage
leehanchung Apr 9, 2020
703eb25
Merge branch 'staging'
leehanchung Apr 9, 2020
70351fb
Merge branch 'master' into refactoring
leehanchung Apr 9, 2020
b722663
Merge branch 'master' of https://github.com/ncov19-us/front-end
leehanchung Apr 9, 2020
78cd91a
Merge branch 'master' into refactoring
leehanchung Apr 9, 2020
c42c0a8
han: codebase cleanup
leehanchung Apr 9, 2020
7d2dd5c
han: added error handling for empty exceptions
leehanchung Apr 9, 2020
4fd3d96
han: removed unused files
leehanchung Apr 9, 2020
d593ab1
han: removed unused lines
leehanchung Apr 9, 2020
5efce75
han: merged staging into current branch
leehanchung Apr 10, 2020
21243ad
han: fixing stats_table.py pandas deprecation warning, fixing utils._…
leehanchung Apr 10, 2020
631c2d0
han: fixing stats_table.py pandas deprecation warning, fixing utils._…
leehanchung Apr 10, 2020
0c8d4d4
Merge pull request #180 from ncov19-us/refactoring
hurshd0 Apr 10, 2020
4fcc37f
style: make all font sizes variables
elizabethts Apr 12, 2020
d8b19a3
style: change max height of sidebars to 700px
elizabethts Apr 12, 2020
14f9468
Merge pull request #181 from ncov19-us/font-fixes
hurshd0 Apr 13, 2020
f99889f
chore: added sms update button
hurshd0 Apr 13, 2020
cb313fd
Merge pull request #182 from ncov19-us/adding-sms-button
hurshd0 Apr 13, 2020
5f6ab94
chore: updating pipefile.lock
hurshd0 Apr 13, 2020
0d8ac0f
Merge pull request #183 from ncov19-us/pipfile-issue
leehanchung Apr 13, 2020
9311099
chore: removed-sms-btn
hurshd0 Apr 13, 2020
5ac8fb2
Merge pull request #184 from ncov19-us/remove-sms-btn
leehanchung Apr 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ name = "pypi"
[packages]
dash = "*"
dash-bootstrap-components = "*"
gunicorn = "*"
dash-daq = "*"
plotly = "*"
pandas = "*"
pymongo = "*"
python-decouple = "*"
tweepy = "*"
requests = "*"
dash-daq = "*"
flask-mobility = "*"
python-dateutil = "*"
flask-caching = "*"
gunicorn = "*"

[dev-packages]
pylint = "*"
black = "*"
jupyter = "*"
pytest = "*"
coverage = "*"
coveralls = "*"

[requires]
python_version = "3.7"

[pipenv]
allow_prereleases = true
allow_prereleases = true
714 changes: 179 additions & 535 deletions Pipfile.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions assets/css/desktop.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@
--font-size-chart-h1: 1.5vw;
--font-size-chart-h2: .9vw;
--font-size-last-updated: .7vw;
--font-size-dropdown-arrow: 1rem;
--font-size-github-favicon: 2rem;

/* Font Weights */
--font-weight-stats-numbers: 500;
--font-weight-table-headings: 500;
--font-weight-bold: 700;

/* Heights */
--max-height-sidebar: 550px;
--max-height-sidebar: 700px;
--max-height-chart: 450px;

/* Margins */
Expand All @@ -63,7 +65,7 @@

/* About Page Variables */
--about-font-color:#fefefe;
--about-font-color-black:black;
--about-font-color-black: #010915;
--about-border-color:#fefefe;
--about-bg-color:#19202A;
--about-bg-color-light:#D2D2D2;
Expand All @@ -82,7 +84,6 @@
--drop-down-bg-color:#1F242D;
--drop-down-border-color:#FFFFFF;
--drop-down-rounded-corners: 7px;

}

/* Custom Scroll bar */
Expand Down Expand Up @@ -258,7 +259,6 @@
font-weight: 500;
border-radius: var(--drop-down-rounded-corners);
color:var(--nav-font-color);

}


Expand Down Expand Up @@ -305,7 +305,7 @@
.states-dropdown .Select-menu-outer {
background-color: var(--drop-down-bg-color);
border-color: transparent;
font-size: 1rem;
font-size: var(--font-size-dropdown-arrow);
z-index: 1000000;
width:91%;
margin-top: 5%;
Expand Down Expand Up @@ -1034,7 +1034,7 @@
}

.fab.fa-github {
font-size: 2rem;
font-size: var(--font-size-github-favicon);
color: #BDBDBD;
}

Expand Down
30 changes: 15 additions & 15 deletions assets/css/mobile.css
100644 β†’ 100755
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@


/* Daily Stats */
--mobile-daily-stats-font: 'Lato', sans-serif;
--mobile-daily-stats-font: 'Lato', sans-serif;
--mobile-daily-stats-cateogory-font: 'Roboto', sans-serif;
--mobile-daily-stats-font-weight: 700;

Expand All @@ -76,7 +76,7 @@
padding: 0 4vw;
color: #F4F4F4;
border: none;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
text-shadow: none;
display: flex;
justify-content: space-between;
Expand All @@ -91,7 +91,7 @@
}

#mobile-navbar-toggler {
padding: 0 0 0 0;
padding: 0;
width: auto !important;
}

Expand Down Expand Up @@ -154,7 +154,7 @@
/* ------------------------------------------------------------------------------ */

.mt-4 {
margin: 0rem;
margin: 0;
}

.mobile-top-bar-content {
Expand Down Expand Up @@ -279,7 +279,7 @@
}

.mobile-top-bar-content .list-group {
height: 75vh;
height: 75vh;
justify-content: space-evenly;
background-color: none !important;
}
Expand Down Expand Up @@ -313,7 +313,7 @@
text-align: center;
border: none;
border-radius: var(--mobile-border-radius);
padding: .2rem;
padding: .2rem;
margin-top: 2rem;
}

Expand All @@ -334,7 +334,7 @@
text-align: center;
border: none;
border-radius: var(--mobile-border-radius);
padding: .2rem;
padding: .2rem;

}

Expand All @@ -353,7 +353,7 @@
text-align: center;
border: none;
border-radius: var(--mobile-border-radius);
padding: .2rem;
padding: .2rem;
}


Expand All @@ -371,7 +371,7 @@
text-align: center;
border: none;
border-radius: var(--mobile-border-radius);
padding: .2rem;
padding: .2rem;

}

Expand Down Expand Up @@ -424,9 +424,9 @@
margin-right: var(--mobile-body-margin);
padding-left: 3vw;
padding-right: 3vw;
padding: 3vw 4vw 3vw 4vw;
padding: 3vw 4vw;
height: 38vh;
}
}

.mobile-chart-h1-title {
font-size: var(--mobile-font-size-h1);
Expand Down Expand Up @@ -484,7 +484,7 @@

.tab.mobile-testing-us-map-tab, .tab.mobile-testing-us-map-tab {
border-top-right-radius: var(--mobile-border-radius) !important;
}
}


.tab.mobile-testing-us-map-tab:active, .tab.mobile-testing-us-map-tab:hover, .tab.mobile-confirmed-us-map-tab:active, .tab.mobile-confirmed-us-map-tab:hover {
Expand Down Expand Up @@ -662,11 +662,11 @@ th.dash-header.column-0 {

/* πŸ“± END Footer 🦢 */

.jsx-2597805859.tab.mobile-news-feed-tab:active, .jsx-2597805859.tab.mobile-twitter-feed-tab:active,
.jsx-2597805859.tab.mobile-news-feed-tab:active, .jsx-2597805859.tab.mobile-twitter-feed-tab:active,
.jsx-2597805859.tab.mobile-news-feed-tab:hover,
.jsx-2597805859.tab.mobile-twitter-feed-tab:target,
.jsx-2597805859.tab.mobile-twitter-feed-tab:target,
.jsx-2597805859.tab.mobile-news-feed-tab:target,
.jsx-2597805859.tab.mobile-twitter-feed-tab:focus,
.jsx-2597805859.tab.mobile-twitter-feed-tab:focus,
.jsx-2597805859.tab.mobile-news-feed-tab:focus, .jsx-2597805859.tab.mobile-twitter-feed-tab:hover {
color: var(--nav-font-color) !important;
}
Expand Down
5 changes: 2 additions & 3 deletions components/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from .confirmed_cases_chart import confirmed_cases_chart
from .daily_stats import daily_stats
from .infection_trajectory_chart import infection_trajectory_chart
from .new_infection_trajectory_chart import new_infection_trajectory_chart
from .news_feed import news_feed
from .scatter_mapbox import confirmed_scatter_mapbox, drive_thru_scatter_mapbox
from .twitter_feed import twitter_feed
from .daily_stats import daily_stats
from .daily_stats_mobile import daily_stats_mobile
from .column_stats import states_confirmed_stats, states_deaths_stats, last_updated
from .column_stats_mobile import mobile_states_confirmed_stats, mobile_states_deaths_stats, mobile_last_updated
from .column_stats import last_updated
from .column_stats_mobile import mobile_last_updated
from .deaths_chart import deaths_chart
from .cases_chart import cases_chart
from .stats_table import stats_table
136 changes: 0 additions & 136 deletions components/column_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import pandas as pd


# worked when i moved this into the try/except in the states_confirmed_stats function
try:
URL = config.NCOV19_API + config.COUNTY
response = requests.get(URL).json()
Expand All @@ -29,138 +28,3 @@
STATES = list(set(data["state_name"].to_list()))

del response, data


@cache.memoize(timeout=600)
def states_confirmed_stats(state="United States") -> dbc.ListGroup:
"""
:params state: display news feed for a particular state. If None, display news feed
for the whole US

:return list_group: A bootstramp ListGroup containing ListGroupItem returns news feeds.
:rtype: dbc.ListGroup
"""

state = REVERSE_STATES_MAP[state]

try:
URL = config.NCOV19_API + config.COUNTY
response = requests.get(URL).json()
data = response["message"]

data = pd.DataFrame.from_records(data)
data["state_name"] = data["state_name"].str.title()

if state in ["US", "United States"]:
# print('if state', state)
confirmed = data.groupby(["state_name"])["confirmed"].sum()
confirmed = confirmed.sort_values(ascending=False).to_dict()
# print(confirmed)
else:
# print('else state', state)
confirmed = data[data["state_name"] == state]
# print(1)
confirmed = confirmed[["county_name", "confirmed"]]
confirmed = dict(
confirmed.sort_values(by="confirmed", ascending=False).to_records(
index=False
)
)

del response, data
except:
print(f"[ERROR] states_confirmed_stats({state}) error accessing ncov19.us API")

list_group = dbc.ListGroup(
[
dbc.ListGroupItem(
[
html.Button(
html.Div(
[
html.Span(
f"{value:,d}",
className="states-stats-confirmed-list-num",
),
html.Span(
f" {key}",
className="states-stats-confirmed-list-state",
),
]
),
n_clicks=0,
id=f"states-confirmed-{key}",
className="states-stats-confirmed-list-txt",
),
],
className="states-stats-confirmed-list-item",
)
for key, value in confirmed.items()
],
flush=True,
className="states-stats-confirmed-listgroup",
)

return list_group


@cache.memoize(timeout=600)
def states_deaths_stats(state="US") -> dbc.ListGroup:
"""
:params state: display news feed for a particular state. If None, display news feed
for the whole US

:return list_group: A bootstramp ListGroup containing ListGroupItem returns news feeds.
:rtype: dbc.ListGroup
"""

try:
URL = config.NCOV19_API + config.COUNTY
response = requests.get(URL).json()
data = response["message"]

data = pd.DataFrame.from_records(data)
data["state_name"] = data["state_name"].str.title()

if state == "US":
deaths = data.groupby(["state_name"])["deaths"].sum()
deaths = confirmed.sort_values(ascending=False).to_dict()
else:
deaths = data[data["state_name"] == state]
confirmed = df[["County Name", "Confirmed"]]
confirmed = dict(
confirmed.sort_values(by="Confirmed", ascending=False).to_records(
index=False
)
)

del response, data
except:
print("[ERROR] states_confirmed_stats error accessing ncov19.us API")

list_group = dbc.ListGroup(
[
dbc.ListGroupItem(
[
html.P(
[
html.Span(
f"{value:,d}", className="states-stats-deaths-list-num",
),
html.Span(
f" {key}", className="states-stats-deaths-list-state",
),
],
className="states-stats-deaths-list-txt",
),
],
id=f"states-death-{key}",
className="states-stats-deaths-list-item",
)
for key, value in death.items()
],
flush=True,
className="states-stats-death-listgroup",
)

return list_group
Loading