diff --git a/.gitignore b/.gitignore
index 8cf0446b..f4ea6b96 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,5 @@ src/js/helpers/osdata.js
src/js/helpers/addressesProxy.js
src/js/helpers/hackneyGeoserver.js
.npmrc
-web.config
\ No newline at end of file
+web.config
+.pre-commit-config.yaml
\ No newline at end of file
diff --git a/README.md b/README.md
index 03895822..bde13a87 100644
--- a/README.md
+++ b/README.md
@@ -169,6 +169,19 @@ Object properties:
| `tooltip` | Object | optional | Used to configure the tooltips for the layer. [See Tooltip Options for details](#tooltip-options) |
| `searchable` | Boolean | optional | If `true`, and if there is a `search` object defined for this map, the layer will be included in the search. The layer must have an attribute with the name specified in `searchField` in the `search` object. |
| `listView` | Object | optional | If listView is configured, and if there is a `list` defined for this map, the features of this layer will be listed in an accordion below the map. This object describe which fields are displayed in the list entry. [See ListView Options for details](#listview-options) |
+|`spatialEnrichments`|Array| optional | This layer will be enriched with extra attributes using spatial joins (point on area only) as defined in the objects in this list. Where :
`geographyLayer` = Source of new attribute, must be the title of a layer in the Layers' Array
`sourceAttribute` = Attribute to be copied from enriching layer
`targetAttribute` = Attribute name being added as enrichment to this layer
|
+
+```javascript
+ [
+ {
+ "geographyLayer": "enriching_layer_title",
+ "sourceAttribute": "enriching_layer_target_attribute",
+ "targetAttribute": "attribute_name_to_add_to_this_layer"
+ }
+ ]
+```
+> Only available for enriching a points layer only
+
### Point Style Options
@@ -180,8 +193,9 @@ Object properties:
| `icon2` | String | optional | A second FontAwesome icon can be used when an advanced style is required (e.g: an outline and a filled colour with different colours). Both icons will be stacked using the FontAwesome data-fa transformations.|
| `markerColor` | String | optional | Colour of the marker when `markerType` is set to `"AwesomeMarker"` or `"CircleMarker"`. See variable `MARKER_COLORS` in `src/js/map/consts.js` to get the list of colours. |
| `markerIcon2` | String | optional | Colour of the second marker when there is a second icon `icon2` is required. See variable `MARKER_COLORS` in `src/js/map/consts.js` to get the list of colours. |
-| `cluster` | Boolean | optional | If `true`, Leaflet will use the ClusterMarker plugin up to zoom 17. Beyond zoom 17 the individual markers will be used as defined above. We use a purple cluster style with a level of transparency depending on the size of the cluster. |
+| `cluster` | Boolean | optional | If `true`, Leaflet will use the ClusterMarker plugin up to zoom 12 (default), or up to the value specified in the next option. Beyond this zoom threshold, the individual markers will be used as defined above. The clusters are styled using the markerColor option.|
| `disableClusteringAtZoom` | Number | optional | This value is the zoom level at which the clustering will be disabled. It can only be used if the cluster is `true`. If the cluster is `true` and the zoom is empty, the clustering will be disabled at the zoom level 12.|
+| `enableSpiderfy` | Boolean | optional | If `true`, Leaflet will use the spiderfyOnMaxZoom option, which means that a cluster might get spiderfied (all markers individual shown) when clicked on. The spiderfy only occurs if all items within the cluster are still clustered at the maximum zoom level or at the zoom level specified by disableClusteringAtZoom option.|
### Line Polygon Options
@@ -225,6 +239,158 @@ Object properties:
| `title` | String | required | The name of the field to use as the title of the list entry. |
| `fields` | Array | optional | A list of field objects to show in the list entry with the following properties:
`label` (String): a label shown in bold before the field value
`name` (String): geoserver field name (matches the table column name) |
+### Statistics Options
+
+| Option | Type | Required | Description | Default |
+| --- | -- | --- | ---- | -- |
+| `sectionHeader` | String | optional | The name of the field to use as the title of the Tables section. | `"Tables"` |
+| `accordionStatus` | String | Optional | If string "allExplanded" is entered, this will expand all Statistic Accordions on load. | `false`|
+| `statisticsTables` | Array | required | A list of Statistic tables to be shown | |
+
+### Statistics Table Options
+
+* To avoid errors, please ommit **any** options **NOT** being used in your Tables.
+
+
+
+| Option | Type | Required | Description | Default |
+| --- | -- | --- | ---- | -- |
+| `tableTitle` | String | required | The name of the field to use as the **Title** of the Statistic Table. | |
+| `scope` | Array | required | A list of map layers' titles from the layers for whose data should be referenced in **this** table creation. **Note** These layers must all have the same data schema for the fields beings referenced |
+| `filters` | Array | optional | A list of object data filters to be applied to all the data in the **scope** for this table.| `false` |
+```json
+ [
+ {
+ "attribute": "Name of field/column | String",
+ "operator": "condition to check e.g '===' | String",
+ "value": "value to compare with i.e. check against | String / Number"
+ }
+ ]
+```
+>`operator` options:
+>- "===" --> Equals to value and type (String/Number/Boolean),
+>- ">" --> Greater than value,
+>- "<" --> Less than value,
+>- "!==" --> Not equal to value and type (String/Number/Boolean),
+>- ">=" --> Greater or equal to value,
+>- "<=" --> Less than or equal to value,
+>- "contains" --> If attribute contains the value substring
+
+
+| Option | Type | Required | Description | Default |
+| --- | -- | --- | ---- | -- |
+| `dtypes` | Object | required | An object with `"int32","float32"` Number data types as **keys** and array of **fields** to be cast into each corresponding data type key as **values**. Any column/field that needs an arithmetic operation performed on it will need to be of `Number` type.| `false` |
+```json
+ {
+ "int32":["field_name_1"],
+ "float32":["field_name_2","field_name_3"]
+ }
+```
+| Option | Type | Required | Description | Default |
+| --- | -- | --- | ---- | -- |
+| `groupBy` | Array | optional | A list of fields/cloumns to group the data. The **order** of the fields is important to the output. | `false` |
+| `aggregations` | Object | conditional | **Required** with a **groupBy** clause!
An Object with the field/column names as the **keys** and and Object of **"functions"** key with an arithmetic operations values array as the **values**. | |
+```json
+ {
+ "field_name_1":{
+ "functions":["count","mean"],
+ },
+ "field_name_2":{
+ "functions":["count"],
+ }
+ }
+```
+| Option | Type | Required | Description | Default |
+| --- | -- | --- | ---- | -- |
+| `functions` | Object | conditional | **Cannot** be used in conjuction with **groupBy** and **aggregations**.
An object where the name of an operation is the **key** and an array of fields as **values**. Useful for when you need to perform the same operation on different fields and or perform different operations on different fields but displayed on the same table.|`false`|
+
+```json
+ {
+ "sum": ["A"],
+ "count": ["B"]
+ }
+```
+>`functions` ***key*** options:
+> - `"sum"`, `"count"`, `"median"` ,` "mean"`, `"mode"`, `"max"`,
+> - `"var"` --> variance , `"std"` --> standard deviation
+>
+>`functions`; flag if used will always result into a table like below:
+
A | B | column | value | ||
---|---|---|---|---|---|
1 | 2 | --------> | A_sum | 6 | |
5 | 9 | B_count | 2 |