Design a dataset bias heatmap dashboard layering distribution skews, feature…
- User
Design a dataset bias heatmap dashboard layering distribution skews, feature correlations, and root causes.
- Assistant
Here's a thinking process that leads to the suggested dashboard:
-
Analyze the Request:
- Goal: Design a dataset bias heatmap dashboard.
- Core Features: Visualize distribution skews, feature correlations, and root causes.
- Style: Neo-Brutalism / Y2K Aesthetic (high contrast, raw typography, hard borders, clashing colors, unpolished look). Crucial Constraint: Must avoid modern "clean" or "rounded" web design.
- Tech Stack: Single HTML file, plain HTML/CSS/JS (no frameworks like React/Vue), but can use libraries if user-specified/allowed (the prompt didn't forbid them, but the "Technical Stack" section of the system prompt says "Use plain HTML, CSS, and vanilla JavaScript... unless the user explicitly requests them." However, the user prompt doesn't specify using GSAP/Chart.js, but the system prompt's "Technical Stack" mentions them as tools we should consider if needed. Given the complexity of heatmaps and charts, using Canvas or SVG manually is hard to make "cool" in a short time. The user said "You... specialize in HTML Web apps...". I will stick to vanilla JS but might implement custom visualizations using HTML/CSS/Canvas to stay true to the "no frameworks unless requested" vibe, or maybe use a very lightweight charting approach via raw SVG/Canvas to keep it self-contained and "raw". Actually, to ensure high quality for "dashboard" elements, using a library like Chart.js or D3 via CDN is often acceptable in "vanilla" prototypes, but the risk is that the user might expect no external dependencies if they said "plain HTML/CSS/JS". I will try to implement the heatmaps using pure CSS
gridanddivs (clunky but fits the aesthetic) or simple SVG generation. This adheres strictly to "no frameworks" and allows full control over the brutalist style.*) - Key Design Principles: Raw typography, hard borders, color clashes, unpolished look, overlapping, marquees, glitch effects.
-
Conceptualization (The "Y2K/Neo-Brutalist Bias Dashboard"):
- Theme: Instead of a clean SaaS dashboard, think "Windows 98 meets Photoshop 6.0 meets late 90s hacker terminal."
- Layout: Grid-based but overlapping elements. Fixed position toolbars. Hard black borders on everything.
- Color Palette: Acid Green, Hot Pink, Cyan, Bright Yellow against a stark White or very light Gray background. Maybe a "Matrix" green or terminal black for high contrast.
- Typography:
Courier Newfor code/text,Times New Romanfor headers (mimicking old newspapers), maybe a pixelated font via@font-face(or justImpact/Comic Sans?). Let's stick to system fonts to keep it single-file and fast:Font: "Courier New", monospaceandfont-family: "Impact", "Arial Black", sans-seriffor headers. Size: Huge.
-
Dashboard Components:
- Header: Marquee scrolling text "DATASET BIAS DETECTOR // SYSTEM READY // WARNING: SKEW DETECTED".
- Main Content Area:
- Left Panel (Controls/Stats): Lists of features (Gender, Age, Income, etc.) with "skew scores" (progress bars or analog meters).
- Center Panel (Heatmap): A grid representing features vs. features. Correlation values. Colors must be clashing (e.g., bright yellow vs black text). Hard grid lines.
- Right Panel (Root Cause Analysis): Text blocks, ASCII art style diagrams, or "logs" describing bias sources.
- Footer/Status Bar: Random numbers scrolling, "connected", "packet loss," etc.
-
Implementation Steps:
-
Step 1: Structure (HTML):
- Container with
border: 4px solid blackandbox-shadow: 8px 8px 0px 0px black(brutalist shadow). - Grid layout: Header, Main (3 cols), Footer.
- Container with
-
Step 2: CSS (The Look):
- Variables for colors:
--acid-green: #ccff00,--hot-pink: #ff00ff,--cyan: #00ffff,--yellow: #ffff00. - Borders:
border: 3px solid #000. - Typography:
mix-blend-modeeffects, large font sizes. - Utilities:
marquee,glitchanimations.
- Variables for colors:
-
Step 3: JavaScript (The Logic/Interactivity):
- Generate mock data (skew values, correlation matrix, root causes).
- Render Heatmap: Loop through matrix, create
divs with background colors based on correlation strength (e.g., Black for 0, Neon Red for high). Add tooltips (browser default is ugly, maybe a custom absolute positioned div with hard border). - Render Skew Bars: Custom width bars with harsh colors.
- Add "Glitch" interaction: Randomly offset elements or change colors on hover.
- Add "Refresh Data" button to simulate re-analysis (shuffles data).
-
-
Refining the "Bias" Aspect:
- We need specific fields: e.g.,
job_title,gender,zip_code,education,age. - Skew visualization: Histograms using simple
divbars stacked. - Correlation: R^2 style values.
- We need specific fields: e.g.,
-
Drafting the Code (Mental & Scratchpad):
-
Marquee: CSS animation
translateXis standard. -
Heatmap: A CSS Grid is perfect.
grid-template-columns: repeat(N, 1fr). -
Hard Shadows:
.brutalist-box { border: 3px solid #000; box-shadow: 6px 6px 0 #000; background: #fff; } -
Glitch Effect: We can use CSS keyframes shifting
clip-pathortransform: translate. Might be too heavy for a simple dashboard, but we can do a simple "shake" on hover. -
Data Structure:
const features = ['Age', 'Gender', 'Income', 'ZipCode', 'JobLevel', 'Education', 'MaritalStatus']; const matrix = [ [1, 0.1, 0.8, ...], ... ]; // symmetric const skews = { Age: 0.2, Gender: 0.9, ... }; // 0 to 1
-
-
Writing the actual single-file solution:
- HTML Head: Inline CSS. Reset.
- Styles: Focus on
border-box, large headers. - Body:
- Top Bar: "BIAS_HEATMAP_V1.0" with a running marquee below.
- Grid:
- Col 1:
<div id="skew-list">- Features with colored blocks. - Col 2:
<div id="correlation-heatmap">- The core. - Col 3:
<div id="root-causes">- Text logs and "diagnosis".
- Col 1:
- Bottom: "STATUS: ANALYZING..." blinking.
- JS:
- Function
generateData(): Randomize correlation and skew. - Function
renderSkew(): HTML generation for the left column. Use "pill" shaped bars. - Function
renderHeatmap(): Nested loops. Color logic: If val > 0.7 -> hot pink; >0.4 -> acid green; >0.1 -> yellow; else white/black. - Function
renderRootCauses(): Based on highest skew feature, generate a pseudo-technical explanation text. - Event Listeners: Buttons to "Re-run Analysis". Hover effects on heatmap cells show tooltip.
- Function
-
Polishing the Aesthetic (The "Brutalist" touches):
- Use
font-family: 'Comic Sans MS', 'Impact', sans-serif? No, that's too cliché. Let's use'Courier New', monospacefor data, and'Arial Black', 'Impact'for titles. Actually, the prompt suggests "mix of system default fonts... extreme font size differences." So: H1: 48px Times New Roman. Data: 14px Courier New. - Borders: Borders double? Or standard 2px solid black.
- Selection:
::selection { background: #ff00ff; color: #fff; } - Cursor:
crosshairmaybe.
- Use
-
Self-Correction/Review during thought process:
- Is it accessible? No, it's deliberately chaotic, but I should add basic
aria-labeland contrast is actually high (black on bright colors), so it's not terrible. - Is it a single file? Yes.
- Is it responsive? I'll add a media query to stack the grid on mobile, but the design might break (inherently chaotic). I'll try to keep it usable.
- Technical constraints: No external libraries. I must build the heatmap manually. This is fine. I'll use
display: gridfor the heatmap. I'll need JS to calculate background colors since correlation varies.
- Is it accessible? No, it's deliberately chaotic, but I should add basic
-
Final Code Assembly:
- Combine HTML structure.
- Inject CSS with distinctive classes (
.neo-card,.glitch-text,.retro-btn). - Write JS logic to populate the dashboard.
- Add a "Download Report" button that does nothing fancy (alert with style).
-
Final Polish: Ensure the marquee looks "Y2K" (maybe a dotted background). Add a CRT monitor scanline effect overlay using
pointer-events: noneandbackground: repeating-linear-gradient(...).
(Self-Correction on Color Clash): Background:
#f0f0f0(light gray) usually makes the black borders pop. But to be more "acid", maybe use a very paper-like off-white#fffccc. Let's set the page background to a grid pattern:background-image: radial-gradient(#000 1px, transparent 1px); background-size: 20px 20px;- subtle texture.Let's do this.
(Detailed Component Design)
- Skew Panel: Vertical bars. Label left, bar right. Color coded by severity.
- Heatmap:
- X and Y axis labels (first row/col).
- Cells:
border: 1px solid #000. Background color based on correlation. - Header cell:
border-right: 2px solid #000; border-bottom: 2px solid #000;
- Root Causes:
- A "terminal" window: black background, green text.
>prompt.
- Marquee: "*** SYSTEM ALERT: DATASET CORRUPTION DETECTED IN SECTOR 4 ***"
Let's go.
Plan:
- Define CSS variables for the palette (Acid Green, Hot Pink, Cyan, Black, White).
- Create the main shell with thick borders and offset shadows (brutalist).
- Build the 3-column grid.
- JS: Simulate a dataset: 6-8 features.
- JS: Generate a correlation matrix.
- JS: Generate skew metrics.
- JS: Render everything.
- Add interactions: Hover over heatmap -> highlight row/col.
- Add "Regenerate" button to simulate new data scan.
Specific Brutalist touches:
text-transform: uppercaseeverywhere.- Underlined links with offset.
- Buttons that look like Windows 95:
border-top: 2px solid #fff; border-left: 2px solid #fff; border-right: 2px solid #000; border-bottom: 2px solid #000; background: #ccc;active state reverses borders.
Let's stick to the user's "Neo-Brutalism" request which is often white bg, black heavy borders, bright colors.
Proceed to generate code.
(Mental Check on Language): The user asked in English: "Design a dataset bias heatmap dashboard layering distribution skews, feature correlations, and root causes." I must respond in English.
(Code Structure)
<!DOCTYPE html> <html lang="en"> <head> ... <style> ... </style> </head> <body> ... <script> ... </script> </body> </html>Let's write it. Here is a complete, single-file HTML solution implementing a Neo-Brutalism / Y2K Dataset Bias Dashboard.
It uses pure HTML, CSS, and JavaScript. It features an acid color palette, hard borders, overlapping elements, a custom-built heatmap engine without external libraries, and raw typography.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>DATASET BIAS HEATMAP // NEO-BRUTALIST DASHBOARD</title> <style> /* * NEO-BRUTALIST DESIGN SYSTEM * Principles: Hard borders, high contrast, raw typography, clashing colors. */ :root { --bg-color: #f0f0e8; /* Dirty paper white */ --ink: #000000; --acid-green: #ccff00; --acid-pink: #ff00ff; --acid-cyan: #00ffff; --acid-yellow: #ffff00; --acid-orange: #ff6600; --grid-color: #000000; } * { box-sizing: border-box; cursor: crosshair; /* Raw cursor */ } body { margin: 0; padding: 20px; background-color: var(--bg-color); /* Subtle dot texture */ background-image: radial-gradient(#000 15%, transparent 16%); background-size: 20px 20px; font-family: 'Courier New', Courier, monospace; color: var(--ink); overflow-x: hidden; } /* HEADER & MARQUEE */ header { border: 4px solid var(--ink); background: var(--acid-green); padding: 10px; margin-bottom: 20px; position: relative; box-shadow: 8px 8px 0px 0px var(--ink); } h1 { font-family: 'Impact', 'Arial Black', sans-serif; font-size: 3.5rem; text-transform: uppercase; margin: 0; letter-spacing: -1px; line-height: 1; text-shadow: 2px 2px 0px #fff; } .marquee-container { background: var(--ink); color: var(--acid-yellow); border: 2px solid var(--ink); margin-top: 5px; font-family: 'Courier New', monospace; font-weight: bold; overflow: hidden; white-space: nowrap; box-shadow: inset 0 0 10px rgba(255,255,0,0.5); } .marquee-content { display: inline-block; padding-left: 100%; animation: marquee 20s linear infinite; font-size: 1.2rem; } @keyframes marquee { 0% { transform: translate(0, 0); } 100% { transform: translate(-100%, 0); } } /* MAIN LAYOUT GRID */ .dashboard-grid { display: grid; grid-template-columns: 280px 1fr 320px; gap: 15px; align-items: start; } @media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } } /* CARDS/Containers */ .neo-card { border: 3px solid var(--ink); background: #fff; padding: 15px; position: relative; box-shadow: 6px 6px 0px 0px var(--ink); /* Give a slight raw texture */ background-image: linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px); background-size: 20px 20px; } .card-header { font-family: 'Times New Roman', Times, serif; font-size: 1.8rem; text-transform: uppercase; border-bottom: 2px solid var(--ink); margin-bottom: 15px; padding-bottom: 5px; display: flex; justify-content: space-between; align-items: flex-end; background: var(--acid-cyan); padding: 2px 5px; } /* SKEW LIST COMPONENT */ .feature-row { display: flex; align-items: center; margin-bottom: 12px; font-size: 0.9rem; font-weight: bold; } .feature-label { width: 100px; text-align: right; padding-right: 10px; border-right: 2px solid var(--ink); } .skew-bar-bg { flex-grow: 1; height: 24px; border: 2px solid var(--ink); background: #eee; margin-left: 5px; position: relative; } .skew-fill { height: 100%; width: 0%; /* JS will control */ transition: width 0.5s steps(5); /* Mechanical feel */ } /* Color classes for skew severity */ .level-0 { background: var(--acid-green); } .level-1 { background: var(--acid-yellow); } .level-2 { background: var(--acid-orange); } .level-3 { background: var(--acid-pink); } .skew-value { position: absolute; right: -35px; font-size: 0.8rem; font-weight: bold; } /* HEATMAP COMPONENT */ .heatmap-wrapper { overflow-x: auto; min-height: 350px; display: flex; align-items: center; justify-content: center; } .heatmap-grid { display: grid; gap: 2px; border: 3px solid var(--ink); background: var(--ink); /* Acts as the grid lines */ } .cell { width: 45px; height: 45px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; color: var(--ink); position: relative; transition: transform 0.1s; } .cell:hover { transform: scale(1.1); z-index: 10; border: 2px solid var(--ink); } .cell.row-header, .cell.col-header { background: var(--acid-yellow); font-weight: 900; writing-mode: vertical-rl; /* For col headers */ transform: rotate(180deg); } .cell.row-header { text-orientation: mixed; } .cell.corner { background: #fff; } /* Tooltip */ #tooltip { position: absolute; background: var(--ink); color: var(--acid-green); padding: 5px 10px; border: 2px solid var(--acid-green); font-size: 0.8rem; pointer-events: none; display: none; z-index: 100; box-shadow: 4px 4px 0 rgba(255,0,255,0.5); } /* ROOT CAUSES / TERMINAL */ .terminal-window { background: #111; color: var(--acid-green); border: 3px solid var(--ink); padding: 10px; font-family: 'Courier New', monospace; box-shadow: 6px 6px 0px 0px var(--ink); height: 100%; min-height: 300px; overflow-y: auto; } .terminal-header { background: var(--ink); color: #fff; padding: 2px 5px; font-size: 0.8rem; margin-bottom: 10px; border-bottom: 1px dashed var(--acid-green); } .log-line { margin-bottom: 8px; display: block; opacity: 0; animation: glitchIn 0.2s forwards; } .log-line::before { content: "> "; } .highlight { background-color: var(--acid-green); color: var(--ink); } @keyframes glitchIn { 0% { opacity: 0; transform: translateX(-10px); } 100% { opacity: 1; transform: translateX(0); } } /* CONTROLS */ .controls { margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; } .neo-btn { font-family: 'Courier New', monospace; font-weight: bold; text-transform: uppercase; padding: 8px 16px; border: 3px solid var(--ink); background: var(--bg-color); color: var(--ink); box-shadow: 4px 4px 0px 0px var(--ink); transition: all 0.1s; } .neo-btn:hover { background: var(--acid-pink); color: #fff; transform: translate(2px, 2px); box-shadow: 2px 2px 0px 0px var(--ink); } .neo-btn:active { transform: translate(4px, 4px); box-shadow: 0px 0px 0px 0px var(--ink); } .neo-btn.primary { background: var(--acid-green); } /* RAID FOOTER */ footer { margin-top: 20px; border-top: 4px solid var(--ink); padding: 10px; display: flex; justify-content: space-between; font-size: 0.8rem; background: #eee; font-weight: bold; } /* Utility overlays */ .overlay-graphic { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 3px solid var(--ink); background: var(--acid-orange); z-index: 5; display: flex; align-items: center; justify-content: center; font-weight: bold; transform: rotate(15deg); } /* CRT Scanline effect */ .crt::after { content: " "; display: block; position: fixed; top: 0; left: 0; bottom: 0; right: 0; background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%); background-size: 100% 4px; z-index: 999; pointer-events: none; } </style> </head> <body class="crt"> <!-- CROSS-CLIP CURSOR & TOOLTIP --> <div id="tooltip"></div> <header> <div style="display:flex; justify-content:space-between; align-items:center;"> <h1>Bias_Diagnoser.exe</h1> <div style="font-size: 1rem; background: var(--ink); color: #fff; padding: 5px;"> VER 4.20 // Y2K COMPLIANT </div> </div> <div class="marquee-container"> <div class="marquee-content"> *** SYSTEM INITIALIZED *** SCANNING FEATURE DISTRIBUTIONS... *** WARNING: SIGNIFICANT SKEW DETECTED IN DEMOGRAPHIC DATA *** GENERATING CORRELATION MATRIX... *** ROOT CAUSE ANALYSIS PENDING... </div> </div> </header> <div class="dashboard-grid"> <!-- COL 1: DISTRIBUTION SKEWS --> <section class="neo-card"> <div class="overlay-graphic">!</div> <div class="card-header"> <span>Skew Metrics</span> <small> sigma-4</small> </div> <div id="skew-container"> <!-- Javascript will populate rows here --> </div> <div style="margin-top: 15px; font-size: 0.8rem;"> <strong>LEGEND:</strong><br> [0-0.2]: OK<br> [0.2-0.4]: WARN<br> [0.4-0.7]: HIGH<br> [0.7-1.0]: CRITICAL </div> </section> <!-- COL 2: CORRELATION HEATMAP --> <section class="neo-card"> <div class="overlay-graphic" style="background:var(--acid-cyan);">H</div> <div class="card-header"> <span>Correlation Matrix</span> <small id="matrix-status">IDLE</small> </div> <div class="controls"> <button class="neo-btn primary" onclick="regenerateData()">RE-SCAN DATA</button> <button class="neo-btn" onclick="toggleGlitch()">GLITCH</button> </div> <div class="heatmap-wrapper"> <div id="heatmap" class="heatmap-grid"> <!-- Javascript builds grid --> </div> </div> </section> <!-- COL 3: ROOT CAUSES --> <section class="neo-card"> <div class="overlay-graphic" style="background:var(--acid-green); transform: rotate(-15deg);">!</div> <div class="card-header"> <span>Root Causes</span> <small>LOG.txt</small> </div> <div class="terminal-window" id="terminal"> <div class="terminal-header">BIAS_ANALYZER_V4.2 // ROOT CAUSE LOG</div> <div id="terminal-content"> <!-- JS Logs --> </div> </div> <div class="controls"> <button class="neo-btn" onclick="clearLog()">CLEAR LOG</button> </div> </section> </div> <footer> <div>MEMORY: 640K OK</div> <div>RENDER TIME: <span id="render-time">0</span>ms</div> <div>CONN: SECURE (FAKE)</div> </footer> <script> // --- DATA MODEL --- const features = [ 'Age', 'Gender', 'Income', 'Zip_Code', 'Job_Level', 'Education', 'Marital_Status', 'Purchase_Hist' ]; let correlationMatrix = []; let skewData = {}; // --- UTILITY FUNCTIONS --- // Generate random float between 0 and 1 function rand() { return Math.random(); } // Determine color based on correlation strength function getCorrelationColor(val) { // We want high values to be "hot" colors, low closer to white // But in our palette, we want clashing. // 0.0-0.3: White/Light Gray (or Yellow?) // 0.3-0.6: Acid Green // 0.6-0.8: Acid Pink // 0.8-1.0: Acid Orange/Red if (val < 0.2) return '#ffffff'; if (val < 0.4) return 'var(--acid-green)'; if (val < 0.6) return 'var(--acid-yellow)'; if (val < 0.8) return 'var(--acid-pink)'; return 'var(--acid-orange)'; } // --- RENDERING LOGIC --- function renderSkew() { const container = document.getElementById('skew-container'); container.innerHTML = ''; features.forEach(f => { const val = skewData[f]; const row = document.createElement('div'); row.className = 'feature-row'; // Class level for color let levelClass = 'level-0'; if (val > 0.2) levelClass = 'level-1'; if (val > 0.4) levelClass = 'level-2'; if (val > 0.7) levelClass = 'level-3'; row.innerHTML = ` <div class="feature-label">${f.replace('_', '<br>')}</div> <div class="skew-bar-bg"> <div class="skew-fill ${levelClass}" style="width: ${val * 100}%"></div> <div class="skew-value">${val.toFixed(2)}</div> </div> `; container.appendChild(row); }); } function renderHeatmap() { const grid = document.getElementById('heatmap'); const n = features.length; grid.innerHTML = ''; grid.style.gridTemplateColumns = `40px repeat(${n}, 1fr)`; grid.style.gridTemplateRows = `repeat(${n}, 1fr) 40px`; // Row headers in first col, col headers in last row? Or standard. // Standard: Row headers in col 1, Col headers in row 1. // Let's do Top-Left corner empty. // Corner const corner = document.createElement('div'); corner.className = 'cell corner'; corner.style.border = 'none'; grid.appendChild(corner); // Column Headers (Top row) for (let j = 0; j < n; j++) { const cell = document.createElement('div'); cell.className = 'cell col-header'; cell.innerText = features[j]; // swap order for vertical text orientation logic cell.style.transform = 'rotate(180deg)'; cell.dataset.index = j; grid.appendChild(cell); } // Rows for (let i = 0; i < n; i++) { // Row Header (First cell in row) const rowH = document.createElement('div'); rowH.className = 'cell row-header'; rowH.innerText = features[i]; grid.appendChild(rowH); // Data cells for (let j = 0; j < n; j++) { const cell = document.createElement('div'); cell.className = 'cell'; // Symmetrical matrix const val = i === j ? 1 : (i > j ? correlationMatrix[i][j] : correlationMatrix[j][i]); cell.style.backgroundColor = getCorrelationColor(val); cell.dataset.val = val.toFixed(2); cell.dataset.f1 = features[i]; cell.dataset.f2 = features[j]; // Add hover events manually for tooltip cell.addEventListener('mouseenter', (e) => showTooltip(e, cell)); cell.addEventListener('mouseleave', hideTooltip); grid.appendChild(cell); } } } function renderRootCauses() { const container = document.getElementById('terminal-content'); // Find features with highest skew const sorted = features.sort((a,b) => skewData[b] - skewData[a]); const worstOffender = sorted[0]; const criticalVal = skewData[worstOffender].toFixed(2); const logs = [ `> SYSTEM BOOT SEQUENCE COMPLETE.`, `> LOADING DATASET [customers_2024.csv]...`, `> DIMENSIONS: ${features.length} FEATURES, 50000 ROWS.`, `>`, `> DISTRIBUTION ANALYSIS INITIATED...`, `> FLAG: FEATURE [${worstOffender}] EXHIBITS SEVERE SKEW (${criticalVal}).`, `> FLAG: CORRELATION BETWEEN [Age] AND [Income] IS ELEVATED (0.82).`, `>`, `> ROOT CAUSE IDENTIFICATION:`, `> 1. SAMPLING BIAS: DATA COLLECTED PRIMARILY FROM URBAN CENTERS.`, `> 2. LEGACY SYSTEM FORMAT DECIMAL_ERR: MISSING VALUES IN [Zip_Code] COMPRESSED TO SINGLE ENTRY.`, `> 3. ACQUISITION MERGE: [Job_Level] SCHEMA MISMATCH BETWEEN DB1 AND DB2.`, `>`, `> ACTION: RECOMMEND RE-WEIGHTING OR OVERSAMPLING FOR [${worstOffender}].`, `>`, `> WAITING FOR USER INPUT...` ]; container.innerHTML = ''; logs.forEach((text, i) => { const line = document.createElement('span'); line.className = 'log-line'; line.innerHTML = text; line.style.animationDelay = `${i * 0.05}s`; container.appendChild(line); }); // Auto scroll to bottom const term = document.getElementById('terminal'); term.scrollTop = term.scrollHeight; } // --- TOOLTIP LOGIC --- const tooltip = document.getElementById('tooltip'); function showTooltip(e, cell) { const val = cell.dataset.val; const f1 = cell.dataset.f1; const f2 = cell.dataset.f2; // Calculate asymmetry text for more detail const isSym = Math.abs(correlationMatrix[f1][f2] || correlationMatrix[f2][f1]) < 0.01; tooltip.innerHTML = ` <strong>${f1} <--> ${f2}</strong><br> R = <span style="font-size:1.2em; color:${val > 0.6 ? '#ff00ff' : '#ffffff'}">${val}</span><br> IMPACT: ${val > 0.7 ? 'CRITICAL' : (val > 0.4 ? 'MODERATE' : 'LOW')} `; tooltip.style.display = 'block'; // Position near cursor but offset const x = e.pageX + 15; const y = e.pageY + 15; // Boundary check if (x + tooltip.offsetWidth > window.innerWidth) tooltip.style.left = (x - tooltip.offsetWidth - 10) + 'px'; else tooltip.style.left = x + 'px'; if (y + tooltip.offsetHeight > window.innerHeight) tooltip.style.top = (y - tooltip.offsetHeight - 10) + 'px'; else tooltip.style.top = y + 'px'; } function hideTooltip() { tooltip.style.display = 'none'; } // --- DATA GENERATION --- function generateCorrelationMatrix() { const n = features.length; const matrix = []; for (let i = 0; i < n; i++) { matrix[i] = []; for (let j = 0; j < n; j++) { if (i === j) { matrix[i][j] = 1.0; } else if (i > j) { // Generate a random value between 0.05 and 0.9 // To make it look somewhat realistic, we'll create some "clusters" let base = Math.random() * 0.8 + 0.1; // Couple some strong correlations manually if ((features[i] === 'Age' && features[j] === 'Income') || (features[i] === 'Income' && features[j] === 'Job_Level') || (features[i] === 'Education' && features[j] === 'Income')) { base = Math.random() * 0.2 + 0.7; // High } matrix[i][j] = parseFloat(base.toFixed(2)); } else { matrix[i][j] = 0; // placeholder, will access lower triangle } } } correlationMatrix = matrix; generateSkew(); } function generateSkew() { skewData = {}; features.forEach(f => { // Bias randomness: make some features very high, some low let base = Math.random(); // Intentionally make some features "bad" based on name (simulate bias) if (f === 'Gender' || f === 'Zip_Code') { base = Math.random() * 0.4 + 0.6; // High skew } else if (f === 'Age' || f === 'Education') { base = Math.random() * 0.3 + 0.2; // Med/High } else { base = Math.random() * 0.3; // Low } skewData[f] = parseFloat(base.toFixed(2)); }); } // --- GLOBAL ACTIONS --- function regenerateData() { const start = performance.now(); // Simulate "processing" lag for effect document.getElementById('heatmap').style.opacity = '0.2'; document.getElementById('skew-container').style.opacity = '0.2'; document.getElementById('terminal-content').innerHTML = '<div class="log-line">> PROCESSING...</div>'; setTimeout(() => { generateCorrelationMatrix(); renderSkew(); renderHeatmap(); renderRootCauses(); const end = performance.now(); document.getElementById('render-time').innerText = (end - start).toFixed(1); document.getElementById('heatmap').style.opacity = '1'; document.getElementById('skew-container').style.opacity = '1'; }, 600); } function clearLog() { const term = document.getElementById('terminal-content'); term.innerHTML = '<div class="log-line">> LOG CLEARED.</div>'; } function toggleGlitch() { const body = document.body; body.classList.toggle('glitch-mode'); // Simple CSS injection for heavy glitch effect if (!document.getElementById('glitch-style')) { const style = document.createElement('style'); style.id = 'glitch-style'; style.innerHTML = ` .glitch-mode { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both infinite; } @keyframes shake { 10%, 90% { transform: translate3d(-1px, 0, 0); } 20%, 80% { transform: translate3d(2px, 0, 0); } 30%, 50%, 70% { transform: translate3d(-4px, 0, 0); } 40%, 60% { transform: translate3d(4px, 0, 0); } } .glitch-mode .neo-card { border-color: red !important; box-shadow: 6px 6px 0px red !important; } `; document.head.appendChild(style); } } // --- INIT --- window.onload = () => { generateCorrelationMatrix(); renderSkew(); renderHeatmap(); renderRootCauses(); }; </script> </body> </html> -
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.