Skip to content

Commit

Permalink
v1.1 public
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonynikhilreddy committed May 5, 2020
1 parent 6ddbb67 commit 491cb31
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 17 deletions.
44 changes: 30 additions & 14 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
'rel': 'stylesheet',
'integrity': 'sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh',
'crossorigin': 'anonymous'
},
{
'href': 'https://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css',
'rel': 'stylesheet'
}
]

Expand Down Expand Up @@ -82,7 +86,7 @@
# ]),
html.Ul(className="navbar-nav ml-auto",children=[
html.Li(className='d-none d-md-block nav-item active', children=[
html.A("Spring Boot Version",className='nav-link', href="https://knowcovid19india.herokuapp.com/")], style={'font-size':'150%'}),
html.A(children=[html.H3("Spring Boot Version"),html.H6("By Abhinav")],className='nav-link', href="https://knowcovid19india.herokuapp.com/")], style={'font-size':'150%'}),
])
])
# navbar = dbc.NavbarSimple(
Expand Down Expand Up @@ -111,34 +115,46 @@
navbar,
html.Br(),
html.Div(id="time-panel"),
html.Br(),
# html.Br(),
html.Div(className='row',children=[
html.Div(className='col-lg-3 col-md-3 col-sm-12', children=[
inputs,
html.Br(),
html.Br(),
html.Div(id="output-panel"),
html.Br(),
html.P(className='alert alert-info',children=[
html.P("Source: "),
html.A("api.covid19india.org",href="api.covid19india.org"),
]),
html.Div(id="news-panel"),
# html.P(className='alert alert-info',children=[
# html.P("Source: "),
# html.A("api.covid19india.org",href="api.covid19india.org"),
# ]),

]),
html.Div(className='col-lg-6 col-md-3 col-sm-12',children=[html.Div(className='table-responsive-sm',children=[
html.Div(id="dist-panel")], style={'border-radius':'2px'}),
]),
html.Div(className="row alert",children=[
html.Div(children=[
html.P(children=[
html.P(children=[
html.Div(children=["Made with ",html.Span("\u2665",style={"color":"red"})," by ",html.A("Anthony",href="https://www.linkedin.com/in/anthonynikhilreddy/",style={'color':'black',"font-weight":"bold"})]),
html.Br(),
html.P(children=["Source: ",html.A("api.covid19india.org",href="https://api.covid19india.org")]),
]),
# html.P("Source: "),
# html.A("api.covid19india.org",href="api.covid19india.org"),

])
])
],style={"width":"90%","margin-left":"4px","background-color":"#F8F9FA"})
],

),
html.Div(className='d-none d-md-block col-lg-3 col-md-3 col-sm-12',children=[
html.Div(dcc.Graph(id="state-pie", responsive=True)),
# html.Div(dcc.Graph(figure=fig,stysle={'overflowX': 'scroll'}))
]),
# html.P(className='alert alert-info',children=[
# # html.P("Source: "),
# # html.A("api.covid19india.org",href="api.covid19india.org"),
# html.Footer("Made by Anthony",style={'align':'center','margin':'auto'})
# ])
]),

])
])
])
@app.callback(output=Output("news-panel","children"), inputs=[Input("state","value")])
def news(state):
Expand Down
Binary file modified func/__pycache__/func.cpython-38.pyc
Binary file not shown.
5 changes: 2 additions & 3 deletions func/func.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
qqq=['District','Confirmed','Active','Deceased','Recovered']
l=['State/UT','Confirmed','Active','Deceased','Recovered']
statelist=[]
# todos['statewise'][0]['state']='INDIA'
response = requests.get("https://api.covid19india.org/data.json")
todos = json.loads(response.text)
for i in range(1,len(todos['statewise'])):
Expand All @@ -31,14 +30,14 @@ def last_updated(state):
if(int(todos['statewise'][i]['lastupdatedtime'].split(' ')[1].split(':')[0])==0):
s=s+"12:"+str(todos['statewise'][i]['lastupdatedtime'].split(' ')[1].split(':')[1])+"AM"
elif(int(todos['statewise'][i]['lastupdatedtime'].split(' ')[1].split(':')[0])<12):
s=s+str(todos['statewise'][i]['lastupdatedtime'].split(' ')[1].split(':')[1])+ \
s=s+str(todos['statewise'][i]['lastupdatedtime'].split(' ')[1].split(':')[0])+":"+ \
str(todos['statewise'][i]['lastupdatedtime'].split(' ')[1].split(':')[1])+"AM"
elif(int(todos['statewise'][i]['lastupdatedtime'].split(' ')[1].split(':')[0])==12):
s=s+"12:"+str(todos['statewise'][i]['lastupdatedtime'].split(' ')[1].split(':')[1])+"PM"
elif(int(todos['statewise'][i]['lastupdatedtime'].split(' ')[1].split(':')[0])>12):
s=s+str(int(todos['statewise'][i]['lastupdatedtime'].split(' ')[1].split(':')[0])-12)+":"+ \
str(todos['statewise'][i]['lastupdatedtime'].split(' ')[1].split(':')[1])+"PM"
return html.P(className="alert alert-primary",**{"role":"alert"}, children=["Last updated on "+todos['statewise'][i]['lastupdatedtime'].split(' ')[0]+" at "+s], style={"textAlign":"center","font-size":"120%"})
return html.P(className="alert alert-light",**{"role":"alert"}, children=["Last updated on "+todos['statewise'][i]['lastupdatedtime'].split(' ')[0]+" at "+s], style={"textAlign":"center","font-size":"120%"})
def state_table():
rows=[]
for i in range(1,len(todos['statewise'])):
Expand Down

0 comments on commit 491cb31

Please sign in to comment.