Build a 100-Person Icon Array Demographic Infographic in One HTML File

You get a single HTML file that shows a fictional town as 100 SVG person icons, with tabs for commute, age and housing and an interactive legend that highlights each group.

The prompt

Prompt
Act as a senior data-visualization designer who writes clean, dependency-free front-end code.

Build "Riverbend in 100 People", a population infographic that shows a fictional town of 42,000 residents scaled down to 100 person icons. A 10 by 10 grid of SVG person icons is colored by segment, so every icon equals 1 percent. Include three category tabs, each summing to exactly 100: Getting to work (drive alone 38, bus or train 24, bike 14, walk 11, work from home 9, carpool 4), Age (under 18 22, 18-34 27, 35-54 26, 55-74 18, 75 and over 7) and Home (rent an apartment 41, own a house 36, rent a house 12, own a condo 8, other 3).

Rules:
- Tabs switch categories by click, tap, arrow keys or number keys 1-3; icons recolor in a short staggered wave, instant under prefers-reduced-motion.
- A legend lists each segment with a color swatch, label, percentage and a thin bar; hovering or tapping a legend row or an icon dims every other group.
- A callout card shows the highlighted group as a big number, "of 100 people" and one plain-language sentence.
- Use a warm off-white background, dark ink text and five or six muted, distinct segment colors with readable contrast.
- Two columns on wide screens, stacked below 760px; works from 360 to 1280px.
- Add proper tab roles, aria-pressed on legend buttons and a text summary for screen readers.

Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.

Example output

One HTML file. Save it and open it in any browser.Open full screen

Example: Riverbend in 100 People, an icon-array portrait of a fictional town.

A 10×10 grid of person icons turns survey percentages into people you can count. Switch between Getting to work, Age and Home with the tabs, arrow keys or keys 1–3, and watch the icons recolor in a wave. Hover or tap a legend row or any icon to spotlight that group; the callout card shows the count and a one-line takeaway. Tap again to clear.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Every category is given exact numbers that total 100, so the model never has to invent or rescale data and the grid always fills cleanly.
  • One icon equals one percent, a mapping non-technical readers grasp instantly without axes, scales or chart literacy.
  • Named interactions (tabs, legend highlight, callout) plus layout breakpoints leave little for the model to guess, so the first output is usable.

Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as riverbend.html and open it in any browser, or view it in the chat's preview or canvas panel. Swap in your own numbers as long as each category totals 100.

Common edits

  • Replace the town and the three categories with your own survey, team or customer data; keep each category summing to 100.
  • Change the palette to your brand colors, or swap the SVG person for an emoji such as 🧑 to give it a more playful look.

Prompt details

By
Prompts-GPT editors
Published

Did this prompt work?

Keep exploring

More in Infographics