Created
April 27, 2016 22:13
-
-
Save lpadukana/e6bc540f9c2cd73cc8fdeb8798280436 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| update() { | |
| // console.log(this.dataset); | |
| this.xScale.domain(d3.extent(this.dataset, d => new Date(+d.x))); | |
| this.yScale.domain([0, d3.max(this.dataset, d => +d.y)]); | |
| d3.transition() | |
| .duration(500) | |
| .each(() => { | |
| this.svg.selectAll("g.x.axis").call(this.xAxis); | |
| this.svg.selectAll("g.y.axis").call(this.yAxis); | |
| this.path.transition().attr('d', this.line); | |
| }) | |
| .transition() | |
| .each(() => { | |
| this.path.data([this.dataset]); | |
| this.path.transition().attr('d', this.line); | |
| }); | |
| this.path.exit() | |
| .remove(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment