Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ The following options are available in the object:
* `custom`: A structure that can't easily be rendered with any of the pre-defined formatters and thus needs a custom implementation (see `externalRenderer`).
* `alias`: If a field has multiple keys, declare the field to use the specification of the other field.
* `listWithKeys`: Set to `true` to allow the option `items` to specify items in an object of objects (like assets). Defaults to `false`.
* `items`: If the value is an array of objects (or an object of objects if `listWithKeys` has ben set), a table can be created with the details in this object. It has the same structure as specified here, but in additon `sortable` and `id` are allowed:
* `sortable`: Specfiies whether the value can be sorted (`true`, e.g. in a table) or not (`false`). Defaults to `false`.
* `id`: Specfiies whether the value is the unique primary key (`true`) or not (`false`). Defaults to `false`.
* `items`: If the value is an array of objects (or an object of objects if `listWithKeys` has ben set), a table can be created with the details in this object. It has the same structure as specified here, but in addition `sortable` and `id` are allowed:
* `sortable`: Specifies whether the value can be sorted (`true`, e.g. in a table) or not (`false`). Defaults to `false`.
* `id`: Specifies whether the value is the unique primary key (`true`) or not (`false`). Defaults to `false`.
* `default`: If no value is present, this value will be used instead.
* `properties`: If the value is an object, specify the properties.
* `null`: The value that should be given instead of `null`. If a value is null but this property is not given, defaults to "n/a".
Expand Down Expand Up @@ -150,7 +150,7 @@ The most important methods are:
* Shape (formats an array containing shape/size information, e.g. `proj:shape`)
* Software (formats the list of software as defined in the processing extension)
* TemporalExtent (array with two timestamps formatted as temporal range, see Timestamp) - add `shorten: true` to the field spec to render a shorter version (i.e. date only)
* TemporalExtents (array containing a temporal extent per element, which is rendere using `TemporalExtent`, see above)
* TemporalExtents (array containing a temporal extent per element, which is rendered using `TemporalExtent`, see above)
* Transform (makes 2D numerical arrays, e.g. the `proj:transform` field, better readable)
* Timestamp (ISO8601 timestamp formatted according to local rules)
* Url (Formats a STAC Link Object)
Expand All @@ -171,7 +171,7 @@ Formatters are always functions that have the following signature:

The returned value is always expected to be a string.
It may contain HTML if the formatter is added to the `htmlFormats` array in `fields.json`.
If the return value is allowed to contain HTML, ALL user input must run thorugh the `e()` function (or `parseInt` for integers, for example) to escape malicious HTML tags.
If the return value is allowed to contain HTML, ALL user input must run through the `e()` function (or `parseInt` for integers, for example) to escape malicious HTML tags.
This avoids XSS and similar security issues.

### `I18N`
Expand Down
4 changes: 2 additions & 2 deletions fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
"mean": "Average",
"maximum": {
"label": "Max.",
"explain": "Maxmimum value"
"explain": "Maximum value"
},
"minimum": {
"label": "Min.",
Expand Down Expand Up @@ -1274,7 +1274,7 @@
"count": "Count",
"maximum": {
"label": "Max.",
"explain": "Maxmimum value"
"explain": "Maximum value"
},
"minimum": {
"label": "Min.",
Expand Down
4 changes: 2 additions & 2 deletions formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ const Formatters = {
return short ? 'COPC' : 'Cloud-Optimized Point Cloud (LASzip)';
case 'application/vnd+zarr': // https://github.com/zarr-developers/zarr-specs/issues/123
return 'Zarr';
case 'application/x-parquet': // Inofficial
case 'application/x-parquet': // Unofficial
case 'application/vnd.apache.parquet': // Official (tbc): https://github.com/opengeospatial/geoparquet/issues/115
return 'Parquet'
case 'application/vnd.pmtiles':
return 'PMTiles';
case 'application/vnd.cov+json':
return 'CoverageJSON';
case 'application/vnd.flatgeobuf':
return 'FlatGeobuf'; // inofficial: https://github.com/flatgeobuf/flatgeobuf/discussions/112
return 'FlatGeobuf'; // unofficial: https://github.com/flatgeobuf/flatgeobuf/discussions/112
case 'application/x-filegdb':
return short ? 'Geodatabase' : 'Esri File Geodatabase';
case 'application/vnd.nitf':
Expand Down
2 changes: 1 addition & 1 deletion interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function formatGrouped(context, data, type, filter, coreKey) {
// Go through each field's summary
for(let i in formatted) {
let result = _.isObject(formatted[i]) ? {} : [];
// Go through each entry in a field's summary (this is besically a single value as defined in the Item spec)
// Go through each entry in a field's summary (this is basically a single value as defined in the Item spec)
for(let key in items) {
result[key] = format(formatted[i][key], key, context, data, items[key]);
}
Expand Down