dabbu2000 commited on
Commit
e6fcad6
·
verified ·
1 Parent(s): e35039c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -17
app.py CHANGED
@@ -1,19 +1,10 @@
1
  import pandas as pd
2
  import plotly.graph_objs as go
3
  import dash
4
- import dash_core_components as dcc
5
- import dash_html_components as html
6
  from dash.dependencies import Input, Output
7
 
8
- modifiedStylesheetValue= [
9
- {
10
- 'href': 'https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css',
11
- 'rel': 'stylesheet',
12
- 'integrity': 'sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh',
13
- 'crossorigin': 'anonymous'
14
- }
15
- ]
16
-
17
  csvFileCovidDataset = pd.read_csv('diseaseOutbreakData.csv')
18
  indianStatesFocus=pd.read_csv('uniqueDataCity.csv')
19
 
@@ -59,7 +50,7 @@ indianStatesValue=[
59
 
60
 
61
 
62
- app = dash.Dash(__name__, external_stylesheets=modifiedStylesheetValue)
63
 
64
  app.layout=html.Div([
65
  html.Div([
@@ -134,8 +125,8 @@ app.layout=html.Div([
134
  html.Div([
135
  html.Div([
136
  html.Div([
137
- dcc.Graph(id='detectedStateValue',
138
- figure={'data':[go.Bar(x=indianStatesFocus['index'],y=indianStatesFocus['detected_state'])],
139
  'layout':go.Layout(title='No. of case in Different state',xaxis={'title':'State'},yaxis={'title':'Number of patients'})})
140
  ],className='card-body')
141
  ],className='card')
@@ -185,12 +176,12 @@ def update_graph(type):
185
  def update_graph(secondInput):
186
  if secondInput=='All':
187
  hiddenValues=indianStatesFocus['detected_state'].value_counts().reset_index()
188
- return {'data':[go.Line(x=hiddenValues['index'],y=hiddenValues['detected_state'])],
189
  'layout':go.Layout(title='Number of Patients',xaxis={'title':'Number of Patients'},yaxis={'title':'states'})}
190
  else:
191
  indicatorCovid = indianStatesFocus[indianStatesFocus['current_status'] == secondInput]
192
  hiddenValueIterator = indicatorCovid['detected_state'].value_counts().reset_index()
193
- return {'data': [go.Line(x=hiddenValueIterator['index'], y=hiddenValueIterator['detected_state'])],
194
  'layout': go.Layout(title='Number of Patients',xaxis={'title':'Number of patients'},yaxis={'title':'States'})}
195
 
196
 
@@ -218,4 +209,4 @@ def update_graph(type2):
218
  return generatedDrawing
219
 
220
  if __name__ == '__main__':
221
- app.run_server(debug=True)
 
1
  import pandas as pd
2
  import plotly.graph_objs as go
3
  import dash
4
+ from dash import dcc
5
+ from dash import html
6
  from dash.dependencies import Input, Output
7
 
 
 
 
 
 
 
 
 
 
8
  csvFileCovidDataset = pd.read_csv('diseaseOutbreakData.csv')
9
  indianStatesFocus=pd.read_csv('uniqueDataCity.csv')
10
 
 
50
 
51
 
52
 
53
+ app = dash.Dash(__name__)
54
 
55
  app.layout=html.Div([
56
  html.Div([
 
125
  html.Div([
126
  html.Div([
127
  html.Div([
128
+ dcc.Graph(id='uniqueDataCity',
129
+ figure={'data':[go.Bar(x=indianStatesFocus['id'],y=indianStatesFocus['detected_state'])],
130
  'layout':go.Layout(title='No. of case in Different state',xaxis={'title':'State'},yaxis={'title':'Number of patients'})})
131
  ],className='card-body')
132
  ],className='card')
 
176
  def update_graph(secondInput):
177
  if secondInput=='All':
178
  hiddenValues=indianStatesFocus['detected_state'].value_counts().reset_index()
179
+ return {'data':[go.Line(x=hiddenValues['id'],y=hiddenValues['detected_state'])],
180
  'layout':go.Layout(title='Number of Patients',xaxis={'title':'Number of Patients'},yaxis={'title':'states'})}
181
  else:
182
  indicatorCovid = indianStatesFocus[indianStatesFocus['current_status'] == secondInput]
183
  hiddenValueIterator = indicatorCovid['detected_state'].value_counts().reset_index()
184
+ return {'data': [go.Line(x=hiddenValueIterator['id'], y=hiddenValueIterator['detected_state'])],
185
  'layout': go.Layout(title='Number of Patients',xaxis={'title':'Number of patients'},yaxis={'title':'States'})}
186
 
187
 
 
209
  return generatedDrawing
210
 
211
  if __name__ == '__main__':
212
+ app.run_server(debug=True)