Update app.py
#1
by
bluenevus
- opened
app.py
CHANGED
|
@@ -157,6 +157,23 @@ def generate_insights():
|
|
| 157 |
with use_scope(f'visualization_{i+1}', clear=True):
|
| 158 |
put_image(img_str, width='100%')
|
| 159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
def main():
|
| 161 |
data_analysis_dashboard()
|
| 162 |
|
|
|
|
| 157 |
with use_scope(f'visualization_{i+1}', clear=True):
|
| 158 |
put_image(img_str, width='100%')
|
| 159 |
|
| 160 |
+
def data_analysis_dashboard():
|
| 161 |
+
set_env(title="Data Analysis Dashboard")
|
| 162 |
+
put_text("# Data Analysis Dashboard")
|
| 163 |
+
|
| 164 |
+
with use_scope('form'):
|
| 165 |
+
put_row([
|
| 166 |
+
put_column([
|
| 167 |
+
put_file_upload("Upload Dataset", accept=[".csv", ".xlsx"], name="file"),
|
| 168 |
+
put_input("Analysis Instructions", type="text", placeholder="Describe the analysis you want...", name="instructions"),
|
| 169 |
+
put_buttons(['Generate Insights'], onclick=[lambda: generate_insights()])
|
| 170 |
+
])
|
| 171 |
+
])
|
| 172 |
+
|
| 173 |
+
with use_scope('output'):
|
| 174 |
+
for i in range(3):
|
| 175 |
+
put_scope(f'visualization_{i+1}')
|
| 176 |
+
|
| 177 |
def main():
|
| 178 |
data_analysis_dashboard()
|
| 179 |
|