Skip to content
Snippets Groups Projects
Commit 3b76f4fe authored by Maiykol's avatar Maiykol
Browse files

rename node attribute name to label in user input; make node attrbitute label...

rename node attribute name to label in user input; make node attrbitute label optional, defaults to ID; Double identifier might be problematic, if node label is e.g. gene symbol, then it will be displayed twice in detail information, once as label and once as symbol
parent 8ac99113
No related branches found
No related tags found
No related merge requests found
Pipeline #11025 failed
<div *ngIf="wrapper">
<div>
<p *ngIf="wrapper.data.name" [ngClass]="{'text-normal':smallStyle}">
<b><span>Name:</span></b>
<span class="is-capitalized"> {{ wrapper.data.name }}</span>
<p *ngIf="wrapper.data.label" [ngClass]="{'text-normal':smallStyle}">
<b><span>Label:</span></b>
<span class="is-capitalized"> {{ wrapper.data.label }}</span>
</p>
<p *ngIf="wrapper.data.symbol" [ngClass]="{'text-normal':smallStyle}">
<b><span>Symbol:</span></b>
......
......@@ -53,6 +53,9 @@ export class ProteinNetwork {
}
let node = JSON.parse(JSON.stringify(config.nodeGroups[group]));
// remove group name
delete node.name
// node.name is actually group name since it comes from the group configuration
// this property is already stored in the wrapper object
// instead, node.name should reflect the actual node name
......@@ -64,22 +67,12 @@ export class ProteinNetwork {
}
// label is only used for network visualization
let nodeLabel = customNode.name;
if (customNode.name.length === 0) {
nodeLabel = customNode.userId;
}
node.label = customNode.label ? customNode.label : customNode.id;
if (node.image) {
node.shape = 'image';
}
node.label = nodeLabel;
// node.id = customNode.id;
// node.x = customNode.x;
// node.y = customNode.y;
// node.uniprotAc = customNode.uniprotAc;
// node.netexId = customNode.netexId;
// node.ensg = customNode.ensg;
// console.log(node)
return node;
}
......
......@@ -44,7 +44,7 @@
"legendUrl": "https://exbio.wzw.tum.de/covex/assets/leg1.png"
}'
network='{
"nodes": [{"name": "ENSG00000171862", "id": "ENSG00000171862", "group": "0.5"}, {"name": "ENSG00000284792", "id": "ENSG00000284792", "group": 0.5}],
"nodes": [{"id": "ENSG00000171862", "group": "0.5"}, {"label": "ENSG00000284792", "id": "ENSG00000284792", "group": 0.5}],
"edges": []
}'
style="height: 100%; width: 100vw; display: block;"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment