Every shape, the styles, the script and the real data in one minified file. Countries are groups, regions are paths:
<svg id="peta-dunia" class="pd" viewBox="0 0 2000 978"
role="group" aria-roledescription="interactive map">
<g id="MYS" role="group" aria-label="Malaysia">
<path id="MY-01" aria-label="Johor" d="M1567.5 470.7l-.5.6…"/>
<path id="MY-10" aria-label="Selangor" d="M1557.4 460.1l.5 1.1…"/>
…
</g>
<script type="application/json" id="pd-data">…</script>
<script>/* 23 KB, no dependencies */</script>
</svg>
World Bank series for 217 economies and OpenDOSM figures for Malaysia’s 16 states, written by tools/fetch-data.mjs:
{ "sources": {
"dosm": { "name": "Department of Statistics Malaysia",
"licence": "CC BY 4.0" } },
"regions": {
"MY-10": { "charts": [
{ "type": "line", "title": "Population",
"unit": "people", "source": "dosm",
"start": 2000,
"values": [4188900, 4317500, … 7454200] },
{ "type": "bar", "title": "Population by group, 2026",
"labels": ["Malay", "Chinese", "Indian", …],
"values": [4080200, 1757100, 731500, …] } ] } } }
The brief’s sample: invented numbers for Selangor, France, São Paulo and California, marked as mock everywhere they show.
{ "mock": true,
"regions": {
"US-CA": { "charts": [
{ "type": "bar",
"title": "Support tickets by topic",
"unit": "tickets",
"labels": ["Billing", "Shipping", "Returns",
"Account", "Other"],
"values": [320, 510, 240, 130, 90] } ] },
"FRA": { … }, "BR-SP": { … }, "MY-10": { … } } }
Every ID on the map with its name and country, so you can key your own data without opening the SVG.
| id | name | country_id | has_data |
| MY-01 | Johor | MYS | region |
| MY-14 | Kuala Lumpur | MYS | region |
| MY-10 | Selangor | MYS | region |
| DE-BY | Bayern | DEU | country |
| FR-75 | Paris | FRA | country |
| ATA-00 | Antarctica | ATA | none |
The brief’s test, word for word: a blank page, the SVG, nothing else. Click any region and the chart appears, with a clean console.
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Peta Dunia: acceptance test</title>
<body style="margin:0">
<object data="peta-dunia.svg" type="image/svg+xml"
style="display:block;width:100%;height:100vh">
World map
</object>