-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathselectvisualization.html
More file actions
180 lines (169 loc) · 5.15 KB
/
selectvisualization.html
File metadata and controls
180 lines (169 loc) · 5.15 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>Visualization Selector</TITLE>
<link rel="stylesheet" href="County_css.css" type="text/css">
<script type="text/javascript">
var sectors = ["Animal Production and Aquaculture",
"Crop Production",
"Financial Investment & Related Activity",
"Forestry and Logging",
"Furniture and Related Product Mfg",
"Hospitals",
"Insurance Carriers & Related Activities",
"Internet Publishing and Broadcasting",
"Motion Picture & Sound Recording Ind",
"Paper Manufacturing",
"Performing Arts and Spectator Sports",
"Petroleum & Coal Products Manufacturing",
"Telecommunications",
"Textile Mills"];
var counties = ["Alamance",
"Alexander",
"Alleghany",
"Anson",
"Ashe",
"Avery",
"Beaufort",
"Bertie",
"Bladen",
"Brunswick",
"Buncombe",
"Burke",
"Cabarrus",
"Caldwell",
"Camden",
"Carteret",
"Caswell",
"Catawba",
"Chatham",
"Cherokee",
"Chowan",
"Clay",
"Cleveland",
"Columbus",
"Craven",
"Cumberland",
"Currituck",
"Dare",
"Davidson",
"Davie",
"Duplin",
"Durham",
"Edgecombe",
"Forsyth",
"Franklin",
"Gaston",
"Gates",
"Graham",
"Granville",
"Greene",
"Guilford",
"Halifax",
"Harnett",
"Haywood",
"Henderson",
"Hertford",
"Hoke",
"Hyde",
"Iredell",
"Jackson",
"Johnston",
"Jones",
"Lee",
"Lenoir",
"Lincoln",
"Macon",
"Madison",
"Martin",
"McDowell",
"Mecklenburg",
"Mitchell",
"Montgomery",
"Moore",
"Nash",
"New Hanover",
"Northampton",
"Onslow",
"Orange",
"Pamlico",
"Pasquotank",
"Pender",
"Perquimans",
"Person",
"Pitt",
"Polk",
"Randolph",
"Richmond",
"Robeson",
"Rockingham",
"Rowan",
"Rutherford",
"Sampson",
"Scotland",
"Stanly",
"Stokes",
"Surry",
"Swain",
"Transylvania",
"Tyrrell",
"Union",
"Vance",
"Wake",
"Warren",
"Washington",
"Watauga",
"Wayne",
"Wilkes",
"Wilson",
"Yadkin",
"Yancey"];
function buildTables(){
var maxcol = 3;
var tableHTML = "<table align='center' valign='center'>";
for (var row=0; row<5; row++){
tableHTML += "<tr>";
for (var col=0; col<maxcol; col++){
tableHTML += "<td>";
if(row*maxcol+col < sectors.length)
tableHTML += "<button onclick=selectSector('" + (sectors[row*maxcol+col]).replace(/ /g, "_").replace("&","and") + "')>" + sectors[row*maxcol+col] + "</button>";
tableHTML += "</td>";
}
tableHTML += "</tr>";
}
tableHTML += "</table>";
document.getElementById("state_sectors").innerHTML = tableHTML;
maxcol = 8;
var tableHTML = "<table align='center' valign='center'>";
for (var row=0; row<13; row++){
tableHTML += "<tr>";
for (var col=0; col<maxcol; col++){
tableHTML += "<td>";
if(row*maxcol+col < counties.length)
tableHTML += "<button onclick=selectCounty('" + counties[row*maxcol+col] + "')>" + counties[row*maxcol+col] + "</button>";
tableHTML += "</td>";
}
tableHTML += "</tr>";
}
tableHTML += "</table>";
document.getElementById("county_selector").innerHTML = tableHTML;
}
function selectSector(sector){
//alert(sector);
var new_url = "stateemploymentdata.html?sector=" + sector;
window.location.assign(new_url);
}
function selectCounty(county){
//alert(county);
var new_url = "countyemploymentdata.html?county=" + county;
window.location.assign(new_url);
}
</script>
</HEAD>
<BODY onload="buildTables()">
<h2>Visualization 1: Pick a NAICS industry subsector to view statewide employment trends in NC</h2>
<div id="state_sectors"></div>
<h2>Visualization 2: Select a North Carolina county to view local employment trends</h2>
<div id="county_selector"></div>
</BODY>
</HTML>