tailwind #9

Manually merged
peperunas merged 157 commits from tailwind into master 2020-12-28 18:38:52 +00:00
Showing only changes of commit 119d80a936 - Show all commits

View File

@ -34,9 +34,16 @@ class RPlot extends Component<{}, PlotState> {
})
socket.on("new_tick", (data: NewTickData) => {
var new_x = [...this.state.x, data.tick]
var new_y = [...this.state.y, data.price]
// cutting to up to 500 entries (last 500)
var x = new_x.slice(Math.max(new_x.length - 500, 0))
var y = new_y.slice(Math.max(new_y.length - 500, 0))
this.setState({
x: [...this.state.x, data.tick],
y: [...this.state.y, data.price],
x: x,
y: y,
})
})
}