<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@datashaper/schema](./schema.md) &gt; [DataOrientation](./schema.dataorientation.md)

## DataOrientation enum

Indicates the orientation of the data within the file.

Most CSV data files are 'values' (row-oriented).

JSON files can commonly be either. Records are probably more common, though require more space due to replication of keys. Apache Arrow or Parquet are columnar. This nearly aligns with pandas: https://pandas.pydata.org/pandas-docs/stable/user\_guide/io.html\#json

A key difference (which probably needs resolved) is that we don't yet support the notion of an index. See their example for "columns" or "index" orientation, which is a nested structure.

Example JSON formats: records: \[{ colA: valueA1, colB: valueB1 }<!-- -->, { colA: valueA2, colB: valueB2 }<!-- -->\]

columnar: { colA: \[valueA1, valueA2\], colB: \[valueB1, valueB2\] }

array: \["value1", "value2"\]

values: \[ \["colA", "colB"\], \["valueA1", "valueA2"\], \["valueA2", "valueB2"\] \]

<b>Signature:</b>

```typescript
export declare enum DataOrientation 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  Array | <code>&quot;array&quot;</code> | Data is stored in a flat array. If a matrix definition is provided, this can be transposed into columns/rows, otherwise it is assumed to be a single column of data.length rows. |
|  Columnar | <code>&quot;columnar&quot;</code> | Data is oriented in a columnar manner, such as that used by Apache Arrow or Parquet. Column headers run down the vertical axis, and cell values run across the horizontal. |
|  Records | <code>&quot;records&quot;</code> | Data is oriented as an array of object records, akin to most databases. Column headers run along the horizontal axis, and cell values run down the vertical. |
|  Values | <code>&quot;values&quot;</code> | Data is stored as raw rows. This is the default for CSVs. If specified for JSON files, it is expected that file contents are a nested array - the outer array is the rows, and each row has an array of column values. The first row is assumed to be the column headers. |

