Skip to content

Commit e46434a

Browse files
implement save arrow data from perspective view (#88)
1 parent 821dd94 commit e46434a

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

data/CTA-Ridership-by-Station.arrow

7.15 KB
Binary file not shown.

src/views/tableView.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,11 @@ export class TableView {
414414
defaultUri: Uri.parse(dataFilePath).with({ scheme: 'file' })
415415
});
416416

417+
if (dataFileType === 'arrow') {
418+
// convert data array to a buffer to save
419+
data = Buffer.from(data);
420+
}
421+
417422
if (dataFileUri) {
418423
// save data
419424
// TODO: switch to using workspace.fs for data save

web/scripts/perspective.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,9 @@ async function saveData() {
317317
viewData = JSON.stringify(jsonDataArray, null, 2);
318318
break;
319319
case 'arrow':
320-
viewData = await view.to_arrow();
320+
const arrayBuffer = await view.to_arrow();
321+
const dataArray = new Uint8Array(arrayBuffer);
322+
viewData = Array.from(dataArray);
321323
break;
322324
}
323325

0 commit comments

Comments
 (0)