Added return from interate callback

feature-120-cell-index
Mike Lynch 2023-08-12 07:30:36 +10:00
parent 85a171da22
commit 7ac70fd261
1 changed files with 3 additions and 0 deletions

View File

@ -262,6 +262,7 @@ function dumb_label_120cell(nodes, links) {
// stupid tetrahedral labelling // stupid tetrahedral labelling
// keeps getting stuck
function naive_label_120cell(nodes, links, n) { function naive_label_120cell(nodes, links, n) {
@ -283,9 +284,11 @@ function naive_label_120cell(nodes, links, n) {
const pcols = [ 1, 2, 3, 4, 5 ].filter((c) => !cols.has(c)); const pcols = [ 1, 2, 3, 4, 5 ].filter((c) => !cols.has(c));
if( pcols.length < 1 ) { if( pcols.length < 1 ) {
console.log(`Got stuck, no options at ${n.id}`); console.log(`Got stuck, no options at ${n.id}`);
return false;
} else { } else {
n.label = pcols[0]; n.label = pcols[0];
console.log(`applied ${pcols[0]} to node ${n.id}`); console.log(`applied ${pcols[0]} to node ${n.id}`);
return true;
} }
}); });
} }