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
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
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 like this
Build a Classroom Grade Distribution Infographic with Histogram and Quartiles
A single HTML file that turns an inline array of class scores into a histogram with mean and median markers, a box plot, stat cards and a plain-language summary.
Build a Gantt-Style Project Timeline Infographic with Milestones in Pure SVG
A single HTML file that draws a project Gantt chart in pure SVG, with progress bars, dependency arrows, milestone diamonds, a Today marker and hover tooltips.
Build a Year-over-Year Growth Infographic with Animated Counters and Sparklines
A single HTML file KPI infographic where year-over-year numbers count up once on view, each metric carries an inline SVG sparkline, and reduced-motion users see static final values.
Build an Accessible Market Share Donut Chart Infographic With Legend in HTML
A prompt that builds a single-file SVG donut chart of competitor market share, with a ranked legend, keyboard navigation, tap focus and an automatic Other bucket.
Build an Interactive Team Org Chart One-Pager with Contact Cards in HTML
Get a single HTML file with an expandable SVG org chart, department color coding, clickable contact cards and a search box that highlights matching people.
Build a 12-Week Fitness Progress Tracker Infographic in a Single HTML File
Generates a one-page fitness report with bodyweight and lift line charts, personal-record badges, a streak calendar and an instant kg/lb toggle, all from built-in sample data.