From 93c51656504320907c3acd4918ab69d29818a814 Mon Sep 17 00:00:00 2001 From: Michael Czechowski Date: Tue, 28 Aug 2018 13:51:29 +0200 Subject: [PATCH] fixed jumping animation start --- src/app/directives/guilloche.directive.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app/directives/guilloche.directive.ts b/src/app/directives/guilloche.directive.ts index 203978b..a2e90dd 100644 --- a/src/app/directives/guilloche.directive.ts +++ b/src/app/directives/guilloche.directive.ts @@ -85,9 +85,9 @@ export class GuillocheDirective implements OnChanges, OnDestroy { }; }); this.bounces = this.initialNodes.map(node => { - const bounceStart = Math.round(Math.random() * 100) / 100; + // const bounceStart = Math.round(Math.random() * 100) / 100; const bounceAmplitude = Math.round(Math.random() * 150); - return this.math.bounce(bounceStart, bounceAmplitude, 3); + return this.math.bounce(0, bounceAmplitude, 3); }); this.animationInterval = setInterval(() => this.animateGraph(), 40); } else { @@ -147,10 +147,11 @@ export class GuillocheDirective implements OnChanges, OnDestroy { .y(p => p.y) .curve(Shape.curveBasis)(points)); - if (env.debug) { - this.group.selectAll('circle').remove(); - this.group.selectAll('text').remove(); - } + // if (env.debug) { + // this.group.selectAll('circle').remove(); + // this.group.selectAll('text').remove(); + // // this.debugGraph(points); + // } } private drawGraph(points: Point[]): void {