This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
74 lines (69 loc) · 2.82 KB
/
index.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>World GDP Data Visualization</title>
<style>
body {background-color: white;}
h1 {color: black;}
label {font-size: 14px;}
#button-container {margin-bottom: 20px; margin-left: 390px; width: 215px; white-space: nowrap;}
.button {
cursor: pointer;
padding: 3px 8px;
margin-right: 5px;
background-color: #f0f0f0;
border: 1px solid #ddd;
border-radius: 5px;
display: inline-block;}
#annotation {
background-color: black;
color: white;
padding-top: 2px;
padding-bottom: 2px;
padding-left: 3px;
padding-right: 3px;
opacity: 0;
}
</style>
<meta charset="UTF-8">
<meta name="description" content="UIUC CS416 Narrative Visualization Project">
<meta name="keywords" content="UIUC, CS416, Data Visualization">
<meta name="author" content="Donghyun Lee">
</head>
<body>
<h1>World GDP Data Visualization</h1>
<div id="narration" width="1000" height="600">
<p>This graph shows the Global GDP trend from 1960 to 2021.</p>
<p><span style="color: steelblue">Blue</span> line: Global GDP in Billions of US Dollars.</p>
<p><span style="color: green">Green</span> line: annual changes from previous year in percentage.</p>
<p>Click on the button to see the GDP trend for each decade progressively.</p>
<p>Hover your mouse over the chart and right click to see more details.</p>
</div>
<div id="button-container">
<div class="button" onclick="revealData(1960, 1970)">1</div>
<div class="button" onclick="revealData(1960, 1980)">2</div>
<div class="button" onclick="revealData(1960, 1990)">3</div>
<div class="button" onclick="revealData(1960, 2000)">4</div>
<div class="button" onclick="revealData(1960, 2010)">5</div>
<div class="button" onclick="revealData(1960, 2021)">6</div>
</div>
<div id="chart">
<!-- SVG content will be added dynamically using JavaScript -->
<svg id="chart-container" width="1000" height="600"></svg>
<!-- Annotation will be added dynamically using JavaScript -->
<div id="annotation"></div>
</div>
<div>
<p>Thanks to <a href="https://www.macrotrends.net/countries/WLD/world/gdp-gross-domestic-product">macrotrends.net</a> for sharing data.</p>
<p>DISCLAIMER AND TERMS OF USE: HISTORICAL DATA IS PROVIDED "AS IS" AND SOLELY
FOR INFORMATIONAL PURPOSES - NOT FOR TRADING PURPOSES OR ADVICE.
NEITHER MACROTRENDS LLC NOR ANY OF OUR INFORMATION PROVIDERS WILL BE LIABLE
FOR ANY DAMAGES RELATING TO YOUR USE OF THE DATA PROVIDED.</p>
</div>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="script.js"></script>
<script>
setup();
</script>
</body>
</html>