-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathmain.py
More file actions
72 lines (61 loc) · 2.04 KB
/
main.py
File metadata and controls
72 lines (61 loc) · 2.04 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import streamlit as st
import plotly.express as px
import pandas as pd
st.set_page_config(page_title="Dashboard",
layout="wide")
st.title("Water Quality Data Dashboard")
st.subheader("Visualization Tool for Biscayne Bay Water Quality using Aquatic Robots")
uploaded_file = st.sidebar.file_uploader("Choose a csv file")
st.sidebar.info("If no CSV file is uploaded, a default one will be displayed.")
if uploaded_file is not None:
df = pd.read_csv(uploaded_file)
else:
df = pd.read_csv("biscayne_bay_dataset_oct_2021-1.csv")
maps, linePlot, scatterPlot, threeDPlot, tables = st.tabs([
"Interactive Map",
"Line Chart",
"Correlation",
"3D Chart",
"Tables"
])
with scatterPlot:
st.subheader("Scatter Plots for the Water Parameters")
fig = px.scatter(df,
x="Salinity (ppt)",
y="Temperature (C)",
color = "ODO (mg/L)")
st.plotly_chart(fig)
with linePlot:
st.subheader("Line Chart")
col1, col2 = st.columns([2,5])
with col1:
color = st.color_picker("Choose a color","#081E3F")
with col2:
fig2 = px.line(df,
x=df.index,
y="ODO (mg/L)")
fig2.update_traces(line_color=color)
st.plotly_chart(fig2)
with maps:
st.subheader("Maps")
fig3 = px.scatter_mapbox(df,
lat="latitude",
lon="longitude",
mapbox_style="open-street-map",
zoom=17,
hover_data=df)
st.plotly_chart(fig3)
with threeDPlot:
st.subheader("3D Visualization")
fig4 = px.scatter_3d(df,
x="longitude",
y="latitude",
z="Total Water Column (m)")
fig4.update_scenes(zaxis_autorange="reversed")
st.plotly_chart(fig4)
with tables:
st.subheader("Raw Data")
st.dataframe(df)
st.divider()
st.subheader("Descriptive Statistics")
st.dataframe(df.describe())