MCPcopy
hub / github.com/tensorflow/playground / redraw

Method redraw

src/linechart.ts:95–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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}

Callers 2

resetMethod · 0.95
addDataPointMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected