diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2018-09-27 21:43:10 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2018-09-27 21:43:10 +0200 |
commit | 99bab17980d9d3f02e9f538ff88a921869328049 (patch) | |
tree | 421e89b22a92caea678ec7955bf57398cc795c29 | |
parent | 585c2d6247d01c1974906d7b0dce2dcb2d10b41c (diff) | |
download | ramaskrik-program-99bab17980d9d3f02e9f538ff88a921869328049.tar.gz ramaskrik-program-99bab17980d9d3f02e9f538ff88a921869328049.tar.bz2 ramaskrik-program-99bab17980d9d3f02e9f538ff88a921869328049.zip |
Scale graph with number of rooms.
-rw-r--r-- | ramaskrik-program.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ramaskrik-program.rb b/ramaskrik-program.rb index 5014260..a9af3a0 100644 --- a/ramaskrik-program.rb +++ b/ramaskrik-program.rb @@ -39,17 +39,20 @@ doc = Nokogiri::HTML(open("program.html")) ## open("https://ramaskrik.no/program movies = doc.css(".kultur-type-movie").map { |movie| Movie.new(movie) } days = movies.group_by { |movie| movie.start_time.strftime("%A %d.%m.%Y") } days.each do |d, movies| + rooms = movies.group_by { |m| m.venue }.delete_if { |t, _| t == "Ramaskrik" } + graph = SVG::Graph::RoomSchedule.new({ graph_title: d, show_graph_title: true, show_x_guidelines: true, width: 1280, + height: rooms.keys.length * 100 + 25, key: false, x_label_format: "%H:%M", timescale_divisions: "30 minutes", }) - movies.group_by { |m| m.venue }.delete_if { |t, _| t == "Ramaskrik" }.each do |title, data| + rooms.each do |title, data| graph.add_data(title: title, data: data) end |