2
0

fixed jumping animation start

This commit is contained in:
2018-08-28 13:51:29 +02:00
parent 15cf786e90
commit 93c5165650

View File

@@ -85,9 +85,9 @@ export class GuillocheDirective implements OnChanges, OnDestroy {
}; };
}); });
this.bounces = this.initialNodes.map(node => { 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); 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); this.animationInterval = setInterval(() => this.animateGraph(), 40);
} else { } else {
@@ -147,10 +147,11 @@ export class GuillocheDirective implements OnChanges, OnDestroy {
.y(p => p.y) .y(p => p.y)
.curve(Shape.curveBasis)(points)); .curve(Shape.curveBasis)(points));
if (env.debug) { // if (env.debug) {
this.group.selectAll('circle').remove(); // this.group.selectAll('circle').remove();
this.group.selectAll('text').remove(); // this.group.selectAll('text').remove();
} // // this.debugGraph(points);
// }
} }
private drawGraph(points: Point[]): void { private drawGraph(points: Point[]): void {