chart
Data visualization. chart, graph, dashboard, visualize data, plot, analytics, D3.js, Chart.js, Recharts, Plotly.
arbazkhan971 · Static checks on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add arbazkhan971/godmode --skill chartAbout this skill
name: chart description: Data visualization. chart, graph, dashboard, visualize data, plot, analytics, D3.js, Chart.js, Recharts, Plotly.
Chart — Data Visualization
Activate When
- User invokes
/godmode:chart - User says "create a chart", "visualize this data", "make a graph"
- User says "build a dashboard", "display metrics", "plot this"
- When building reporting pages or analytics dashboards
- When
/godmode:planidentifies data visualization tasks - When
/godmode:reviewflags visualization accessibility or usability issues
Workflow
Step 1: Data & Intent Discovery
Understand the data and what the visualization needs to communicate:
VISUALIZATION DISCOVERY:
Project: <name and purpose>
Data source: <API endpoint | database query | static JSON | CSV | real-time stream>
Data shape: <rows x columns, field names, types>
Audience: <executives | engineers | end-users | public>
Goal: <compare | trend | distribute | correlate | compose | flow | geospatial>
Interactivity: <static | hover tooltips | click-to-filter | drill-down | real-time>
Environment: <React | Vue | Angular | vanilla JS | server-side PDF | Jupyter>
Existing library: <D3.js | Chart.js | Recharts | Plotly | Nivo | Victory | none>
Constraints: <bundle size limit | IE support | print-friendly | offline | color-blind safe>
If the user hasn't specified, ask: "What story should this visualization tell? Who is the audience?"
Step 2: Chart Type Selection
Select the optimal chart type based on the data and communication goal:
CHART TYPE SELECTION:
| Goal | Recommended Chart Types |
|--|--|
| Compare values | Bar (vertical/horizontal), Grouped bar, Lollipop |
| Show trends | Line, Area, Sparkline, Step |
| Show distribution | Histogram, Box plot, Violin, Density |
| Show correlation | Scatter, Bubble, Heatmap (correlation matrix) |
| Show composition | Stacked bar, Treemap, Sunburst, Waffle |
| Show flow/process | Sankey, Alluvial, Chord diagram |
| Show hierarchy | Treemap, Sunburst, Dendrogram, Circle packing |
| Show geographic | Choropleth, Bubble map, Hex bin map |
| Show part-to-whole | Donut, Stacked area, Marimekko |
...
Rules:
- Never use pie charts for more than 5 categories — use bar charts instead
- Never use 3D charts — they distort perception and reduce accuracy
- Use line charts only for continuous data (time series) — not categorical
- Prefer horizontal bar charts when labels are long
- Use small multiples over complex multi-series charts when series exceed 5
Step 3: Library Selection & Setup
Choose the right visualization library for the project:
LIBRARY SELECTION:
| Library | Best For | Bundle Size | Learning Curve |
|--|--|--|--|
| D3.js | Custom, complex, | ~90KB | Steep — full control |
| | unique visualizations | | over every pixel |
| Chart.js | Standard charts, | ~60KB | Low — declarative |
| | quick setup, canvas | | config-based API |
| Recharts | React dashboards, | ~120KB | Low — React-native |
| | composable charts | | component API |
| Plotly | Scientific/data | ~1MB | Medium — rich |
| | analysis, 3D plots | | interactive charts |
Step 4: Data Transformation
Prepare data for the selected chart type:
DATA TRANSFORMATION:
Source format: <raw data shape — e.g., array of objects, CSV rows, nested JSON>
Target format: <what the chart library expects>
Transformations needed:
1. <transformation — e.g., group by category, aggregate sum>
2. <transformation — e.g., pivot rows to columns>
3. <transformation — e.g., normalize to percentages>
4. <transformation — e.g., sort descending by value>
5. <transformation — e.g., compute rolling average>
Missing data strategy: <omit | zero-fill | interpolate | show gap>
...
Generate the transformation code:
// Data transformation pipeline
function transformData(raw: RawData[]): ChartData {
return raw
.filter(/* remove invalid entries */)
.map(/* reshape to chart format */)
.sort(/* order for readability */)
Step 5: Chart Implementation
Build the chart with full configuration:
CHART CONFIGURATION:
| Property | Value |
|--|--|
| Type | <bar | line | scatter | heatmap | ...> |
| Width | <responsive | fixed px> |
| Height | <responsive | fixed px> |
| Aspect ratio | <16:9 | 4:3 | 1:1 | custom> |
| Margins | top=<N> right=<N> bottom=<N> left=<N> |
| Colors | <palette name or hex values> |
| Font family | <system | project font> |
| Animation | <none | enter | update | transition> |
| Legend | <position: top | right | bottom | none> |
...
Use the selected library's standard patterns:
- D3.js: SVG with margin convention, scales, axes, data joins
- Recharts:
ResponsiveContainerwrapper, declarative component composition - Chart.js: Canvas-based config object with datasets array
- Plotly: Trace objects with layout configuration
Step 6: Responsive Design
Mobile (<480px): stack legend below, reduce ticks, enlarge touch targets. Tablet (480-1024px): side legend, full interactivity. Desktop (>1024px): full layout, annotations, brush/zoom.
Step 7: Color & Accessibility
Design accessible visualizations that work for everyone:
ACCESSIBILITY CHECKLIST:
| Check | Status |
|--|--|
| Color contrast ratio >= 3:1 against background | PASS | FAIL |
| Colorblind-safe palette (no red/green only) | PASS | FAIL |
| Patterns/textures as secondary differentiator | PASS | FAIL |
| aria-label on chart container (SVG role="img") | PASS | FAIL |
| Data table alternative available | PASS | FAIL |
| Keyboard navigable (focus on data points) | PASS | FAIL |
| Screen reader descriptions for trends | PASS | FAIL |
| Tooltip accessible via keyboard (not hover-only) | PASS | FAIL |
| Text labels minimum 12px font size | PASS | FAIL |
...
Step 8: Dashboard Composition
When building multi-chart dashboards, apply layout principles:
DASHBOARD DESIGN:
Layout: <grid columns — e.g., 12-column grid>
Sections:
1. <KPI row — number c
Read the complete source ↗