Spaces:
Running
Running
claude: add dropdown with pre-determined URLs
Browse filesAdd a dropdown that can be used to select from 10 pre-determined Parquet URLs, which will populate the Parquet File URL input box. Use example.com as the pre-determined URL for
all of them, for now -- I will separately research which URLs to use.
(I also manually edited two of the pre-determined URLs.)
- index.html +26 -1
- style.css +13 -1
index.html
CHANGED
|
@@ -15,6 +15,23 @@
|
|
| 15 |
<p class="subtitle">Query parquet files using SQL with DuckDB WASM</p>
|
| 16 |
|
| 17 |
<form id="queryForm">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
<div class="form-group">
|
| 19 |
<label for="parquetUrl">Parquet File URL</label>
|
| 20 |
<input
|
|
@@ -30,7 +47,7 @@
|
|
| 30 |
<textarea
|
| 31 |
id="sqlQuery"
|
| 32 |
rows="4"
|
| 33 |
-
placeholder="SELECT * FROM
|
| 34 |
required
|
| 35 |
></textarea>
|
| 36 |
</div>
|
|
@@ -176,6 +193,14 @@
|
|
| 176 |
}
|
| 177 |
}
|
| 178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
// Set up event listeners
|
| 180 |
document.getElementById('queryForm').addEventListener('submit', handleSubmit);
|
| 181 |
|
|
|
|
| 15 |
<p class="subtitle">Query parquet files using SQL with DuckDB WASM</p>
|
| 16 |
|
| 17 |
<form id="queryForm">
|
| 18 |
+
<div class="form-group">
|
| 19 |
+
<label for="urlSelect">Select Example Dataset</label>
|
| 20 |
+
<select id="urlSelect">
|
| 21 |
+
<option value="">-- Choose a dataset or enter custom URL below --</option>
|
| 22 |
+
<option value="https://huggingface.co/datasets/PleIAs/SYNTH/resolve/refs%2Fconvert%2Fparquet/default/partial-train/0000.parquet">PleIAs/SYNTH</option>
|
| 23 |
+
<option value="https://huggingface.co/datasets/facebook/omnilingual-asr-corpus/resolve/refs%2Fconvert%2Fparquet/gby_Latn/train/0000.parquet">facebook/omnilingual-asr-corpus</option>
|
| 24 |
+
<option value="https://example.com/dataset3.parquet">Dataset 3</option>
|
| 25 |
+
<option value="https://example.com/dataset4.parquet">Dataset 4</option>
|
| 26 |
+
<option value="https://example.com/dataset5.parquet">Dataset 5</option>
|
| 27 |
+
<option value="https://example.com/dataset6.parquet">Dataset 6</option>
|
| 28 |
+
<option value="https://example.com/dataset7.parquet">Dataset 7</option>
|
| 29 |
+
<option value="https://example.com/dataset8.parquet">Dataset 8</option>
|
| 30 |
+
<option value="https://example.com/dataset9.parquet">Dataset 9</option>
|
| 31 |
+
<option value="https://example.com/dataset10.parquet">Dataset 10</option>
|
| 32 |
+
</select>
|
| 33 |
+
</div>
|
| 34 |
+
|
| 35 |
<div class="form-group">
|
| 36 |
<label for="parquetUrl">Parquet File URL</label>
|
| 37 |
<input
|
|
|
|
| 47 |
<textarea
|
| 48 |
id="sqlQuery"
|
| 49 |
rows="4"
|
| 50 |
+
placeholder="SELECT * FROM train LIMIT 10"
|
| 51 |
required
|
| 52 |
></textarea>
|
| 53 |
</div>
|
|
|
|
| 193 |
}
|
| 194 |
}
|
| 195 |
|
| 196 |
+
// Handle dropdown selection
|
| 197 |
+
document.getElementById('urlSelect').addEventListener('change', function(e) {
|
| 198 |
+
const selectedUrl = e.target.value;
|
| 199 |
+
if (selectedUrl) {
|
| 200 |
+
document.getElementById('parquetUrl').value = selectedUrl;
|
| 201 |
+
}
|
| 202 |
+
});
|
| 203 |
+
|
| 204 |
// Set up event listeners
|
| 205 |
document.getElementById('queryForm').addEventListener('submit', handleSubmit);
|
| 206 |
|
style.css
CHANGED
|
@@ -50,6 +50,7 @@ label {
|
|
| 50 |
font-size: 0.95rem;
|
| 51 |
}
|
| 52 |
|
|
|
|
| 53 |
input[type="text"],
|
| 54 |
textarea {
|
| 55 |
width: 100%;
|
|
@@ -57,10 +58,21 @@ textarea {
|
|
| 57 |
border: 2px solid #e2e8f0;
|
| 58 |
border-radius: 8px;
|
| 59 |
font-size: 0.95rem;
|
| 60 |
-
font-family: 'Monaco', 'Courier New', monospace;
|
| 61 |
transition: border-color 0.2s, box-shadow 0.2s;
|
| 62 |
}
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
input[type="text"]:focus,
|
| 65 |
textarea:focus {
|
| 66 |
outline: none;
|
|
|
|
| 50 |
font-size: 0.95rem;
|
| 51 |
}
|
| 52 |
|
| 53 |
+
select,
|
| 54 |
input[type="text"],
|
| 55 |
textarea {
|
| 56 |
width: 100%;
|
|
|
|
| 58 |
border: 2px solid #e2e8f0;
|
| 59 |
border-radius: 8px;
|
| 60 |
font-size: 0.95rem;
|
|
|
|
| 61 |
transition: border-color 0.2s, box-shadow 0.2s;
|
| 62 |
}
|
| 63 |
|
| 64 |
+
select {
|
| 65 |
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
|
| 66 |
+
background: white;
|
| 67 |
+
cursor: pointer;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
input[type="text"],
|
| 71 |
+
textarea {
|
| 72 |
+
font-family: 'Monaco', 'Courier New', monospace;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
select:focus,
|
| 76 |
input[type="text"]:focus,
|
| 77 |
textarea:focus {
|
| 78 |
outline: none;
|