GUI2 Fixed bug of edge link not being added dynamically
Change-Id: If5a2b546f23274bbdac09a55bdd18357c72414fe
diff --git a/web/gui2-topo-lib/projects/gui2-topo-lib/src/lib/layer/forcesvg/models/force-directed-graph.ts b/web/gui2-topo-lib/projects/gui2-topo-lib/src/lib/layer/forcesvg/models/force-directed-graph.ts
index 312b69b..0a00f03 100644
--- a/web/gui2-topo-lib/projects/gui2-topo-lib/src/lib/layer/forcesvg/models/force-directed-graph.ts
+++ b/web/gui2-topo-lib/projects/gui2-topo-lib/src/lib/layer/forcesvg/models/force-directed-graph.ts
@@ -37,6 +37,7 @@
direct: 100,
optical: 120,
UiEdgeLink: 3,
+ UiDeviceLink: 100,
_def_: 50,
};
@@ -97,7 +98,7 @@
this.simulation.nodes(this.nodes);
this.simulation.force('link',
d3.forceLink(this.links)
- .strength(this.strength.bind(this))
+ .strength(LINK_STRENGTH._def_)
.distance(this.distance.bind(this))
);
this.simulation.alpha(0.3).restart();
@@ -110,16 +111,9 @@
distance(link: Link) {
const linkType = link.type;
- this.log.debug('Link type', linkType, LINK_DISTANCE[linkType]);
return LINK_DISTANCE[linkType] || LINK_DISTANCE._def_;
}
- strength(link: Link) {
- const linkType = link.type;
- this.log.debug('Link type', linkType, LINK_STRENGTH[linkType]);
- return LINK_STRENGTH[linkType] || LINK_STRENGTH._def_;
- }
-
stopSimulation() {
this.simulation.stop();
this.log.debug('Simulation stopped');