Spaces:
Running
Running
Update app.R
Browse files
app.R
CHANGED
|
@@ -158,54 +158,24 @@ output$table <- renderReactable({
|
|
| 158 |
|
| 159 |
# activate download buttons
|
| 160 |
output$down_nodes <- downloadHandler(
|
| 161 |
-
filename = function(){
|
| 162 |
-
paste("
|
| 163 |
},
|
| 164 |
-
content = function(file){
|
| 165 |
-
#
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
id = "download_progress",
|
| 169 |
-
title = "Generating Nodes CSV...",
|
| 170 |
-
display_pct = TRUE,
|
| 171 |
-
value = 0
|
| 172 |
-
)
|
| 173 |
-
|
| 174 |
-
# Simulate progress updates
|
| 175 |
-
for (i in seq(1, 100, by = 20)) {
|
| 176 |
-
Sys.sleep(0.5) # Simulate processing time
|
| 177 |
-
updateProgressBar(session, id = "download_progress", value = i)
|
| 178 |
-
}
|
| 179 |
-
|
| 180 |
-
fwrite(nodes_df(),file,row.names = F)
|
| 181 |
-
|
| 182 |
-
closeSweetAlert(session)
|
| 183 |
}
|
| 184 |
)
|
| 185 |
|
| 186 |
output$down_edges <- downloadHandler(
|
| 187 |
-
filename = function(){
|
| 188 |
-
paste("
|
| 189 |
},
|
| 190 |
-
content = function(file){
|
| 191 |
-
#
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
id = "download_progress",
|
| 195 |
-
title = "Generating Nodes CSV...",
|
| 196 |
-
display_pct = TRUE,
|
| 197 |
-
value = 0
|
| 198 |
-
)
|
| 199 |
-
|
| 200 |
-
# Simulate progress updates
|
| 201 |
-
for (i in seq(1, 100, by = 20)) {
|
| 202 |
-
Sys.sleep(0.5) # Simulate processing time
|
| 203 |
-
updateProgressBar(session, id = "download_progress", value = i)
|
| 204 |
-
}
|
| 205 |
-
|
| 206 |
-
fwrite(edges_df(),file,row.names = F)
|
| 207 |
-
|
| 208 |
-
closeSweetAlert(session)
|
| 209 |
}
|
| 210 |
)
|
| 211 |
|
|
|
|
| 158 |
|
| 159 |
# activate download buttons
|
| 160 |
output$down_nodes <- downloadHandler(
|
| 161 |
+
filename = function() {
|
| 162 |
+
paste("Nodes.csv.gz", sep = "")
|
| 163 |
},
|
| 164 |
+
content = function(file) {
|
| 165 |
+
gzfile_conn <- gzfile(file, "w") # compress file for faster download
|
| 166 |
+
fwrite(nodes_df(), gzfile_conn)
|
| 167 |
+
close(gzfile_conn)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
}
|
| 169 |
)
|
| 170 |
|
| 171 |
output$down_edges <- downloadHandler(
|
| 172 |
+
filename = function() {
|
| 173 |
+
paste("Edges.csv.gz", sep = "")
|
| 174 |
},
|
| 175 |
+
content = function(file) {
|
| 176 |
+
gzfile_conn <- gzfile(file, "w") # compress file for faster download
|
| 177 |
+
fwrite(edges_df(), gzfile_conn)
|
| 178 |
+
close(gzfile_conn)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
}
|
| 180 |
)
|
| 181 |
|