()
| 115 | } |
| 116 | |
| 117 | public updateGraph() { |
| 118 | if (!this.stopped) { |
| 119 | try { |
| 120 | const now = new Date().getTime(); |
| 121 | const limit = now - this.span; |
| 122 | |
| 123 | if (this.points.length > 0) { |
| 124 | const last = this.points[this.points.length - 1]; |
| 125 | |
| 126 | this.points = this.points.filter((xy) => xy.timestamp >= limit); |
| 127 | if (this.points.length === 0) { this.points.push(last); } |
| 128 | |
| 129 | this.path.datum(this.points).attr('d', this.line); |
| 130 | } |
| 131 | } |
| 132 | catch (e) { |
| 133 | console.log('Error Updating Plot: ', e); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | window.requestAnimationFrame(this.updateGraph.bind(this)); |
| 138 | } |
| 139 | } |
nothing calls this directly
no test coverage detected