Add first CSVParser documentation authored by Georg Graßnick's avatar Georg Graßnick
......@@ -82,6 +82,70 @@ In the following a table with all available properties is presented. All distanc
|| ... | ... | ... | ... | ... |
## Input Data Parsing
We aim to support the same input data in CSV files as [SVG-Plott](https://gitlab.hrz.tu-chemnitz.de/s9716248--tu-dresden.de/SVG-Plott) does.
This includes unique csv patterns for:
* Bar Charts
* Categorical Bar Charts
* Line/Scatter Plots
At the moment of writing, the following patterns are supported:
### Simple Bar Charts (no categories):
#### Vertical
`CsvParser.parse(CsvType.X_ALIGNED, CsvOrientation.VERTICAL) -> PointListContainer<PointList>`
|Column 1|Column 2|
|---|---|
|${Name_of_sample#1}|${Value_for_sample#1}|
|${Name_of_sample#2}|${Value_for_sample#2}|
|...|...|
|${Name_of_sample#n}|${Value_for_sample#n}|
[Example File](https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/blob/master/src/main/resources/examples/csv/0_bar_chart.csv)
### Categorical Bar Charts
#### Vertical
`CsvParser.parse(CsvType.X_ALIGNED_CATEGORIES, CsvOrientation.VERTICAL) -> CategoricalPointListContainer<PointList>`
|Column 1|Column 2|Column 3|...|Column n|
|---|---|---|---|---|
||${Name_of_category#1}|${Name_of_category#2}|...|${Name_of_category#n}
|${Name_of_dataset#1}|${Value#1_for_dataset#1_in_category#1}|${Value#2_for_dataset#1_in_category#2}|...|${Value#n_for_dataset#1_in_category#n}|
|${Name_of_dataset#2}|${Value#1_for_dataset#2_in_category#1}|${Value#2_for_dataset#2_in_category#2}|...|${Value#n_for_dataset#2_in_category#n}|
|...|...|...|...|...|
|${Name_of_dataset#n}|${Value#1_for_dataset#n_in_category#1}|${Value#2_for_dataset#n_in_category#2}|...|${Value#n_for_dataset#n_in_category#n}|
[Example File](https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/blob/master/src/main/resources/examples/csv/0_bar_chart_categorical_vertical.csv)
### Scatter and Line Plots
#### Horizontal
`CsvParser.parse(CsvType.DOTS, CsvOrientation.HORIZONTAL) -> PointListContainer<PointList>`
|Column 1|Column 2|Column 3|...|Column n|
|---|---|---|---|---|
|${Name_of_dataset#1}|${XValue#1_for_dataset#1}|${XValue#2_for_dataset#1}|...|${XValue#n_for_dataset#1}
||${YValue#1_for_dataset#1}|${YValue#2_for_dataset#1}|...|${YValue#n_for_dataset#1}
|${Name_of_dataset#2}|${XValue#1_for_dataset#2}|${XValue#2_for_dataset#2}|...|${XValue#n_for_dataset#2}
||${YValue#1_for_dataset#2}|${YValue#2_for_dataset#2}|...|${YValue#n_for_dataset#2}
|...|...|...|...|...|
|${Name_of_dataset#n}|${XValue#1_for_dataset#n}|${XValue#2_for_dataset#n}|...|${XValue#n_for_dataset#n}
||${YValue#1_for_dataset#n}|${YValue#2_for_dataset#n}|...|${YValue#n_for_dataset#n}
[Example File](https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/blob/master/src/main/resources/examples/csv/1_scatter_plot.csv)
* Global rules for all CSV patterns
* Each column has to be separated by the `,` character
* Values need to be of numerical type
* Fractional rational numbers (e.g. a float), to be escaped by placing the `"` character at the beginning and and on the end of that number (e.g. `"3,5"`)
## Rendering
Would be nice to explain this thing a bit here...
\ No newline at end of file