From d8e49d3cbe44e2c059b1feac752f9cf1f2a01881 Mon Sep 17 00:00:00 2001 From: dbauszus-glx Date: Wed, 20 Nov 2024 16:00:54 +0000 Subject: [PATCH] update tabulator and chartjs plugins --- geotam/workspace.json | 160 +++++++++ plugins/chartjs.js | 2 +- plugins/tabulator.js | 767 +++++++++++++++++++++++++++++++++--------- 3 files changed, 777 insertions(+), 152 deletions(-) create mode 100644 geotam/workspace.json diff --git a/geotam/workspace.json b/geotam/workspace.json new file mode 100644 index 0000000..23c1bb1 --- /dev/null +++ b/geotam/workspace.json @@ -0,0 +1,160 @@ +{ + "locale": { + "minZoom": 8, + "maxZoom": 17, + "extent": { + "north": 54.1, + "east": -1.5, + "south": 52.9, + "west": -3.1, + "mask": true + }, + "layers": { + "OSM": { + "display": true, + "format": "tiles", + "URI": "https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png", + "_style": { + "contextFilter": "grayscale(100%)" + }, + "attribution": { + "© OpenStreetMap": "http://www.openstreetmap.org/copyright" + } + }, + "openlocal": { + "dbs": "GEOTAM", + "format": "wkt", + "table": "openlocal", + "geom": "geom", + "srid": "4326", + "qID": "id", + "cluster": { + "distance": 25 + }, + "filter": { + "current": { + "voacategory": { + "ni": ["OFFICE", "OTHER"] + } + } + }, + "style": { + "default": { + "icon": { + "type": "dot" + } + }, + "highlight": { + "scale": 1.5 + }, + "theme": { + "type": "categorized", + "field": "voacategory", + "cat": { + "INDUSTRIAL": { + "style": { + "icon": { + "type": "dot", + "fillColor": "#e74c3c" + } + } + }, + "LEISURE": { + "style": { + "icon": { + "type": "dot", + "fillColor": "#f7dc6f" + } + } + }, + "OFFICE": { + "style": { + "icon": { + "type": "dot", + "fillColor": "#af601a" + } + } + }, + "OTHER": { + "style": { + "icon": { + "type": "dot", + "fillColor": "#797d7f" + } + } + }, + "RETAIL": { + "style": { + "icon": { + "type": "dot", + "fillColor": "#2874a6" + } + } + } + } + } + }, + "infoj": [ + { + "type": "pin", + "field": "pin", + "fieldfx": "ARRAY[ST_X(geom),ST_Y(geom)]" + }, + { + "title": "voabillingauthoritycode", + "field": "voabillingauthoritycode" + }, + { + "title": "voabillingauthorityname", + "field": "voabillingauthorityname" + }, + { + "title": "voapropertyaddress", + "field": "voapropertyaddress" + }, + { + "title": "voapropertypostcode", + "field": "voapropertypostcode", + "inline": true + }, + { + "title": "voascatcode", + "field": "voascatcode", + "nullValue": "NULL", + "inline": true + }, + { + "title": "voascatname", + "field": "voascatname", + "nullValue": "NULL", + "inline": true + }, + { + "title": "voacategory", + "field": "voacategory", + "nullValue": "NULL", + "inline": true + }, + { + "title": "voasubcategory", + "field": "voasubcategory", + "nullValue": "NULL", + "inline": true + }, + { + "title": "voafloorarea", + "field": "voafloorarea", + "nullValue": "NULL", + "inline": true + }, + { + "title": "voarateablevalue", + "field": "voarateablevalue", + "nullValue": "NULL", + "inline": true + } + ] + } + } + } + } \ No newline at end of file diff --git a/plugins/chartjs.js b/plugins/chartjs.js index 6628a77..4b5ff69 100644 --- a/plugins/chartjs.js +++ b/plugins/chartjs.js @@ -199,7 +199,7 @@ function create(_this) { // Charts most be rendered into a canvas type element. const canvas = mapp.utils.html.node`` - + _this.target.replaceChildren(canvas); // Nullish coalescing operator to assign default values. diff --git a/plugins/tabulator.js b/plugins/tabulator.js index 92738f8..649bcf1 100644 --- a/plugins/tabulator.js +++ b/plugins/tabulator.js @@ -30,10 +30,16 @@ const dataview = { @author @dbauszus-glx */ -import { TabulatorFull as Tabulator, Module} from 'https://esm.sh/tabulator-tables@6.0.1' +import { TabulatorFull as Tabulator, Module } from 'https://esm.sh/tabulator-tables@6.0.1' document.head.append(mapp.utils.html.node` - `) + `) + +// Prepend the tabulator-edited style to the head. +document.head.prepend(mapp.utils.html.node`