Resources¶
A resource is a configuration for a single dataset. The configuration options differ based on the type of data to be displayed. For more information about supported data types and formats, see Supported Data.
Common Configurations¶
| Parameter | Description | Type |
|---|---|---|
id |
The unique resource id. | Required |
name |
The resource name. | Required |
description |
The resource description. | Optional |
source |
The data source URL. | Required |
type |
The data type. Available values are CSV, JSON, GeoJSON, HTML and PDF. |
Required |
CSV and JSON Data¶
Example
The following example is a list of all available configurations for CSV and JSON data:
resources:
- id: string
name: string
description: string
source: string
type: CSV | JSON
numberFormat: string # (1)!
renameFields:
<rename-fields-configs> # (2)!
skipFieldsRegEx: string # (3)!
defaultFilters:
<default-filters-configs> # (4)!
visualizations:
<visualization-config> # (5)!
- Specify the input number format. See numberFormat.
- Rename fields/properties. See renameFields.
- Skip fields/properties. See skipFields.
- Specify default filters for the dataset. See defaultFilters.
- Visualization-specific configurations. See Bar Chart.
GeoJSON Data¶
Example
The following example is a list of all available configurations for GeoJSON data:
resources:
- id: string
name: string
description: string
source: string
type: GeoJSON
numberFormat: string # (1)!
coordinateFormat: string # (2)!
renameFields:
<rename-fields-configs> # (3)!
skipFieldsRegEx: string # (4)!
visualizations:
<visualization-config> # (5)!
- Specify the input number format for the GeoJSON properties. See numberFormat.
- Specify the coordinate format. See coordinateFormat.
- Rename fields/properties. See renameFields.
- Skip fields/properties. See skipFields.
- Visualization-specific configurations. See Map.
HTML and PDF Data¶
Example
For HTML and PDF resources, no configuration options beyond the commons are available:
Configurations for CSV, JSON and GeoJSON Data¶
Number Format¶
Optionally, specify the input format for numbers.
- By default, English number format (
en) will be assumed. - Alternatively, German number format (
de) can be specified.
To provide a concrete example, see the difference in format below:
en |
de |
|---|---|
| 1,234.56 | 1.234,56 |
Rename Fields¶
Optionally, specify configurations to rename fields/properties as on object with key-value pairs of the form
<initial property name>: <new property name>.
An actual config renaming the property test_prop to test prop would look like this:
Skip Fields¶
Optionally, specify a regular expression to skip fields/properties.
An actual config skipping the property test_prop would look like this:
Configurations for CSV and JSON Data¶
Default Filters¶
Optionally, specify a default filter as an object. This filter will be used if the dataset is loading without additional parameters.
- For partial string matching across all properties, specify an
all-entriesfilter. - For partial string matching for a non-numeric property, specify the filter as a string.
- For numeric properties, use
minand/ormaxinstead.
Warning
In case you are using defaultFilters in combination with renameFields, make sure to always use the new property names.
An actual config setting the filters:
- All rows include the string
test - Property
stringPropincludes the stringstr - Property
numberPropis greater or equal than5and less or equal than100
... would look like this:
Configurations for GeoJSON Data¶
Coordinate Format¶
Optionally, specify the coordinate format.
- By default, Latitude Longitude coordinates (
LatLng) will be assumed. - Alternatively, the UTM coordinate system can be specified.
To provide a concrete example, see the difference in format for the coordinates of Karlsruhe below:
LatLng |
UTM |
|---|---|
| [49.018071401430845, 8.404381570202148] | [456450.836, 5429635.580] |