blob: 1da2a5b3fcb8b2edcafbc874522b51e13c3f1a21 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
# Populate the graph with some random points
points = []
(1..10).each do |i|
points << { x: i, y: rand(50) }
end
last_x = points.last[:x]
SCHEDULER.every '2s' do
points.shift
last_x += 1
points << { x: last_x, y: rand(50) }
send_event('convergence', points: points)
end
|