Skip to content
Snippets Groups Projects
Commit 196291ff authored by Hartung, Michael's avatar Hartung, Michael
Browse files

use event listeners for network stabilization events

parent 2b81976d
Branches
Tags
No related merge requests found
......@@ -305,14 +305,12 @@ export class NetworkComponent implements OnInit {
public stabilize(): Promise<any> {
return new Promise<boolean>((resolve, reject) => {
this.networkInternal.once('stabilizationIterationsDone', () => {
this.networkInternal.on('stabilizationIterationsDone', () => {
this.updatePhysicsEnabled(this.drugstoneConfig.config.physicsOn);
this.networkInternal.fit();
this.loadingScreen.stateUpdate(false);
console.log('Stabilization end: ' + Date.now());
resolve(true);
});
console.log('Stabilization start: ' + Date.now());
this.loadingScreen.stateUpdate(true);
this.networkInternal.stabilize(1000);
});
......
......@@ -364,7 +364,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
this.networkHandler.activeNetwork.networkInternal = new vis.Network(container, this.nodeData, options);
this.networkHandler.activeNetwork.networkInternal.once('stabilizationIterationsDone', () => {
this.networkHandler.activeNetwork.networkInternal.on('stabilizationIterationsDone', () => {
if (!this.drugstoneConfig.config.physicsOn) {
this.networkHandler.activeNetwork.updatePhysicsEnabled(false);
}
......
......@@ -114,8 +114,37 @@ menu<br>
<drugst-one id="netexp1"
config='{"activateNetworkMenuButtonAdjacentDisorders":false,"activateNetworkMenuButtonAdjacentDrugs":false, "activateNetworkMenuButtonAdjacentDisordersDrugs": false, "licensedDatasets":true}'
groups='{"nodeGroups":{"important":{"type":"gene","color":"#ff881f","font":{"color":"#000000"},"groupName":"Important Gene","shape":"star"},"gene":{"type":"gene","color":"#4da300","font":{"color":"#f0f0f0"},"groupName":"Gene","shape":"circle"},"foundDrug":{"type":"drug","color":"#F12590","font":{"color":"#000000"},"groupName":"Drug","shape":"diamond"}},"edgeGroups":{"default":{"color":"#000000","groupName":"default edge"}}}'
network='{"nodes":[{"id":"ATG16L1","group":"gene","label":"ATG16L1"},{"id":"HETZ","group":"gene","label":"HETZ234234234"}]}'>
groups='{"nodeGroups":{"protein":{"type":"protein","color":"#4da300","font":{"color":"#f0f0f0"},"groupName":"Protein","shape":"circle"},"foundDrug":{"type":"drug","color":"#F12590","font":{"color":"#000000"},"groupName":"Drug","shape":"diamond"}},"edgeGroups":{"default":{"color":"#000000","groupName":"default edge"}}}'
network='{"nodes":[{ "id": "ATG16L1", "group": "protein", "label": "ATG16L1" },
{ "id": "ICAM1", "group": "protein", "label": "ICAM1" },
{ "id": "TNF", "group": "protein", "label": "TNF" },
{ "id": "SFRP2", "group": "protein", "label": "SFRP2" },
{ "id": "APC2", "group": "protein", "label": "APC2" },
{ "id": "IL10", "group": "protein", "label": "IL10" },
{ "id": "CUL2", "group": "protein", "label": "CUL2" },
{ "id": "SFRP1", "group": "protein", "label": "SFRP1" },
{ "id": "TNFSF15", "group": "protein", "label": "TNFSF15" },
{ "id": "ITGA4", "group": "protein", "label": "ITGA4" },
{ "id": "DEFA5", "group": "protein", "label": "DEFA5" },
{ "id": "MUC19", "group": "protein", "label": "MUC19" },
{ "id": "SLAMF8", "group": "protein", "label": "SLAMF8" },
{ "id": "APC", "group": "protein", "label": "APC" },
{ "id": "IL6", "group": "protein", "label": "IL6" },
{ "id": "INAVA", "group": "protein", "label": "INAVA" },
{ "id": "CARD9", "group": "protein", "label": "CARD9" },
{ "id": "ITGB8", "group": "protein", "label": "ITGB8" },
{ "id": "IL23R", "group": "protein", "label": "IL23R" },
{ "id": "NOD2", "group": "protein", "label": "NOD2" },
{ "id": "RASSF1", "group": "protein", "label": "RASSF1" },
{ "id": "SLC11A1", "group": "protein", "label": "SLC11A1" },
{ "id": "IL18RAP", "group": "protein", "label": "IL18RAP" },
{ "id": "TGFB1", "group": "protein", "label": "TGFB1" },
{ "id": "IRGM", "group": "protein", "label": "IRGM" },
{ "id": "PLCG2", "group": "protein", "label": "PLCG2" },
{ "id": "PTPN22", "group": "protein", "label": "PTPN22" },
{ "id": "PTGS2", "group": "protein", "label": "PTGS2" },
{ "id": "VNN1", "group": "protein", "label": "VNN1" },
{ "id": "ITGAL", "group": "protein", "label": "ITGAL" }]}'>
</drugst-one>
<!-- <drugst-one id="netexp1"-->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment