new deployer command

This commit is contained in:
Mark Gregory
2026-09-16 11:28:40 +01:00
parent 84a628277d
commit 8105d1cb6a
33 changed files with 77 additions and 20 deletions
+10 -10
View File
@@ -2,7 +2,7 @@
'use strict';
function cssVar(name, fallback) {
var value = getComputedStyle(document.documentElement).getPropertyValue(name);
let value = getComputedStyle(document.documentElement).getPropertyValue(name);
return value && value.trim() !== '' ? value.trim() : fallback;
}
@@ -18,8 +18,8 @@
}
function enrichDataset(dataset, index, type) {
var colours = palette();
var colour = colours[index % colours.length];
let colours = palette();
let colour = colours[index % colours.length];
if (type === 'doughnut' || type === 'pie') {
dataset.backgroundColor = colours;
@@ -39,10 +39,10 @@
}
function optionsFor(type) {
var textColour = cssVar('--wms-chart-text', '#334155');
var gridColour = cssVar('--wms-chart-grid', 'rgba(148, 163, 184, 0.25)');
let textColour = cssVar('--wms-chart-text', '#334155');
let gridColour = cssVar('--wms-chart-grid', 'rgba(148, 163, 184, 0.25)');
var options = {
let options = {
responsive: true,
maintainAspectRatio: false,
interaction: {
@@ -100,7 +100,7 @@
}
function normaliseConfig(rawConfig, type) {
var config = rawConfig || {};
let config = rawConfig || {};
config.labels = config.labels || [];
config.datasets = (config.datasets || []).map(function (dataset, index) {
return enrichDataset(dataset, index, type);
@@ -115,9 +115,9 @@
}
document.querySelectorAll('[data-wms-chart]').forEach(function (canvas) {
var type = canvas.getAttribute('data-chart-type') || 'line';
var raw = canvas.getAttribute('data-chart-config') || '{}';
var config = {};
let type = canvas.getAttribute('data-chart-type') || 'line';
let raw = canvas.getAttribute('data-chart-config') || '{}';
let config = {};
try {
config = JSON.parse(raw);