From 99bab17980d9d3f02e9f538ff88a921869328049 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 27 Sep 2018 21:43:10 +0200 Subject: Scale graph with number of rooms. --- ramaskrik-program.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3