-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
74 lines (59 loc) · 2.78 KB
/
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
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
73
74
import streamlit as st
import numpy as np
import pandas as pd
import plotly.express as px
st.title("Visualization DataShow")
st.sidebar.header("Data Visualization Settings")
st.subheader("Here's Your Dataset -")
uploaded_file=st.sidebar.file_uploader(label="Upload your CSV file", type=['csv'])
df=pd.DataFrame([1,2,3])
if uploaded_file is not None:
df=pd.read_csv(uploaded_file)
st.write(df)
selectchart=st.sidebar.selectbox(
label="Select the Chart Type",
options=['None','Line Plots','Scatter Plots','Histogram Plots','Bar Plots','Box Plots','Violin Plots']
)
lst=df.columns
if selectchart=='Line Plots':
st.sidebar.subheader("Line Plots Features")
selectx=st.sidebar.selectbox('X axis',options=lst)
selecty=st.sidebar.selectbox('Y axis',options=lst)
variation=st.sidebar.selectbox('Enter Feature for Color Variation',options=lst)
plot1=px.line(df,x=selectx,y=selecty,color=variation)
st.plotly_chart(plot1)
elif selectchart=='Scatter Plots':
st.sidebar.subheader("Scatter Plot Features")
selectx=st.sidebar.selectbox('X axis',options=lst)
selecty=st.sidebar.selectbox('Y axis',options=lst)
variation=st.sidebar.selectbox('Enter Feature for Color Variation',options=lst)
plot2=px.scatter(df,x=selectx,y=selecty,color=variation)
st.plotly_chart(plot2)
elif selectchart=='Histogram Plots':
st.sidebar.subheader("Histogram Plot Features")
selectx=st.sidebar.selectbox('X axis',options=lst)
selecty=st.sidebar.selectbox('Y axis',options=lst)
variation=st.sidebar.selectbox('Enter Feature for Color Variation',options=lst)
plot3=px.histogram(df,x=selectx,y=selecty,color=variation)
st.plotly_chart(plot3)
elif selectchart=='Bar Plots':
st.sidebar.subheader("Bar Plot Features")
selectx=st.sidebar.selectbox('X axis',options=lst)
selecty=st.sidebar.selectbox('Y axis',options=lst)
variation=st.sidebar.selectbox('Enter Feature for Color Variation',options=lst)
plot4=px.bar(df,x=selectx,y=selecty,color=variation)
st.plotly_chart(plot4)
elif selectchart=='Box Plots':
st.sidebar.subheader("Box Plot Features")
selectx=st.sidebar.selectbox('X axis',options=lst)
selecty=st.sidebar.selectbox('Y axis',options=lst)
variation=st.sidebar.selectbox('Enter Feature for Color Variation',options=lst)
plot5=px.box(df,x=selectx,y=selecty,color=variation)
st.plotly_chart(plot5)
elif selectchart=='Violin Plots':
st.sidebar.subheader("Box Plot Features")
selectx=st.sidebar.selectbox('X axis',options=lst)
selecty=st.sidebar.selectbox('Y axis',options=lst)
variation=st.sidebar.selectbox('Enter Feature for Color Variation',options=lst)
plot6=px.violin(df,x=selectx,y=selecty,color=variation)
st.plotly_chart(plot6)