Spaces:
Running
Running
claude fix: struct field freezes the UI
Browse filesprompt: The page freezes up when a struct type column is chosen from the dropdown of 2D plot choices. Can you determine why?
- index.html +14 -2
index.html
CHANGED
|
@@ -156,17 +156,29 @@
|
|
| 156 |
return div.innerHTML;
|
| 157 |
}
|
| 158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
// Determine if a DuckDB type is numeric
|
| 160 |
function isNumericType(type) {
|
|
|
|
|
|
|
|
|
|
| 161 |
const numericTypes = ['TINYINT', 'SMALLINT', 'INTEGER', 'BIGINT', 'HUGEINT',
|
| 162 |
'FLOAT', 'DOUBLE', 'DECIMAL', 'NUMERIC', 'REAL'];
|
| 163 |
-
return numericTypes.some(t => type.toUpperCase().
|
| 164 |
}
|
| 165 |
|
| 166 |
// Determine if a DuckDB type is text
|
| 167 |
function isTextType(type) {
|
|
|
|
|
|
|
|
|
|
| 168 |
const textTypes = ['VARCHAR', 'CHAR', 'TEXT', 'STRING'];
|
| 169 |
-
return textTypes.some(t => type.toUpperCase().
|
| 170 |
}
|
| 171 |
|
| 172 |
// Detect columns and their types from the dataset
|
|
|
|
| 156 |
return div.innerHTML;
|
| 157 |
}
|
| 158 |
|
| 159 |
+
// Determine if a DuckDB type is a complex type (struct, list, map, etc.)
|
| 160 |
+
function isComplexType(type) {
|
| 161 |
+
const complexTypes = ['STRUCT', 'LIST', 'MAP', 'UNION', 'ARRAY'];
|
| 162 |
+
return complexTypes.some(t => type.toUpperCase().startsWith(t));
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
// Determine if a DuckDB type is numeric
|
| 166 |
function isNumericType(type) {
|
| 167 |
+
// First check if it's a complex type
|
| 168 |
+
if (isComplexType(type)) return false;
|
| 169 |
+
|
| 170 |
const numericTypes = ['TINYINT', 'SMALLINT', 'INTEGER', 'BIGINT', 'HUGEINT',
|
| 171 |
'FLOAT', 'DOUBLE', 'DECIMAL', 'NUMERIC', 'REAL'];
|
| 172 |
+
return numericTypes.some(t => type.toUpperCase().startsWith(t));
|
| 173 |
}
|
| 174 |
|
| 175 |
// Determine if a DuckDB type is text
|
| 176 |
function isTextType(type) {
|
| 177 |
+
// First check if it's a complex type
|
| 178 |
+
if (isComplexType(type)) return false;
|
| 179 |
+
|
| 180 |
const textTypes = ['VARCHAR', 'CHAR', 'TEXT', 'STRING'];
|
| 181 |
+
return textTypes.some(t => type.toUpperCase().startsWith(t));
|
| 182 |
}
|
| 183 |
|
| 184 |
// Detect columns and their types from the dataset
|