Skip to content

Commit

Permalink
Fix select attribute on larger tables
Browse files Browse the repository at this point in the history
  • Loading branch information
phibr0 committed Mar 26, 2022
1 parent 771e33b commit 10a294f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-charts",
"name": "Obsidian Charts",
"version": "3.4.7",
"version": "3.5.0",
"minAppVersion": "0.12.7",
"description": "This Plugin lets you create Charts within Obsidian",
"author": "phibr0",
Expand Down
10 changes: 3 additions & 7 deletions src/chartFromTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,16 @@ export function generateTableData(table: string, layout: 'columns' | 'rows', sel
throw error;
}
const labels = Object.keys(Object.values(fields)[0]);
const dataFields: DataField[] = Object.keys(fields).map((key) => {
let dataFields: DataField[] = Object.keys(fields).map((key) => {
return {
dataTitle: key,
data: Object.values(fields[key]) as string[]
}
});

if(selected) {
dataFields.filter((v) => {
if(!selected.contains(v.dataTitle)) {
dataFields.remove(v)
}
});
dataFields = dataFields.filter(value => selected.contains(value.dataTitle));
}

return {labels, dataFields};
}

0 comments on commit 10a294f

Please sign in to comment.