Spaces:
Sleeping
Sleeping
from dash import callback, Dash, dcc, html, Input, Output | |
import pandas as pd | |
import plotly.express as px | |
import pyarrow | |
app = Dash(__name__, suppress_callback_exceptions=True) | |
server = app.server | |
df = pd.read_parquet("odr.parquet") | |
app.layout = html.Div([ | |
html.H1(children='ODR Exploratory Data Analysis Dashboard'), | |
html.Div([ | |
html.H3(children="Select a visualization option:"), | |
dcc.Dropdown(["Visualize Statistical Properties of Data", "Visualize Time Series"], "Visualize Statistical Properties of Data", id="drop1") | |
]), | |
html.Div(id="gui-2"), | |
html.Div(id="figs") | |
]) | |
def update_dropdown_one(input_value): | |
if input_value == "Visualize Statistical Properties of Data": | |
return html.Div([ | |
html.H3(children="Select the label to visualize statistical properties across:"), | |
dcc.Dropdown([ | |
"Monkey's Age", | |
"Brain Region", | |
"Stimuli Location" | |
], "Stimuli Location", id="drop2") | |
]) | |
else: | |
return html.Div([ | |
html.H3(children="Input a row to visualize time series data from:"), | |
dcc.Input(id='range', type='number', min=0, max=len(df)-1, step=1) | |
]) | |
def visualize_stats(input_value): | |
create_stat_figs(input_value) | |
def create_stat_figs(val): | |
if val == "Monkey's Age": | |
return html.Div([ | |
dcc.Graph(figure=px.box(df, x="monkey_age", y="cue_rate")) | |
]) | |
def main(): | |
app.run(debug=True) |