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

Method addDataPoint

src/linechart.ts:82–93  ·  view source on GitHub ↗
(dataPoint: number[])

Source from the content-addressed store, hash-verified

80 }
81
82 addDataPoint(dataPoint: number[]) {
83 if (dataPoint.length !== this.numLines) {
84 throw Error("Length of dataPoint must equal number of lines");
85 }
86 dataPoint.forEach(y => {
87 this.minY = Math.min(this.minY, y);
88 this.maxY = Math.max(this.maxY, y);
89 });
90
91 this.data.push({x: this.data.length + 1, y: dataPoint});
92 this.redraw();
93 }
94
95 private redraw() {
96 // Adjust the x and y domain.

Callers 1

updateUIFunction · 0.80

Calls 1

redrawMethod · 0.95

Tested by

no test coverage detected