diff --git a/src/app/d3/models/force-directed-graph.ts b/src/app/d3/models/force-directed-graph.ts index b0cf9c5..a48dd0b 100644 --- a/src/app/d3/models/force-directed-graph.ts +++ b/src/app/d3/models/force-directed-graph.ts @@ -79,9 +79,7 @@ export class ForceDirectedGraph { ); // Connecting the d3 ticker to an angular event emitter - this.simulation.on('tick', function () { - ticker.emit(this); - }); + this.simulation.on('tick', () => ticker.emit(this.simulation)); this.initNodes(); this.initLinks();