Skip to content

husnimubarok/disaster-metrics-dashboard

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disaster metrics dashboard

This project allows you to create a dashboard with high-level numbers for a disaster impact and response. The primary use case is when a single IFRC Appeal includes multiple operations. For example, the 2018 Indonesia earthquakes and tsunami appeal that included operations to separate disaster events in both Sulawesi and Lombok. Pages on the IFRC GO platform are created for each appeal, not operation, and only has a single overview numbers section. This project allows you to create an overview section for each operation and then add them to a GO page via an iframe embed in the "Additional Graphics" section.

screen shot of a dashboard

Creating a new dashboard

  • Request to be a contributor or fork the repository, clone, and create a new branch for your changes.
  • Make a copy one of the dashboard folders (e.g. .\2018-idn-sulawesi\) and rename it. It's nice to stick to the naming convention of 4 digit year, dash, alpha 3 iso code for the country, dash, descriptor. All lowercase. For a multi-country disaster, you'll need to pick one country or think of something creative.
  • Create a Google Spreadsheet, name a tab overview and create a table like the below:
key value label img color
overview-text Type an overview description here.
key-target 80,000 Target beneficiaries
key-money1 1,500,000 Requested amount (CHF)
key-money2 1,200,750 Funding (CHF)
secondary-figure 870 Fatalities dead.svg
secondary-figure 30,000 Displaced displaced.svg
secondary-figure 673 Volunteers mobilized person.svg primary-darkred-0
secondary-figure 10,330 People benefited from health services health.svg primary-darkred-0
sources Type a list of sources here.
  • However, you can add or delete as many secondary-figure rows as you want.
  • For each secondary-figure row, edit the value and label, and add a filename from the ./img/secondary-icons/ folder in the img column. Optionally, you can adjust the color of the icon by adding a value from the "secondary-figure color options" section below in the color column.
  • For your list of sources you can include links using an html anchor tag. The target="_blank" in the below example requests the browser to open the link in a new tab. Adding a <br> will insert a line break.
Impact figures provided from <a href="https://sites.google.com/view/gempadonggala/beranda" target="_blank">BNPB portal</a>, 20-Nov 
<br>Other data: PMI, 02-Jan 2019 
  • This project uses Tabletop.js to load the Google spreadsheet data. Follow the instructions for "1) Publishing your Google Sheet" to get the URL for your data.
  • In the index.html file, edit what should be about line 70 so that is has the URL for your data.
<script>
var publicSpreadsheetUrl = 'https://docs.google.com/spreadsheets/d/1N3g6lG4J16qCJ0dK2W0KhNF4h__jmR5Nhx6WV7oHaZg/';
</script>
  • While you're editing the index.html file, change what should be about line 27 so that it has the title for your new dashboard.
<div class="row text-center">
  <h3 class="gored">My Dashboard Title</h3>
</div>
  • To test your dashboard locally I suggest using node.js and the http-server package, or using the built-in web server in Python using python -m SimpleHTTPServer.
  • When you're ready, push your branch and edits up to GitHub. Then open a pull request into the gh-pages branch of the repository.
  • The code to embed within a Snippet on an IFRC GO page should look something like the below. You'll need to adjust the height value according to how many rows of secondary icons you end up having. You want the iframe tall enough so that a scroll bar doesn't appear at most screen sizes. You can include more than one iframe embed in a single Snippet object, just add a line break between each with a <br>.
<iframe width="100%" height="500px" frameborder="0" src="https://americanredcross.github.io/disaster-metrics-dashboard/2018-idn-lombok/"></iframe>
<br>

secondary-figure color options

  • #C9C3C1 (this is the default color)
  • #E32219   ifrc
  • #F63440   primary-red-0
  • #7A1600   primary-darkred-0
  • #C3ADA9   primary-darkred-1
  • #E1D6D4   primary-darkred-2
  • #786A65   primary-grey-0
  • #C9C3C1   primary-grey-1
  • #E4E1E0   primary-grey-2
  • #FFD200   secondary-yellow-0
  • #FFE466   secondary-yellow-1
  • #FFF6CC   secondary-yellow-2
  • #FF5014   secondary-orange-0
  • #FF9966   secondary-orange-1
  • #FFDCD0  secondary-orange-2
  • #00A0DC  secondary-blue-0
  • #99D9F1  secondary-blue-1
  • #CCECF8  secondary-blue-2
  • #D20073  secondary-magenta-0
  • #ED99C7  secondary-magenta-1
  • #F6CCE3  secondary-magenta-2
  • #8CD200  secondary-green-0
  • #BAE466  secondary-green-1
  • #E8F6CC  secondary-green-2
  • #003246  secondary-darkblue-0
  • #99ADB5  secondary-darkblue-1
  • #CCD6DA  secondary-darkblue-2
  • #5A325F  secondary-purple-0
  • #BDADBF  secondary-purple-1
  • #DED6DF  secondary-purple-2
  • #555F1E  secondary-darkgreen-0
  • #999F78  secondary-darkgreen-1
  • #DDDFD2  secondary-darkgreen-2

Adding new secondary icons

  • If using Adobe Illustrator to save a new SVG icon for the secondary-icon set, under Advanced Options, for CSS Properties, set the option to "Style Attributes" (not "style Elements").
  • The color of new icons should be #C9C3C1 with 100% opacity.
  • So that it's possible to change the color of an icon, the icon can't have any objects with transparent/white/etc fill.

About

embeds for Go disaster page

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 51.3%
  • JavaScript 28.2%
  • CSS 20.5%