MCPcopy Create free account
hub / github.com/DFin/palaeograph / handleFileList

Function handleFileList

src/main.js:354–395  ·  view source on GitHub ↗
(fileList)

Source from the content-addressed store, hash-verified

352}
353
354function handleFileList(fileList) {
355 const file = fileList?.[0];
356 if (!file) return;
357 setStatus("Parsing CSV...");
358 parseCSV(file)
359 .then((result) => {
360 state.dataset = {
361 rows: result.rows,
362 headers: result.headers
363 };
364 state.columnStats = result.columnStats;
365 state.mapping.categoryStyles = createDefaultCategoryStyles();
366 state.mapping.categoryColumn = "";
367 state.mapping.layerColumn = "";
368 state.mapping.visibleLayers = null;
369 state.mapping.categoryUniverse = new Set();
370 state.mapping.visibleCategories = null;
371 state.mapping.layerStyles = createDefaultCategoryStyles();
372 state.mapping.colorMode = "category";
373 if (dom.colorMode) dom.colorMode.value = state.mapping.colorMode;
374 state.mapping.pointScale = 1;
375 state.mapping.pointScaleMin = 0;
376 state.mapping.pointScaleMax = 1;
377 state.mapping.labelScale = 1;
378 state.mapping.labelScaleMin = 0;
379 state.mapping.labelScaleMax = 1;
380 syncPointScaleControls();
381 syncLabelScaleControls();
382 scene.requestFrame();
383 setStatus(`Loaded ${result.rows.length} rows, ${result.headers.length} columns.`);
384 refreshColumnSelects();
385 autoAssignAxes();
386 renderStyleConfig();
387 renderLayerFilters();
388 renderScene();
389 })
390 .catch((error) => {
391 console.error(error);
392 setStatus("Failed to parse CSV. Please check the file format.");
393 resetUI();
394 });
395}
396
397function refreshColumnSelects() {
398 if (!state.dataset) {

Callers 1

main.jsFile · 0.85

Calls 12

parseCSVFunction · 0.90
setStatusFunction · 0.85
syncPointScaleControlsFunction · 0.85
syncLabelScaleControlsFunction · 0.85
refreshColumnSelectsFunction · 0.85
autoAssignAxesFunction · 0.85
renderStyleConfigFunction · 0.85
renderLayerFiltersFunction · 0.85
renderSceneFunction · 0.85
resetUIFunction · 0.85
requestFrameMethod · 0.80

Tested by

no test coverage detected