-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypo.html
40 lines (38 loc) · 965 Bytes
/
typo.html
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
<head>
<meta charset="UTF-8" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Tangerine"
/>
</head>
<script src="https://cdn.jsdelivr.net/npm/d3@7"></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]"
charset="utf-8"
></script>
<script>
let geojson = "./world.json";
d3.json(geojson).then((data) => {
let svg = geoviz.create({ projection: "EqualEarth" });
svg.plot({ type: "outline" });
svg.plot({ type: "graticule", stroke: "white", strokeWidth: 0.4 });
svg.plot({
type: "typo",
data: data,
var: "region",
colors: "Set3",
tip: "$NAMEen ($region)",
leg_pos: [670, 300],
leg_title: "Continents",
alphabetical: true,
});
svg.header({
fontSize: 30,
text: "A Typo World Map",
fill: "#267A8A",
fontWeight: "bold",
fontFamily: "Tangerine",
});
document.body.appendChild(svg.render());
});
</script>