-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
379 lines (323 loc) · 15.9 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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Zack Gilbert's Life in Concert</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./leaflet-0.4.5.css"/>
<link rel="stylesheet" href="./bootstrap-custom.css">
<link rel="stylesheet" href="./concerts.css">
</head>
<body>
<div id="container" class="container-fluid">
<header>
<h1><span>Zack Gilbert's</span>Life in Concert*</h1>
<p>The following is a collection of most* of the music concerts I have attended in my life. It's been over 25 years since I started going to shows. Growing up, they were a way to escape the monotonous small town life. Heading into the big city with friends to listen to our music and see our bands was often the only thing we had to look forward to for weeks at a time. Going to concerts was an escape. The music scene was an opportunity for people with similar hopes and fears to come together and enjoy the most universal of experiences: Music.</p>
</header>
<hr/>
<h3 id="concert-range">Currently Viewing: <span>-</span></h3>
<div id="concert-charts">
<div id="concert-date-chart" class="chart">
</div>
</div>
<div class="row-fluid">
<div id="filters" class="span3">
<!--<h3>Filters</h3>-->
<h4>While Living In:</h4>
<ul class="inline">
<li><a href="javascript:reset(0);" class="badge badge-important">All Places</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(1998, 06, 1), new Date(2002, 7, 27)]]);" class="badge badge-info">Gloversville, NY</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2002, 7, 28), new Date(2008, 7, 28)]]);" class="badge badge-info">Rochester, NY</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2008, 7, 29), new Date(2023, 0, 1)]]);" class="badge badge-info">Chicago, IL</a></li>
</ul>
<h4>By Year:</h4>
<ul class="inline">
<li><a href="javascript:reset(0);" class="badge badge-important">All Time</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(1998, 06, 1), new Date(2002, 0, 1)]]);" class="badge badge-info">2001 & Before</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2001, 11, 31), new Date(2003, 0, 1)]]);" class="badge badge-info">2002</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2002, 11, 31), new Date(2004, 0, 1)]]);" class="badge badge-info">2003</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2003, 11, 31), new Date(2005, 0, 1)]]);" class="badge badge-info">2004</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2004, 11, 31), new Date(2006, 0, 1)]]);" class="badge badge-info">2005</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2005, 11, 31), new Date(2007, 0, 1)]]);" class="badge badge-info">2006</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2006, 11, 31), new Date(2008, 0, 1)]]);" class="badge badge-info">2007</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2007, 11, 31), new Date(2009, 0, 1)]]);" class="badge badge-info">2008</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2008, 11, 31), new Date(2010, 0, 1)]]);" class="badge badge-info">2009</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2009, 11, 31), new Date(2011, 0, 1)]]);" class="badge badge-info">2010</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2010, 11, 31), new Date(2012, 0, 1)]]);" class="badge badge-info">2011</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2011, 11, 31), new Date(2013, 0, 1)]]);" class="badge badge-info">2012</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2012, 11, 31), new Date(2014, 0, 1)]]);" class="badge badge-info">2013</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2013, 11, 31), new Date(2015, 0, 1)]]);" class="badge badge-info">2014</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2014, 11, 31), new Date(2016, 0, 1)]]);" class="badge badge-info">2015</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2015, 11, 31), new Date(2017, 0, 1)]]);" class="badge badge-info">2016</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2016, 11, 31), new Date(2018, 0, 1)]]);" class="badge badge-info">2017</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2017, 11, 31), new Date(2019, 0, 1)]]);" class="badge badge-info">2018</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2018, 11, 31), new Date(2020, 0, 1)]]);" class="badge badge-info">2019</a></li>
<li><a href="#" onclick="return filter(this, [[new Date(2021, 11, 31), new Date(2023, 0, 1)]]);" class="badge badge-info">2022</a></li>
</ul>
</div>
<div id="concert-map" class="span9"></div>
</div>
<hr/>
<div id="stats-container" class="row-fluid">
<div id="stats-bands" class="stats-widget span6">
<h3>Most Frequently Seen Bands</h3>
<dl>
<dt>New Found Glory</dt>
<dd>11</dd>
<dt>The Movielife</dt>
<dd>10</dd>
<dt>Kevin Devine</dt>
<dd>10</dd>
<dt>The Rocket Summer</dt>
<dd>10</dd>
<dt>Coheed And Cambria</dt>
<dd>9</dd>
</dl>
</div>
<div id="stats-venues" class="stats-widget span6">
<h3>Most Frequented Venues</h3>
<dl>
<dt>Metro</dt>
<dd>20</dd>
<dt>Water Street Music Hall</dt>
<dd>19</dd>
<dt>Schubas</dt>
<dd>14</dd>
<dt>Subterranean</dt>
<dd>11</dd>
<dt>Beat Kitchen</dt>
<dd>10</dd>
</dl>
</div>
</div>
<hr/>
<aside id="concert-totals" class="pull-right"><span id="concert-active">-</span> of <span id="concert-total">-</span> concerts showing.</aside>
<div class="pull-left">
<input type="text" id="concert-filter" class="filter form-control" placeholder="Search"> <span id="concert-filter-clear" style="display: none;"><a href="javascript:void(0);" onclick="$('#concert-filter').val(''); $('#concert-filter').trigger('keyup'); return false;">(clear)</a></span>
</div>
<div id="concert-lists">
<table id="concert-list" class="filterable list table table-striped table-bordered">
<tbody></tbody>
</table>
</div>
<div id="disclaimer">
<p>* Due to a computer hard drive failure in 2007, a large chunk of shows were lost. I have done my best, thanks to the help of countless friends, to put the list back together, but am no doubt missing a few. If you have any information about shows I might have attended or any corrections to the existing list, please don't hesitate to <a href="http://twitter.com/zackgilbert">notify me</a>.</p>
</div>
</div>
<footer>
© 2013-2023 <a href="http://www.zackgilbert.com/">ZackGilbert.com</a> // <a href="http://twitter.com/zackgilbert">@zackgilbert</a> // Made with ♥ in Chicago.
</footer>
<script src="./jquery-1.9.1.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox.js/v1.0.2/mapbox.js"></script>
<script src="./leaflet.markercluster-src.js"></script>
<script src="https://square.github.io/crossfilter/crossfilter.v1.min.js"></script>
<script src="https://square.github.io/crossfilter/d3.v3.min.js"></script>
<script src="./jquery.csv.min.js"></script>
<script src="./barchart.js"></script>
<script>
var cloudmadeUrl = 'https://{s}.tile.osm.org/{z}/{x}/{y}.png',
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 14, minZoom: 2, attribution: ''}),
latlng = new L.LatLng(45.0,-70.65);
var map = new L.Map('concert-map', {center: latlng, layers: [cloudmade]});
map.scrollWheelZoom.disable();
//var map = new L.mapbox.map('concert-map', 'zackgilbert.map-r14wp1gn').addControl(L.mapbox.geocoderControl('zackgilbert.map-r14wp1gn'));
var markers = new L.MarkerClusterGroup({ maxClusterRadius: 40, showCoverageOnHover: false, spiderfyOnMaxZoom: true });
var markersArray = [];
// Various formatters.
var formatMonth = d3.time.format.utc("%B, %Y"),
formatNumber = d3.format(",d"),
formatDate = d3.time.format.utc("%B %d, %Y");
var list, chart, concert, all, day, days, month, months, venue, venues;
$.get('concerts.csv', function(data) {
concerts = $.csv.toObjects(data);
// A little coercion, since the CSV is untyped.
concerts.forEach(function(d, i) {
d.index = i;
d.date = parseDate(d['date']);
d.title = d['title'].replace(''', "'").replace(/&/g, '&');
d.bands = d['bands'].replace(''', "'").replace(/&/g, '&').split("---");
d.venue = d['venue'].replace(''', "'").replace(/&/g, '&');
d.lat = d['lat'];
d.lng = d['lng'];
});
// Create the crossfilter for the relevant dimensions and groups.
concert = crossfilter(concerts),
all = concert.groupAll(),
day = concert.dimension(function(d) { return d.date }),
days = day.group(),
month = concert.dimension(function(d) { return d3.time.month(d.date) }),
months = month.group(),
venue = concert.dimension(function(d) { return d.venue; }),
venues = venue.group(),
search = concert.dimension(function(d) { return d.venue + "---" + d.title + "---" + d.bands.join("---"); });
var firstDate = new Date(concerts[0].date);
firstDate.setMonth(firstDate.getMonth()-1);
firstDate.setDate(27);
var lastDate = new Date(concerts[concerts.length-1].date);
lastDate.setYear(lastDate.getFullYear()+1);
lastDate.setMonth(0);
lastDate.setDate(1);
charts = [
barChart()
.dimension(month)
.group(months)
//.round(d3.time.month.round)
.x(d3.time.scale()
.domain([firstDate, lastDate])
.rangeRound([0, 10 * 93]))
//.filter([concerts[0].date, concerts[concerts.length-1].date])
];
// Given our array of charts, which we assume are in the same order as the
// .chart elements in the DOM, bind the charts to the DOM and render them.
// We also listen to the chart's brush events to update the display.
chart = d3.selectAll(".chart")
.data(charts)
.each(function(chart) {
chart.on("brush", renderAll)
.on("brushend", function() { $('#filters ul li a').removeClass('badge-important').addClass('badge-info'); renderAll(); });
});
// Render the initial lists.
list = d3.selectAll(".list")
.data([concertList]);
// Render the total.
d3.selectAll("#concert-total")
.text(formatNumber(concert.size()));
renderAll();
map.addLayer(markers);
});
// Renders the specified chart or list.
function render(method) {
d3.select(this).call(method);
}
// Whenever the brush moves, re-rendering everything.
function renderAll() {
chart.each(render);
list.each(render);
setRange();
}
// Like d3.time.format, but faster.
function parseDate(d) {
return new Date(d);
}
function setRange() {
//console.log(charts[0].extent());
//console.log(charts[0].x().domain());
var selected = charts[0].extent(),
total = charts[0].x().domain();
if ((selected[0].getMonth() == 11) && (selected[0].getDate() == 31) &&
(selected[1].getMonth() == 0) && (selected[1].getDate() == 1)) {
$('#concert-range span').html(selected[0].getFullYear()+1);
} else if (formatDate(selected[0]) == formatDate(selected[1])) {
$('#concert-range span').html(formatDate(selected[0]) + " to " + formatDate(total[1]));
} else {
$('#concert-range span').html(formatDate(selected[0]) + " to " + formatDate(selected[1]));
}
}
window.filter = function(elm, filters) {
$('#filters ul li a').removeClass('badge-important').addClass('badge-info');
$(elm).removeClass('badge-info').addClass('badge-important');
filters.forEach(function(d, i) {
charts[i].filter(d);
});
renderAll();
return false;
};
window.reset = function(i) {
$('#filters ul li a').removeClass('badge-important').addClass('badge-info');
$('#filters ul li:first-child a').removeClass('badge-info').addClass('badge-important');
charts[i].filter(null);
renderAll();
};
$('.filter').on('keyup', function(e) {
var query = this.value.toLowerCase();
search.filter(function(d) {
if ( (query == '') || d.toLowerCase().indexOf(query.toLowerCase()) > -1 ) {
return d;
}
});
if ( query === '' ) {
$('#concert-filter-clear').hide();
} else {
$('#concert-filter-clear').show();
}
renderAll();
});
function concertList(div) {
var filteredConcerts = day.top(Infinity);
d3.select("#concert-active").text(formatNumber(filteredConcerts.length));
div.each(function() {
var concert = d3.select(this).select('tbody').selectAll(".concert")
.data(filteredConcerts, function(d) { return d.index; });
var concertEnter = concert.enter().append("tr")
.attr("class", "concert");
concertEnter.append("td")
.attr("class", "date")
.text(function(d) { return formatDate(d.date); });
concertEnter.append("td")
.attr("class", "bands")
.html(function(d) { return (d.title != d.bands.join(', ')) ? d.title + ': ' + linkify(d.bands) : linkify(d.bands); });
concertEnter.append("td")
.attr("class", "venue")
.html(function(d) { return linkify([d.venue]); });
concert.exit().remove();
concert.order();
});
var bands = {};
markers.removeLayers(markersArray);
for (var i = 0; i < filteredConcerts.length; i++) {
for (var j = 0; j < filteredConcerts[i].bands.length; j++) {
bands[filteredConcerts[i].bands[j]] = (bands[filteredConcerts[i].bands[j]]) ? bands[filteredConcerts[i].bands[j]] + 1 : 1;
}
var title = formatDate(filteredConcerts[i].date) + ' - ' + filteredConcerts[i].venue + "\n";
var titleFormatted = '<b>' + formatDate(filteredConcerts[i].date) + '</b> - ' + filteredConcerts[i].venue + '<br/>';
if (filteredConcerts[i].title != filteredConcerts[i].bands.join(', ')) {
title += filteredConcerts[i].title + ': ';
titleFormatted += filteredConcerts[i].title + ': ';
}
titleFormatted += linkify(filteredConcerts[i].bands);
title += filteredConcerts[i].bands.join(', ');
var marker = L.marker(new L.LatLng(filteredConcerts[i].lat, filteredConcerts[i].lng), {
icon: L.mapbox.marker.icon({'marker-symbol': 'star', 'marker-color': '5b8dd3'}),
title: title
});
marker.bindPopup(titleFormatted);
markersArray.push(marker);
markers.addLayer(marker);
}
map.fitBounds(markers.getBounds());
var sortable = [];
for (var band in bands) sortable.push([band, bands[band]]);
var top_bands = sortable.sort(function(a, b) {return b[1] - a[1]}).slice(0,5);
var top_venues = venues.top(5);
$('#stats-bands dl').html('');
for (x in top_bands) {
if (top_bands[x][1] != '0') {
var b = top_bands[x][0];
var v = top_bands[x][1];
$('#stats-bands dl').append('<dt>' + linkify([b]) + '</dt><dd>' + v + '</dd>');
}
}
$('#stats-venues dl').html('');
for (x in top_venues) {
if (top_venues[x].value != '0') {
var b = top_venues[x].key;
var v = top_venues[x].value;
$('#stats-venues dl').append('<dt>' + linkify([b]) + '</dt><dd>' + v + '</dd>');
}
}
}
function linkify(bands) {
var formatted_bands = [];
for (x in bands) {
//if (bands[x].indexOf('<a href=') < 0) {
var band = bands[x];
formatted_bands[x] = '<a href="javascript:void();" onclick="$(\'#concert-filter\').val(\'' + band.replace('\'', "\\\'") + '\'); $(\'.filter\').trigger(\'keyup\'); return false;">' + band + '</a>';
//}
}
return formatted_bands.join(', ');
}
</script>
<!-- Fathom - beautiful, simple website analytics -->
<script src="https://cdn.usefathom.com/script.js" data-site="SEGRUNSC" defer></script>
<!-- / Fathom -->
</body>
</html>