-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.html
101 lines (83 loc) · 3.9 KB
/
main.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE
html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=
"http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Linux (vers 25 March 2009), see www.w3.org" />
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title>以 D3.js 製作的臺灣人口互動統計圖及統計地圖</title>
<link type="text/css" rel= "stylesheet" href="d3.slider.css" />
<link type="text/css" rel= "stylesheet" href="main.css" />
<!-- script type='text/javascript' src= 'jquery.js'> </script>
<script type='text/javascript' src= 'div-switcher-jq.js'> </script -->
</head>
<body>
<div id="content">
<h1>以 D3.js 製作的臺灣人口互動統計圖及統計地圖</h1>
<p>有 「長條圖」、 「男女人口」、 「人口地圖」
三個分頁可以切換。 滑鼠滾輪可以縮放地圖。
主要顯示資訊為 「各階段年齡的人口佔該區總人口多少百分比」。
更多說明請見 <a href="https://github.com/ckhung/d3-stat-map">
程式碼下載區</a> 及 <a href="https://newtoypia.blogspot.tw/2015/11/d3js.html">
「抄程式學 d3.js」</a>。
<!-- a href="http://ckhung.github.com/d3-stat-map/index.zh_TW.html">
計畫首頁</a --> </p>
<p>This visualization of Taiwan population census is
my first serious d3.js exercise.
On the left you can choose the county. On the right
there are 3 tabs to show in different ways
the percentage of a range of population relative to
the total population of each district/town.
The age range is determined by the sliders.
Mouse scroll wheel can be used to zoom.
Code is <a href="https://github.com/ckhung/d3-stat-map">here</a>.
<h2>[年齡範圍]</h2>
<div class="control">
<div id="slider-age-span"></div>
<div id="slider-age-min"></div>
</div>
<p class="dummy-filler">
不知為什麼, 這裡如果留空, div-switcher 就會失效</p>
<div style="margin-bottom: 8px">
<select name="r" id="region-selection"></select>
從 <span id="text-age-min">20</span> 歲到
<span id="text-age-max">24</span> 歲人口
(年齡層範圍: <span id="text-age-span">5</span> 歲)
<div class="div-switch-wrapper">
<button class="div-switch" value="#bar-chart-panel">長條圖</button>
<button class="div-switch" value="#gender-plot-panel">男女人口</button>
<button class="div-switch active" value="#pop-map-panel">人口地圖</button>
</div>
</div>
<div id="bar-chart-panel" class="switchable-div">
<div id="bar-chart-proper">
<!--
<div class="entry"><div class="entry-text">臺中市霧峰區</div> <div class="entry-bar" style="width: 120px"> </div></div>
<div class="entry"><div class="entry-text">臺中市大里區</div> <div class="entry-bar" style="width: 180px"> </div></div>
<div class="entry"><div class="entry-text">臺中市太平區</div> <div class="entry-bar" style="width: 230px"> </div></div>
<div class="entry"><div class="entry-text">臺中市烏日區</div> <div class="entry-bar" style="width: 200px"> </div></div>
-->
</div>
</div>
<div id="gender-plot-panel" class="switchable-div">
<div id="gp-rsvg-wrapper" class="rsvg-container"> </div>
</div>
<div id="pop-map-panel" class= "switchable-div">
<div id="pm-rsvg-wrapper" class="rsvg-container"> </div>
</div>
<svg width="300px" height="300px"
xmlns="http://www.w3.org/2000/svg">
<text x="10" y="50" font-size="30">My SVG</text>
</svg>
</div>
<script type="text/javascript" src="d3.js"></script>
<script type="text/javascript" src="d3.slider.js"></script>
<script type="text/javascript" src="d3-legend.js"></script>
<script type="text/javascript" src="queue.js"></script>
<script type="text/javascript" src="div-switcher-d3.js"></script>
<script type="text/javascript" src="main.js"></script>
</body>
</html>