()
| 93 | } |
| 94 | |
| 95 | private redraw() { |
| 96 | // Adjust the x and y domain. |
| 97 | this.xScale.domain([1, this.data.length]); |
| 98 | this.yScale.domain([this.minY, this.maxY]); |
| 99 | // Adjust all the <path> elements (lines). |
| 100 | let getPathMap = (lineIndex: number) => { |
| 101 | return d3.svg.line<{x: number, y:number}>() |
| 102 | .x(d => this.xScale(d.x)) |
| 103 | .y(d => this.yScale(d.y[lineIndex])); |
| 104 | }; |
| 105 | for (let i = 0; i < this.numLines; i++) { |
| 106 | this.paths[i].datum(this.data).attr("d", getPathMap(i)); |
| 107 | } |
| 108 | } |
| 109 | } |
no outgoing calls
no test coverage detected