berangerthomas commited on
Commit
84f5667
·
1 Parent(s): ef92518

Add auto check checkbox aggregate if count over time is selected

Browse files
Files changed (1) hide show
  1. sections/analyze.py +8 -3
sections/analyze.py CHANGED
@@ -108,11 +108,14 @@ elif chart_type == "Time Series":
108
  )
109
 
110
  # Option to aggregate data
111
- do_aggregate = st.sidebar.checkbox("Aggregate by time period")
 
 
112
  if do_aggregate:
113
  period = st.sidebar.selectbox(
114
  "Select period",
115
  [
 
116
  "Minute",
117
  "5 Minutes",
118
  "15 Minutes",
@@ -124,14 +127,16 @@ elif chart_type == "Time Series":
124
  "Month",
125
  "Year",
126
  ],
 
127
  )
128
  freq_map = {
 
129
  "Minute": "min",
130
  "5 Minutes": "5min",
131
  "15 Minutes": "15min",
132
  "30 Minutes": "30min",
133
- "Hour": "H",
134
- "6 Hours": "6H",
135
  "Day": "D",
136
  "Week": "W",
137
  "Month": "M",
 
108
  )
109
 
110
  # Option to aggregate data
111
+ do_aggregate = st.sidebar.checkbox(
112
+ "Aggregate by time period", value=(ts_mode == "Count Over Time")
113
+ )
114
  if do_aggregate:
115
  period = st.sidebar.selectbox(
116
  "Select period",
117
  [
118
+ "Second",
119
  "Minute",
120
  "5 Minutes",
121
  "15 Minutes",
 
127
  "Month",
128
  "Year",
129
  ],
130
+ index=5,
131
  )
132
  freq_map = {
133
+ "Second": "s",
134
  "Minute": "min",
135
  "5 Minutes": "5min",
136
  "15 Minutes": "15min",
137
  "30 Minutes": "30min",
138
+ "Hour": "h",
139
+ "6 Hours": "6h",
140
  "Day": "D",
141
  "Week": "W",
142
  "Month": "M",