import { html, css, cssManager } from '@design.estate/dees-element'; import type { DeesChartRadar } from './component.js'; import '@design.estate/dees-wcctools/demotools'; import './component.js'; export const demoFunc = () => { const indicators = [ { name: 'Latency', max: 100 }, { name: 'Throughput', max: 100 }, { name: 'Availability', max: 100 }, { name: 'Error Rate', max: 100 }, { name: 'Saturation', max: 100 }, { name: 'Security', max: 100 }, ]; const series = [ { name: 'Service A', values: [85, 90, 99, 12, 45, 78] }, { name: 'Service B', values: [70, 65, 95, 28, 60, 90] }, ]; const singleIndicators = [ { name: 'Speed', max: 10 }, { name: 'Reliability', max: 10 }, { name: 'Comfort', max: 10 }, { name: 'Safety', max: 10 }, { name: 'Cost', max: 10 }, ]; const singleSeries = [ { name: 'Rating', values: [8.5, 9.2, 7.0, 9.5, 6.0] }, ]; return html` { const compChart = elementArg.querySelector('#comparison-chart') as DeesChartRadar; const singleChart = elementArg.querySelector('#single-chart') as DeesChartRadar; const buttons = elementArg.querySelectorAll('dees-button'); buttons.forEach((button: any) => { const text = button.text?.trim(); if (text === 'Randomize') { button.addEventListener('click', () => { compChart.series = series.map((s) => ({ ...s, values: s.values.map(() => Math.round(20 + Math.random() * 80)), })); singleChart.series = singleSeries.map((s) => ({ ...s, values: s.values.map(() => Math.round((2 + Math.random() * 8) * 10) / 10), })); }); } }); }}> Randomize Radar chart for multi-dimensional comparison • Supports multiple overlay series and configurable fill • Click 'Randomize' to update data `; };