.claude/skills/data-visualization/SKILL.md
Build mathematically correct, visually prominent data visualizations for time-series charts. Use this skill when creating charts with mathematical overlays (trendlines, patterns, indicators), fixing visual artifacts (wavy lines, domain mismatches), or validating chart correctness. Focuses on technical correctness and progressive validation, not aesthetic design.
npx skillsauth add awannaphasch2016/jousef-landing data-visualizationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Focus: Mathematical correctness and visual prominence for time-series charts with overlays (trendlines, patterns, indicators).
When to use this skill:
When NOT to use this skill:
frontend-design skill)telegram-uiux skill)telegram-uiux skill)Problem: Trendlines appear wavy at weekend gaps Solution: Use timestamp-based regression (not index-based) → MATHEMATICAL-CORRECTNESS.md
Problem: Pattern overlays hard to see on chart Solution: Use shaded regions + bold lines + layer ordering → VISUAL-HIERARCHY.md
Problem: Custom polygon fill doesn't render in Chart.js Solution: Use framework's dataset-to-dataset fill feature → FRAMEWORK-PATTERNS.md
Problem: Chart works with perfect data but crashes on real data Solution: Test with edge cases (gaps, nulls, holidays) → VALIDATION.md
User request involves data visualization?
├─ YES → Continue
└─ NO → Use different skill
Mathematical overlays (trendlines, patterns)?
├─ YES → Use this skill
└─ NO → Consider frontend-design (if aesthetic focus)
Problem type?
├─ Visual artifacts (wavy lines, curvature)
│ └─ Check: Domain compatibility [MATHEMATICAL-CORRECTNESS.md]
├─ Low visibility (patterns hard to see)
│ └─ Check: Visual hierarchy [VISUAL-HIERARCHY.md]
├─ Framework issues (custom code not working)
│ └─ Check: Framework patterns [FRAMEWORK-PATTERNS.md]
├─ Correctness validation (how to verify?)
│ └─ Check: Progressive validation [VALIDATION.md]
└─ General implementation
└─ Read all sections for comprehensive approach
Pattern: Shaded regions (fills) + bold trendlines + layer ordering
Why: Simple lines blend into busy charts; shaded areas create immediate recognition
See: VISUAL-HIERARCHY.md for opacity guidelines, layering strategy, Chart.js implementation
Pattern: Regression domain must match visualization axis domain
Why: Domain mismatch creates visual artifacts (wavy lines at irregular spacing)
See: MATHEMATICAL-CORRECTNESS.md for timestamp vs index, testing strategy, common mismatches
Pattern: Use framework's built-in features instead of custom implementations
Why: Native features are tested, documented, maintained; custom solutions fragile
See: FRAMEWORK-PATTERNS.md for Chart.js patterns, research workflow, when custom is acceptable
Pattern: Test with irregular data (weekend gaps, holidays, nulls)
Why: Regular spacing hides domain mismatches; irregular spacing reveals bugs
See: VALIDATION.md for edge case examples, testing checklist, validation workflow
Pattern: Validate through layers: visual → code → edge cases → mathematical
Why: Visual appearance alone doesn't prove correctness; need multiple validation levels
See: VALIDATION.md for 4-layer validation, evidence hierarchy, validation matrix
If wavy lines:
type: 'time')If low visibility:
If framework issues:
Use when: Continuous time axis (Chart.js type: 'time')
function fitLinearTrendline(points) {
const n = points.length;
// Use timestamps (p.x), not indices (i)
const sumX = points.reduce((sum, p) => sum + p.x, 0);
const sumXY = points.reduce((sum, p) => sum + p.x * p.y, 0);
const sumX2 = points.reduce((sum, p) => sum + p.x * p.x, 0);
const slope = (n * sumXY - sumX * sumY) / (n * sumX2 - sumX * sumX);
const intercept = (sumY - slope * sumX) / n;
return points.map(p => ({
x: p.x,
y: slope * p.x + intercept // Timestamp-based
}));
}
See: MATHEMATICAL-CORRECTNESS.md
Use when: Overlaying patterns on busy charts
const datasets = [];
// Layer 3: Fill area (behind)
datasets.push({
label: 'Pattern Area',
data: polygonPoints,
backgroundColor: 'rgba(38, 166, 154, 0.25)', // 25% opacity
fill: true,
borderColor: 'transparent',
order: 3, // Behind
pointRadius: 0
});
// Layer 2: Trendline (front)
datasets.push({
label: 'Trendline',
data: trendlinePoints,
borderColor: '#26A69A',
borderWidth: 3, // Bold
fill: false,
order: 2, // Front
pointRadius: 0
});
// Layer 1: Data (highest priority)
datasets.push({
type: 'candlestick',
data: ohlcData,
order: 1 // Front-most
});
See: VISUAL-HIERARCHY.md
Use when: Filling area between two lines
const datasets = [];
// Draw lower boundary first
const lowerIndex = datasets.length;
datasets.push({
label: 'Support',
data: lowerLine,
borderColor: '#26A69A',
fill: false,
order: 2
});
// Draw upper boundary with fill TO lower
datasets.push({
label: 'Resistance',
data: upperLine,
borderColor: '#26A69A',
backgroundColor: 'rgba(38, 166, 154, 0.25)',
fill: lowerIndex, // Fill to support dataset (Chart.js native)
order: 2
});
See: FRAMEWORK-PATTERNS.md
Use when: Validating mathematical correctness
// Test data with weekend gap
const testData = [
{ x: Date.parse('2024-01-01'), y: 100 }, // Mon
{ x: Date.parse('2024-01-02'), y: 102 }, // Tue
{ x: Date.parse('2024-01-03'), y: 104 }, // Wed
// Weekend gap (Thu-Sun missing)
{ x: Date.parse('2024-01-08'), y: 106 }, // Mon (5 days later!)
{ x: Date.parse('2024-01-09'), y: 108 }, // Tue
];
const trendline = fitLinearTrendline(testData);
// Validation: Line should stay straight
// If wavy → domain mismatch bug
See: VALIDATION.md
// BAD: Using array indices on continuous time axis
const sumX = points.reduce((sum, p, i) => sum + i, 0);
return { x: p.x, y: slope * i + intercept };
// Result: Wavy lines at weekend gaps
Fix: Use timestamp-based regression → MATHEMATICAL-CORRECTNESS.md
// BAD: Concatenating reversed arrays
const polygon = [...upperLine, ...lowerLine.reverse()];
datasets.push({ data: polygon, fill: true });
// Result: Doesn't render correctly in Chart.js
Fix: Use dataset-to-dataset fill → FRAMEWORK-PATTERNS.md
// BAD: Stopping at "looks good"
console.log('Screenshot looks good! Ship it!');
// Missing: Code review, edge cases, math verification
Fix: Progressive validation (4 layers) → VALIDATION.md
// BAD: Random rendering order
datasets.push({ order: 1 }); // Fill
datasets.push({ order: 1 }); // Line
datasets.push({ order: 1 }); // Data
// Result: Unpredictable z-index
Fix: Explicit layering (1=data, 2=lines, 3=fills) → VISUAL-HIERARCHY.md
Complements:
frontend-design: Aesthetic UI design (this skill: technical correctness)telegram-uiux: Telegram-specific patterns (this skill: general data viz)testing-workflow: General testing (this skill: visualization-specific validation)References:
docs/frontend/UI_PRINCIPLES.md for comprehensive principles.claude/implementations/2026-01-05-shaded-pattern-visualization.md for implementation case study.claude/implementations/2026-01-05-proper-pattern-trendlines-all-types.md for pattern-specific detailsProblem: Chart pattern trendlines appeared wavy at weekends, user feedback "I don't like the look"
Root causes:
Solutions applied:
Outcome: ✅ Patterns 3-5x more visible, ✅ Straight lines across gaps, ✅ Professional appearance
See: .claude/evolution/2026-01-05-data-visualization-principles.md for full case study
Before implementation:
During implementation:
After implementation:
See detailed documentation:
Last Updated: 2026-01-05 Version: 1.0.0 Source: Distilled from candlestick chart pattern visualization work
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
testing
Write comprehensive tests following project conventions (tiers, patterns, anti-patterns). Use when writing tests, improving test coverage, fixing failing tests, or reviewing test quality.
content-media
Clone and customize existing templates (landing pages, dashboards, admin panels) with style extraction, config-driven content, and theme customization
development
Create high-converting B2B landing pages using psychological section sequencing. Use when building landing pages for services, agencies, consultants, or B2B products. Provides 14-section framework optimized for conversion psychology.