Spaces:
Running
Running
File size: 22,007 Bytes
0ffdb0a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | """
Generates the 'excellent' benchmark metadata JSON files for UICopilot's
Module 3b Benchmark Library (Pack 1).
These pair with the renamed PNGs produced by rename_benchmark_images.sh:
data/benchmarks/images/excellent/{category}/{id}.png
Covers 30 of the 32 target excellent images. Two are intentionally absent
(tables_004, metrics_002) because the source image set was missing
excellent_table_04.png and excellent_metrics_02.png — generate those two
images separately, then add matching JSON entries using this file as a
template.
Run: python scripts/generate_excellent_metadata.py
Output: data/benchmarks/images/excellent/{category}/{id}.json
"""
import json
import os
OUTPUT_ROOT = os.path.join(os.path.dirname(__file__), "..", "data", "benchmarks", "images", "excellent")
ENTRIES = [
# ---------------- DASHBOARDS (8) ----------------
{
"id": "dashboard_001", "category": "dashboards", "quality_score": 91,
"style": "minimal", "industry": "analytics", "theme": "light",
"layout": "sidebar", "complexity": "medium",
"components": ["sidebar", "line_chart", "kpi_metric"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 20, "radius": 8, "shadow": "light", "spacing_unit": 8},
"notes": ["Calm, single-color accent against a neutral palette", "Generous whitespace around the primary chart", "Sidebar nav clearly separated from content"]
},
{
"id": "dashboard_002", "category": "dashboards", "quality_score": 89,
"style": "minimal", "industry": "saas", "theme": "dark",
"layout": "sidebar", "complexity": "medium",
"components": ["sidebar", "line_chart", "kpi_metric"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 20, "radius": 10, "shadow": "none", "spacing_unit": 8},
"notes": ["Dark theme with sufficient contrast on key numbers", "Single donut chart given clear visual priority", "Consistent icon weight throughout sidebar"]
},
{
"id": "dashboard_003", "category": "dashboards", "quality_score": 93,
"style": "modern", "industry": "analytics", "theme": "light",
"layout": "topnav", "complexity": "medium",
"components": ["topbar", "bar_chart", "donut_chart", "kpi_metric"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "excellent", "density": "comfortable"},
"design_tokens": {"padding": 24, "radius": 12, "shadow": "light", "spacing_unit": 8},
"notes": ["Clear hierarchy between primary chart and supporting donut", "Bar chart uses a restrained two-color palette", "Section labels in consistent small-caps style"]
},
{
"id": "dashboard_004", "category": "dashboards", "quality_score": 90,
"style": "bold_minimal", "industry": "finance", "theme": "light",
"layout": "topnav", "complexity": "low",
"components": ["bar_chart", "kpi_metric"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "spacious"},
"design_tokens": {"padding": 24, "radius": 8, "shadow": "none", "spacing_unit": 8},
"notes": ["Purple accent used consistently for the single chart", "Single focal metric at top with no competing numbers", "Plenty of negative space framing the chart"]
},
{
"id": "dashboard_005", "category": "dashboards", "quality_score": 88,
"style": "minimal", "industry": "crm", "theme": "light",
"layout": "sidebar", "complexity": "medium",
"components": ["sidebar", "donut_chart", "kpi_metric"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 20, "radius": 10, "shadow": "light", "spacing_unit": 8},
"notes": ["Donut chart and metric numbers given equal balanced weight", "Sidebar icons all from a single consistent set", "Comfortable line-height on all label text"]
},
{
"id": "dashboard_006", "category": "dashboards", "quality_score": 92,
"style": "modern", "industry": "saas", "theme": "light",
"layout": "sidebar", "complexity": "low",
"components": ["sidebar", "line_chart"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "excellent", "density": "spacious"},
"design_tokens": {"padding": 24, "radius": 8, "shadow": "light", "spacing_unit": 8},
"notes": ["Single smooth area chart as the clear focal point", "Soft gradient fill used tastefully, not distractingly", "Sidebar kept visually quiet to not compete with the chart"]
},
{
"id": "dashboard_007", "category": "dashboards", "quality_score": 87,
"style": "minimal", "industry": "finance", "theme": "dark",
"layout": "sidebar", "complexity": "medium",
"components": ["sidebar", "bar_chart", "kpi_metric", "donut_chart"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 20, "radius": 10, "shadow": "none", "spacing_unit": 8},
"notes": ["Dark theme maintains good contrast on bars and labels", "Bar and donut charts share a consistent color system", "Sidebar nav items have generous vertical spacing"]
},
{
"id": "dashboard_008", "category": "dashboards", "quality_score": 90,
"style": "modern", "industry": "analytics", "theme": "light",
"layout": "sidebar", "complexity": "medium",
"components": ["sidebar", "line_chart", "donut_chart", "kpi_metric"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 20, "radius": 10, "shadow": "light", "spacing_unit": 8},
"notes": ["Clean grid alignment between chart panels", "Consistent green accent used for positive trend indicators", "Clear visual separation between sidebar and main content"]
},
# ---------------- CARDS (4) ----------------
{
"id": "cards_001", "category": "cards", "quality_score": 88,
"style": "minimal", "industry": "crm", "theme": "light",
"layout": "grid", "complexity": "low",
"components": ["card", "avatar"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 20, "radius": 12, "shadow": "light", "spacing_unit": 8},
"notes": ["Consistent avatar size and placement across cards", "Equal padding on all sides of each card", "Subtle shadow gives gentle depth without distraction"]
},
{
"id": "cards_002", "category": "cards", "quality_score": 86,
"style": "minimal", "industry": "saas", "theme": "light",
"layout": "grid", "complexity": "low",
"components": ["card", "avatar", "badge"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 20, "radius": 10, "shadow": "light", "spacing_unit": 8},
"notes": ["Status badges use a single consistent color system", "Card titles and metadata clearly differentiated by weight", "Comfortable spacing between stacked cards"]
},
{
"id": "cards_003", "category": "cards", "quality_score": 90,
"style": "modern", "industry": "finance", "theme": "light",
"layout": "grid", "complexity": "low",
"components": ["card", "kpi_metric"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "excellent", "density": "comfortable"},
"design_tokens": {"padding": 24, "radius": 14, "shadow": "light", "spacing_unit": 8},
"notes": ["Large KPI number given clear visual priority over label", "Trend indicator color and direction are unambiguous", "Generous internal padding keeps the card feeling uncluttered"]
},
{
"id": "cards_004", "category": "cards", "quality_score": 89,
"style": "minimal", "industry": "analytics", "theme": "light",
"layout": "grid", "complexity": "low",
"components": ["card", "sparkline"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 20, "radius": 10, "shadow": "light", "spacing_unit": 8},
"notes": ["Sparkline sits cleanly below the metric with clear separation", "Single accent color used consistently for the trend line", "Card corners and shadow match the rest of the design system"]
},
# ---------------- TABLES (3 — one image missing) ----------------
{
"id": "tables_001", "category": "tables", "quality_score": 87,
"style": "minimal", "industry": "generic", "theme": "light",
"layout": "full_width", "complexity": "medium",
"components": ["table", "badge"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 16, "radius": 8, "shadow": "none", "spacing_unit": 8},
"notes": ["Generous row height makes scanning easy", "Header row clearly distinguished by weight and color", "Status badges use a consistent, limited color palette"]
},
{
"id": "tables_002", "category": "tables", "quality_score": 85,
"style": "minimal", "industry": "crm", "theme": "light",
"layout": "full_width", "complexity": "medium",
"components": ["table", "avatar", "badge"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 16, "radius": 8, "shadow": "none", "spacing_unit": 8},
"notes": ["Consistent column alignment across all rows", "Subtle row separators without heavy borders", "Avatar and name pairing kept visually tidy"]
},
{
"id": "tables_003", "category": "tables", "quality_score": 88,
"style": "modern", "industry": "saas", "theme": "light",
"layout": "full_width", "complexity": "medium",
"components": ["table", "badge"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "excellent", "density": "comfortable"},
"design_tokens": {"padding": 16, "radius": 8, "shadow": "none", "spacing_unit": 8},
"notes": ["Clear visual hierarchy between header and data rows", "Numeric columns right-aligned for easy scanning", "Sort indicators on headers are unambiguous"]
},
# tables_004 intentionally omitted — source PNG not yet generated
# ---------------- FORMS (4) ----------------
{
"id": "forms_001", "category": "forms", "quality_score": 88,
"style": "minimal", "industry": "saas_login", "theme": "dark",
"layout": "single_column", "complexity": "low",
"components": ["form", "input", "button"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "spacious"},
"design_tokens": {"padding": 24, "radius": 8, "shadow": "none", "spacing_unit": 8},
"notes": ["Single primary CTA clearly distinguished from secondary links", "Comfortable spacing between label and input", "Dark theme maintains good contrast on input borders"]
},
{
"id": "forms_002", "category": "forms", "quality_score": 87,
"style": "minimal", "industry": "saas_signup", "theme": "light",
"layout": "single_column", "complexity": "low",
"components": ["form", "input", "button"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "spacious"},
"design_tokens": {"padding": 24, "radius": 8, "shadow": "none", "spacing_unit": 8},
"notes": ["Clear visual focus state implied by consistent input style", "Generous vertical rhythm between form fields", "Primary button full-width and unmistakably the next step"]
},
{
"id": "forms_003", "category": "forms", "quality_score": 86,
"style": "minimal", "industry": "fintech", "theme": "light",
"layout": "single_column", "complexity": "medium",
"components": ["form", "input", "button", "validation_icon"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 20, "radius": 8, "shadow": "none", "spacing_unit": 8},
"notes": ["Validation state shown clearly with both icon and color", "Field grouping (card number, expiry, CVC) logically arranged", "Consistent input height across the whole form"]
},
{
"id": "forms_004", "category": "forms", "quality_score": 89,
"style": "minimal", "industry": "saas", "theme": "light",
"layout": "single_column", "complexity": "low",
"components": ["form", "input", "button"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "spacious"},
"design_tokens": {"padding": 24, "radius": 8, "shadow": "none", "spacing_unit": 8},
"notes": ["Short, focused form with no unnecessary fields", "Clear single call-to-action with no competing buttons", "Comfortable whitespace around the entire form card"]
},
# ---------------- NAVIGATION (4) ----------------
{
"id": "navigation_001", "category": "navigation", "quality_score": 90,
"style": "minimal", "industry": "saas", "theme": "dark",
"layout": "sidebar", "complexity": "medium",
"components": ["sidebar", "nav_item"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 16, "radius": 8, "shadow": "none", "spacing_unit": 8},
"notes": ["Active nav item clearly highlighted with consistent treatment", "Icon and label alignment consistent down the whole list", "Comfortable spacing between nav groups"]
},
{
"id": "navigation_002", "category": "navigation", "quality_score": 88,
"style": "minimal", "industry": "project_management", "theme": "dark",
"layout": "sidebar", "complexity": "medium",
"components": ["sidebar", "nav_item"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 16, "radius": 6, "shadow": "none", "spacing_unit": 8},
"notes": ["Clean grouping between workspace switcher and nav items", "Single consistent icon weight throughout", "Subtle hover/active distinction without visual noise"]
},
{
"id": "navigation_003", "category": "navigation", "quality_score": 87,
"style": "minimal", "industry": "generic", "theme": "light",
"layout": "sidebar", "complexity": "low",
"components": ["sidebar", "nav_item"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "spacious"},
"design_tokens": {"padding": 16, "radius": 6, "shadow": "none", "spacing_unit": 8},
"notes": ["Minimal icon set with generous spacing between items", "Clear section divider between primary and secondary nav", "Comfortable touch/click target size on each item"]
},
{
"id": "navigation_004", "category": "navigation", "quality_score": 89,
"style": "minimal", "industry": "saas", "theme": "dark",
"layout": "topnav", "complexity": "low",
"components": ["topbar", "nav_item"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 16, "radius": 6, "shadow": "none", "spacing_unit": 8},
"notes": ["Top nav items evenly spaced with clear active state", "Workspace name and breadcrumb kept visually subordinate", "Consistent button style for the single primary action"]
},
# ---------------- CHARTS (4) ----------------
{
"id": "charts_001", "category": "charts", "quality_score": 88,
"style": "minimal", "industry": "analytics", "theme": "light",
"layout": "card", "complexity": "low",
"components": ["line_chart"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "spacious"},
"design_tokens": {"padding": 20, "radius": 10, "shadow": "light", "spacing_unit": 8},
"notes": ["Two clearly distinguishable line series with a legend", "Axis labels legible without crowding the plot area", "Restrained color palette appropriate for the data"]
},
{
"id": "charts_002", "category": "charts", "quality_score": 87,
"style": "minimal", "industry": "analytics", "theme": "light",
"layout": "card", "complexity": "low",
"components": ["bar_chart"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 20, "radius": 10, "shadow": "light", "spacing_unit": 8},
"notes": ["Bars evenly spaced with clear category labels", "Single consistent color used across all bars", "Gridlines subtle enough to not compete with the data"]
},
{
"id": "charts_003", "category": "charts", "quality_score": 90,
"style": "modern", "industry": "saas", "theme": "light",
"layout": "card", "complexity": "low",
"components": ["donut_chart"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "excellent", "density": "spacious"},
"design_tokens": {"padding": 24, "radius": 12, "shadow": "light", "spacing_unit": 8},
"notes": ["Clear legend with distinct, harmonious slice colors", "Center label gives the chart a clear focal point", "Generous surrounding whitespace"]
},
{
"id": "charts_004", "category": "charts", "quality_score": 86,
"style": "minimal", "industry": "finance", "theme": "light",
"layout": "card", "complexity": "low",
"components": ["bar_chart"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "comfortable"},
"design_tokens": {"padding": 20, "radius": 10, "shadow": "light", "spacing_unit": 8},
"notes": ["Single blue accent used consistently across all bars", "Clear axis title and units", "Comfortable spacing between bars avoids a cluttered look"]
},
# ---------------- METRICS (3 — one image missing) ----------------
{
"id": "metrics_001", "category": "metrics", "quality_score": 91,
"style": "minimal", "industry": "saas", "theme": "light",
"layout": "card", "complexity": "low",
"components": ["kpi_metric", "sparkline"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "spacious"},
"design_tokens": {"padding": 24, "radius": 12, "shadow": "light", "spacing_unit": 8},
"notes": ["Large, bold metric value with clear visual priority", "Trend percentage color-coded and unambiguous", "Comparison period clearly labeled for context"]
},
# metrics_002 intentionally omitted — source PNG not yet generated
{
"id": "metrics_003", "category": "metrics", "quality_score": 89,
"style": "minimal", "industry": "saas", "theme": "light",
"layout": "card", "complexity": "low",
"components": ["kpi_metric", "sparkline"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "good", "density": "spacious"},
"design_tokens": {"padding": 24, "radius": 12, "shadow": "light", "spacing_unit": 8},
"notes": ["Clean alignment between label, value, and trend indicator", "Sparkline color matches the trend direction", "Generous padding keeps the card feeling calm"]
},
{
"id": "metrics_004", "category": "metrics", "quality_score": 90,
"style": "minimal", "industry": "saas", "theme": "light",
"layout": "card", "complexity": "low",
"components": ["kpi_metric", "sparkline"],
"attributes": {"spacing": "excellent", "typography": "clear", "contrast": "excellent", "density": "spacious"},
"design_tokens": {"padding": 24, "radius": 12, "shadow": "light", "spacing_unit": 8},
"notes": ["Percentage metric formatted clearly with appropriate precision", "Consistent card styling matching the rest of the metrics row", "Trend arrow direction and color are unambiguous"]
},
]
def main():
count = 0
for entry in ENTRIES:
category = entry["category"]
entry_id = entry["id"]
out_dir = os.path.join(OUTPUT_ROOT, category)
os.makedirs(out_dir, exist_ok=True)
record = {
"id": entry_id,
"category": category,
"quality": "excellent",
"quality_score": entry["quality_score"],
"product": "AI-generated",
"style": entry["style"],
"industry": entry["industry"],
"framework": "unspecified",
"theme": entry["theme"],
"layout": entry["layout"],
"complexity": entry["complexity"],
"components": entry["components"],
"attributes": entry["attributes"],
"design_tokens": entry["design_tokens"],
"notes": entry["notes"],
}
out_path = os.path.join(out_dir, f"{entry_id}.json")
with open(out_path, "w") as f:
json.dump(record, f, indent=2)
f.write("\n")
count += 1
print(f"Generated {count} excellent/ metadata files under {OUTPUT_ROOT}")
print("Missing: tables_004, metrics_002 (source PNGs not yet generated)")
if __name__ == "__main__":
main()
|