Deploy HickLab3D Dashboard / Deploy to production (push) Failing after 23s
Replace the old touchmark/PNG identity with the supplied lockup and monogram, segmented role-aware navigation, Live/Draft listing filters with generation-based cache invalidation, and admin Projects covering immutable file revisions, listing live pointers, and exact-decimal filament/packaging/shipping costing. Additive schema only; no Etsy publication. Isolated clone tests: 301 tests, 1162 assertions.
67 lines
2.7 KiB
JavaScript
67 lines
2.7 KiB
JavaScript
const chartBase = {
|
|
chart: {
|
|
background: 'transparent',
|
|
foreColor: '#A7ADB5',
|
|
fontFamily: "'Avenir Next', 'Avenir', ui-sans-serif, system-ui, sans-serif",
|
|
toolbar: { show: false },
|
|
zoom: { enabled: false },
|
|
},
|
|
theme: { mode: 'dark' },
|
|
grid: { borderColor: '#292c30', strokeDashArray: 4 },
|
|
tooltip: { theme: 'dark' },
|
|
noData: { text: 'No data yet' },
|
|
};
|
|
|
|
if (document.querySelector('[data-dashboard-chart]')) {
|
|
import('apexcharts').then(({ default: ApexCharts }) => {
|
|
document.querySelectorAll('[data-dashboard-chart]').forEach((element) => {
|
|
let data;
|
|
|
|
try {
|
|
data = JSON.parse(element.dataset.chart);
|
|
} catch (error) {
|
|
console.error('Dashboard chart data is invalid', error);
|
|
return;
|
|
}
|
|
|
|
const height = element.clientHeight || 256;
|
|
let options;
|
|
|
|
if (element.dataset.dashboardChart === 'orders') {
|
|
options = {
|
|
...chartBase,
|
|
chart: { ...chartBase.chart, type: 'area', height },
|
|
colors: ['#E7FF00'],
|
|
series: [{ name: 'Awaiting dispatch', data: data.series }],
|
|
xaxis: { categories: data.labels, labels: { rotate: -45, hideOverlappingLabels: true } },
|
|
yaxis: { min: 0, forceNiceScale: true, labels: { formatter: (value) => Number.isInteger(value) ? value.toString() : '' } },
|
|
stroke: { curve: 'smooth', width: 3 },
|
|
fill: { type: 'gradient', gradient: { opacityFrom: 0.35, opacityTo: 0.02 } },
|
|
dataLabels: { enabled: false },
|
|
markers: { size: 3 },
|
|
legend: { show: false },
|
|
};
|
|
} else if (element.dataset.dashboardChart === 'printers') {
|
|
options = {
|
|
...chartBase,
|
|
chart: { ...chartBase.chart, type: 'donut', height },
|
|
labels: data.map((item) => item.label),
|
|
series: data.map((item) => item.count),
|
|
colors: ['#E7FF00', '#7dd3a3', '#f0a46b', '#f17fa5', '#8b9df0'],
|
|
legend: { position: 'bottom', fontSize: '12px', labels: { colors: '#A7ADB5' } },
|
|
plotOptions: { pie: { donut: { size: '68%', labels: { show: true, total: { show: true, label: 'Printers' } } } } },
|
|
dataLabels: { enabled: false },
|
|
stroke: { colors: ['#1a1d21'], width: 2 },
|
|
};
|
|
}
|
|
|
|
if (options) {
|
|
new ApexCharts(element, options).render();
|
|
}
|
|
});
|
|
});
|
|
}
|
|
|
|
import './notifications';
|
|
import './navigation';
|