Spaces:
Running
Running
Commit
·
87ccf2e
1
Parent(s):
2587847
Add application files
Browse files
app.py
CHANGED
@@ -91,14 +91,17 @@ def greet(name1, name2):
|
|
91 |
df_pred.to_csv(temp_file.name, index=False)
|
92 |
csv_output = temp_file.name
|
93 |
|
|
|
94 |
# Create a button to toggle table view and a script to handle the button click
|
95 |
show_more_button = """
|
96 |
<button onclick="toggleTableView()">Show More</button>
|
97 |
<script>
|
98 |
var isFullTableShown = false;
|
99 |
function toggleTableView() {
|
|
|
100 |
var table = document.getElementById('output-table');
|
101 |
var rows = table.getElementsByTagName('tr');
|
|
|
102 |
for (var i = 16; i < rows.length; i++) {
|
103 |
if (isFullTableShown) {
|
104 |
rows[i].style.display = 'none';
|
@@ -107,6 +110,7 @@ def greet(name1, name2):
|
|
107 |
}
|
108 |
}
|
109 |
isFullTableShown = !isFullTableShown;
|
|
|
110 |
document.querySelector('button').textContent = isFullTableShown ? 'Show Less' : 'Show More';
|
111 |
}
|
112 |
</script>
|
|
|
91 |
df_pred.to_csv(temp_file.name, index=False)
|
92 |
csv_output = temp_file.name
|
93 |
|
94 |
+
# Create a button to toggle table view and a script to handle the button click
|
95 |
# Create a button to toggle table view and a script to handle the button click
|
96 |
show_more_button = """
|
97 |
<button onclick="toggleTableView()">Show More</button>
|
98 |
<script>
|
99 |
var isFullTableShown = false;
|
100 |
function toggleTableView() {
|
101 |
+
console.log('toggleTableView function called'); // Debugging line
|
102 |
var table = document.getElementById('output-table');
|
103 |
var rows = table.getElementsByTagName('tr');
|
104 |
+
console.log('Number of rows in table: ' + rows.length); // Debugging line
|
105 |
for (var i = 16; i < rows.length; i++) {
|
106 |
if (isFullTableShown) {
|
107 |
rows[i].style.display = 'none';
|
|
|
110 |
}
|
111 |
}
|
112 |
isFullTableShown = !isFullTableShown;
|
113 |
+
console.log('isFullTableShown status: ' + isFullTableShown); // Debugging line
|
114 |
document.querySelector('button').textContent = isFullTableShown ? 'Show Less' : 'Show More';
|
115 |
}
|
116 |
</script>
|