Skip to content

Commit

Permalink
csv/json data preview patch after adding data schema for arrow data f…
Browse files Browse the repository at this point in the history
…iles
  • Loading branch information
RandomFractals committed May 28, 2019
1 parent 3867887 commit af2c3c0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-data-preview",
"displayName": "Data Preview",
"description": "Data Preview",
"version": "1.5.0",
"version": "1.5.1",
"publisher": "RandomFractalsInc",
"author": "Taras Novak",
"contributors": [
Expand All @@ -25,7 +25,8 @@
"json",
"json data",
"arrow",
"arrow data"
"arrow data",
"excel"
],
"engines": {
"vscode": "^1.32.3"
Expand Down
14 changes: 9 additions & 5 deletions templates/data.preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,16 @@
// initialize perspective viewer
console.log(`data.preview:refresh(): initializing view data for: ${data.fileName}`);
viewer.restore(viewConfig);
// viewer.columns = viewConfig['columns'];
viewer.load(data.schema);
viewer.update(tableData);
if (data.schema !== undefined && Object.keys(data.schema).length > 0) {
// viewer.columns = viewConfig['columns'];
viewer.load(data.schema);
viewer.update(tableData);
}
else {
viewer.load(tableData);
}
viewer.toggleConfig();
} else {
// update viewer data without toggles reset
} else { // update viewer data without toggles reset
console.log(`data.preview:refresh(): updating view data for: ${data.fileName}`);
viewer.clear();
viewer.update(tableData);
Expand Down

0 comments on commit af2c3c0

Please sign in to comment.