The user wants a UI-driven model comparator dashboard that summarizes:
- Metrics - model performance metrics
- Fairness - fairness metrics across different groups
- Telemetry deltas - differences in telemetry data
This is a data dashboard, so I need to:
- Create a modern, professional dashboard UI
- Have at least 3 dynamic/interactive elements
- Good contrast and design
- No emojis in titles/buttons
- Single HTML file
Let me plan the dashboard:
Layout:
- Header with dashboard title
- Model selector (dropdown to select models to compare)
- Three main sections:
- Metrics comparison (bar charts, radar charts)
- Fairness analysis (grouped data, disparity indicators)
- Telemetry deltas (time series, delta visualization)
Dynamic Elements (at least 3):
- Animated bar charts that grow on load
- Interactive model selection that updates all panels
- Hover effects on data cards showing detailed info
- Particle background or animated gradient
- Animated delta indicators
- Tooltip system
- Animated progress rings for metrics
Color Scheme:
- Dark theme with high contrast
- Accent colors: cyan/teal for primary, coral/orange for warnings, green for positive
- Professional, modern look
Data:
- Mock data for 2-3 models
- Metrics: Accuracy, Precision, Recall, F1, AUC
- Fairness: Demographic parity, Equalized odds, Disparate impact
- Telemetry: Latency, Throughput, Error rate, Memory usage
Let me create this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Model Comparator Dashboard</title>
<style>
/* CSS here */
</style>
</head>
<body>
<!-- HTML structure -->
<script>
// JavaScript here
</script>
</body>
</html>
I'll create:
- Animated gradient background with subtle particle effects
- Model selector with checkboxes
- Metrics section with animated bars and radar chart
- Fairness section with group disparities visualization
- Telemetry section with delta charts
Let me build this comprehensive dashboard.
This is a great data dashboard challenge. I'll create a sophisticated model comparator with animated visualizations, interactive model selection, and real-time metric comparisons.
My approach:
- Header - Model selector chips to pick which models to compare
- Metrics Panel - Animated bar charts + radar chart for performance metrics
- Fairness Panel - Group disparity visualization with animated indicators
- Telemetry Deltas - Time-series style delta comparison with trend arrows
- Dynamic elements: Animated bars, pulsing indicators, hover tooltips, particle background, animated counters
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Model Comparator Dashboard</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--bg-primary: #0a0f1a;
--bg-secondary: #111927;
--bg-card: #1a2332;
--border: #2a3a52;
--text-primary: #e8edf5;
--text-secondary: #8b9cb8;
--accent-cyan: #00d4aa;
--accent-blue: #3b82f6;
--accent-purple: #8b5cf6;
--accent-orange: #f59e0b;
--accent-red: #ef4444;
--accent-green: #22c55e;
}
body {
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
min-height: 100vh;
overflow-x: hidden;
}
#particles-canvas {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 0;
}
.dashboard {
position: relative;
z-index: 1;
padding: 24px;
max-width: 1600px;
margin: 0 auto;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 32px;
flex-wrap: wrap;
gap: 20px;
}
.header h1 {
font-size: 28px;
font-weight: 600;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.model-selector {
display: flex;
gap: 12px;
flex-wrap: wrap;
}
.model-chip {
padding: 10px 20px;
border-radius: 24px;
border: 2px solid var(--border);
background: var(--bg-secondary);
cursor: pointer;
transition: all 0.3s ease;
font-weight: 500;
position: relative;
overflow: hidden;
}
.model-chip::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
transition: left 0.5s ease;
}
.model-chip:hover::before {
left: 100%;
}
.model-chip.active {
border-color: var(--chip-color);
background: rgba(0,0,0,0.3);
box-shadow: 0 0 20px rgba(0,0,0,0.3), inset 0 0 20px rgba(255,255,255,0.05);
}
.model-chip.model-a { --chip-color: var(--accent-cyan); }
.model-chip.model-b { --chip-color: var(--accent-purple); }
.model-chip.model-c { --chip-color: var(--accent-orange); }
.model-chip .indicator {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 50%;
background: var(--chip-color);
margin-right: 8px;
animation: pulse 2s infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.6; transform: scale(1.1); }
}
.grid {
display: grid;
grid-template-columns: repeat(12, 1fr);
gap: 24px;
}
.card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 16px;
padding: 24px;
position: relative;
overflow: hidden;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
transform: translateY(-4px);
box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3px;
background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
}
.card-title {
font-size: 16px;
font-weight: 600;
color: var(--text-secondary);
margin-bottom: 20px;
text-transform: uppercase;
letter-spacing: 1px;
}
.metrics-card { grid-column: span 8; }
.summary-card { grid-column: span 4; }
.fairness-card { grid-column: span 6; }
.telemetry-card { grid-column: span 6; }
.metric-row {
display: flex;
align-items: center;
margin-bottom: 16px;
position: relative;
}
.metric-label {
width: 100px;
font-size: 13px;
color: var(--text-secondary);
}
.metric-bars {
flex: 1;
height: 28px;
position: relative;
display: flex;
flex-direction: column;
gap: 4px;
}
.bar-container {
height: 8px;
background: var(--bg-secondary);
border-radius: 4px;
overflow: hidden;
position: relative;
}
.bar {
height: 100%;
border-radius: 4px;
width: 0;
transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
}
.bar.model-a { background: linear-gradient(90deg, var(--accent-cyan), #00a88a); }
.bar.model-b { background: linear-gradient(90deg, var(--accent-purple), #7c3aed); }
.bar.model-c { background: linear-gradient(90deg, var(--accent-orange), #d97706); }
.bar-value {
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
font-size: 12px;
font-weight: 600;
color: var(--text-primary);
}
.radar-container {
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
}
.radar-svg {
width: 280px;
height: 280px;
}
.radar-grid {
fill: none;
stroke: var(--border);
stroke-width: 1;
}
.radar-axis {
stroke: var(--border);
stroke-width: 1;
}
.radar-shape {
fill-opacity: 0.2;
stroke-width: 2;
transition: all 0.5s ease;
}
.radar-shape.model-a { fill: var(--accent-cyan); stroke: var(--accent-cyan); }
.radar-shape.model-b { fill: var(--accent-purple); stroke: var(--accent-purple); }
.radar-shape.model-c { fill: var(--accent-orange); stroke: var(--accent-orange); }
.radar-label {
font-size: 11px;
fill: var(--text-secondary);
text-anchor: middle;
}
.summary-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 0;
border-bottom: 1px solid var(--border);
}
.summary-item:last-child {
border-bottom: none;
}
.summary-label {
font-size: 13px;
color: var(--text-secondary);
}
.summary-value {
font-size: 24px;
font-weight: 700;
}
.summary-value.positive { color: var(--accent-green); }
.summary-value.negative { color: var(--accent-red); }
.summary-value.neutral { color: var(--accent-blue); }
.summary-delta {
font-size: 12px;
display: flex;
align-items: center;
gap: 4px;
margin-top: 4px;
}
.summary-delta.up { color: var(--accent-green); }
.summary-delta.down { color: var(--accent-red); }
.fairness-group {
margin-bottom: 20px;
}
.fairness-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.fairness-group-name {
font-size: 14px;
font-weight: 500;
}
.fairness-status {
padding: 4px 12px;
border-radius: 12px;
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
}
.fairness-status.pass {
background: rgba(34, 197, 94, 0.2);
color: var(--accent-green);
}
.fairness-status.warning {
background: rgba(245, 158, 11, 0.2);
color: var(--accent-orange);
}
.fairness-status.fail {
background: rgba(239, 68, 68, 0.2);
color: var(--accent-red);
}
.fairness-bars {
display: flex;
gap: 8px;
height: 32px;
}
.fairness-bar-segment {
flex: 1;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
font-size: 11px;
font-weight: 600;
transition: all 0.5s ease;
cursor: pointer;
position: relative;
}
.fairness-bar-segment:hover {
transform: scaleY(1.1);
}
.fairness-bar-segment .tooltip {
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
background: var(--bg-primary);
border: 1px solid var(--border);
padding: 8px 12px;
border-radius: 8px;
font-size: 11px;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease;
z-index: 10;
}
.fairness-bar-segment:hover .tooltip {
opacity: 1;
}
.telemetry-row {
display: flex;
align-items: center;
padding: 12px 0;
border-bottom: 1px solid var(--border);
}
.telemetry-row:last-child {
border-bottom: none;
}
.telemetry-metric {
width: 140px;
font-size: 13px;
}
.telemetry-values {
flex: 1;
display: flex;
gap: 16px;
}
.telemetry-value {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
}
.telemetry-num {
font-size: 16px;
font-weight: 600;
}
.telemetry-delta {
font-size: 11px;
display: flex;
align-items: center;
gap: 2px;
}
.telemetry-delta.positive { color: var(--accent-green); }
.telemetry-delta.negative { color: var(--accent-red); }
.telemetry-delta.neutral { color: var(--text-secondary); }
.delta-bar {
width: 100%;
height: 4px;
background: var(--bg-secondary);
border-radius: 2px;
margin-top: 6px;
overflow: hidden;
}
.delta-fill {
height: 100%;
border-radius: 2px;
transition: width 0.8s ease;
}
.delta-fill.positive { background: var(--accent-green); }
.delta-fill.negative { background: var(--accent-red); }
.sparkline {
width: 80px;
height: 30px;
}
.legend {
display: flex;
justify-content: center;
gap: 24px;
margin-top: 16px;
flex-wrap: wrap;
}
.legend-item {
display: flex;
align-items: center;
gap: 8px;
font-size: 12px;
color: var(--text-secondary);
}
.legend-dot {
width: 10px;
height: 10px;
border-radius: 50%;
}
.legend-dot.model-a { background: var(--accent-cyan); }
.legend-dot.model-b { background: var(--accent-purple); }
.legend-dot.model-c { background: var(--accent-orange); }
@media (max-width: 1200px) {
.metrics-card { grid-column: span 12; }
.summary-card { grid-column: span 12; }
.fairness-card { grid-column: span 12; }
.telemetry-card { grid-column: span 12; }
}
@media (max-width: 600px) {
.header {
flex-direction: column;
align-items: flex-start;
}
.telemetry-values {
flex-direction: column;
gap: 8px;
}
}
.loading-shimmer {
background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-secondary) 50%, var(--bg-card) 100%);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
.counter-animate {
display: inline-block;
transition: all 0.3s ease;
}
</style>
</head>
<body>
<canvas id="particles-canvas"></canvas>
<div class="dashboard">
<div class="header">
<h1>Model Comparator Dashboard</h1>
<div class="model-selector" id="modelSelector">
<div class="model-chip model-a active" data-model="a">
<span class="indicator"></span>Model A - GPT-X
</div>
<div class="model-chip model-b active" data-model="b">
<span class="indicator"></span>Model B - Claude-X
</div>
<div class="model-chip model-c" data-model="c">
<span class="indicator"></span>Model C - Gemini-X
</div>
</div>
</div>
<div class="grid">
<div class="card metrics-card">
<div class="card-title">Performance Metrics</div>
<div id="metricsContainer"></div>
<div class="radar-container">
<svg class="radar-svg" id="radarChart" viewBox="0 0 300 300"></svg>
</div>
<div class="legend">
<div class="legend-item"><span class="legend-dot model-a"></span>Model A</div>
<div class="legend-item"><span class="legend-dot model-b"></span>Model B</div>
<div class="legend-item"><span class="legend-dot model-c"></span>Model C</div>
</div>
</div>
<div class="card summary-card">
<div class="card-title">Executive Summary</div>
<div id="summaryContainer"></div>
</div>
<div class="card fairness-card">
<div class="card-title">Fairness Analysis</div>
<div id="fairnessContainer"></div>
</div>
<div class="card telemetry-card">
<div class="card-title">Telemetry Deltas</div>
<div id="telemetryContainer"></div>
</div>
</div>
</div>
<script>
// Model Data
const modelData = {
a: {
name: 'GPT-X',
metrics: { accuracy: 94.2, precision: 92.8, recall: 91.5, f1: 92.1, auc: 96.3 },
fairness: {
gender: { male: 0.92, female: 0.89, nonBinary: 0.87 },
age: { young: 0.88, middle: 0.91, senior: 0.85 },
race: { groupA: 0.90, groupB: 0.88, groupC: 0.91, groupD: 0.86 }
},
telemetry: {
latency: { value: 145, delta: -12 },
throughput: { value: 1250, delta: 8 },
errorRate: { value: 0.12, delta: -25 },
memory: { value: 4.2, delta: 5 }
}
},
b: {
name: 'Claude-X',
metrics: { accuracy: 93.8, precision: 94.1, recall: 89.2, f1: 91.6, auc: 95.8 },
fairness: {
gender: { male: 0.90, female: 0.91, nonBinary: 0.89 },
age: { young: 0.89, middle: 0.90, senior: 0.88 },
race: { groupA: 0.89, groupB: 0.90, groupC: 0.88, groupD: 0.91 }
},
telemetry: {
latency: { value: 132, delta: -8 },
throughput: { value: 1180, delta: 5 },
errorRate: { value: 0.18, delta: 10 },
memory: { value: 3.8, delta: -3 }
}
},
c: {
name: 'Gemini-X',
metrics: { accuracy: 92.5, precision: 91.2, recall: 93.8, f1: 92.5, auc: 94.2 },
fairness: {
gender: { male: 0.88, female: 0.88, nonBinary: 0.90 },
age: { young: 0.91, middle: 0.87, senior: 0.89 },
race: { groupA: 0.87, groupB: 0.92, groupC: 0.89, groupD: 0.88 }
},
telemetry: {
latency: { value: 158, delta: 15 },
throughput: { value: 1320, delta: 12 },
errorRate: { value: 0.09, delta: -40 },
memory: { value: 5.1, delta: 8 }
}
}
};
let activeModels = ['a', 'b'];
const modelColors = { a: 'model-a', b: 'model-b', c: 'model-c' };
const metricLabels = ['Accuracy', 'Precision', 'Recall', 'F1', 'AUC'];
const metricKeys = ['accuracy', 'precision', 'recall', 'f1', 'auc'];
// Particle System
class ParticleSystem {
constructor(canvas) {
this.canvas = canvas;
this.ctx = canvas.getContext('2d');
this.particles = [];
this.resize();
window.addEventListener('resize', () => this.resize());
this.init();
}
resize() {
this.canvas.width = window.innerWidth;
this.canvas.height = window.innerHeight;
}
init() {
const count = Math.floor((this.canvas.width * this.canvas.height) / 15000);
for (let i = 0; i < count; i++) {
this.particles.push({
x: Math.random() * this.canvas.width,
y: Math.random() * this.canvas.height,
vx: (Math.random() - 0.5) * 0.3,
vy: (Math.random() - 0.5) * 0.3,
radius: Math.random() * 1.5 + 0.5,
opacity: Math.random() * 0.5 + 0.2
});
}
}
animate() {
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
this.particles.forEach(p => {
p.x += p.vx;
p.y += p.vy;
if (p.x < 0) p.x = this.canvas.width;
if (p.x > this.canvas.width) p.x = 0;
if (p.y < 0) p.y = this.canvas.height;
if (p.y > this.canvas.height) p.y = 0;
this.ctx.beginPath();
this.ctx.arc(p.x, p.y, p.radius, 0, Math.PI * 2);
this.ctx.fillStyle = `rgba(0, 212, 170, ${p.opacity})`;
this.ctx.fill();
});
// Draw connections
this.particles.forEach((p1, i) => {
this.particles.slice(i + 1).forEach(p2 => {
const dx = p1.x - p2.x;
const dy = p1.y - p2.y;
const dist = Math.sqrt(dx * dx + dy * dy);
if (dist < 120) {
this.ctx.beginPath();
this.ctx.moveTo(p1.x, p1.y);
this.ctx.lineTo(p2.x, p2.y);
this.ctx.strokeStyle = `rgba(0, 212, 170, ${0.1 * (1 - dist / 120)})`;
this.ctx.stroke();
}
});
});
requestAnimationFrame(() => this.animate());
}
}
// Initialize particles
const particles = new ParticleSystem(document.getElementById('particles-canvas'));
particles.animate();
// Model Selection
document.querySelectorAll('.model-chip').forEach(chip => {
chip.addEventListener('click', () => {
const model = chip.dataset.model;
chip.classList.toggle('active');
if (chip.classList.contains('active')) {
if (!activeModels.includes(model)) {
activeModels.push(model);
}
} else {
activeModels = activeModels.filter(m => m !== model);
}
if (activeModels.length > 0) {
renderAll();
}
});
});
// Render Metrics
function renderMetrics() {
const container = document.getElementById('metricsContainer');
container.innerHTML = '';
metricKeys.forEach((key, idx) => {
const row = document.createElement('div');
row.className = 'metric-row';
const label = document.createElement('div');
label.className = 'metric-label';
label.textContent = metricLabels[idx];
row.appendChild(label);
const barsContainer = document.createElement('div');
barsContainer.className = 'metric-bars';
activeModels.forEach(modelId => {
const barRow = document.createElement('div');
barRow.className = 'bar-container';
const bar = document.createElement('div');
bar.className = `bar ${modelColors[modelId]}`;
const value = document.createElement('span');
value.className = 'bar-value';
value.textContent = modelData[modelId].metrics[key].toFixed(1);
bar.appendChild(value);
barRow.appendChild(bar);
barsContainer.appendChild(barRow);
setTimeout(() => {
bar.style.width = `${modelData[modelId].metrics[key]}%`;
}, 100 + idx * 100 + activeModels.indexOf(modelId) * 50);
});
row.appendChild(barsContainer);
container.appendChild(row);
});
}
// Render Radar Chart
function renderRadar() {
const svg = document.getElementById('radarChart');
svg.innerHTML = '';
const cx = 150, cy = 150, maxR = 100;
const angles = metricKeys.map((_, i) => (Math.PI * 2 * i) / metricKeys.length - Math.PI / 2);
// Draw grid
for (let r = 20; r <= maxR; r += 20) {
const points = angles.map(a => `${cx + Math.cos(a) * r},${cy + Math.sin(a) * r}`).join(' ');
const polygon = document.createElementNS('http://www.w3.org/2000/svg', 'polygon');
polygon.setAttribute('points', points);
polygon.setAttribute('class', 'radar-grid');
svg.appendChild(polygon);
}
// Draw axes
angles.forEach(a => {
const line = document.createElementNS('http://www.w3.org/2000/svg', 'line');
line.setAttribute('x1', cx);
line.setAttribute('y1', cy);
line.setAttribute('x2', cx + Math.cos(a) * maxR);
line.setAttribute('y2', cy + Math.sin(a) * maxR);
line.setAttribute('class', 'radar-axis');
svg.appendChild(line);
});
// Draw labels
angles.forEach((a, i) => {
const text = document.createElementNS('http://www.w3.org/2000/svg', 'text');
text.setAttribute('x', cx + Math.cos(a) * (maxR + 20));
text.setAttribute('y', cy + Math.sin(a) * (maxR + 20));
text.setAttribute('class', 'radar-label');
text.textContent = metricLabels[i];
svg.appendChild(text);