Skip to content
This repository has been archived by the owner on Aug 31, 2019. It is now read-only.

Commit

Permalink
BUG: Fix #102
Browse files Browse the repository at this point in the history
Signed-off-by: Luke Malinowski <lmalinowski@mitre.org>
  • Loading branch information
lukemalinowski committed Aug 14, 2019
1 parent ce7ca60 commit 5ed75ef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Treemap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export default {
d.value = d._children.reduce(function (p, v) { return p + context.accumulate(v, context) }, 0)
return d.value
} else {
return d.value
return d.value = d.value || 1
}
},
// Helper method - gets a node by its id attribute
Expand Down
16 changes: 14 additions & 2 deletions src/store/testable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class ControlFilter {
}


// Treemap requires all nodes to have a children function and a name
class treemapControl extends Control {
name: string;
children(): null {return null;}
}



Expand Down Expand Up @@ -146,8 +151,15 @@ class Treemap extends VuexModule {
categoryControls.forEach(control => {
// Save the status
categoryStatuses.push(control.status);
// Save the control
category.children.push(control);

// Treemap requires all nodes to have a children function and a name
let copiedControl: treemapControl = {
...control,
name: control.id,
children: () => null
};
console.log(copiedControl.status);
category.children.push(copiedControl);
// Count
category.count += 1;
family.count += 1;
Expand Down

0 comments on commit 5ed75ef

Please sign in to comment.