trae-starter 0.0.1

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.
Files changed (83) hide show
  1. package/README.md +45 -0
  2. package/bin/cli.js +33 -0
  3. package/package.json +25 -0
  4. package/public/app.js +263 -0
  5. package/public/index.html +123 -0
  6. package/server/api.js +181 -0
  7. package/server/index.js +38 -0
  8. package/templates/proto/.agents/skills/ui-ux-pro-max/SKILL.md +659 -0
  9. package/templates/proto/.agents/skills/ui-ux-pro-max/data/_sync_all.py +414 -0
  10. package/templates/proto/.agents/skills/ui-ux-pro-max/data/app-interface.csv +31 -0
  11. package/templates/proto/.agents/skills/ui-ux-pro-max/data/charts.csv +26 -0
  12. package/templates/proto/.agents/skills/ui-ux-pro-max/data/colors.csv +162 -0
  13. package/templates/proto/.agents/skills/ui-ux-pro-max/data/design.csv +1776 -0
  14. package/templates/proto/.agents/skills/ui-ux-pro-max/data/draft.csv +1779 -0
  15. package/templates/proto/.agents/skills/ui-ux-pro-max/data/google-fonts.csv +1924 -0
  16. package/templates/proto/.agents/skills/ui-ux-pro-max/data/icons.csv +106 -0
  17. package/templates/proto/.agents/skills/ui-ux-pro-max/data/landing.csv +35 -0
  18. package/templates/proto/.agents/skills/ui-ux-pro-max/data/products.csv +162 -0
  19. package/templates/proto/.agents/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  20. package/templates/proto/.agents/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  21. package/templates/proto/.agents/skills/ui-ux-pro-max/data/styles.csv +85 -0
  22. package/templates/proto/.agents/skills/ui-ux-pro-max/data/typography.csv +74 -0
  23. package/templates/proto/.agents/skills/ui-ux-pro-max/data/ui-reasoning.csv +162 -0
  24. package/templates/proto/.agents/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  25. package/templates/proto/.agents/skills/ui-ux-pro-max/scripts/core.py +247 -0
  26. package/templates/proto/.agents/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  27. package/templates/proto/.agents/skills/ui-ux-pro-max/scripts/search.py +114 -0
  28. package/templates/proto/.trae/skills/preview-manager/SKILL.md +37 -0
  29. package/templates/proto/.trae/skills/ui-ux-pro-max/SKILL.md +659 -0
  30. package/templates/proto/.trae/skills/ui-ux-pro-max/data/_sync_all.py +414 -0
  31. package/templates/proto/.trae/skills/ui-ux-pro-max/data/app-interface.csv +31 -0
  32. package/templates/proto/.trae/skills/ui-ux-pro-max/data/charts.csv +26 -0
  33. package/templates/proto/.trae/skills/ui-ux-pro-max/data/colors.csv +162 -0
  34. package/templates/proto/.trae/skills/ui-ux-pro-max/data/design.csv +1776 -0
  35. package/templates/proto/.trae/skills/ui-ux-pro-max/data/draft.csv +1779 -0
  36. package/templates/proto/.trae/skills/ui-ux-pro-max/data/google-fonts.csv +1924 -0
  37. package/templates/proto/.trae/skills/ui-ux-pro-max/data/icons.csv +106 -0
  38. package/templates/proto/.trae/skills/ui-ux-pro-max/data/landing.csv +35 -0
  39. package/templates/proto/.trae/skills/ui-ux-pro-max/data/products.csv +162 -0
  40. package/templates/proto/.trae/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  41. package/templates/proto/.trae/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  42. package/templates/proto/.trae/skills/ui-ux-pro-max/data/styles.csv +85 -0
  43. package/templates/proto/.trae/skills/ui-ux-pro-max/data/typography.csv +74 -0
  44. package/templates/proto/.trae/skills/ui-ux-pro-max/data/ui-reasoning.csv +162 -0
  45. package/templates/proto/.trae/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  46. package/templates/proto/.trae/skills/ui-ux-pro-max/scripts/core.py +247 -0
  47. package/templates/proto/.trae/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  48. package/templates/proto/.trae/skills/ui-ux-pro-max/scripts/search.py +114 -0
  49. package/templates/proto/README.md +77 -0
  50. package/templates/proto/agent.md +361 -0
  51. package/templates/proto/eslint.config.js +23 -0
  52. package/templates/proto/index.html +13 -0
  53. package/templates/proto/package.json +39 -0
  54. package/templates/proto/pnpm-lock.yaml +2401 -0
  55. package/templates/proto/postcss.config.js +6 -0
  56. package/templates/proto/public/favicon.svg +1 -0
  57. package/templates/proto/public/icons.svg +24 -0
  58. package/templates/proto/skills-lock.json +10 -0
  59. package/templates/proto/src/App.css +184 -0
  60. package/templates/proto/src/App.tsx +15 -0
  61. package/templates/proto/src/assets/hero.png +0 -0
  62. package/templates/proto/src/assets/react.svg +1 -0
  63. package/templates/proto/src/assets/vite.svg +1 -0
  64. package/templates/proto/src/components/ui/SampleButton/sampleButton.css +4 -0
  65. package/templates/proto/src/components/ui/SampleButton/sampleButton.tsx +14 -0
  66. package/templates/proto/src/data/mock/products.csv +4 -0
  67. package/templates/proto/src/data/mock/users.json +16 -0
  68. package/templates/proto/src/data/types.ts +17 -0
  69. package/templates/proto/src/index.css +64 -0
  70. package/templates/proto/src/main.tsx +13 -0
  71. package/templates/proto/src/pages/Demo/components/DemoHeader/demoHeader.tsx +20 -0
  72. package/templates/proto/src/pages/Demo/components/FeatureGrid/featureGrid.tsx +18 -0
  73. package/templates/proto/src/pages/Demo/index.tsx +29 -0
  74. package/templates/proto/src/pages/Home/components/FeatureCard/featureCard.tsx +15 -0
  75. package/templates/proto/src/pages/Home/components/HeroSection/heroSection.tsx +28 -0
  76. package/templates/proto/src/pages/Home/components/InteractiveControls/interactiveControls.tsx +27 -0
  77. package/templates/proto/src/pages/Home/index.tsx +39 -0
  78. package/templates/proto/src/utils/format.ts +7 -0
  79. package/templates/proto/tailwind.config.js +11 -0
  80. package/templates/proto/tsconfig.app.json +28 -0
  81. package/templates/proto/tsconfig.json +7 -0
  82. package/templates/proto/tsconfig.node.json +26 -0
  83. package/templates/proto/vite.config.ts +10 -0
@@ -0,0 +1,414 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Sync colors.csv and ui-reasoning.csv with the updated products.csv (161 entries).
4
+ - Remove deleted product types
5
+ - Rename mismatched entries
6
+ - Add new entries for missing product types
7
+ - Keep colors.csv aligned 1:1 with products.csv
8
+ - Renumber everything
9
+ """
10
+ import csv, os, json
11
+
12
+ BASE = os.path.dirname(os.path.abspath(__file__))
13
+
14
+ # ─── Color derivation helpers ────────────────────────────────────────────────
15
+ def h2r(h):
16
+ h = h.lstrip("#")
17
+ return tuple(int(h[i:i+2], 16) for i in (0, 2, 4))
18
+
19
+ def r2h(r, g, b):
20
+ return f"#{max(0,min(255,int(r))):02X}{max(0,min(255,int(g))):02X}{max(0,min(255,int(b))):02X}"
21
+
22
+ def lum(h):
23
+ r, g, b = [x/255.0 for x in h2r(h)]
24
+ r, g, b = [(x/12.92 if x<=0.03928 else ((x+0.055)/1.055)**2.4) for x in (r, g, b)]
25
+ return 0.2126*r + 0.7152*g + 0.0722*b
26
+
27
+ def is_dark(bg):
28
+ return lum(bg) < 0.18
29
+
30
+ def on_color(bg):
31
+ return "#FFFFFF" if lum(bg) < 0.4 else "#0F172A"
32
+
33
+ def blend(a, b, f=0.15):
34
+ ra, ga, ba = h2r(a)
35
+ rb, gb, bb = h2r(b)
36
+ return r2h(ra+(rb-ra)*f, ga+(gb-ga)*f, ba+(bb-ba)*f)
37
+
38
+ def shift(h, n):
39
+ r, g, b = h2r(h)
40
+ return r2h(r+n, g+n, b+n)
41
+
42
+ def derive_row(pt, pri, sec, acc, bg, notes=""):
43
+ """Generate full 16-token color row from 4 base colors."""
44
+ dark = is_dark(bg)
45
+ fg = "#FFFFFF" if dark else "#0F172A"
46
+ on_pri = on_color(pri)
47
+ on_sec = on_color(sec)
48
+ on_acc = on_color(acc)
49
+ card = shift(bg, 10) if dark else "#FFFFFF"
50
+ card_fg = "#FFFFFF" if dark else "#0F172A"
51
+ muted = blend(bg, pri, 0.08) if dark else blend("#FFFFFF", pri, 0.06)
52
+ muted_fg = "#94A3B8" if dark else "#64748B"
53
+ border = f"rgba(255,255,255,0.08)" if dark else blend("#FFFFFF", pri, 0.12)
54
+ destr = "#DC2626"
55
+ on_destr = "#FFFFFF"
56
+ ring = pri
57
+ return [pt, pri, on_pri, sec, on_sec, acc, on_acc, bg, fg, card, card_fg, muted, muted_fg, border, destr, on_destr, ring, notes]
58
+
59
+ # ─── Rename maps ─────────────────────────────────────────────────────────────
60
+ COLOR_RENAMES = {
61
+ "Quantum Computing": "Quantum Computing Interface",
62
+ "Biohacking / Longevity": "Biohacking / Longevity App",
63
+ "Autonomous Systems": "Autonomous Drone Fleet Manager",
64
+ "Generative AI Art": "Generative Art Platform",
65
+ "Spatial / Vision OS": "Spatial Computing OS / App",
66
+ "Climate Tech": "Sustainable Energy / Climate Tech",
67
+ }
68
+ UI_RENAMES = {
69
+ "Architecture/Interior": "Architecture / Interior",
70
+ "Autonomous Drone Fleet": "Autonomous Drone Fleet Manager",
71
+ "B2B SaaS Enterprise": "B2B Service",
72
+ "Biohacking/Longevity App": "Biohacking / Longevity App",
73
+ "Biotech/Life Sciences": "Biotech / Life Sciences",
74
+ "Developer Tool/IDE": "Developer Tool / IDE",
75
+ "Education": "Educational App",
76
+ "Fintech (Banking)": "Fintech/Crypto",
77
+ "Government/Public": "Government/Public Service",
78
+ "Home Services": "Home Services (Plumber/Electrician)",
79
+ "Micro-Credentials/Badges": "Micro-Credentials/Badges Platform",
80
+ "Music/Entertainment": "Music Streaming",
81
+ "Quantum Computing": "Quantum Computing Interface",
82
+ "Real Estate": "Real Estate/Property",
83
+ "Remote Work/Collaboration": "Remote Work/Collaboration Tool",
84
+ "Restaurant/Food": "Restaurant/Food Service",
85
+ "SaaS Dashboard": "Analytics Dashboard",
86
+ "Space Tech/Aerospace": "Space Tech / Aerospace",
87
+ "Spatial Computing OS": "Spatial Computing OS / App",
88
+ "Startup Landing": "Micro SaaS",
89
+ "Sustainable Energy/Climate": "Sustainable Energy / Climate Tech",
90
+ "Travel/Tourism": "Travel/Tourism Agency",
91
+ "Wellness/Mental Health": "Mental Health App",
92
+ }
93
+
94
+ REMOVE_TYPES = {
95
+ "Service Landing Page", "Sustainability/ESG Platform",
96
+ "Cleaning Service", "Coffee Shop",
97
+ "Consulting Firm", "Conference/Webinar Platform",
98
+ }
99
+
100
+ # ─── New color definitions: (primary, secondary, accent, bg, notes) ──────────
101
+ # Grouped by category for clarity. Each tuple generates a full 16-token row.
102
+ NEW_COLORS = {
103
+ # ── Old #97-#116 that never got colors ──
104
+ "Todo & Task Manager": ("#2563EB","#3B82F6","#059669","#F8FAFC","Functional blue + progress green"),
105
+ "Personal Finance Tracker": ("#1E40AF","#3B82F6","#059669","#0F172A","Trust blue + profit green on dark"),
106
+ "Chat & Messaging App": ("#2563EB","#6366F1","#059669","#FFFFFF","Messenger blue + online green"),
107
+ "Notes & Writing App": ("#78716C","#A8A29E","#D97706","#FFFBEB","Warm ink + amber accent on cream"),
108
+ "Habit Tracker": ("#D97706","#F59E0B","#059669","#FFFBEB","Streak amber + habit green"),
109
+ "Food Delivery / On-Demand": ("#EA580C","#F97316","#2563EB","#FFF7ED","Appetizing orange + trust blue"),
110
+ "Ride Hailing / Transportation":("#1E293B","#334155","#2563EB","#0F172A","Map dark + route blue"),
111
+ "Recipe & Cooking App": ("#9A3412","#C2410C","#059669","#FFFBEB","Warm terracotta + fresh green"),
112
+ "Meditation & Mindfulness": ("#7C3AED","#8B5CF6","#059669","#FAF5FF","Calm lavender + mindful green"),
113
+ "Weather App": ("#0284C7","#0EA5E9","#F59E0B","#F0F9FF","Sky blue + sun amber"),
114
+ "Diary & Journal App": ("#92400E","#A16207","#6366F1","#FFFBEB","Warm journal brown + ink violet"),
115
+ "CRM & Client Management": ("#2563EB","#3B82F6","#059669","#F8FAFC","Professional blue + deal green"),
116
+ "Inventory & Stock Management":("#334155","#475569","#059669","#F8FAFC","Industrial slate + stock green"),
117
+ "Flashcard & Study Tool": ("#7C3AED","#8B5CF6","#059669","#FAF5FF","Study purple + correct green"),
118
+ "Booking & Appointment App": ("#0284C7","#0EA5E9","#059669","#F0F9FF","Calendar blue + available green"),
119
+ "Invoice & Billing Tool": ("#1E3A5F","#2563EB","#059669","#F8FAFC","Navy professional + paid green"),
120
+ "Grocery & Shopping List": ("#059669","#10B981","#D97706","#ECFDF5","Fresh green + food amber"),
121
+ "Timer & Pomodoro": ("#DC2626","#EF4444","#059669","#0F172A","Focus red on dark + break green"),
122
+ "Parenting & Baby Tracker": ("#EC4899","#F472B6","#0284C7","#FDF2F8","Soft pink + trust blue"),
123
+ "Scanner & Document Manager": ("#1E293B","#334155","#2563EB","#F8FAFC","Document grey + scan blue"),
124
+ # ── A. Utility / Productivity ──
125
+ "Calendar & Scheduling App": ("#2563EB","#3B82F6","#059669","#F8FAFC","Calendar blue + event green"),
126
+ "Password Manager": ("#1E3A5F","#334155","#059669","#0F172A","Vault dark blue + secure green"),
127
+ "Expense Splitter / Bill Split":("#059669","#10B981","#DC2626","#F8FAFC","Balance green + owe red"),
128
+ "Voice Recorder & Memo": ("#DC2626","#EF4444","#2563EB","#FFFFFF","Recording red + waveform blue"),
129
+ "Bookmark & Read-Later": ("#D97706","#F59E0B","#2563EB","#FFFBEB","Warm amber + link blue"),
130
+ "Translator App": ("#2563EB","#0891B2","#EA580C","#F8FAFC","Global blue + teal + accent orange"),
131
+ "Calculator & Unit Converter": ("#EA580C","#F97316","#2563EB","#1C1917","Operation orange on dark"),
132
+ "Alarm & World Clock": ("#D97706","#F59E0B","#6366F1","#0F172A","Time amber + night indigo on dark"),
133
+ "File Manager & Transfer": ("#2563EB","#3B82F6","#D97706","#F8FAFC","Folder blue + file amber"),
134
+ "Email Client": ("#2563EB","#3B82F6","#DC2626","#FFFFFF","Inbox blue + priority red"),
135
+ # ── B. Games ──
136
+ "Casual Puzzle Game": ("#EC4899","#8B5CF6","#F59E0B","#FDF2F8","Cheerful pink + reward gold"),
137
+ "Trivia & Quiz Game": ("#2563EB","#7C3AED","#F59E0B","#EFF6FF","Quiz blue + gold leaderboard"),
138
+ "Card & Board Game": ("#15803D","#166534","#D97706","#0F172A","Felt green + gold on dark"),
139
+ "Idle & Clicker Game": ("#D97706","#F59E0B","#7C3AED","#FFFBEB","Coin gold + prestige purple"),
140
+ "Word & Crossword Game": ("#15803D","#059669","#D97706","#FFFFFF","Word green + letter amber"),
141
+ "Arcade & Retro Game": ("#DC2626","#2563EB","#22C55E","#0F172A","Neon red+blue on dark + score green"),
142
+ # ── C. Creator Tools ──
143
+ "Photo Editor & Filters": ("#7C3AED","#6366F1","#0891B2","#0F172A","Editor violet + filter cyan on dark"),
144
+ "Short Video Editor": ("#EC4899","#DB2777","#2563EB","#0F172A","Video pink on dark + timeline blue"),
145
+ "Drawing & Sketching Canvas": ("#7C3AED","#8B5CF6","#0891B2","#1C1917","Canvas purple + tool teal on dark"),
146
+ "Music Creation & Beat Maker": ("#7C3AED","#6366F1","#22C55E","#0F172A","Studio purple + waveform green on dark"),
147
+ "Meme & Sticker Maker": ("#EC4899","#F59E0B","#2563EB","#FFFFFF","Viral pink + comedy yellow + share blue"),
148
+ "AI Photo & Avatar Generator": ("#7C3AED","#6366F1","#EC4899","#FAF5FF","AI purple + generation pink"),
149
+ "Link-in-Bio Page Builder": ("#2563EB","#7C3AED","#EC4899","#FFFFFF","Brand blue + creator purple"),
150
+ # ── D. Personal Life ──
151
+ "Wardrobe & Outfit Planner": ("#BE185D","#EC4899","#D97706","#FDF2F8","Fashion rose + gold accent"),
152
+ "Plant Care Tracker": ("#15803D","#059669","#D97706","#F0FDF4","Nature green + sun yellow"),
153
+ "Book & Reading Tracker": ("#78716C","#92400E","#D97706","#FFFBEB","Book brown + page amber"),
154
+ "Couple & Relationship App": ("#BE185D","#EC4899","#DC2626","#FDF2F8","Romance rose + love red"),
155
+ "Family Calendar & Chores": ("#2563EB","#059669","#D97706","#F8FAFC","Family blue + chore green"),
156
+ "Mood Tracker": ("#7C3AED","#6366F1","#D97706","#FAF5FF","Mood purple + insight amber"),
157
+ "Gift & Wishlist": ("#DC2626","#D97706","#EC4899","#FFF1F2","Gift red + gold + surprise pink"),
158
+ # ── E. Health ──
159
+ "Running & Cycling GPS": ("#EA580C","#F97316","#059669","#0F172A","Energetic orange + pace green on dark"),
160
+ "Yoga & Stretching Guide": ("#6B7280","#78716C","#0891B2","#F5F5F0","Sage neutral + calm teal"),
161
+ "Sleep Tracker": ("#4338CA","#6366F1","#7C3AED","#0F172A","Night indigo + dream violet on dark"),
162
+ "Calorie & Nutrition Counter": ("#059669","#10B981","#EA580C","#ECFDF5","Healthy green + macro orange"),
163
+ "Period & Cycle Tracker": ("#BE185D","#EC4899","#7C3AED","#FDF2F8","Blush rose + fertility lavender"),
164
+ "Medication & Pill Reminder": ("#0284C7","#0891B2","#DC2626","#F0F9FF","Medical blue + alert red"),
165
+ "Water & Hydration Reminder": ("#0284C7","#06B6D4","#0891B2","#F0F9FF","Refreshing blue + water cyan"),
166
+ "Fasting & Intermittent Timer":("#6366F1","#4338CA","#059669","#0F172A","Fasting indigo on dark + eating green"),
167
+ # ── F. Social ──
168
+ "Anonymous Community / Confession":("#475569","#334155","#0891B2","#0F172A","Protective grey + subtle teal on dark"),
169
+ "Local Events & Discovery": ("#EA580C","#F97316","#2563EB","#FFF7ED","Event orange + map blue"),
170
+ "Study Together / Virtual Coworking":("#2563EB","#3B82F6","#059669","#F8FAFC","Focus blue + session green"),
171
+ # ── G. Education ──
172
+ "Coding Challenge & Practice": ("#22C55E","#059669","#D97706","#0F172A","Code green + difficulty amber on dark"),
173
+ "Kids Learning (ABC & Math)": ("#2563EB","#F59E0B","#EC4899","#EFF6FF","Learning blue + play yellow + fun pink"),
174
+ "Music Instrument Learning": ("#DC2626","#9A3412","#D97706","#FFFBEB","Musical red + warm amber"),
175
+ # ── H. Transport ──
176
+ "Parking Finder": ("#2563EB","#059669","#DC2626","#F0F9FF","Available blue/green + occupied red"),
177
+ "Public Transit Guide": ("#2563EB","#0891B2","#EA580C","#F8FAFC","Transit blue + line colors"),
178
+ "Road Trip Planner": ("#EA580C","#0891B2","#D97706","#FFF7ED","Adventure orange + map teal"),
179
+ # ── I. Safety & Lifestyle ──
180
+ "VPN & Privacy Tool": ("#1E3A5F","#334155","#22C55E","#0F172A","Shield dark + connected green"),
181
+ "Emergency SOS & Safety": ("#DC2626","#EF4444","#2563EB","#FFF1F2","Alert red + safety blue"),
182
+ "Wallpaper & Theme App": ("#7C3AED","#EC4899","#2563EB","#FAF5FF","Aesthetic purple + trending pink"),
183
+ "White Noise & Ambient Sound": ("#475569","#334155","#4338CA","#0F172A","Ambient grey + deep indigo on dark"),
184
+ "Home Decoration & Interior Design":("#78716C","#A8A29E","#D97706","#FAF5F2","Interior warm grey + gold accent"),
185
+ }
186
+
187
+ # ─── 1. REBUILD colors.csv ───────────────────────────────────────────────────
188
+ def rebuild_colors():
189
+ src = os.path.join(BASE, "colors.csv")
190
+ with open(src, newline="", encoding="utf-8") as f:
191
+ reader = csv.DictReader(f)
192
+ headers = reader.fieldnames
193
+ existing = list(reader)
194
+
195
+ # Build lookup: Product Type -> row data
196
+ color_map = {}
197
+ for row in existing:
198
+ pt = row.get("Product Type", "").strip()
199
+ if not pt:
200
+ continue
201
+ # Remove deleted types
202
+ if pt in REMOVE_TYPES:
203
+ print(f" [colors] REMOVE: {pt}")
204
+ continue
205
+ # Rename mismatched types
206
+ if pt in COLOR_RENAMES:
207
+ new_name = COLOR_RENAMES[pt]
208
+ print(f" [colors] RENAME: {pt} → {new_name}")
209
+ row["Product Type"] = new_name
210
+ pt = new_name
211
+ color_map[pt] = row
212
+
213
+ # Read products.csv to get the correct order
214
+ with open(os.path.join(BASE, "products.csv"), newline="", encoding="utf-8") as f:
215
+ products = list(csv.DictReader(f))
216
+
217
+ # Build final rows in products.csv order
218
+ final_rows = []
219
+ added = 0
220
+ for i, prod in enumerate(products, 1):
221
+ pt = prod["Product Type"]
222
+ if pt in color_map:
223
+ row = color_map[pt]
224
+ row["No"] = str(i)
225
+ final_rows.append(row)
226
+ elif pt in NEW_COLORS:
227
+ pri, sec, acc, bg, notes = NEW_COLORS[pt]
228
+ new_row = derive_row(pt, pri, sec, acc, bg, notes)
229
+ d = dict(zip(headers, [str(i)] + new_row))
230
+ final_rows.append(d)
231
+ added += 1
232
+ else:
233
+ print(f" [colors] WARNING: No color data for '{pt}' - using defaults")
234
+ new_row = derive_row(pt, "#2563EB", "#3B82F6", "#059669", "#F8FAFC", "Auto-generated default")
235
+ d = dict(zip(headers, [str(i)] + new_row))
236
+ final_rows.append(d)
237
+ added += 1
238
+
239
+ # Write
240
+ with open(src, "w", newline="", encoding="utf-8") as f:
241
+ writer = csv.DictWriter(f, fieldnames=headers)
242
+ writer.writeheader()
243
+ writer.writerows(final_rows)
244
+
245
+ product_count = len(products)
246
+ print(f"\n ✅ colors.csv: {len(final_rows)} rows ({product_count} products)")
247
+ print(f" Added: {added} new color rows")
248
+
249
+ # ─── 2. REBUILD ui-reasoning.csv ─────────────────────────────────────────────
250
+ def derive_ui_reasoning(prod):
251
+ """Generate ui-reasoning row from products.csv row."""
252
+ pt = prod["Product Type"]
253
+ style = prod.get("Primary Style Recommendation", "")
254
+ landing = prod.get("Landing Page Pattern", "")
255
+ color_focus = prod.get("Color Palette Focus", "")
256
+ considerations = prod.get("Key Considerations", "")
257
+ keywords = prod.get("Keywords", "")
258
+
259
+ # Typography mood derived from style
260
+ typo_map = {
261
+ "Minimalism": "Professional + Clean hierarchy",
262
+ "Glassmorphism": "Modern + Clear hierarchy",
263
+ "Brutalism": "Bold + Oversized + Monospace",
264
+ "Claymorphism": "Playful + Rounded + Friendly",
265
+ "Dark Mode": "High contrast + Light on dark",
266
+ "Neumorphism": "Subtle + Soft + Monochromatic",
267
+ "Flat Design": "Bold + Clean + Sans-serif",
268
+ "Vibrant": "Energetic + Bold + Large",
269
+ "Aurora": "Elegant + Gradient-friendly",
270
+ "AI-Native": "Conversational + Minimal chrome",
271
+ "Organic": "Warm + Humanist + Natural",
272
+ "Motion": "Dynamic + Hierarchy-shifting",
273
+ "Accessible": "Large + High contrast + Clear",
274
+ "Soft UI": "Modern + Accessible + Balanced",
275
+ "Trust": "Professional + Serif accents",
276
+ "Swiss": "Grid-based + Mathematical + Helvetica",
277
+ "3D": "Immersive + Spatial + Variable",
278
+ "Retro": "Nostalgic + Monospace + Neon",
279
+ "Cyberpunk": "Terminal + Monospace + Neon",
280
+ "Pixel": "Retro + Blocky + 8-bit",
281
+ }
282
+ typo_mood = "Professional + Clear hierarchy"
283
+ for key, val in typo_map.items():
284
+ if key.lower() in style.lower():
285
+ typo_mood = val
286
+ break
287
+
288
+ # Key effects from style
289
+ eff_map = {
290
+ "Glassmorphism": "Backdrop blur (10-20px) + Translucent overlays",
291
+ "Neumorphism": "Dual shadows (light+dark) + Soft press 150ms",
292
+ "Claymorphism": "Multi-layer shadows + Spring bounce + Soft press 200ms",
293
+ "Brutalism": "No transitions + Hard borders + Instant feedback",
294
+ "Dark Mode": "Subtle glow + Neon accents + High contrast",
295
+ "Flat Design": "Color shift hover + Fast 150ms transitions + No shadows",
296
+ "Minimalism": "Subtle hover 200ms + Smooth transitions + Clean",
297
+ "Motion-Driven": "Scroll animations + Parallax + Page transitions",
298
+ "Micro-interactions": "Haptic feedback + Small 50-100ms animations",
299
+ "Vibrant": "Large section gaps 48px+ + Color shift hover + Scroll-snap",
300
+ "Aurora": "Flowing gradients 8-12s + Color morphing",
301
+ "AI-Native": "Typing indicator + Streaming text + Context reveal",
302
+ "Organic": "Rounded 16-24px + Natural shadows + Flowing SVG",
303
+ "Soft UI": "Improved shadows + Modern 200-300ms + Focus visible",
304
+ "3D": "WebGL/Three.js + Parallax 3-5 layers + Physics 300-400ms",
305
+ "Trust": "Clear focus rings + Badge hover + Metric pulse",
306
+ "Accessible": "Focus rings 3-4px + ARIA + Reduced motion",
307
+ }
308
+ key_effects = "Subtle hover (200ms) + Smooth transitions"
309
+ for key, val in eff_map.items():
310
+ if key.lower() in style.lower():
311
+ key_effects = val
312
+ break
313
+
314
+ # Decision rules
315
+ rules = {}
316
+ if "dark" in style.lower() or "oled" in style.lower():
317
+ rules["if_light_mode_needed"] = "provide-theme-toggle"
318
+ if "glass" in style.lower():
319
+ rules["if_low_performance"] = "fallback-to-flat"
320
+ if "conversion" in landing.lower():
321
+ rules["if_conversion_focused"] = "add-urgency-colors"
322
+ if "social" in landing.lower():
323
+ rules["if_trust_needed"] = "add-testimonials"
324
+ if "data" in keywords.lower() or "dashboard" in keywords.lower():
325
+ rules["if_data_heavy"] = "prioritize-data-density"
326
+ if not rules:
327
+ rules["if_ux_focused"] = "prioritize-clarity"
328
+ rules["if_mobile"] = "optimize-touch-targets"
329
+
330
+ # Anti-patterns
331
+ anti_patterns = []
332
+ if "minimalism" in style.lower() or "minimal" in style.lower():
333
+ anti_patterns.append("Excessive decoration")
334
+ if "dark" in style.lower():
335
+ anti_patterns.append("Pure white backgrounds")
336
+ if "flat" in style.lower():
337
+ anti_patterns.append("Complex shadows + 3D effects")
338
+ if "vibrant" in style.lower():
339
+ anti_patterns.append("Muted colors + Low energy")
340
+ if "accessible" in style.lower():
341
+ anti_patterns.append("Color-only indicators")
342
+ if not anti_patterns:
343
+ anti_patterns = ["Inconsistent styling", "Poor contrast ratios"]
344
+ anti_str = " + ".join(anti_patterns[:2])
345
+
346
+ return {
347
+ "UI_Category": pt,
348
+ "Recommended_Pattern": landing,
349
+ "Style_Priority": style,
350
+ "Color_Mood": color_focus,
351
+ "Typography_Mood": typo_mood,
352
+ "Key_Effects": key_effects,
353
+ "Decision_Rules": json.dumps(rules),
354
+ "Anti_Patterns": anti_str,
355
+ "Severity": "HIGH"
356
+ }
357
+
358
+
359
+ def rebuild_ui_reasoning():
360
+ src = os.path.join(BASE, "ui-reasoning.csv")
361
+ with open(src, newline="", encoding="utf-8") as f:
362
+ reader = csv.DictReader(f)
363
+ headers = reader.fieldnames
364
+ existing = list(reader)
365
+
366
+ # Build lookup
367
+ ui_map = {}
368
+ for row in existing:
369
+ cat = row.get("UI_Category", "").strip()
370
+ if not cat:
371
+ continue
372
+ if cat in REMOVE_TYPES:
373
+ print(f" [ui-reason] REMOVE: {cat}")
374
+ continue
375
+ if cat in UI_RENAMES:
376
+ new_name = UI_RENAMES[cat]
377
+ print(f" [ui-reason] RENAME: {cat} → {new_name}")
378
+ row["UI_Category"] = new_name
379
+ cat = new_name
380
+ ui_map[cat] = row
381
+
382
+ with open(os.path.join(BASE, "products.csv"), newline="", encoding="utf-8") as f:
383
+ products = list(csv.DictReader(f))
384
+
385
+ final_rows = []
386
+ added = 0
387
+ for i, prod in enumerate(products, 1):
388
+ pt = prod["Product Type"]
389
+ if pt in ui_map:
390
+ row = ui_map[pt]
391
+ row["No"] = str(i)
392
+ final_rows.append(row)
393
+ else:
394
+ row = derive_ui_reasoning(prod)
395
+ row["No"] = str(i)
396
+ final_rows.append(row)
397
+ added += 1
398
+
399
+ with open(src, "w", newline="", encoding="utf-8") as f:
400
+ writer = csv.DictWriter(f, fieldnames=headers)
401
+ writer.writeheader()
402
+ writer.writerows(final_rows)
403
+
404
+ print(f"\n ✅ ui-reasoning.csv: {len(final_rows)} rows")
405
+ print(f" Added: {added} new reasoning rows")
406
+
407
+
408
+ # ─── MAIN ────────────────────────────────────────────────────────────────────
409
+ if __name__ == "__main__":
410
+ print("=== Rebuilding colors.csv ===")
411
+ rebuild_colors()
412
+ print("\n=== Rebuilding ui-reasoning.csv ===")
413
+ rebuild_ui_reasoning()
414
+ print("\n🎉 Done!")
@@ -0,0 +1,31 @@
1
+ No,Category,Issue,Keywords,Platform,Description,Do,Don't,Code Example Good,Code Example Bad,Severity
2
+ 1,Accessibility,Icon Button Labels,icon button accessibilityLabel,iOS/Android/React Native,Icon-only buttons must expose an accessible label,Set accessibilityLabel or label prop on icon buttons,Icon buttons without accessible names,"<Pressable accessibilityLabel=""Close""><XIcon /></Pressable>","<Pressable><XIcon /></Pressable>",Critical
3
+ 2,Accessibility,Form Control Labels,form input label accessibilityLabel,iOS/Android/React Native,All inputs must have a visible label and an accessibility label,Pair Text label with input and set accessibilityLabel,Inputs with placeholder only,"<View><Text>Email</Text><TextInput accessibilityLabel=""Email address"" /></View>","<TextInput placeholder=""Email"" /></View>",Critical
4
+ 3,Accessibility,Role & Traits,accessibilityRole accessibilityTraits,iOS/Android/React Native,Interactive elements must expose correct roles/traits,Use accessibilityRole/button/link/checkbox etc.,Rely on generic views with no roles,"<Pressable accessibilityRole=""button"">Submit</Pressable>","<View onTouchStart={submit}>Submit</View>",High
5
+ 4,Accessibility,Dynamic Updates,accessibilityLiveRegion announce,iOS/Android/React Native,Async status updates should be announced to screen readers,Use accessibilityLiveRegion or announceForAccessibility,Update text silently with no announcement,"<Text accessibilityLiveRegion=""polite"">{status}</Text>","<Text>{status}</Text>",Medium
6
+ 5,Accessibility,Decorative Icons,accessible={false} importantForAccessibility,iOS/Android/React Native,Decorative icons should be hidden from screen readers,Mark decorative icons as not accessible,Have screen reader read every icon,"<Icon accessible={false} importantForAccessibility=""no"" />","<Icon />",Medium
7
+ 6,Touch,Touch Target Size,touch 44x44 hitSlop,iOS/Android/React Native,Primary touch targets must be at least 44x44pt,Increase hitSlop or padding to meet minimum,Small icons with tiny touch area,"<Pressable hitSlop={10}><Icon /></Pressable>","<Pressable><Icon style={{ width: 16, height: 16 }} /></Pressable>",Critical
8
+ 7,Touch,Touch Spacing,touch spacing gap 8px,iOS/Android/React Native,Adjacent touch targets need enough spacing,Keep at least 8dp spacing between touchables,Cluster many buttons with no gap,"<View style={{ gap: 8 }}><Button ... /><Button ... /></View>","<View><Button ... /><Button ... /></View>",Medium
9
+ 8,Touch,Gesture Conflicts,scroll swipe back gesture,iOS/Android/React Native,Custom gestures must not break system scroll/back,Reserve horizontal swipes for carousels,Full-screen custom swipe conflicting with back,"HorizontalPager inside vertical ScrollView","PanResponder on full screen blocking back",High
10
+ 9,Navigation,Back Behavior,back handler navigation stack,iOS/Android/React Native,Back navigation should be predictable and preserve state,Use navigation.goBack and keep screen state,Reset stack or exit app unexpectedly,onPress={() => navigation.goBack()},"BackHandler.exitApp() on first press",Critical
11
+ 10,Navigation,Bottom Tabs,tab bar max items,iOS/Android/React Native,Bottom tab bar should have at most 5 primary items,Use 3–5 tabs and move extras to More/Settings,Overloaded tab bar with many icons,Home/Explore/Profile/Settings,"Home/Explore/Shop/Cart/Profile/Settings/More",Medium
12
+ 11,Navigation,Modal Escape,modal dismiss close affordance,iOS/Android/React Native,Modals/sheets must have clear close actions,Provide close button and swipe-down where platform expects,Trapping users in modal with no obvious exit,"<Modal><Button title=""Close"" onPress={onClose} /></Modal>","<Modal><View>{children}</View></Modal>",High
13
+ 12,State,Preserve Screen State,navigation preserve state,iOS/Android/React Native,Returning to a screen should restore its scroll and form state,Keep components mounted or persist state,Reset list scroll and form inputs on every visit,"<Tab.Navigator screenOptions={{ unmountOnBlur: false }}>","<Tab.Screen options={{ unmountOnBlur: true }} />",Medium
14
+ 13,Feedback,Loading Indicators,activity indicator skeleton,iOS/Android/React Native,Show visible feedback during network operations,Use ActivityIndicator or skeleton for >300ms operations,Leave button and screen frozen,"{loading ? <ActivityIndicator /> : <Button title=""Save"" />}", "<Button title=""Save"" onPress={submit} /> // no loading",High
15
+ 14,Feedback,Success Feedback,toast checkmark banner,iOS/Android/React Native,Confirm successful actions with brief feedback,Show toast/checkmark or banner,Complete actions silently with no confirmation,"showToast('Saved successfully')","// silently update state only",Medium
16
+ 15,Feedback,Error Feedback,inline error banner,iOS/Android/React Native,Show clear error messages near the problem,input-level error + summary banner,Only change border color with no explanation,"<TextInput ... /><Text style={{color:'red'}}>{error}</Text>","<TextInput style={{borderColor:'red'}} />",High
17
+ 16,Forms,Inline Validation,onBlur validation,iOS/Android/React Native,Validate inputs on blur or submit with clear messaging,Validate onBlur and onSubmit,Validate on every keystroke causing jank,"onBlur={() => validateEmail(value)}","onChangeText={v => validateEmail(v)} // every char",Medium
18
+ 17,Forms,Keyboard Type,keyboardType returnKeyType,iOS/Android/React Native,Use appropriate keyboardType and returnKeyType,Match email/tel/number/search types,Use default keyboard for all inputs,"<TextInput keyboardType=""email-address"" />","<TextInput keyboardType=""default"" />",Medium
19
+ 18,Forms,Auto Focus & Next,autoFocus blurOnSubmit onSubmitEditing,iOS/Android/React Native,Guide users through form fields with Next/Done flows,Use onSubmitEditing to focus next input,Force users to tap each field manually,"onSubmitEditing={() => nextRef.current?.focus()}","// no onSubmitEditing, manual tap only",Low
20
+ 19,Forms,Password Visibility,secureTextEntry toggle,iOS/Android/React Native,Allow toggling password visibility securely,Provide Show/Hide icon toggling secureTextEntry,Force users to type blind with no option,"<TextInput secureTextEntry={secure} /><Icon onPress={toggle} />","<TextInput secureTextEntry /> // no toggle",Medium
21
+ 20,Performance,Virtualize Long Lists,FlatList SectionList virtualization,iOS/Android/React Native,Use FlatList/SectionList for lists over ~50 items,Use keyExtractor and initialNumToRender appropriately,Render hundreds of items with ScrollView,"<FlatList data={items} renderItem={...} />","<ScrollView>{items.map(renderItem)}</ScrollView>",High
22
+ 21,Performance,Image Size & Cache,Image resize cache,iOS/Android/React Native,Use correctly sized and cached images,Use Image component with proper resizeMode and caching,Load full-resolution images everywhere,"<Image source={{uri}} resizeMode=""cover"" />","<Image source={require('4k.png')} /> // small avatar",Medium
23
+ 22,Performance,Debounce High-Freq Events,debounce scroll search,iOS/Android/React Native,Debounce scroll/search callbacks to avoid jank,Wrap handlers with debounce/throttle,Run heavy logic on every event,"onScroll={debouncedHandleScroll}","onScroll={handleScrollHeavy}",Medium
24
+ 23,Animation,Duration & Easing,animation duration easing,iOS/Android/React Native,Micro-interactions should be 150–300ms with native-like easing,Use ease-out for enter/ease-in for exit,Use long or linear animations for core UI,"Animated.timing(..., { duration: 200, easing: Easing.out(Easing.quad) })","Animated.timing(..., { duration: 800, easing: Easing.linear })",Medium
25
+ 24,Animation,Respect Reduced Motion,reduced motion accessibility,iOS/Android/React Native,Respect OS reduced-motion accessibility setting,Check reduceMotionEnabled and simplify animations,Ignore user motion preferences,"if (reduceMotionEnabled) skipAnimation()","Always run complex parallax animations",Critical
26
+ 25,Animation,Limited Continuous Motion,loop animation loader,iOS/Android/React Native,Reserve infinite animations for loaders and live data,Use looping only where necessary,Keep decorative elements looping forever,"Animated.loop(loaderAnim) for ActivityIndicator","Animated.loop(bounceAnim) on background icons",Medium
27
+ 26,Typography,Base Font Size,fontScale dynamic type,iOS/Android/React Native,Body text must be readable and support Dynamic Type,Use platform fontScale and at least 14–16pt base,Render critical text below 12pt,"<Text style={{ fontSize: 16 }}>Body</Text>","<Text style={{ fontSize: 10 }}>Body</Text>",High
28
+ 27,Typography,Dynamic Type Support,allowFontScaling adjustsFontSizeToFit,iOS/Android/React Native,Support system text scaling without breaking layout,Set allowFontScaling and test large text,Disable scaling on all text globally,"<Text allowFontScaling>{label}</Text>","<Text allowFontScaling={false}>{label}</Text>",High
29
+ 28,Safe Areas,Safe Area Insets,safe area insets notch gesture,iOS/Android/React Native,Content must not overlap notches/gesture bars,Wrap screens in SafeAreaView or apply insets,Place tappable content under system bars,"<SafeAreaView style={{ flex: 1 }}><Screen /></SafeAreaView>","<View style={{ flex: 1 }}><Screen /></View>",High
30
+ 29,Theming,Light/Dark Contrast,dark mode contrast tokens,iOS/Android/React Native,Ensure sufficient contrast in both light and dark themes,Use semantic tokens and test both themes,Reuse light-theme grays directly in dark mode,"colors.textPrimaryDark = '#F9FAFB'","colors.textPrimaryDark = '#9CA3AF' on '#111827'",High
31
+ 30,Anti-Pattern,No Gesture-Only Actions,gesture only hidden controls,iOS/Android/React Native,Don't rely solely on hidden gestures for core actions,Provide visible buttons in addition to gestures,Rely on swipe/shake only with no UI affordance,"Swipe to delete + visible Delete button","Only shake device to undo with no UI",Critical
@@ -0,0 +1,26 @@
1
+ No,Data Type,Keywords,Best Chart Type,Secondary Options,When to Use,When NOT to Use,Data Volume Threshold,Color Guidance,Accessibility Grade,Accessibility Notes,A11y Fallback,Library Recommendation,Interactive Level
2
+ 1,Trend Over Time,"trend, time-series, line, growth, timeline, progress",Line Chart,"Area Chart, Smooth Area","Data has a time axis; user needs to observe rise/fall trends or rate of change over a continuous period","Fewer than 4 data points (use stat card); more than 6 series (visual noise); no time dimension exists","<1000 pts: SVG; ≥1000 pts: Canvas + downsampling; >10000: aggregate to intervals","Primary: #0080FF. Multiple series: distinct colors + distinct line styles. Fill: 20% opacity",AA,"Differentiate series by line style (solid/dashed/dotted) not color alone. Add pattern overlays for colorblind users.","Dashed/dotted lines per series; togglable data table with timestamps and values","Chart.js, Recharts, ApexCharts",Hover + Zoom
3
+ 2,Compare Categories,"compare, categories, bar, comparison, ranking",Bar Chart (Horizontal or Vertical),"Column Chart, Grouped Bar","Comparing discrete categories by magnitude; ranking or ordering is the core insight; categories ≤ 15","Categories > 15 (use table or search); data has time dimension (use line); showing proportions (use waffle/stacked)","<20 categories: vertical bar; 20–50: horizontal bar; >50: paginated table","Each bar: distinct color. Grouped: same hue family. Always sort descending by value",AAA,"Value labels on each bar by default. Sort control for user reordering.","Value labels always visible; provide CSV export","Chart.js, Recharts, D3.js",Hover + Sort
4
+ 3,Part-to-Whole,"part-to-whole, pie, donut, percentage, proportion, share",Pie Chart or Donut,"Stacked Bar, Waffle Chart","≤5 categories; one dominant segment vs rest; emphasis on visual proportion over exact values","Categories > 5; slice differences < 5% (visually indistinguishable); user needs precise values; accessibility-first context","Max 6 slices; beyond that switch to stacked bar 100%","5–6 max colors. Contrasting palette. Largest slice at 12 o'clock. Always label slices with %",C,"Pie charts fail WCAG for colorblind users. Slices rely on color alone. Avoid as primary chart in a11y contexts.","Must provide stacked bar alternative + percentage data table as mandatory fallback","Chart.js, Recharts, D3.js",Hover + Drill
5
+ 4,Correlation / Distribution,"correlation, distribution, scatter, relationship, pattern, cluster",Scatter Plot or Bubble Chart,"Heat Map, Matrix","Exploring relationship between two continuous variables; identifying clusters or outliers in a dataset","Variables are categorical (use grouped bar); fewer than 20 points (patterns aren't meaningful); mobile-primary context","<500 pts: SVG; 500–5000: Canvas at 0.6–0.8 opacity; >5000: hexbin or aggregate first","Color axis: gradient (blue → red). Bubble size: relative to 3rd variable. Opacity: 0.6–0.8 to show density",B,"Provide data table alternative. Combine color + shape distinction for colorblind users.","Data table with correlation coefficient annotation; shape markers (circle/square/triangle) per group","D3.js, Plotly, Recharts",Hover + Brush
6
+ 5,Heatmap / Intensity,"heatmap, heat-map, intensity, density, matrix, calendar",Heat Map or Choropleth,"Grid Heat Map, Bubble Heat","Showing intensity/density across a 2D grid; time-based patterns (e.g., activity by hour × day)","Fewer than 20 cells (use bar); user needs to read exact values; colorblind users without pattern fallback","Up to 10,000 cells efficiently; beyond that aggregate; calendar heatmap: 365 cells max per SVG","Gradient: Cool (blue) to Hot (red). Divergent scale for ±data. Always include numeric color legend",B,"Pattern overlay for colorblind users. Numerical value on hover. Legend must include scale ticks.","Numerical overlay on hover; downloadable grid table with row/column labels","D3.js, Plotly, ApexCharts",Hover + Zoom
7
+ 6,Geographic Data,"geographic, map, location, region, geo, spatial, choropleth",Choropleth Map or Bubble Map,Geographic Heat Map,"Data has a regional/location dimension; spatial distribution is the core insight for the user","Regions have very different sizes making visual comparison misleading (use bar); mobile-primary context","<1000 regions: SVG; ≥1000: Canvas/WebGL (Deck.gl); global maps: tile-based rendering","Single color gradient per region group. Categorized colors for discrete types. Legend with clear scale breaks",B,"Include text labels for major regions. Provide keyboard navigation between regions.","Region text labels; sortable data table by region name and value; keyboard-navigable regions","D3.js, Mapbox, Leaflet",Pan + Zoom + Drill
8
+ 7,Funnel / Flow,"funnel, flow, conversion, drop-off, pipeline, stages",Funnel Chart or Sankey,Waterfall (for flows),"Sequential multi-stage process; showing conversion or drop-off rates between defined stages","Stages aren't sequential; values don't decrease monotonically (use bar); fewer than 3 stages","3–8 stages optimal; beyond 8 stages group minor steps into 'Other'","Stages: single color gradient (start → end). Show conversion % between each stage. Highlight biggest drop",AA,"Explicit conversion % as text per stage. Stage labels always visible. Linear list view as fallback.","Provide linear list view with stage name + count + drop-off %; keyboard traversal","D3.js, Recharts, Custom SVG",Hover + Drill
9
+ 8,Performance vs Target,"performance, target, kpi, gauge, goal, threshold, progress",Gauge Chart or Bullet Chart,"Dial, Thermometer","Single KPI measured against a defined target or threshold; dashboard summary context","No target or benchmark exists; comparing multiple KPIs at once (use bullet chart grid)","Single metric per gauge; for 3+ KPIs use bullet chart grid layout","Performance: Red → Yellow → Green gradient. Target: marker line. Threshold zones clearly differentiated",AA,"Always show numerical value + % of target as text beside chart. Never rely on color position alone.","Numerical value + % of target shown as visible text; ARIA live region for real-time updates","D3.js, ApexCharts, Custom SVG",Hover
10
+ 9,Time-Series Forecast,"forecast, prediction, confidence, band, projection, estimate",Line with Confidence Band,Ribbon Chart,"Historical data + model predictions; communicating uncertainty range to non-technical stakeholders","No historical baseline; prediction confidence is too low to be useful; audience is not data-literate","Keep historical window to 30–90 days for readability; forecast horizon ≤ 30% of visible x-axis range","Actual: solid line #0080FF. Forecast: dashed #FF9500. Confidence band: 15% opacity fill same hue",AA,"Toggle between actual-only and forecast views. Legend must distinguish lines beyond color (solid vs dashed).","Toggle actual/forecast independently; legend labels must include line-style description","Chart.js, ApexCharts, Plotly",Hover + Toggle
11
+ 10,Anomaly Detection,"anomaly, outlier, spike, alert, detection, monitoring, deviation",Line Chart with Highlights,Scatter with Alert,"Monitoring a time-series for outliers; alerting users to unexpected spikes or dips in operational data","Anomalies are predefined categories (use bar with highlight); real-time context without a pause control","Stream at ≤60fps with Canvas; batch: up to 10,000 pts; mark anomalies as a separate data layer","Normal: #0080FF solid line. Anomaly marker: #FF0000 circle + filled. Alert band: #FFF3CD background zone",AA,"Use shape marker (not color only) for anomaly points. Add text annotation per anomaly event.","Text alert annotation per anomaly; anomaly summary list panel alongside chart","D3.js, Plotly, ApexCharts",Hover + Alert
12
+ 11,Hierarchical / Nested Data,"hierarchy, nested, treemap, parent, children, breakdown, drill",Treemap,"Sunburst, Nested Donut, Icicle","Showing size relationships within a hierarchy; overview of proportional structure (e.g., budget breakdown)","Hierarchy depth > 3 levels (too complex to read); user needs to compare sibling values precisely","<200 nodes: SVG; 200–1000: Canvas; >1000: paginate or pre-filter before rendering","Parent nodes: distinct hues. Children: lighter shades of same hue. White separator borders: 2–3px",C,"Poor baseline accessibility. Always provide table alternative as primary view. Label all large areas.","Collapsible tree table as primary view; treemap as supplementary visual only","D3.js, Recharts, ApexCharts",Hover + Drilldown
13
+ 12,Flow / Process Data,"flow, process, sankey, distribution, source, target, transfer",Sankey Diagram,"Alluvial, Chord Diagram","Showing how quantities flow between nodes; multi-source multi-target distribution","Flow directions form loops (use network graph); fewer than 3 source-target pairs; mobile-primary context","<50 flows: SVG; ≥50: Canvas; >200 flows: aggregate minor flows into 'Other' node","Gradient from source to target color. Flow opacity: 0.4–0.6. Node labels always visible",C,"Structural flow charts cannot be conveyed by color alone. Provide flow table. Avoid on mobile.","Flow table (Source → Target → Value); keyboard-traversable node list with tab stops","D3.js (d3-sankey), Plotly",Hover + Drilldown
14
+ 13,Cumulative Changes,"waterfall, cumulative, variance, incremental, bridge, delta",Waterfall Chart,"Stacked Bar, Cascade","Showing how individual positive/negative components add up to a final total (e.g., P&L, budget variance)","Changes are not additive; more than 12 bars (readability breaks); audience expects a simple total","4–12 bars optimal; beyond 12 aggregate minor items into a single 'Other' bar","Increases: #4CAF50. Decreases: #F44336. Start total: #2196F3. End total: #0D47A1. Running total line: dashed",AA,"Color + directional arrow icon per bar (not color alone). Labels on every bar.","Table with running total column; directional arrow icons per row","ApexCharts, Highcharts, Plotly",Hover
15
+ 14,Multi-Variable Comparison,"radar, spider, multi-variable, attributes, dimensions, comparison",Radar / Spider Chart,"Parallel Coordinates, Grouped Bar","Comparing multiple entities across the same fixed set of attributes (e.g., product feature comparison)","Axes > 8 (unreadable); values need precise comparison (use grouped bar); audience unfamiliar with radar charts","2–3 datasets maximum per chart; 5–8 axes; beyond 8 axes switch to parallel coordinates","Single dataset: #0080FF at 20% fill. Multiple: distinct hues with 30% fill. Border: full opacity",B,"Limit axes to 5–8. Always provide grouped bar chart alternative for precise reading.","Grouped bar chart as mandatory alternative; include raw data table","Chart.js, Recharts, ApexCharts",Hover + Toggle
16
+ 15,Stock / Trading OHLC,"stock, trading, ohlc, candlestick, finance, price, volume",Candlestick Chart,"OHLC Bar, Heikin-Ashi","Financial time-series with Open/High/Low/Close data; trading or investment product context only","Non-financial audience; no OHLC data available (use line chart); accessibility-first context","Real-time: Canvas required. Historical: paginate by time range. Max 500 candles visible at once","Bullish: #26A69A. Bearish: #EF5350. Volume bars: 40% opacity below. Body fill vs hollow for OHLC style",B,"Provide OHLC data table. Colorblind: use fill vs outline pattern (bullish = filled, bearish = hollow).","OHLC data table with sortable columns; numeric summary panel (daily change %)","Lightweight Charts (TradingView), ApexCharts",Real-time + Hover + Zoom
17
+ 16,Relationship / Connection Data,"network, graph, nodes, edges, connections, relationships, force",Network Graph,"Hierarchical Tree, Adjacency Matrix","Mapping connections between entities; network topology or social graph exploration context","Node count > 500 without clustering pre-applied; user needs precise connection counts; mobile context","≤100 nodes: SVG; 101–500: Canvas; >500: must apply clustering/LOD before rendering","Node types: categorical colors. Edges: #90A4AE at 60% opacity. Highlight path: #F59E0B",D,"Fundamentally inaccessible without alternative. Never use as sole representation. Always provide list alternative.","Adjacency list table (Node A → Node B → Weight); hierarchical tree view when structure allows","D3.js (d3-force), Vis.js, Cytoscape.js",Drilldown + Hover + Drag
18
+ 17,Distribution / Statistical,"distribution, statistical, spread, median, outlier, quartile, boxplot",Box Plot,"Violin Plot, Beeswarm","Showing spread, median, and outliers of a dataset; comparing distributions across multiple groups","Fewer than 20 data points per group (distribution is not meaningful); audience unfamiliar with statistical charts","Any sample size; aggregated representation so rendering is ⚡ Excellent at any volume","Box fill: #BBDEFB. Border: #1976D2. Median line: #D32F2F bold. Outlier dots: #F44336",AA,"Include stats summary table. Annotate outlier count in chart subtitle.","Stats summary table (min / Q1 / median / Q3 / max / mean); outlier count annotation","Plotly, D3.js, Chart.js (plugin)",Hover
19
+ 18,Performance vs Target (Compact),"bullet, compact, kpi, dashboard, target, benchmark, range",Bullet Chart,"Gauge, Progress Bar","Dashboard with multiple KPIs side by side; space-constrained contexts where a gauge is too large","Single KPI with emphasis (use gauge); data has no defined target range; fewer than 3 KPIs","Ideal for 3–10 bullet charts in a grid; scales to any count efficiently","Qualitative ranges: #FFCDD2 / #FFF9C4 / #C8E6C9 (bad/ok/good). Performance bar: #1976D2. Target: black 3px marker",AAA,"All values always visible as text. Color ranges are labeled with text thresholds not color alone.","Numerical values always visible (not hover-only); color ranges labeled with threshold text","D3.js, Plotly, Custom SVG",Hover
20
+ 19,Proportional / Percentage,"waffle, percentage, proportion, progress, filled, grid",Waffle Chart,"Pictogram, Stacked Bar 100%","Showing what fraction of a whole is filled; percentage progress in a visually engaging and accessible format","More than 5 categories (use stacked bar); exact values matter over visual proportion; very tight space","10×10 grid standard (100 cells); for > 5 categories switch to stacked 100% bar","3–5 categories max. 2–3px gap between cells. Each category a distinct accessible color pair",AA,"Better than pie for accessibility. Percentage text label always visible. Each cell has aria-label.","Percentage text always visible; grid cells labeled with aria-label value; provide legend","D3.js, React-Waffle, Custom CSS Grid",Hover
21
+ 20,Hierarchical Proportional,"sunburst, hierarchy, nested, proportion, radial, circle",Sunburst Chart,"Treemap, Icicle, Circle Packing","Exploring nested proportions where both hierarchy and relative size matter (e.g., org spend breakdown)","More than 3 hierarchy levels (outer rings become unreadable); precision matters over overview; mobile","<100 nodes: SVG; 100–500: Canvas; >500: filter to top N before rendering","Center to outer: darker to lighter hue. Each level 15–20% lighter. Contrasting border between sectors",C,"Poor accessibility beyond 2 levels. Mandatory table alternative required for any production use.","Collapsible indented list with percentages; breadcrumb trail for current drill-down state","D3.js (d3-hierarchy), Recharts, ApexCharts",Drilldown + Hover
22
+ 21,Root Cause Analysis,"root cause, decomposition, tree, hierarchy, drill-down, ai-split, attribution",Decomposition Tree,"Decision Tree, Flow Chart","Decomposing a metric into contributing factors; AI-assisted analysis or BI drill-down scenarios","No clear parent-child causal relationship; audience expects a summary rather than exploration","Up to 5 levels deep; limit visible nodes to 20 per level for readability; lazy-load deeper levels","Positive impact nodes: #2563EB. Negative impact nodes: #EF4444. Neutral connectors: #94A3B8",AA,"Keyboard-navigable expand/collapse. Screen reader announces node value and % contribution.","Keyboard expand/collapse tree; screen reader announces node label + value + % impact","Power BI (native), React-Flow, Custom D3.js",Drill + Expand
23
+ 22,3D Spatial Data,"3d, spatial, immersive, terrain, molecular, volumetric, point-cloud",3D Scatter / Surface Plot,"Volumetric Rendering, Point Cloud","Scientific/engineering context where Z-axis carries essential info not expressible in 2D","2D projection conveys the same insight; mobile context; accessibility-required environments; standard business dashboards","WebGL required. Deck.gl: up to 1M points. Three.js: LOD required beyond 50,000 pts","Depth cues: lighting and shading. Z-axis: color gradient (cool → warm). Transparent overlapping: opacity 0.4",D,"3D spatial charts are fundamentally inaccessible. Must not be used as primary chart type in any product UI.","Mandatory 2D projection view + data table; do not use as primary chart type in product UI","Three.js, Deck.gl, Plotly 3D",Rotate + Zoom + VR
24
+ 23,Real-Time Streaming,"streaming, real-time, ticker, live, velocity, pulse, monitoring",Streaming Area Chart,"Ticker Tape, Moving Gauge","Live monitoring dashboards; IoT/ops data updating at ≥1 Hz; user needs current value at a glance","Update frequency < 1/min (use periodic-refresh line chart); flashing content without reduced-motion support","Canvas/WebGL required. Buffer last 60–300s of data. Downsample older data on scroll","Current pulse: #00FF00 (dark theme) or #0080FF (light theme). History: fading opacity. Grid: dark background",B,"Pause/resume control required. Current value as large visible text KPI. Respect prefers-reduced-motion.","Pause/resume button required; current value shown as large text KPI; prefers-reduced-motion: freeze animation","Smoothed D3.js, CanvasJS",Real-time + Pause + Zoom
25
+ 24,Sentiment / Emotion,"sentiment, emotion, nlp, opinion, feeling, text-analysis",Word Cloud with Sentiment,"Sentiment Arc, Radar Chart","NLP output visualization; exploratory analysis of text corpus sentiment; frequency-weighted keyword overview","Precise values matter (word size is inherently imprecise); screen-reader context; corpus < 50 items","50–5000 terms optimal. Beyond 5000: apply top-N filtering before render. Avoid on mobile","Positive: #22C55E. Negative: #EF4444. Neutral: #94A3B8. Word size maps to frequency",C,"Word clouds fail screen readers. Never use as sole output of NLP analysis. Always pair with list view.","Sortable list view by frequency with sentiment label column; word cloud as supplementary only","D3-cloud, Highcharts, Nivo",Hover + Filter
26
+ 25,Process Mining,"process, mining, variants, path, bottleneck, log, event",Process Map / Graph,"Directed Acyclic Graph (DAG), Petri Net","Analyzing event logs to visualize actual process flows; identifying bottlenecks and deviations in ops/product funnels","No event log data available; audience expects a static flowchart (use diagram tool); node count > 100 without pre-filtering","<30 nodes: SVG; 30–100: Canvas; >100: apply variant filtering (top 80% of cases) before rendering","Happy path: #10B981 thick line. Deviations: #F59E0B thin line. Bottleneck nodes: #EF4444 fill",B,"Complex graphs are hard to navigate. Provide path summary text. Highlight top 3 bottlenecks as annotations.","Path summary table (variant → frequency → avg duration); top 3 bottlenecks as text annotation panel","React-Flow, Cytoscape.js, Recharts",Drag + Node-Click