Skip to content

Instantly share code, notes, and snippets.

@markdon
Last active June 27, 2019 01:41
Show Gist options
  • Save markdon/1e95cababf7522b55ea31c7ba41b1af0 to your computer and use it in GitHub Desktop.
Save markdon/1e95cababf7522b55ea31c7ba41b1af0 to your computer and use it in GitHub Desktop.
[Board Stats for Boards Websphere] This script will output the counts of each type of node in the currently open board. Internet Explorer does not support this code.
(()=>{
const counts = {};
Boards.current.boardNode.getAllDescendants().forEach((node)=>{
const type = node.attributes.commonType;
if(!counts[type]) counts[type] = 1;
else counts[type]++;
});
Object.keys(counts).forEach(key => console.log(`${key} ${counts[key]}`));
return counts;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment