Added a flag to turn off link2opacity for layered 120-cell

pull/9/head
Mike Lynch 2023-11-02 16:26:48 +11:00
parent c281c4569a
commit e7cb1856e0
2 changed files with 7 additions and 5 deletions

10
main.js
View File

@ -103,11 +103,13 @@ function setBackground(c) {
}
function setLinkOpacity(o, primary) {
if( primary ) {
link_ms[0].opacity = o;
if( structure.nolink2opacity ) {
link_ms.map((lm) => lm.opacity = o);
} else {
for( const lm of link_ms.slice(1) ) {
lm.opacity = o;
if( primary ) {
link_ms[0].opacity = o;
} else {
link_ms.slice(1).map((lm) => lm.opacity = o);
}
}
}

View File

@ -397,6 +397,7 @@ export const cell120_layered = (max) => {
node_size: 0.02,
link_size: 0.02
},
nolink2opacity: true,
options: options
}
}
@ -598,7 +599,6 @@ function get_node(nodes, id) {
}
function audit_link_labels(nodes, links) {
console.log("Link audit");
for( const l of links ) {
const n1 = get_node(nodes, l.source);
const n2 = get_node(nodes, l.target);