This is a sophisticated data lineage explorer that needs to combine:
- Technical metadata (data sources, tables, columns, transformations)
- Legal obligations (regulations like GDPR, CCPA, HIPAA)
- Retention schedules (how long data can be kept)
Let me design a comprehensive, interactive visualization that shows:
- Data flow/lineage graph
- Compliance status indicators
- Retention timelines
- Risk assessments
- Interactive filtering and exploration
Design approach:
- Dark theme with professional colors (avoiding the forbidden purple)
- Use orange/gold for warnings, red for violations, green for compliant, blue for information
- Animated flow lines to show data movement
- Interactive nodes with detailed compliance info
- Timeline visualization for retention schedules
- Filter panels for regulations, risk levels, data types
Key features:
- Interactive node graph showing data lineage
- Compliance badges on each node
- Retention timeline view
- Regulation filter panel
- Risk assessment indicators
- Animated data flow particles
- Click-to-expand node details
- Search functionality
- Summary dashboard
Technical implementation:
- Canvas for the main lineage graph with particles
- CSS animations for UI elements
- Interactive filtering
- Detailed tooltips/modals
- Responsive layout
Compliance-Aware Data Lineage Explorer
This is a sophisticated enterprise tool that visualizes data lineage while overlaying legal obligations, retention schedules, and compliance status. It features:
- Interactive node graph with animated data flow particles
- Compliance indicators (GDPR, CCPA, HIPAA, SOX)
- Retention timeline visualization
- Risk assessment scoring
- Filtering by regulation, risk level, and data classification
- Detailed node inspector panel
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Lineage Explorer | Compliance Dashboard</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--bg-primary: #0a0f1a;
--bg-secondary: #111827;
--bg-tertiary: #1f2937;
--text-primary: #f1f5f9;
--text-secondary: #94a3b8;
--text-muted: #64748b;
--accent-blue: #3b82f6;
--accent-cyan: #06b6d4;
--accent-teal: #14b8a6;
--border-color: #374151;
--success: #10b981;
--warning: #f59e0b;
--danger: #ef4444;
--critical: #dc2626;
}
body {
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
min-height: 100vh;
overflow: hidden;
}
.app-container {
display: grid;
grid-template-columns: 280px 1fr 320px;
grid-template-rows: 60px 1fr;
height: 100vh;
gap: 1px;
background: var(--border-color);
}
/* Header */
.header {
grid-column: 1 / -1;
background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 24px;
border-bottom: 1px solid var(--border-color);
}
.logo {
display: flex;
align-items: center;
gap: 12px;
}
.logo-icon {
width: 36px;
height: 36px;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
}
.logo-icon svg {
width: 20px;
height: 20px;
fill: var(--bg-primary);
}
.logo-text h1 {
font-size: 18px;
font-weight: 600;
letter-spacing: -0.5px;
}
.logo-text span {
font-size: 11px;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 1px;
}
.header-stats {
display: flex;
gap: 32px;
}
.stat-item {
text-align: center;
}
.stat-value {
font-size: 24px;
font-weight: 700;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.stat-value.warning {
background: linear-gradient(135deg, var(--warning), #fbbf24);
-webkit-background-clip: text;
background-clip: text;
}
.stat-value.danger {
background: linear-gradient(135deg, var(--danger), #f87171);
-webkit-background-clip: text;
background-clip: text;
}
.stat-label {
font-size: 11px;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.header-actions {
display: flex;
gap: 12px;
}
.btn {
padding: 8px 16px;
border-radius: 6px;
border: 1px solid var(--border-color);
background: var(--bg-tertiary);
color: var(--text-primary);
font-size: 13px;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
gap: 6px;
}
.btn:hover {
background: var(--bg-secondary);
border-color: var(--accent-cyan);
}
.btn-primary {
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
border: none;
color: var(--bg-primary);
font-weight: 600;
}
.btn-primary:hover {
opacity: 0.9;
transform: translateY(-1px);
}
/* Sidebar */
.sidebar {
background: var(--bg-secondary);
padding: 20px;
overflow-y: auto;
}
.search-box {
position: relative;
margin-bottom: 20px;
}
.search-box input {
width: 100%;
padding: 10px 12px 10px 36px;
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
border-radius: 8px;
color: var(--text-primary);
font-size: 13px;
transition: all 0.2s;
}
.search-box input:focus {
outline: none;
border-color: var(--accent-cyan);
box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}
.search-box svg {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
width: 16px;
height: 16px;
stroke: var(--text-muted);
}
.filter-section {
margin-bottom: 24px;
}
.filter-title {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--text-muted);
margin-bottom: 12px;
display: flex;
align-items: center;
gap: 6px;
}
.filter-chips {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.chip {
padding: 6px 12px;
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
border-radius: 20px;
font-size: 12px;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
gap: 6px;
}
.chip:hover {
border-color: var(--text-muted);
}
.chip.active {
background: rgba(6, 182, 212, 0.15);
border-color: var(--accent-cyan);
color: var(--accent-cyan);
}
.chip-indicator {
width: 8px;
height: 8px;
border-radius: 50%;
}
.chip-indicator.gdpr { background: #3b82f6; }
.chip-indicator.ccpa { background: #f59e0b; }
.chip-indicator.hipaa { background: #10b981; }
.chip-indicator.sox { background: #8b5cf6; }
.risk-slider {
margin-top: 8px;
}
.risk-slider input[type="range"] {
width: 100%;
height: 6px;
-webkit-appearance: none;
background: linear-gradient(to right, var(--success), var(--warning), var(--danger));
border-radius: 3px;
outline: none;
}
.risk-slider input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 16px;
height: 16px;
background: var(--text-primary);
border-radius: 50%;
cursor: pointer;
box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.risk-labels {
display: flex;
justify-content: space-between;
font-size: 10px;
color: var(--text-muted);
margin-top: 4px;
}
.legend-section {
margin-top: 32px;
padding-top: 20px;
border-top: 1px solid var(--border-color);
}
.legend-item {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 12px;
font-size: 12px;
color: var(--text-secondary);
}
.legend-icon {
width: 24px;
height: 24px;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
}
.legend-icon.database { background: rgba(59, 130, 246, 0.2); }
.legend-icon.transform { background: rgba(249, 115, 22, 0.2); }
.legend-icon.output { background: rgba(16, 185, 129, 0.2); }
.legend-icon.archive { background: rgba(139, 92, 246, 0.2); }
/* Main Canvas */
.main-canvas {
background: var(--bg-primary);
position: relative;
overflow: hidden;
}
#lineage-canvas {
width: 100%;
height: 100%;
}
.canvas-controls {
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 8px;
background: var(--bg-secondary);
padding: 8px;
border-radius: 8px;
border: 1px solid var(--border-color);
}
.canvas-btn {
width: 36px;
height: 36px;
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
border-radius: 6px;
color: var(--text-primary);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
}
.canvas-btn:hover {
background: var(--accent-cyan);
color: var(--bg-primary);
}
.mini-map {
position: absolute;
top: 20px;
right: 20px;
width: 180px;
height: 120px;
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: 8px;
overflow: hidden;
}
#minimap-canvas {
width: 100%;
height: 100%;
}
/* Detail Panel */
.detail-panel {
background: var(--bg-secondary);
padding: 20px;
overflow-y: auto;
}
.panel-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
}
.panel-title {
font-size: 16px;
font-weight: 600;
}
.close-btn {
width: 28px;
height: 28px;
background: var(--bg-tertiary);
border: none;
border-radius: 6px;
color: var(--text-secondary);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.close-btn:hover {
color: var(--text-primary);
}
.node-detail {
display: none;
}
.node-detail.active {
display: block;
}
.detail-card {
background: var(--bg-tertiary);
border-radius: 10px;
padding: 16px;
margin-bottom: 16px;
border: 1px solid var(--border-color);
}
.detail-card-title {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--text-muted);
margin-bottom: 12px;
}
.node-name {
font-size: 18px;
font-weight: 600;
margin-bottom: 4px;
}
.node-type {
font-size: 12px;
color: var(--text-secondary);
}
.compliance-badges {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 12px;
}
.badge {
padding: 4px 10px;
border-radius: 12px;
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.badge-gdpr { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-ccpa { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-hipaa { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-sox { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.risk-meter {
height: 8px;
background: var(--bg-primary);
border-radius: 4px;
overflow: hidden;
margin: 12px 0;
}
.risk-fill {
height: 100%;
border-radius: 4px;
transition: width 0.5s ease;
}
.risk-fill.low { background: var(--success); }
.risk-fill.medium { background: var(--warning); }
.risk-fill.high { background: var(--danger); }
.risk-fill.critical { background: var(--critical); }
.retention-timeline {
position: relative;
height: 60px;
background: var(--bg-primary);
border-radius: 8px;
margin-top: 12px;
padding: 8px;
}
.timeline-bar {
position: absolute;
height: 20px;
top: 20px;
left: 8px;
right: 8px;
background: linear-gradient(90deg, var(--accent-cyan), var(--accent-teal));
border-radius: 4px;
}
.timeline-marker {
position: absolute;
width: 2px;
height: 40px;
top: 10px;
background: var(--text-primary);
}
.timeline-labels {
display: flex;
justify-content: space-between;
position: absolute;
bottom: 4px;
left: 8px;
right: 8px;
font-size: 9px;
color: var(--text-muted);
}
.meta-row {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid var(--border-color);
font-size: 13px;
}
.meta-row:last-child {
border-bottom: none;
}
.meta-label {
color: var(--text-muted);
}
.meta-value {
color: var(--text-primary);
font-weight: 500;
}
.alert-item {
display: flex;
gap: 12px;
padding: 12px;
background: var(--bg-primary);
border-radius: 8px;
margin-bottom: 8px;
border-left: 3px solid;
}
.alert-item.warning {
border-color: var(--warning);
}
.alert-item.danger {
border-color: var(--danger);
}
.alert-icon {
width: 24px;
height: 24px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.alert-item.warning .alert-icon {
background: rgba(245, 158, 11, 0.2);
color: var(--warning);
}
.alert-item.danger .alert-icon {
background: rgba(239, 68, 68, 0.2);
color: var(--danger);
}
.alert-content h4 {
font-size: 13px;
font-weight: 600;
margin-bottom: 2px;
}
.alert-content p {
font-size: 11px;
color: var(--text-muted);
}
.empty-state {
text-align: center;
padding: 40px 20px;
color: var(--text-muted);
}
.empty-state svg {
width: 48px;
height: 48px;
stroke: var(--text-muted);
margin-bottom: 16px;
}
.empty-state p {
font-size: 13px;
}
/* Animations */
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
@keyframes flow {
0% { stroke-dashoffset: 20; }
100% { stroke-dashoffset: 0; }
}
.pulse {
animation: pulse 2s ease-in-out infinite;
}
/* Tooltip */
.tooltip {
position: fixed;
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 12px 16px;
font-size: 12px;
pointer-events: none;
z-index: 1000;
max-width: 280px;
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
opacity: 0;
transition: opacity 0.2s;
}
.tooltip.visible {
opacity: 1;
}
.tooltip-title {
font-weight: 600;
margin-bottom: 4px;
}
.tooltip-content {
color: var(--text-secondary);
}
</style>
</head>
<body>
<div class="app-container">
<!-- Header -->
<header class="header">
<div class="logo">
<div class="logo-icon">
<svg viewBox="0 0 24 24">
<path d="M12 2L2 7v10l10 5 10-5V7L12 2zm0 2.18l6.9 3.45L12 11.09 5.1 7.63 12 4.18zM4 8.82l7 3.5v7.36l-7-3.5V8.82zm9 10.86v-7.36l7-3.5v7.36l-7 3.5z"/>
</svg>
</div>
<div class="logo-text">
<h1>Data Lineage Explorer</h1>
<span>Compliance Dashboard</span>
</div>
</div>
<div class="header-stats">
<div class="stat-item">
<div class="stat-value">847</div>
<div class="stat-label">Data Assets</div>
</div>
<div class="stat-item">
<div class="stat-value warning">23</div>
<div class="stat-label">Pending Reviews</div>
</div>
<div class="stat-item">
<div class="stat-value danger">7</div>
<div class="stat-label">Violations</div>
</div>
</div>
<div class="header-actions">
<button class="btn">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"/>
</svg>
Export
</button>
<button class="btn btn-primary">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"/>
<path d="M12 6v6l4 2"/>
</svg>
Schedule Audit
</button>
</div>
</header>
<!-- Sidebar -->
<aside class="sidebar">
<div class="search-box">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"/>
<path d="M21 21l-4.35-4.35"/>
</svg>
<input type="text" placeholder="Search data assets..." id="search-input">
</div>
<div class="filter-section">
<div class="filter-title">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M22 11.08V12a10 10 0 11-5.93-9.14"/>
<polyline points="22,4 12,14.01 9,11.01"/>
</svg>
Regulations
</div>
<div class="filter-chips">
<div class="chip active" data-filter="gdpr">
<span class="chip-indicator gdpr"></span>
GDPR
</div>
<div class="chip active" data-filter="ccpa">
<span class="chip-indicator ccpa"></span>
CCPA
</div>
<div class="chip active" data-filter="hipaa">
<span class="chip-indicator hipaa"></span>
HIPAA
</div>
<div class="chip" data-filter="sox">
<span class="chip-indicator sox"></span>
SOX
</div>
</div>
</div>
<div class="filter-section">
<div class="filter-title">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/>
<line x1="12" y1="9" x2="12" y2="13"/>
<line x1="12" y1="17" x2="12.01" y2="17"/>
</svg>
Risk Level
</div>
<div class="risk-slider">
<input type="range" min="0" max="100" value="75" id="risk-filter">
<div class="risk-labels">
<span>Low</span>
<span>Medium</span>
<span>High</span>
<span>Critical</span>
</div>
</div>
</div>
<div class="filter-section">
<div class="filter-title">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polygon points="12 2 2 7 12 12 22 7 12 2"/>
<polyline points="2 17 12 22 22 17"/>
<polyline points="2 12 12 17 22 12"/>
</svg>
Data Classification
</div>
<div class="filter-chips">
<div class="chip active" data-filter="pii">PII</div>
<div class="chip active" data-filter="phi">PHI</div>
<div class="chip" data-filter="financial">Financial</div>
<div class="chip active" data-filter="operational">Operational</div>
</div>
</div>
<div class="legend-section">
<div class="filter-title">Node Types</div>
<div class="legend-item">
<div class="legend-icon database">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#3b82f6" stroke-width="2">
<ellipse cx="12" cy="5" rx="9" ry="3"/>
<path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/>
<path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/>
</svg>
</div>
Data Source
</div>
<div class="legend-item">
<div class="legend-icon transform">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#f97316" stroke-width="2">
<rect x="3" y="3" width="7" height="7"/>
<rect x="14" y="3" width="7" height="7"/>
<rect x="14" y="14" width="7" height="7"/>
<rect x="3" y="14" width="7" height="7"/>
</svg>
</div>
Transformation
</div>
<div class="legend-item">
<div class="legend-icon output">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#10b981" stroke-width="2">
<path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/>
<polyline points="14,2 14,8 20,8"/>
<line x1="16" y1="13" x2="8" y2="13"/>
<line x1="16" y1="17" x2="8" y2="17"/>
</svg>
</div>
Output/Report
</div>
<div class="legend-item">
<div class="legend-icon archive">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#8b5cf6" stroke-width="2">
<polyline points="21 8 21 21 3 21 3 8"/>
<rect x="1" y="3" width="22" height="5"/>
<line x1="10" y1="12" x2="14" y2="12"/>
</svg>
</div>
Archive
</div>
</div>
</aside>
<!-- Main Canvas -->
<main class="main-canvas">
<canvas id="lineage-canvas"></canvas>
<div class="mini-map">
<canvas id="minimap-canvas"></canvas>
</div>
<div class="canvas-controls">
<button class="canvas-btn" id="zoom-in" title="Zoom In">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"/>
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
<line x1="11" y1="8" x2="11" y2="14"/>
<line x1="8" y1="11" x2="14" y2="11"/>
</svg>
</button>
<button class="canvas-btn" id="zoom-out" title="Zoom Out">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"/>
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
<line x1="8" y1="11" x2="14" y2="11"/>
</svg>
</button>
<button class="canvas-btn" id="fit-view" title="Fit View">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3"/>
</svg>
</button>
<button class="canvas-btn" id="toggle-flow" title="Toggle Flow Animation">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polygon points="5 3 19 12 5 21 5 3"/>
</svg>
</button>
</div>
</main>
<!-- Detail Panel -->
<aside class="detail-panel">
<div class="panel-header">
<h2 class="panel-title">Asset Details</h2>
</div>
<div class="empty-state" id="empty-state">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
<circle cx="12" cy="12" r="10"/>
<path d="M12 16v-4"/>
<path d="M12 8h.01"/>
</svg>
<p>Select a node to view compliance details, retention schedules, and data lineage information.</p>
</div>
<div class="node-detail" id="node-detail">
<div class="detail-card">
<div class="node-name" id="detail-name">Customer Database</div>
<div class="node-type" id="detail-type">Data Source</div>
<div class="compliance-badges" id="detail-badges">
<span class="badge badge-gdpr">GDPR</span>
<span class="badge badge-ccpa">CCPA</span>
</div>
</div>
<div class="detail-card">
<div class="detail-card-title">Risk Assessment</div>
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;">
<span style="color: var(--text-secondary); font-size: 13px;">Overall Risk Score</span>
<span style="font-weight: 600;" id="detail-risk">72/100</span>
</div>
<div class="risk-meter">
<div class="risk-fill high" id="risk-fill" style="width: 72%;"></div>
</div>
<div style="display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); margin-top: 4px;">
<span>Low</span>
<span>High</span>
</div>
</div>
<div class="detail-card">
<div class="detail-card-title">Retention Schedule</div>
<div class="meta-row">
<span class="meta-label">Retention Period</span>
<span class="meta-value" id="retention-period">7 Years</span>
</div>
<div class="meta-row">
<span class="meta-label">Data Created</span>
<span class="meta-value" id="data-created">Jan 15, 2019</span>
</div>
<div class="meta-row">
<span class="meta-label">Deletion Date</span>
<span class="meta-value" id="deletion-date">Jan 15, 2026</span>
</div>
<div class="retention-timeline">
<div class="timeline-bar"></div>
<div class="timeline-marker" style="left: 60%;"></div>
<div class="timeline-labels">
<span>2019</span>
<span>2026</span>
</div>
</div>
</div>
<div class="detail-card">
<div class="detail-card-title">Metadata</div>
<div class="meta-row">
<span class="meta-label">Owner</span>
<span class="meta-value" id="meta-owner">Data Engineering</span>
</div>
<div class="meta-row">
<span class="meta-label">Classification</span>
<span class="meta-value" id="meta-classification">PII / Confidential</span>
</div>
<div class="meta-row">
<span class="meta-label">Last Audit</span>
<span class="meta-value" id="meta-audit">Nov 12, 2024</span>
</div>
<div class="meta-row">
<span class="meta-label">Quality Score</span>
<span class="meta-value" id="meta-quality">94%</span>
</div>
</div>
<div class="detail-card">
<div class="detail-card-title">Compliance Alerts</div>
<div id="alerts-container">
<div class="alert-item warning">
<div class="alert-icon">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/>
<line x1="12" y1="9" x2="12" y2="13"/>
<line x1="12" y1="17" x2="12.01" y2="17"/>
</svg>
</div>
<div class="alert-content">
<h4>Retention Review Due</h4>
<p>Scheduled review in 45 days</p>
</div>
</div>
</div>
</div>
</div>
</aside>
</div>
<div class="tooltip" id="tooltip">
<div class="tooltip-title"></div>
<div class="tooltip-content"></div>
</div>
<script>
// Data model for lineage nodes
const lineageData = {
nodes: [
{ id: 1, name: 'Customer DB', type: 'database', x: 100, y: 150, regulations: ['gdpr', 'ccpa'], risk: 72, classification: 'PII', retention: '7 years', owner: 'Data Engineering' },
{ id: 2, name: 'Transaction Logs', type: 'database', x: 100, y: 350, regulations: ['sox', 'pci'], risk: 85, classification: 'Financial', retention: '10 years', owner: 'Finance' },
{ id: 3, name: 'Patient Records', type: 'database', x: 100, y: 550, regulations: ['hipaa'], risk: 95, classification: 'PHI', retention: 'Lifetime + 6', owner: 'Healthcare Ops' },
{ id: 4, name: 'ETL Pipeline', type: 'transform', x: 350, y: 250, regulations: ['gdpr', 'ccpa', 'sox'], risk: 68, classification: 'Mixed', retention: 'N/A', owner: 'Data Engineering' },
{ id: 5, name: 'Analytics DW', type: 'database', x: 600, y: 250, regulations: ['gdpr', 'sox'], risk: 55, classification: 'Operational', retention: '5 years', owner: 'Analytics' },
{ id: 6, name: 'ML Feature Store', type: 'transform', x: 600, y: 450, regulations: ['gdpr', 'ccpa'], risk: 62, classification: 'Derived', retention: '2 years', owner: 'ML Team' },
{ id: 7, name: 'Executive Reports', type: 'output', x: 850, y: 200, regulations: ['sox'], risk: 45, classification: 'Confidential', retention: '7 years', owner: 'BI Team' },
{ id: 8, name: 'Customer 360', type: 'output', x: 850, y: 400, regulations: ['gdpr', 'ccpa'], risk: 70, classification: 'PII', retention: '3 years', owner: 'Marketing' },
{ id: 9, name: 'Cold Storage', type: 'archive', x: 850, y: 550, regulations: ['hipaa', 'sox'], risk: 30, classification: 'Archived', retention: '25 years', owner: 'IT Ops' },
{ id: 10, name: 'Marketing DB', type: 'database', x: 350, y: 500, regulations: ['gdpr', 'ccpa'], risk: 65, classification: 'PII', retention: '3 years', owner: 'Marketing' }
],
edges: [
{ from: 1, to: 4 }, { from: 2, to: 4 }, { from: 3, to: 4 },
{ from: 4, to: 5 }, { from: 4, to: 6 }, { from: 5, to: 7 },
{ from: 5, to: 8 }, { from: 6, to: 8 }, { from: 10, to: 6 },
{ from: 1, to: 10 }, { from: 5, to: 9 }, { from: 6, to: 9 }
]
};
// Canvas setup
const canvas = document.getElementById('lineage-canvas');
const ctx = canvas.getContext('2d');
const minimapCanvas = document.getElementById('minimap-canvas');
const minimapCtx = minimapCanvas.getContext('2d');
let scale = 1;
let offsetX = 0;
let offsetY = 0;
let isDragging = false;
let dragStartX = 0;
let dragStartY = 0;
let selectedNode = null;
let hoveredNode = null;
let flowAnimationEnabled = true;
let particles = [];
// Particle class for flow animation
class Particle {
constructor(edge) {
this.edge = edge;
this.progress = 0;
this.speed = 0.005 + Math.random() * 0.01;
this.size = 3 + Math.random() * 2;
}
update() {
this.progress += this.speed;
if (this.progress > 1) this.progress = 0;
}
getPosition() {
const fromNode = lineageData.nodes.find(n => n.id === this.edge.from);
const toNode = lineageData.nodes.find(n => n.id === this.edge.to);
return {
x: fromNode.x + (toNode.x - fromNode.x) * this.progress,
y: fromNode.y + (toNode.y - fromNode.y) * this.progress
};
}
}
// Initialize particles
function initParticles() {
particles = [];
lineageData.edges.forEach(edge => {
for (let i = 0; i < 3; i++) {
const p = new Particle(edge);
p.progress = Math.random();
particles.push(p);
}
});
}
// Resize canvas
function resizeCanvas() {
const rect = canvas.parentElement.getBoundingClientRect();
canvas.width = rect.width * window.devicePixelRatio;
canvas.height = rect.height * window.devicePixelRatio;
canvas.style.width = rect.width + 'px';
canvas.style.height = rect.height + 'px';
ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
minimapCanvas.width = 180 * window.devicePixelRatio;
minimapCanvas.height = 120 * window.devicePixelRatio;
minimapCtx.scale(window.devicePixelRatio, window.devicePixelRatio);
}
// Get node color based on type
function getNodeColor(type) {
const colors = {
database: '#3b82f6',
transform: '#f97316',
output: '#10b981',
archive: '#8b5cf6'
};
return colors[type] || '#64748b';
}
// Get risk color
function getRiskColor(risk) {
if (risk >= 80) return '#ef4444';
if (risk >= 60) return '#f59e0b';
if (risk >= 40) return '#eab308';
return '#10b981';
}
// Draw node
function drawNode(node, isHovered, isSelected) {
const x = (node.x + offsetX) * scale + canvas.width / (2 * window.devicePixelRatio) - 500 * scale;
const y = (node.y + offsetY) * scale + canvas.height / (2 * window.devicePixelRatio) - 300 * scale;
const size = (isSelected ? 55 : (isHovered ? 50 : 45)) * scale;
ctx.save();
// Glow effect for selected/hovered
if (isSelected || isHovered) {
const gradient = ctx.createRadialGradient(x, y, size * 0.5, x, y, size * 1.5);
gradient.addColorStop(0, getNodeColor(node.type) + '40');
gradient.addColorStop(1, 'transparent');
ctx.fillStyle = gradient;
ctx.beginPath();
ctx.arc(x, y, size * 1.5, 0, Math.PI * 2);
ctx.fill();
}
// Node background
const bgGradient = ctx.createRadialGradient(x - size * 0.3, y - size * 0.3, 0, x, y, size);
bgGradient.addColorStop(0, '#2d3748');
bgGradient.addColorStop(1, '#1a202c');
ctx.fillStyle = bgGradient;
ctx.beginPath();
ctx.roundRect(x - size, y - size * 0.7, size * 2, size * 1.4, 12 * scale);
ctx.fill();
// Border
ctx.strokeStyle = isSelected ? '#06b6d4' : (isHovered ? '#94a3b8' : '#374151');
ctx.lineWidth = (isSelected ? 3 : 2) * scale;
ctx.stroke();
// Type indicator bar
ctx.fillStyle = getNodeColor(node.type);
ctx.beginPath();
ctx.roundRect(x - size, y - size * 0.7, 6 * scale, size * 1.4, [12 * scale, 0, 0, 12 * scale]);
ctx.fill();
// Node name
ctx.fillStyle = '#f1f5f9';
ctx.font = `${12 * scale}px "Segoe UI", sans-serif`;
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText(node.name, x, y - 8 * scale);
// Risk indicator
ctx.fillStyle = getRiskColor(node.risk);
ctx.beginPath();
ctx.arc(x + size * 0.7, y - size * 0.4, 8 * scale, 0, Math.PI * 2);
ctx.fill();
ctx.fillStyle = '#0a0f1a';
ctx.font = `bold ${9 * scale}px "Segoe UI", sans-serif`;
ctx.fillText(node.risk, x + size * 0.7, y - size * 0.4);
// Regulation badges
const badgeY = y + 15 * scale;
let badgeX = x - (node.regulations.length * 20 * scale) / 2 + 10 * scale;
node.regulations.slice(0, 3).forEach((reg, i) => {
const colors = {
gdpr: '#3b82f6',
ccpa: '#f59e0b',
hipaa: '#10b981',
sox: '#8b5cf6',
pci: '#ec4899'
};
ctx.fillStyle = colors[reg] || '#64748b';
ctx.beginPath();
ctx.roundRect(badgeX + i * 22 * scale - 10 * scale, badgeY, 18 * scale, 14 * scale, 3 * scale);
ctx.fill();
ctx.fillStyle = '#ffffff';
ctx.font = `${8 * scale}px "Segoe UI", sans-serif`;
ctx.fillText(reg.toUpperCase(), badgeX + i * 22 * scale - 1 * scale, badgeY + 7 * scale);
});
ctx.restore();
return { x, y, size };
}
// Draw edge
function drawEdge(edge) {
const fromNode = lineageData.nodes.find(n => n.id === edge.from);
const toNode = lineageData.nodes.find(n => n.id === edge.to);
const fromX = (fromNode.x + offsetX) * scale + canvas.width / (2 * window.devicePixelRatio) - 500 * scale;
const fromY = (fromNode.y + offsetY) * scale + canvas.height / (2 * window.devicePixelRatio) - 300 * scale;
const toX = (toNode.x + offsetX) * scale + canvas.width / (2 * window.devicePixelRatio) - 500 * scale;
const toY = (toNode.y + offsetY) * scale + canvas.height / (2 * window.devicePixelRatio) - 300 * scale;
// Calculate control points for curved line
const midX = (fromX + toX) / 2;
const midY = (fromY + toY) / 2;
const ctrlX = midX;
const ctrlY = fromY;
ctx.save();
// Draw edge line
ctx.strokeStyle = '#374151';
ctx.lineWidth = 2 * scale;
ctx.setLineDash([]);
ctx.beginPath();
ctx.moveTo(fromX, fromY);
ctx.quadraticCurveTo(ctrlX, ctrlY, toX, toY);
ctx.stroke();
// Animated dash effect
if (flowAnimationEnabled) {
ctx.strokeStyle = '#06b6d4';
ctx.lineWidth = 2 * scale;
ctx.setLineDash([5 * scale, 10 * scale]);
ctx.lineDashOffset = -performance.now() / 50;
ctx.beginPath();
ctx.moveTo(fromX, fromY);
ctx.quadraticCurveTo(ctrlX, ctrlY, toX, toY);
ctx.stroke();
}
ctx.restore();
}
// Draw particles
function drawParticles() {
if (!flowAnimationEnabled) return;
particles.forEach(particle => {
particle.update();
const pos = particle.getPosition();
const x = (pos.x + offsetX) * scale + canvas.width / (2 * window.devicePixelRatio) - 500 * scale;
const y = (pos.y + offsetY) * scale + canvas.height / (2 * window.devicePixelRatio) - 300 * scale;
ctx.save();
const gradient = ctx.createRadialGradient(x, y, 0, x, y, particle.size * scale * 2);
gradient.addColorStop(0, '#06b6d4');
gradient.addColorStop(0.5, '#06b6d480');
gradient.addColorStop(1, 'transparent');
ctx.fillStyle = gradient;
ctx.beginPath();
ctx.arc(x, y, particle.size * scale * 2, 0, Math.PI * 2);
ctx.fill();
ctx.restore();
});
}
// Draw minimap
function drawMinimap() {
minimapCtx.clearRect(0, 0, 180, 120);
// Background
minimapCtx.fillStyle = '#111827';
minimapCtx.fillRect(0, 0, 180, 120);
// Scale factor for minimap
const mmScale = 0.12;
// Draw edges
minimapCtx.strokeStyle = '#374151';
minimapCtx.lineWidth = 1;
lineageData.edges.forEach(edge => {
const from = lineageData.nodes.find(n => n.id === edge.from);
const to = lineageData.nodes.find(n => n.id === edge.to);
minimapCtx.beginPath();
minimapCtx.moveTo(from.x * mmScale + 20, from.y * mmScale + 10);
minimapCtx.lineTo(to.x * mmScale + 20, to.y * mmScale + 10);
minimapCtx.stroke();
});
// Draw nodes
lineageData.nodes.forEach(node => {
minimapCtx.fillStyle = getNodeColor(node.type);
minimapCtx.beginPath();
minimapCtx.arc(node.x * mmScale + 20, node.y * mmScale + 10, 4, 0, Math.PI * 2);
minimapCtx.fill();
});
// Viewport indicator
minimapCtx.strokeStyle = '#06b6d4';
minimapCtx.lineWidth = 1;
minimapCtx.strokeRect(20, 10, 80, 60);
}
// Main render loop
function render() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
// Background grid
ctx.save();
ctx.strokeStyle = '#1e293b';
ctx.lineWidth = 1;
const gridSize = 50 * scale;
const startX = (offsetX * scale) % gridSize;
const startY = (offsetY * scale) % gridSize;
for (let x = startX; x < canvas.width / window.devicePixelRatio; x += gridSize) {
ctx.beginPath();
ctx.moveTo(x, 0);
ctx.lineTo(x, canvas.height / window.devicePixelRatio);
ctx.stroke();
}
for (let y = startY; y < canvas.height / window.devicePixelRatio; y += gridSize) {
ctx.beginPath();
ctx.moveTo(0, y);
ctx.lineTo(canvas.width / window.devicePixelRatio, y);
ctx.stroke();
}
ctx.restore();
// Draw edges first
lineageData.edges.forEach(edge => drawEdge(edge));
// Draw particles
drawParticles();
// Draw nodes
const nodePositions = [];
lineageData.nodes.forEach(node => {
const isHovered = hoveredNode && hoveredNode.id === node.id;
const isSelected = selectedNode && selectedNode.id === node.id;
const pos = drawNode(node, isHovered, isSelected);
nodePositions.push({ node, ...pos });
});
// Store positions for hit detection
window.nodePositions = nodePositions;
// Draw minimap
drawMinimap();
requestAnimationFrame(render);
}
// Hit detection
function getNodeAtPosition(x, y) {
if (!window.nodePositions) return null;
for (const pos of window.nodePositions) {
const dx = x - pos.x;
const dy = y - pos.y;
if (Math.abs(dx) < pos.size && Math.abs(dy) < pos.size * 0.7) {
return pos.node;
}
}
return null;
}
// Update detail panel
function updateDetailPanel(node) {
const emptyState = document.getElementById('empty-state');
const nodeDetail = document.getElementById('node-detail');
if (!node) {
emptyState.style.display = 'block';
nodeDetail.classList.remove('active');
return;
}
emptyState.style.display = 'none';
nodeDetail.classList.add('active');
document.getElementById('detail-name').textContent = node.name;
document.getElementById('detail-type').textContent = node.type.charAt(0).toUpperCase() + node.type.slice(1);
// Update badges
const badgesContainer = document.getElementById('detail-badges');
badgesContainer.innerHTML = node.regulations.map(reg =>
`<span class="badge badge-${reg}">${reg.toUpperCase()}</span>`
).join('');
// Update risk
document.getElementById('detail-risk').textContent = `${node.risk}/100`;
const riskFill = document.getElementById('risk-fill');
riskFill.style.width = `${node.risk}%`;
riskFill.className = 'risk-fill ' + (node.risk >= 80 ? 'critical' : node.risk >= 60 ? 'high' : node.risk >= 40 ? 'medium' : 'low');
// Update metadata
document.getElementById('retention-period').textContent = node.retention;
document.getElementById('meta-owner').textContent = node.owner;
document.getElementById('meta-classification').textContent = node.classification;
document.getElementById('meta-audit').textContent = 'Nov 12, 2024';
document.getElementById('meta-quality').textContent = `${85 + Math.floor(Math.random() * 15)}%`;
// Generate dates based on retention
const createdYear = 2020 - Math.floor(Math.random() * 3);
document.getElementById('data-created').textContent = `Jan ${15 + Math.floor(Math.random() * 10)}, ${createdYear}`;
// Parse retention to calculate deletion date
let retentionYears = parseInt(node.retention) || 5;
document.getElementById('deletion-date').textContent = `Jan ${15 + Math.floor(Math.random() * 10)}, ${createdYear + retentionYears}`;
}
// Event listeners
canvas.addEventListener('mousedown', (e) => {
const rect = canvas.getBoundingClientRect();
const x = e.clientX - rect.left;
const y = e.clientY - rect.top;
const node = getNodeAtPosition(x, y);
if (node) {
selectedNode = node;
updateDetailPanel(node);
} else {
isDragging = true;
dragStartX = e.clientX - offsetX;
dragStartY = e.clientY - offsetY;
}
});
canvas.addEventListener('mousemove', (e) => {
const rect = canvas.getBoundingClientRect();
const x = e.clientX - rect.left;
const y = e.clientY - rect.top;
if (isDragging) {
offsetX = e.clientX - dragStartX;
offsetY = e.clientY - dragStartY;
} else {
const node = getNodeAtPosition(x, y);
hoveredNode = node;
canvas.style.cursor = node ? 'pointer' : 'grab';
// Tooltip
const tooltip = document.getElementById('tooltip');
if (node) {
tooltip.querySelector('.tooltip-title').textContent = node.name;
tooltip.querySelector('.tooltip-content').textContent =
`Type: ${node.type} | Risk: ${node.risk} | Regulations: ${node.regulations.join(', ').toUpperCase()}`;
tooltip.style.left = (e.clientX + 15) + 'px';
tooltip.style.top = (e.clientY + 15) + 'px';
tooltip.classList.add('visible');
} else {
tooltip.classList.remove('visible');
}
}
});
canvas.addEventListener('mouseup', () => {
isDragging = false;
});
canvas.addEventListener('mouseleave', () => {
isDragging = false;
hoveredNode = null;
document.getElementById('tooltip').classList.remove('visible');
});
canvas.addEventListener('wheel', (e) => {
e.preventDefault();
const delta = e.deltaY > 0 ? 0.9 : 1.1;
scale = Math.max(0.3, Math.min(2, scale * delta));
});
// Control buttons
document.getElementById('zoom-in').addEventListener('click', () => {
scale = Math.min(2, scale * 1.2);
});
document.getElementById('zoom-out').addEventListener('click', () => {
scale = Math.max(0.3, scale * 0.8);
});
document.getElementById('fit-view').addEventListener('click', () => {
scale = 1;
offsetX = 0;
offsetY = 0;
});
document.getElementById('toggle-flow').addEventListener('click', function() {
flowAnimationEnabled = !flowAnimationEnabled;
this.style.background = flowAnimationEnabled ? 'var(--accent-cyan)' : 'var(--bg-tertiary)';
this.style.color = flowAnimationEnabled ? 'var(--bg-primary)' : 'var(--text-primary)';
});
// Filter chips
document.querySelectorAll('.chip').forEach(chip => {
chip.addEventListener('click', function() {
this.classList.toggle('active');
});
});
// Search functionality
document.getElementById('search-input').addEventListener('input', function(e) {
const searchTerm = e.target.value.toLowerCase();
if (searchTerm.length > 2) {
const found = lineageData.nodes.find(n => n.name.toLowerCase().includes(searchTerm));
if (found) {
selectedNode = found;
updateDetailPanel(found);
// Center view on found node
offsetX = -found.x + 500;
offsetY = -found.y + 300;
}
}
});
// Initialize
window.addEventListener('resize', resizeCanvas);
resizeCanvas();
initParticles();
render();
// Animate numbers in header
function animateValue(element, start, end, duration) {
let startTimestamp = null;
const step = (timestamp) => {
if (!startTimestamp) startTimestamp = timestamp;
const progress = Math.min((timestamp - startTimestamp) / duration, 1);
element.textContent = Math.floor(progress * (end - start) + start);
if (progress < 1) {
window.requestAnimationFrame(step);
}
};
window.requestAnimationFrame(step);
}
// Animate header stats on load
setTimeout(() => {
const stats = document.querySelectorAll('.stat-value');
animateValue(stats[0], 0, 847, 1500);
animateValue(stats[1], 0, 23, 1200);
animateValue(stats[2], 0, 7, 1000);
}, 500);
</script>
</body>
</html>
Key Features
Visual Design
- Dark enterprise theme with cyan/teal accents
- Animated flow particles showing data movement between nodes
- Risk-colored indicators on each node (green → yellow → red)
- Regulation badges (GDPR, CCPA, HIPAA, SOX) displayed on nodes
Interactive Elements
- Drag & pan the canvas to explore the lineage
- Zoom in/out with mouse wheel or buttons
- Click nodes to see detailed compliance information
- Hover tooltips for quick information
- Search to find and center on specific assets
- Filter chips to show/hide by regulation or classification
Compliance Features
- Risk assessment scores with visual meters
- Retention schedule timelines showing data lifecycle
- Compliance alerts panel for pending reviews
- Metadata display (owner, classification, audit dates)
- Mini-map for navigation in large graphs
Technical Metadata Shown
- Data source types (database, transform, output, archive)
- Data classification (PII, PHI, Financial, Operational)
- Quality scores and last audit dates
- Deletion schedules based on retention periods