This gem exists to make it eaiser to display data on your Panic Status Board.
The Panic Status Board loads itself with data it pulls from the internet.
Therefore, if you want to show very custom data in your Status Board, you'll want to create a website that serves that custom data.
With this gem, the easiest way to do this is to create a simple Sinatra application. Create a simple site that returns the output from this gem, and your custom Status Board will be good-to-go.
# Sinatra example get '/my_table' do # sample images for our board images = [build_image('http://tinyurl.com/mnvjm96'), build_image('http://tinyurl.com/kt3hp7v')] # special note: An array of values (like "images") will # be flattened into a single value in the cell... # so no need to concatenate things like rows of images. data = [['Project A', "5 days", images, progress_bar_to(3)], ['Project B', "2 days", images, progress_bar_to(7)], ['Project C', "9 days", images, progress_bar_to(1)], ['Project D', "1 day", nil, progress_bar_to(8)]] table = ::. data # optionally set the column widths table.widths = [nil, 125, 100] # return HTML necessary for import into Status Board table.to_html end
#another Sinatra example get '/graph_example' do # one set of data hotdogs = ::.('Hotdogs') hotdogs.data['Sunday'] = 4 hotdogs.data['Monday'] = 3 hotdogs.data['Tuesday'] = 4 hotdogs.data['Wednesday'] = 8 hotdogs.data['Thursday'] = 10 hotdogs.data['Friday'] = 11 hotdogs.data['Saturday'] = 2 # another set of data burgers = ::.('Burgers') burgers.data['Sunday'] = 1 burgers.data['Monday'] = 7 burgers.data['Tuesday'] = 5 burgers.data['Wednesday'] = 6 burgers.data['Thursday'] = 10 burgers.data['Friday'] = 15 burgers.data['Saturday'] = 5 # build the graph graph = ::. graph.title = "Purchases" # this can be :bar or :line graph.type = :bar # add the sets of data you want to display in the graph graph.data_sequences << hotdogs graph.data_sequences << burgers # return JSON necessary for import into Status Board graph.to_json end
These can be really big...
# yet another Sinatra example get '/single_value' do heading = 'How many people live in the United States?' value = ::. heading, '317,044,240' # return HTML necessary for import into Status Board value.to_html end
... or very small.
# yet another Sinatra example get '/single_value' do ::.('Logins Today', 1). end