require 'daru/view'
true
Daru::View.plotting_library = :googlecharts
:googlecharts
data_str = 'https://docs.google.com/spreadsheets/d/1aXns2ch8y_rl9ZLxSYZIU5ewUB1ZNAg5O6iPLZLApZI/gviz/tq?header=1&tq='
table = Daru::View::Table.new(data_str, width: 500)
table.show_in_iruby
plot = Daru::View::Plot.new(data_str, {type: :bar, width: 800})
plot.show_in_iruby
query1 = 'SELECT C, sum(B) group by C'
table = Daru::View::Table.new(data_str + query1, width: 800)
table.show_in_iruby
query2 = 'SELECT * WHERE A > 1'
data_str << query2
table = Daru::View::Table.new(data_str, width: 800)
table.show_in_iruby
plot = Daru::View::Plot.new(data_str, {type: :line})
plot.show_in_iruby
query_string = 'SELECT A, H, O, Q, R, U LIMIT 5 OFFSET 8'
data_spreadsheet = 'https://docs.google.com/spreadsheets/d/1XWJLkAwch5GXAt_7zOFDcg8Wm8Xv29_8PWuuW15qmAE/gviz/tq?gid=0&headers=1&tq='
table_spreadsheet = Daru::View::Table.new(data_spreadsheet + query_string, width: 800)
table_spreadsheet.show_in_iruby
plot_spreadsheet = Daru::View::Plot.new(data_spreadsheet + query_string, {type: :area, width: 800})
plot_spreadsheet.show_in_iruby
plot_sheet = Daru::View::Plot.new(data_spreadsheet + query_string, {type: :column, width: 800})
plot_sheet.show_in_iruby
query = 'SELECT H, O, Q, R WHERE O > 1'
plot_sheet = Daru::View::Plot.new(data_spreadsheet + query)
plot_sheet.show_in_iruby