How to make an Exhibit from a tsv or csv file
This tutorial walks you through the steps of setting up an Exhibit
from a tsv or csv file. Here are the example exhibit and the data
files in both formats: csv and tsv.
Setting up the Exhibit
To make your TSV/CSV Exhibit, you should first follow the Getting
Started Tutorial to set up the initial html page. The link to the data
however should be similar to the following, depending on the file's
format:
⟨link href="italianSoccer.csv" type="text/csv" rel="exhibit/data"/⟩
or
⟨link href="italianSoccer.txt" type="text/tsv" rel="exhibit/data"/⟩
Formatting the Data
If you are creating the tsv/csv file yourself , the first line should
provide the names of the properties along with their value types as
shown below. In the case that the value type is .text., then you do
not have to specify it as it is the default type.
label,url:url,image:url,City,Region,Winners,Runner-up,Championship
Seasons
or
label url:url image:url City Region Winners Runner-up
Championship Seasons
Adding the Property Names and Value Types
If instead the data is taken from another website and you would like
to add or replace the existing property names to match the Exhibit
format, you must change the link so that it follows the structure
below:
⟨link href="italianSoccer.txt" type="text/tsv" rel="exhibit/data"
data-ex-properties="label,url:url,image:url,City,Region,latlng,Winners:number,Runner-up:number,ChampionshipSeasons"
data-ex-has-column-titles="true"/⟩
The data-ex-properties
attribute allows you to specify a comma-separated
list of names and types for the properties. The
data-ex-has-column-titles
attribute, which is set to true by default, lets
you specify whether the data file already contains a header row. If a
list of properties is specified in data-ex-properties
and
data-ex-has-column-titles
is set to true, the property list will override the
existing header row. Note, you will get an error if you set
data-ex-has-column-titles
to false and do not provide a list of property
names.