@elsahafy/ux-mcp-server 2.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +159 -18
- package/dist/index.js +2130 -8
- package/knowledge/ai-ml-patterns.json +192 -0
- package/knowledge/analytics-metrics.json +521 -0
- package/knowledge/angular-patterns.json +347 -0
- package/knowledge/ar-vr-interfaces.json +139 -0
- package/knowledge/color-theory.json +499 -0
- package/knowledge/data-viz.json +527 -0
- package/knowledge/design-system-advanced.json +533 -0
- package/knowledge/ecommerce-patterns.json +616 -0
- package/knowledge/ethical-design.json +484 -0
- package/knowledge/finance-ux.json +208 -0
- package/knowledge/forms.json +641 -0
- package/knowledge/haptic-feedback.json +102 -0
- package/knowledge/healthcare-ux.json +209 -0
- package/knowledge/information-architecture.json +494 -0
- package/knowledge/microcopy.json +743 -0
- package/knowledge/mobile-patterns.json +537 -0
- package/knowledge/neurodiversity.json +228 -0
- package/knowledge/pwa-patterns.json +429 -0
- package/knowledge/saas-patterns.json +613 -0
- package/knowledge/testing-validation.json +561 -0
- package/knowledge/typography.json +509 -0
- package/knowledge/voice-ui.json +359 -0
- package/knowledge/vue-patterns.json +279 -0
- package/knowledge/web-components.json +148 -0
- package/package.json +1 -1
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Data Visualization Patterns",
|
|
3
|
+
"description": "Comprehensive guide to choosing, designing, and implementing accessible data visualizations",
|
|
4
|
+
"choosing_charts": {
|
|
5
|
+
"by_purpose": {
|
|
6
|
+
"comparison": {
|
|
7
|
+
"description": "Compare values across categories",
|
|
8
|
+
"chart_types": ["Bar chart", "Column chart", "Radar chart"],
|
|
9
|
+
"when": "Comparing sales by region, product performance",
|
|
10
|
+
"best": "Bar chart (horizontal) for many categories"
|
|
11
|
+
},
|
|
12
|
+
"composition": {
|
|
13
|
+
"description": "Show parts of a whole",
|
|
14
|
+
"chart_types": ["Pie chart", "Donut chart", "Stacked bar", "Treemap"],
|
|
15
|
+
"when": "Market share, budget breakdown",
|
|
16
|
+
"best": "Pie chart for < 6 segments, stacked bar for more"
|
|
17
|
+
},
|
|
18
|
+
"distribution": {
|
|
19
|
+
"description": "Show how data is distributed",
|
|
20
|
+
"chart_types": ["Histogram", "Box plot", "Violin plot"],
|
|
21
|
+
"when": "Age distribution, test scores",
|
|
22
|
+
"best": "Histogram for continuous data"
|
|
23
|
+
},
|
|
24
|
+
"relationship": {
|
|
25
|
+
"description": "Show correlation between variables",
|
|
26
|
+
"chart_types": ["Scatter plot", "Bubble chart", "Heatmap"],
|
|
27
|
+
"when": "Sales vs marketing spend, correlation analysis",
|
|
28
|
+
"best": "Scatter plot for two variables"
|
|
29
|
+
},
|
|
30
|
+
"trend_over_time": {
|
|
31
|
+
"description": "Show changes over time",
|
|
32
|
+
"chart_types": ["Line chart", "Area chart", "Sparkline"],
|
|
33
|
+
"when": "Stock prices, website traffic, sales trends",
|
|
34
|
+
"best": "Line chart (most common and clear)"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"chart_selection_guide": {
|
|
38
|
+
"one_variable": {
|
|
39
|
+
"categorical": "Bar chart, pie chart",
|
|
40
|
+
"numerical": "Histogram, box plot"
|
|
41
|
+
},
|
|
42
|
+
"two_variables": {
|
|
43
|
+
"both_numerical": "Scatter plot, line chart",
|
|
44
|
+
"one_categorical_one_numerical": "Bar chart, box plot",
|
|
45
|
+
"both_categorical": "Grouped bar chart, heatmap"
|
|
46
|
+
},
|
|
47
|
+
"three_variables": "Bubble chart, 3D scatter (use sparingly)",
|
|
48
|
+
"time_series": "Line chart, area chart",
|
|
49
|
+
"hierarchical": "Treemap, sunburst"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"chart_types": {
|
|
53
|
+
"bar_chart": {
|
|
54
|
+
"description": "Horizontal bars for comparing categories",
|
|
55
|
+
"use_when": ["Comparing discrete categories", "Many categories (long labels)", "Ranking data"],
|
|
56
|
+
"orientation": "Horizontal preferred (easier to read labels)",
|
|
57
|
+
"best_practices": [
|
|
58
|
+
"Start y-axis at zero",
|
|
59
|
+
"Sort bars by value (unless natural order exists)",
|
|
60
|
+
"Use consistent colors",
|
|
61
|
+
"Label bars directly when possible",
|
|
62
|
+
"Keep bars same width"
|
|
63
|
+
],
|
|
64
|
+
"avoid": ["3D effects", "Too many categories (> 20)", "Truncated y-axis"],
|
|
65
|
+
"accessibility": "Provide data table alternative"
|
|
66
|
+
},
|
|
67
|
+
"column_chart": {
|
|
68
|
+
"description": "Vertical bars (same as bar chart, rotated)",
|
|
69
|
+
"use_when": ["Few categories (< 10)", "Time series data", "Short labels"],
|
|
70
|
+
"same_as": "Bar chart but vertical",
|
|
71
|
+
"prefer_bar_when": "Many categories or long labels"
|
|
72
|
+
},
|
|
73
|
+
"line_chart": {
|
|
74
|
+
"description": "Show trends over continuous data",
|
|
75
|
+
"use_when": ["Time series", "Continuous data", "Trends and patterns"],
|
|
76
|
+
"best_practices": [
|
|
77
|
+
"Use points at data markers",
|
|
78
|
+
"Limit to 5-7 lines maximum",
|
|
79
|
+
"Use distinct colors/patterns for each line",
|
|
80
|
+
"Label lines directly (not just in legend)",
|
|
81
|
+
"Start y-axis at zero (or make break obvious)",
|
|
82
|
+
"Show grid lines lightly"
|
|
83
|
+
],
|
|
84
|
+
"multiple_lines": {
|
|
85
|
+
"max_recommended": 5,
|
|
86
|
+
"use_color_and_pattern": "For accessibility",
|
|
87
|
+
"interactive": "Allow toggling lines on/off"
|
|
88
|
+
},
|
|
89
|
+
"avoid": ["Too many lines (> 7)", "Inconsistent intervals", "3D effects"]
|
|
90
|
+
},
|
|
91
|
+
"pie_chart": {
|
|
92
|
+
"description": "Show parts of a whole (percentage)",
|
|
93
|
+
"use_when": ["Showing proportions", "< 6 segments", "Segments are meaningfully different"],
|
|
94
|
+
"best_practices": [
|
|
95
|
+
"Limit to 5-6 segments maximum",
|
|
96
|
+
"Start at 12 o'clock position",
|
|
97
|
+
"Order segments by size (largest first)",
|
|
98
|
+
"Label segments directly with percentages",
|
|
99
|
+
"Use distinct colors",
|
|
100
|
+
"Include legend if labels don't fit"
|
|
101
|
+
],
|
|
102
|
+
"avoid": ["More than 6 segments (use bar chart instead)", "3D effects (distorts perception)", "Multiple pies for comparison", "Exploding segments (except one for emphasis)"],
|
|
103
|
+
"better_alternative": "Bar chart for most comparisons"
|
|
104
|
+
},
|
|
105
|
+
"donut_chart": {
|
|
106
|
+
"description": "Pie chart with center removed",
|
|
107
|
+
"use_when": "Same as pie chart + want center text/metric",
|
|
108
|
+
"advantages": ["Can show total in center", "Slightly better than pie for comparing segments"],
|
|
109
|
+
"same_limitations": "Still limited to few segments"
|
|
110
|
+
},
|
|
111
|
+
"scatter_plot": {
|
|
112
|
+
"description": "Show relationship between two variables",
|
|
113
|
+
"use_when": ["Correlation analysis", "Outlier detection", "Two continuous variables"],
|
|
114
|
+
"best_practices": [
|
|
115
|
+
"Label axes clearly with units",
|
|
116
|
+
"Use consistent point size (unless bubble chart)",
|
|
117
|
+
"Show trend line if correlation exists",
|
|
118
|
+
"Highlight outliers or clusters",
|
|
119
|
+
"Add tooltips for point details"
|
|
120
|
+
],
|
|
121
|
+
"bubble_chart": "Scatter plot + size dimension (3 variables)",
|
|
122
|
+
"avoid": ["Too many points (> 500, consider heat map)", "Overlapping points without transparency"]
|
|
123
|
+
},
|
|
124
|
+
"area_chart": {
|
|
125
|
+
"description": "Line chart with filled area below",
|
|
126
|
+
"use_when": ["Show magnitude over time", "Cumulative totals"],
|
|
127
|
+
"types": {
|
|
128
|
+
"simple": "Single dataset",
|
|
129
|
+
"stacked": "Multiple datasets showing cumulative total",
|
|
130
|
+
"100_percent_stacked": "Show percentage composition over time"
|
|
131
|
+
},
|
|
132
|
+
"best_practices": [
|
|
133
|
+
"Use for showing volume/magnitude",
|
|
134
|
+
"Semi-transparent fills for multiple areas",
|
|
135
|
+
"Order stacks logically",
|
|
136
|
+
"Start y-axis at zero"
|
|
137
|
+
],
|
|
138
|
+
"avoid": "Too many stacked areas (hard to read)"
|
|
139
|
+
},
|
|
140
|
+
"heatmap": {
|
|
141
|
+
"description": "Show data density or values in matrix using color",
|
|
142
|
+
"use_when": ["Large datasets", "Matrix data", "Correlation matrices", "Time + category"],
|
|
143
|
+
"best_practices": [
|
|
144
|
+
"Use sequential color scale (light to dark)",
|
|
145
|
+
"Include legend/color scale",
|
|
146
|
+
"Label axes clearly",
|
|
147
|
+
"Consider adding values in cells",
|
|
148
|
+
"Use diverging colors for positive/negative"
|
|
149
|
+
],
|
|
150
|
+
"color_scales": {
|
|
151
|
+
"sequential": "Light to dark (0 to max)",
|
|
152
|
+
"diverging": "Two colors meeting at middle (negative to positive)",
|
|
153
|
+
"categorical": "Distinct colors (for categories)"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"histogram": {
|
|
157
|
+
"description": "Show distribution of continuous data",
|
|
158
|
+
"use_when": ["Understanding data distribution", "Frequency analysis"],
|
|
159
|
+
"bins": {
|
|
160
|
+
"too_few": "Loses detail",
|
|
161
|
+
"too_many": "Too noisy",
|
|
162
|
+
"rule_of_thumb": "√n bins (where n = data points) or Sturges' formula"
|
|
163
|
+
},
|
|
164
|
+
"best_practices": [
|
|
165
|
+
"No gaps between bars (continuous data)",
|
|
166
|
+
"Label x-axis with bin ranges",
|
|
167
|
+
"Show count or frequency on y-axis",
|
|
168
|
+
"Consider overlay of normal distribution curve"
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
"box_plot": {
|
|
172
|
+
"description": "Show distribution summary (quartiles, median, outliers)",
|
|
173
|
+
"use_when": ["Comparing distributions", "Showing spread and outliers", "Statistical analysis"],
|
|
174
|
+
"components": {
|
|
175
|
+
"box": "25th to 75th percentile (IQR)",
|
|
176
|
+
"line_in_box": "Median",
|
|
177
|
+
"whiskers": "Min/max within 1.5×IQR",
|
|
178
|
+
"points": "Outliers beyond whiskers"
|
|
179
|
+
},
|
|
180
|
+
"best_practices": [
|
|
181
|
+
"Explain box plot to general audience",
|
|
182
|
+
"Use for statistical audiences",
|
|
183
|
+
"Compare multiple distributions side-by-side",
|
|
184
|
+
"Label quartiles"
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
"treemap": {
|
|
188
|
+
"description": "Hierarchical data as nested rectangles",
|
|
189
|
+
"use_when": ["Hierarchical data", "Part-to-whole relationships", "Space-constrained dashboards"],
|
|
190
|
+
"best_practices": [
|
|
191
|
+
"Size rectangles by value",
|
|
192
|
+
"Use color for categories or secondary metric",
|
|
193
|
+
"Label largest rectangles only",
|
|
194
|
+
"Provide drill-down interaction",
|
|
195
|
+
"Sort by size within groups"
|
|
196
|
+
],
|
|
197
|
+
"avoid": ["Too many levels (> 3)", "Too many items at once"]
|
|
198
|
+
},
|
|
199
|
+
"gauge_chart": {
|
|
200
|
+
"description": "Show single value against scale",
|
|
201
|
+
"use_when": ["KPIs", "Progress toward goal", "Performance metrics"],
|
|
202
|
+
"types": ["Radial gauge", "Bullet chart (better alternative)"],
|
|
203
|
+
"best_practices": [
|
|
204
|
+
"Show target/goal clearly",
|
|
205
|
+
"Use color zones (red/yellow/green)",
|
|
206
|
+
"Include actual number",
|
|
207
|
+
"Consider bullet chart instead (more space-efficient)"
|
|
208
|
+
],
|
|
209
|
+
"avoid": "Using for data that doesn't have a goal"
|
|
210
|
+
},
|
|
211
|
+
"bullet_chart": {
|
|
212
|
+
"description": "Linear gauge (better than radial gauge)",
|
|
213
|
+
"use_when": "Same as gauge but more space-efficient",
|
|
214
|
+
"benefits": ["Takes less space", "Easier to compare multiple metrics", "Less decoration"],
|
|
215
|
+
"recommended_over": "Radial gauges"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"design_principles": {
|
|
219
|
+
"data_ink_ratio": {
|
|
220
|
+
"description": "Maximize data, minimize decoration",
|
|
221
|
+
"rule": "Data-ink ratio = Data ink / Total ink",
|
|
222
|
+
"maximize": "Remove chartjunk",
|
|
223
|
+
"chartjunk": ["Unnecessary gridlines", "3D effects", "Decorative fills", "Excessive labels"],
|
|
224
|
+
"keep": ["Axes", "Data points/lines", "Essential labels"]
|
|
225
|
+
},
|
|
226
|
+
"color_usage": {
|
|
227
|
+
"purposes": {
|
|
228
|
+
"categorical": "Distinguish categories (use distinct hues)",
|
|
229
|
+
"sequential": "Show order/magnitude (light to dark)",
|
|
230
|
+
"diverging": "Show positive/negative (two colors meeting at zero)"
|
|
231
|
+
},
|
|
232
|
+
"best_practices": [
|
|
233
|
+
"Limit to 5-7 colors for categories",
|
|
234
|
+
"Use colorblind-safe palettes",
|
|
235
|
+
"Don't rely on color alone (use patterns too)",
|
|
236
|
+
"Maintain sufficient contrast",
|
|
237
|
+
"Use consistent colors across dashboards",
|
|
238
|
+
"Label colors in legend"
|
|
239
|
+
],
|
|
240
|
+
"colorblind_safe_palettes": {
|
|
241
|
+
"use": "Blue/orange, blue/yellow, purple/green",
|
|
242
|
+
"avoid": "Red/green (most common colorblindness)",
|
|
243
|
+
"tools": ["ColorBrewer", "Viz Palette", "Adobe Color"]
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"typography": {
|
|
247
|
+
"axis_labels": "10-12px, medium weight",
|
|
248
|
+
"chart_title": "14-18px, bold",
|
|
249
|
+
"data_labels": "10-11px",
|
|
250
|
+
"legend": "10-12px",
|
|
251
|
+
"annotations": "10-12px, italic",
|
|
252
|
+
"hierarchy": "Title > axis labels > data labels",
|
|
253
|
+
"font": "Sans-serif for clarity"
|
|
254
|
+
},
|
|
255
|
+
"gridlines": {
|
|
256
|
+
"purpose": "Help read values",
|
|
257
|
+
"style": "Light gray, thin, subtle",
|
|
258
|
+
"horizontal": "Usually helpful (easier to read values)",
|
|
259
|
+
"vertical": "Often optional",
|
|
260
|
+
"avoid": "Dark, heavy gridlines that distract"
|
|
261
|
+
},
|
|
262
|
+
"whitespace": {
|
|
263
|
+
"importance": "Breathing room for comprehension",
|
|
264
|
+
"use": "Between charts, around titles, margins",
|
|
265
|
+
"avoid": "Cramming too much in small space"
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"accessibility": {
|
|
269
|
+
"wcag_compliance": {
|
|
270
|
+
"text_contrast": "4.5:1 for text, 3:1 for large text",
|
|
271
|
+
"color_contrast": "3:1 for UI elements (bars, lines)",
|
|
272
|
+
"non_text_content": "Provide text alternatives (alt text, data tables)",
|
|
273
|
+
"keyboard_navigation": "All interactive elements accessible via keyboard"
|
|
274
|
+
},
|
|
275
|
+
"color_considerations": {
|
|
276
|
+
"dont_rely_on_color": "Use patterns, shapes, labels in addition",
|
|
277
|
+
"colorblind_safe": "Test with colorblind simulators",
|
|
278
|
+
"sufficient_contrast": "Especially for text on colored backgrounds"
|
|
279
|
+
},
|
|
280
|
+
"alternative_text": {
|
|
281
|
+
"charts": "Describe chart type, data, and key insights",
|
|
282
|
+
"example": "alt='Line chart showing website traffic increasing from 10K to 50K visitors over 6 months, with peak in December'",
|
|
283
|
+
"detail_level": "Match to content importance"
|
|
284
|
+
},
|
|
285
|
+
"data_tables": {
|
|
286
|
+
"requirement": "Provide data table alternative for complex charts",
|
|
287
|
+
"format": "Accessible HTML table with headers",
|
|
288
|
+
"toggle": "Allow users to switch between chart and table view",
|
|
289
|
+
"example": "<table>\n <caption>Monthly Sales 2025</caption>\n <thead><tr><th>Month</th><th>Sales</th></tr></thead>\n <tbody><tr><td>Jan</td><td>$50K</td></tr></tbody>\n</table>"
|
|
290
|
+
},
|
|
291
|
+
"screen_reader_support": {
|
|
292
|
+
"aria_labels": "Descriptive labels for chart elements",
|
|
293
|
+
"live_regions": "Announce data updates",
|
|
294
|
+
"focus_management": "Logical tab order",
|
|
295
|
+
"sonification": "Consider audio representation (advanced)"
|
|
296
|
+
},
|
|
297
|
+
"keyboard_navigation": {
|
|
298
|
+
"interactive_elements": "All clickable elements keyboard accessible",
|
|
299
|
+
"tooltips": "Show on focus, not just hover",
|
|
300
|
+
"tab_order": "Logical order through chart elements",
|
|
301
|
+
"escape": "Close tooltips/modals with Escape key"
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
"interactive_features": {
|
|
305
|
+
"tooltips": {
|
|
306
|
+
"description": "Show details on hover/click",
|
|
307
|
+
"content": ["Data value", "Category/label", "Additional context"],
|
|
308
|
+
"timing": "Show immediately on hover, delay on hide (300ms)",
|
|
309
|
+
"position": "Near cursor but not covering data",
|
|
310
|
+
"mobile": "Show on tap, dismiss on tap outside or second tap"
|
|
311
|
+
},
|
|
312
|
+
"filtering": {
|
|
313
|
+
"description": "Allow users to filter displayed data",
|
|
314
|
+
"methods": ["Checkboxes", "Dropdowns", "Sliders for ranges"],
|
|
315
|
+
"feedback": "Show what's filtered, allow clear all",
|
|
316
|
+
"preserve": "Remember filters when navigating away"
|
|
317
|
+
},
|
|
318
|
+
"drill_down": {
|
|
319
|
+
"description": "Click to see more detail",
|
|
320
|
+
"use_when": "Hierarchical data, time series zoom",
|
|
321
|
+
"indicate": "Show cursor changes to pointer on hover",
|
|
322
|
+
"breadcrumbs": "Show current drill-down path",
|
|
323
|
+
"back": "Easy way to go back up hierarchy"
|
|
324
|
+
},
|
|
325
|
+
"zooming_panning": {
|
|
326
|
+
"description": "Zoom into detail, pan to explore",
|
|
327
|
+
"methods": ["Scroll to zoom", "Click-drag to select region", "Pan by dragging"],
|
|
328
|
+
"reset": "Provide reset/home button",
|
|
329
|
+
"mobile": "Pinch to zoom, drag to pan"
|
|
330
|
+
},
|
|
331
|
+
"highlighting": {
|
|
332
|
+
"description": "Emphasize related data",
|
|
333
|
+
"on_hover": "Dim other elements, brighten hovered",
|
|
334
|
+
"on_click": "Toggle selection, show details",
|
|
335
|
+
"linked_highlighting": "Highlight across multiple charts"
|
|
336
|
+
},
|
|
337
|
+
"animation": {
|
|
338
|
+
"use_when": ["Data transitions", "Showing change over time", "First render"],
|
|
339
|
+
"duration": "300-500ms for transitions",
|
|
340
|
+
"easing": "Ease-out for natural feel",
|
|
341
|
+
"avoid": ["Autoplay loops", "Excessive animation", "Ignoring prefers-reduced-motion"],
|
|
342
|
+
"accessibility": "Respect prefers-reduced-motion"
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
"dashboard_design": {
|
|
346
|
+
"layout": {
|
|
347
|
+
"f_pattern": "Most important chart top-left (where eyes go first)",
|
|
348
|
+
"z_pattern": "Secondary pattern for scanning",
|
|
349
|
+
"grid": "Use grid system for alignment",
|
|
350
|
+
"hierarchy": "Largest/most important charts prominent",
|
|
351
|
+
"whitespace": "Don't cram - leave breathing room"
|
|
352
|
+
},
|
|
353
|
+
"kpis": {
|
|
354
|
+
"placement": "Top of dashboard",
|
|
355
|
+
"format": "Large number + change indicator + sparkline",
|
|
356
|
+
"context": "Show trend, not just current value",
|
|
357
|
+
"comparison": "vs previous period, vs goal"
|
|
358
|
+
},
|
|
359
|
+
"chart_selection": {
|
|
360
|
+
"limit_types": "Use 2-3 chart types max per dashboard",
|
|
361
|
+
"consistency": "Same metrics use same chart type",
|
|
362
|
+
"right_chart": "Choose chart type appropriate for data"
|
|
363
|
+
},
|
|
364
|
+
"interactivity": {
|
|
365
|
+
"filtering": "Global filters affect all charts",
|
|
366
|
+
"drill_down": "Click charts to see details",
|
|
367
|
+
"linked_selection": "Select in one chart, highlight in others",
|
|
368
|
+
"export": "Allow exporting data/images"
|
|
369
|
+
},
|
|
370
|
+
"mobile": {
|
|
371
|
+
"responsive": "Stack charts vertically on small screens",
|
|
372
|
+
"simplify": "Show fewer charts, prioritize key metrics",
|
|
373
|
+
"touch_friendly": "Large touch targets for filters",
|
|
374
|
+
"scrolling": "Vertical scroll, avoid horizontal"
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
"performance": {
|
|
378
|
+
"large_datasets": {
|
|
379
|
+
"threshold": "> 1000 data points",
|
|
380
|
+
"strategies": {
|
|
381
|
+
"aggregation": "Group data (daily → weekly → monthly)",
|
|
382
|
+
"sampling": "Show representative sample",
|
|
383
|
+
"progressive_loading": "Load overview first, details on demand",
|
|
384
|
+
"virtualization": "Render only visible data points",
|
|
385
|
+
"server_side": "Aggregate on server, send summary"
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
"rendering": {
|
|
389
|
+
"svg": {
|
|
390
|
+
"pros": "Crisp at any size, accessible, manipulable",
|
|
391
|
+
"cons": "Slow with many elements (> 1000)",
|
|
392
|
+
"use_for": "< 1000 elements, interactivity needed"
|
|
393
|
+
},
|
|
394
|
+
"canvas": {
|
|
395
|
+
"pros": "Fast rendering, handle many elements",
|
|
396
|
+
"cons": "Not accessible, fixed resolution",
|
|
397
|
+
"use_for": "> 1000 elements, animation-heavy"
|
|
398
|
+
},
|
|
399
|
+
"webgl": {
|
|
400
|
+
"pros": "Extremely fast, hardware accelerated",
|
|
401
|
+
"cons": "Complex, accessibility challenges",
|
|
402
|
+
"use_for": "Very large datasets (> 100K points), 3D"
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
"optimization": [
|
|
406
|
+
"Debounce window resize events",
|
|
407
|
+
"Throttle real-time updates",
|
|
408
|
+
"Use requestAnimationFrame for animations",
|
|
409
|
+
"Lazy load charts below fold",
|
|
410
|
+
"Cache rendered charts",
|
|
411
|
+
"Simplify on mobile"
|
|
412
|
+
]
|
|
413
|
+
},
|
|
414
|
+
"libraries": {
|
|
415
|
+
"javascript": {
|
|
416
|
+
"d3js": {
|
|
417
|
+
"description": "Low-level, maximum flexibility",
|
|
418
|
+
"pros": ["Complete control", "Powerful", "Large community"],
|
|
419
|
+
"cons": ["Steep learning curve", "Verbose"],
|
|
420
|
+
"use_when": "Custom, complex visualizations"
|
|
421
|
+
},
|
|
422
|
+
"chartjs": {
|
|
423
|
+
"description": "Simple, clean charts",
|
|
424
|
+
"pros": ["Easy to use", "Good defaults", "Lightweight"],
|
|
425
|
+
"cons": ["Limited customization", "Canvas-based"],
|
|
426
|
+
"use_when": "Standard charts, quick implementation"
|
|
427
|
+
},
|
|
428
|
+
"plotly": {
|
|
429
|
+
"description": "Interactive, scientific charts",
|
|
430
|
+
"pros": ["Many chart types", "3D support", "Interactive"],
|
|
431
|
+
"cons": ["Large bundle size"],
|
|
432
|
+
"use_when": "Scientific/statistical visualization"
|
|
433
|
+
},
|
|
434
|
+
"echarts": {
|
|
435
|
+
"description": "Feature-rich, performant",
|
|
436
|
+
"pros": ["Many chart types", "Good performance", "Free"],
|
|
437
|
+
"cons": ["Documentation can be unclear"],
|
|
438
|
+
"use_when": "Complex dashboards, large datasets"
|
|
439
|
+
},
|
|
440
|
+
"highcharts": {
|
|
441
|
+
"description": "Commercial, polished",
|
|
442
|
+
"pros": ["Beautiful defaults", "Great docs", "Reliable"],
|
|
443
|
+
"cons": ["Commercial license", "Large size"],
|
|
444
|
+
"use_when": "Enterprise dashboards, non-commercial use"
|
|
445
|
+
},
|
|
446
|
+
"recharts": {
|
|
447
|
+
"description": "React components for charts",
|
|
448
|
+
"pros": ["React-friendly", "Declarative", "Customizable"],
|
|
449
|
+
"cons": ["React only"],
|
|
450
|
+
"use_when": "React applications"
|
|
451
|
+
},
|
|
452
|
+
"victory": {
|
|
453
|
+
"description": "React charts with React Native support",
|
|
454
|
+
"pros": ["React + React Native", "Modular"],
|
|
455
|
+
"cons": ["Can be verbose"],
|
|
456
|
+
"use_when": "React/React Native apps"
|
|
457
|
+
},
|
|
458
|
+
"visx": {
|
|
459
|
+
"description": "Low-level React + D3 components",
|
|
460
|
+
"pros": ["Flexibility of D3 + React", "Modular"],
|
|
461
|
+
"cons": ["More work than high-level libraries"],
|
|
462
|
+
"use_when": "Custom React visualizations"
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
"best_practices": [
|
|
467
|
+
"Choose appropriate chart type for your data",
|
|
468
|
+
"Start y-axis at zero for bar/column charts",
|
|
469
|
+
"Use color purposefully, not decoratively",
|
|
470
|
+
"Limit colors to 5-7 for categories",
|
|
471
|
+
"Provide alt text for all charts",
|
|
472
|
+
"Use colorblind-safe palettes",
|
|
473
|
+
"Label axes clearly with units",
|
|
474
|
+
"Keep it simple - remove chartjunk",
|
|
475
|
+
"Provide data table alternative",
|
|
476
|
+
"Make interactive elements keyboard accessible",
|
|
477
|
+
"Show data directly when possible (not just in tooltips)",
|
|
478
|
+
"Sort data logically (by value or naturally)",
|
|
479
|
+
"Use consistent colors across dashboard",
|
|
480
|
+
"Provide context (show trends, comparisons, goals)",
|
|
481
|
+
"Test with real data (not just examples)",
|
|
482
|
+
"Optimize for performance with large datasets",
|
|
483
|
+
"Design for mobile (responsive, touch-friendly)",
|
|
484
|
+
"Respect prefers-reduced-motion",
|
|
485
|
+
"Use meaningful titles and annotations",
|
|
486
|
+
"Show uncertainty when present (error bars, confidence intervals)"
|
|
487
|
+
],
|
|
488
|
+
"anti_patterns": [
|
|
489
|
+
"Using pie charts for many categories (> 6)",
|
|
490
|
+
"3D charts (distort perception)",
|
|
491
|
+
"Dual y-axes (confusing)",
|
|
492
|
+
"Truncated y-axis without clear indication",
|
|
493
|
+
"Red/green color scheme only (colorblindness)",
|
|
494
|
+
"Too many colors (> 10)",
|
|
495
|
+
"Relying on color alone",
|
|
496
|
+
"Missing axis labels or units",
|
|
497
|
+
"Chartjunk (unnecessary decoration)",
|
|
498
|
+
"Poor contrast",
|
|
499
|
+
"No alt text or table alternative",
|
|
500
|
+
"Not responsive on mobile",
|
|
501
|
+
"Autoplay animations that can't be stopped",
|
|
502
|
+
"Tiny text (< 10px)",
|
|
503
|
+
"Too many chart types in one dashboard",
|
|
504
|
+
"Cherry-picking data scales to exaggerate",
|
|
505
|
+
"Missing context (no benchmarks, comparisons)",
|
|
506
|
+
"Overcomplicating simple data",
|
|
507
|
+
"Using fancy chart types unnecessarily",
|
|
508
|
+
"Not testing with real data"
|
|
509
|
+
],
|
|
510
|
+
"storytelling": {
|
|
511
|
+
"principles": [
|
|
512
|
+
"Have a clear message/insight",
|
|
513
|
+
"Guide viewer's attention",
|
|
514
|
+
"Provide context (what does this number mean?)",
|
|
515
|
+
"Use annotations to highlight key points",
|
|
516
|
+
"Progressive disclosure (overview → details)",
|
|
517
|
+
"Compare to meaningful benchmarks"
|
|
518
|
+
],
|
|
519
|
+
"narrative_flow": {
|
|
520
|
+
"title": "Clear, descriptive title",
|
|
521
|
+
"subtitle": "Additional context if needed",
|
|
522
|
+
"chart": "Appropriate visualization",
|
|
523
|
+
"annotations": "Highlight key insights",
|
|
524
|
+
"caption": "Summarize takeaway"
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|