# Metadata Data

## Required columns

Only an identifier for your data rows is required. The ID column must be unique (i.e. each row has a unique ID value). Note that the column does not need to be named "ID" as a header, although it can be [renamed ](#renaming-columns)as such.

**Proper visualisation in Microreact requires a single ID column that uniquely identifies each row of data in each of the related files.**

* if your data uses a combination of two or more columns to uniquely identify each row, then you will need to concatenate those columns into a single-column ID before importing the data.\ <mark style="color:purple;">**`TIP`**</mark>: Use Data-flo's [columns-concatenation](https://github.com/microreact/docs/blob/main/instructions/creating-a-microreact-project/broken-reference/README.md) adaptor before importing the data to Microreact.
* the ID values should be shared across files. IDs are the linking values that allow panels to interact with one another.
* if a user changes the ID column name while updating the metadata table in Microreact, they will receive a warning message prompting them to select the correct ID column. This is necessary for the Microreact visualizations to function properly

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeEcAMmXG04-LQ2LIsXDF1aHNqkBhsb-jK1BO4J2iJmx2BpHCInXiNkJgtxABqU1GLCx79pOfP5vkSSa2_8y4M_6B3thuC1CR3yUo9iUWzPkjJDYq8yBwyD5wPnUb352GYQN-JLZEPA5KB7dBLLGToZVEXv?key=eWiUFSXUJbPgi8wi6uipZA" alt=""><figcaption></figcaption></figure>

## Optional columns

In addition, your [data file ](https://docs.microreact.org/instructions/supported-file-formats#data-file-formats)can contain the following columns:

| column name (default)    | other panels                                                                                           | column contents                                                                                                      |
| ------------------------ | ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
| **`latitude`**           | [map data](https://docs.microreact.org/instructions/creating-a-microreact-project/map-panel)           | Decimal latitude ([WGS84](https://en.wikipedia.org/wiki/World_Geodetic_System)).                                     |
| **`longitude`**          | [map data](https://docs.microreact.org/instructions/creating-a-microreact-project/map-panel)           | Decimal longitude ([WGS84](https://en.wikipedia.org/wiki/World_Geodetic_System)).                                    |
| **`date`**               | [timeline data](https://docs.microreact.org/instructions/creating-a-microreact-project/timeline-panel) | Parsed as date (ensure that [formatting ](#date-formats)is not getting misinterpreted if using a program like Excel) |
| **`year`**               | [timeline data](https://docs.microreact.org/instructions/creating-a-microreact-project/timeline-panel) | Parsed as number (i.e., 2016 and 16 are not the same year).                                                          |
| **`month`**              | [timeline data](https://docs.microreact.org/instructions/creating-a-microreact-project/timeline-panel) | Parsed as number (i.e, 03 and 3 are both parsed as March).                                                           |
| **`day`**                | [timeline data](https://docs.microreact.org/instructions/creating-a-microreact-project/timeline-panel) | Parsed as number.                                                                                                    |
| **`ColumnName__colour`** |                                                                                                        | Assign a specific colour to a data attribute.                                                                        |
| **`ColumnName__shape`**  |                                                                                                        | Assign a specific shape to a data attribute.                                                                         |

### Formats

* [latitude/longitude](https://docs.microreact.org/instructions/creating-a-microreact-project/map-panel)
* [dates & date parts](https://docs.microreact.org/instructions/creating-a-microreact-project/timeline-panel)

### Defining colour

Microreact can colour by any column, and when that column is selected for colouring, colours from the selected palette will be automatically (randomly) assigned to column values. Sometimes, however, you may want to predefine which colours are used for which values.

When specific colours are desired, you can use a separate column to define the colours and set specific colours for specific values.

If you want to colour by a column named `Country` you would add a new column called `Country__colour` (or `Country__color`) containing colour values. Colours are defined using standard HEX codes or valid HTML5 colour names. A colour wheel allowing you to pick colours can be found here: <https://duckduckgo.com/?q=color+picker>.

<mark style="color:purple;">**`TIP`**</mark>: Use Data-flo to create the new column and set its values using the [extend-datatable](https://github.com/microreact/docs/blob/main/instructions/creating-a-microreact-project/broken-reference/README.md) adaptor.

### Defining shape

You may want to change the shapes on your Microreact panels, e.g. making the leaf nodes on a tree more meaningful via specific shapes. To predefine the shapes for a column named `Country` you would add a new column called `Country__shape` containing shape values.

<mark style="color:purple;">**`TIP`**</mark>: Use Data-flo to create the new column and set its values using the [extend-datatable](https://github.com/microreact/docs/blob/main/instructions/creating-a-microreact-project/broken-reference/README.md) adaptor.

Shapes are defined using the following values:

* `circle`
* `diamond`
* `dot`
* `heptagon`
* `heptagon-inverted`
* `heptagram`
* `heptagram-inverted`
* `hexagon`
* `hexagram`
* `octagon`
* `octagram`
* `pentagon`
* `pentagon-inverted`
* `pentagram`
* `pentagram-inverted`
* `plus`
* `cross`
* `square`
* `star`
* `tetragram`
* `triangle`
* `triangle-inverted`
* `triangle-right`
* `triangle-left`
* `chevron`
* `double-chevron`
* `chevron-inverted`
* `double-chevron-inverted`
* `chevron-right`
* `double-chevron-right`
* `chevron-left`
* `double-chevron-left`
* `wye`
* `wye-inverted`

See <https://www.phylocanvas.gl/docs/constants.html#shapes> for shape examples.

## Renaming columns

Column names can be changed in the Data even after being imported to Microreact.\
Note, however, that these changes may not persist if the data are refreshed and updated via API.

{% embed url="<https://vimeo.com/740541604/>" %}
Changing the name of a column after importing to Microreact
{% endembed %}
