Py.Cafe

Bing-Cheng/

dash-nyc-animal-abuse-viz

NYC Animal Abuse Reports Visualization

DocsPricing
  • 311_Animals_short2.csv
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# check out https://dash.plotly.com/ for documentation
# And check out https://py.cafe/maartenbreddels for more examples
from dash import Dash, Input, Output, callback, dcc, html, dash_table
import plotly.express as px
import pandas as pd

df = pd.read_csv("311_Animals_short2.csv")
fig= px.histogram(df, x='Borough')


app = Dash()
app.layout = html.Div(
    children=[
        html.Hr(),
    dcc.RadioItems(options=['pop', 'lifeExp', 'gdpPercap'], value='lifeExp', id='controls-and-radio-item'),
        dcc.Graph(figure=fig),
        html.Div(children='Hello World'),
        html.Div(children='My First App with Data'),
        dash_table.DataTable(data=df.to_dict('records'), page_size=10)
    ]
)
#app.layout = [html.Div(children='Hello World')]