Data is taken from GitHub API
Daru::DataFrame
(yes, that's all!):@watchers = Daru::DataFrame.read_json(
'https://api.github.com/orgs/Sciruby/repos',
repo_name: '$..name',
watchers: '$..watchers'
)
respond_to do |format|
format.html
format.csv { send_data(dataframe.to_csv_string) }
format.xls { send_data(dataframe.to_excel_string) }
format.json { send_data(dataframe.to_json_string(pretty: true)) }
end
daru_table(
@watchers,
adapter: :googlecharts, pageSize: 10,
height: 300, width: 400
)
daru_chart(
@watchers,
type: :line,
adapter: :googlecharts,
height: 500,
width: 1000
)
daru_chart(
@watchers,
type: :pie,
adapter: :googlecharts,
height: 500,
width: 1000,
title: 'Sciruby Popular repos (in the view of number of watchers)',
is3D: true
)