Proof of concept plotting for looking at robot data.
Parker created this plotting program to show how large data sets
can be viewed.
Change-Id: Ie97deccefd778be543068e42b6fb7565fb00c1e1
diff --git a/y2016/plotting/test.rb b/y2016/plotting/test.rb
new file mode 100644
index 0000000..9f2f58a
--- /dev/null
+++ b/y2016/plotting/test.rb
@@ -0,0 +1,29 @@
+require "sinatra"
+
+# Must use sinatra server for this because fetch() in javascript
+# cannot load from the filesystem.
+get '/test.html' do
+ File.read("./test.html")
+end
+
+get '/responsive_plotter.js' do
+ content_type 'text/javascript'
+ File.read("./responsive_plotter.js")
+end
+
+get '/test_data' do
+ content_type 'binary/octet-stream'
+ data = ""
+ # Use ./test_data if it exists. Otherwise random data.
+ if (File.exists?("./test_data"))
+ data = File.read("./test_data")
+ else
+ 1000.times do
+ data += (1024.times.collect do |i|
+ (rand() * 480 - 160)
+ end.pack("F*"))
+ end
+ end
+ data
+end
+