Adding data to a template
Templates get interesting when you add your own data. The keys to using your own data successfully are:
- Understanding the template's data structure so you can match it
- Using the column settings panel to join your data with the template
In this article
Understanding the data structure
The first step is to look at the sample data in the template, as we’ll need to get our data into the same format.
All templates expect data in a certain format. While the exact format varies by template, you can always look at the column settings panel ("Select columns to visualize", on the right, to see which columns are required and which are optional. In Flourish, the names and order columns don't matter – instead, you use the column settings panel to specify, by letter, which column is which.
In this example, we can see, from taking a look at the column settings panel, that the template is currently using the “Values” sheet to specify each arrow, and it requires the following columns:
- Source location (country) for the arrow (currently set to column C)
- Destination location (country) for the arrow (column D)
- Value (thickness) of the arrow (column E)
There are also two optional columns for the data filters, currently set to column A and column B.
Switching tabs, we can see how the Locations sheet specifies the locations of the arrows using a location code and a name, latitude, and longitude for each country. These location codes match the codes in columns C and D in the Values sheet.
To make our own version of the globe, we’ll need to replace the sample “Values” sheet with new data that has columns for each arrow's source, destination, and value. And we’ll need to make sure each source and destination has a matching entry in the “Locations” sheet.
TIP: If you aren't sure which template you should be using with your data, you might want to check out this help doc on the topic.
Uploading data and selecting columns
There are three ways of adding data to a template:
- Uploading data via the Import your data button
Once your data is in the right format, you can navigate to the datasheet you want to replace and click Import your data. Alternatively, you can simply drag the data file you are looking to import into the datasheet. Then you can update the column settings panel to point to the correct columns.
- Pasting data directly into the datasheet
- You can also paste data directly into the datasheet. This might be a good idea if you don't have that much data, or if you are only looking to import part of the data in your Excel, CSV, or GeoJSON file.
- Linking a live CSV file to import
- On Business Pro, Enterprise, and Newsrooms plans, it's also possible to link through to a live data source using our live CSV feature. You can learn more about it in our help doc.
Changing your data structure
Often your data will be suitable for the template but your spreadsheet or CSV file will be in a slightly different format than what's required. For example, to show a time slider in the Connections globe or Scatter templates, your data should be in a “long” format, with years or dates in a single column. But it’s not unusual to have “wide” data, where dates are spread across multiple columns. To convert your data from one format to another, you can use a spreadsheet tool, like Excel, before importing it into Flourish. If you just want to change your data from wide to long, you can also use Flourish's nifty unpivoting feature. (Read more about that here.)
Other times, your data will contain the information that you want to visualize but it will be in a more fundamentally different format. For example, you might want to use the Marker map template uses latitudes and longitudes to draw points, but your dataset might contain postcodes instead. In this situation, you could convert your data using a free online service, like this site, which will convert postcodes to latitudes and longitudes.