Skip to content

Commit

Permalink
Log to the console any unassigned modules
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Mar 4, 2021
1 parent 47576f7 commit 44ab7f6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions web/piechart.html
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,22 @@
updatePage();
}

unassigned = [];

function findGroup(module) {
var assigned = false;
var group = "Unassigned";
for ([t, l, g] of current.compiled) {
if (matchPattern(t, module.type) && matchPattern(l, module.label)) {
assigned = true;
group = g;
break;
}
}
if (! assigned) {
unassigned.push({ type: module.type, label: module.label });
}

return group.split("|");
}

Expand Down Expand Up @@ -582,6 +590,10 @@
group.push(module.type);
makeOrUpdateGroup(group, module);
}
if (unassigned.length) {
console.log("Unassigned modules:");
console.table(unassigned);
}
normalise(current.data, current.dataset.total.events);

for (key in current.colours) {
Expand Down
12 changes: 12 additions & 0 deletions web/piechart.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,14 +494,22 @@ function compileGroups() {
updatePage();
}

unassigned = [];

function findGroup(module) {
var assigned = false;
var group = "Unassigned";
for ([t, l, g] of current.compiled) {
if (matchPattern(t, module.type) && matchPattern(l, module.label)) {
assigned = true;
group = g;
break;
}
}
if (! assigned) {
unassigned.push({ type: module.type, label: module.label });
}

return group.split("|");
}

Expand Down Expand Up @@ -602,6 +610,10 @@ function updateDataView() {
group.push(module.type);
makeOrUpdateGroup(group, module);
}
if (unassigned.length) {
console.log("Unassigned modules:");
console.table(unassigned);
}
normalise(current.data, current.dataset.total.events);

for (key in current.colours) {
Expand Down

0 comments on commit 44ab7f6

Please sign in to comment.