Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: ec7a13bfde
Fetching contributors…

Cannot retrieve contributors at this time

62 lines (54 sloc) 2.023 kB
<!DOCTYPE html>
<html>
<head>
<title>insta</title>
<link href='style.css' media='screen' rel='stylesheet' type='text/css' />
<script type='text/javascript' src='crossfilter.min.js'></script>
<script type='text/javascript' src='d3.v2.min.js'></script>
<script type='text/javascript' src='modestmaps.js'></script>
<script type='text/javascript'>
window.onload = function() {
d3.json('data/index.json', function(photos) {
var id = window.location.hash.substring(1);
photosIndex = crossfilter(photos);
photosById = photosIndex.dimension(function(d) { return d.id });
var photoContainer = d3.select('#photos');
var stackContainer = d3.select('#stack');
var d = photosById.filterExact(id).top(1)[0];
d3.select('#photo-img')
.attr('src', 'data/' + d.id + '.jpg');
d3.select('#title').text(d.caption && d.caption.text);
d3.select('#filter').text(d.filter);
d3.select('#likes').text(d.likes.count);
d3.select('#taken').text(new Date(+d.created_time * 1000));
d3.select('#instagram').attr('href', d.link);
if (d.location.latitude) {
d3.select('#map')
.append('iframe').attr('src',
'http://a.tiles.mapbox.com/v3/mapbox.mapbox-simple/mm/attribution.html#10.00/'
+ d.location.latitude + '/' + d.location.longitude)
.attr('frameborder', 'none');
}
});
};
</script>
</head>
<body>
<div class='wrapper'>
<div id='photo'>
<img src='' id='photo-img' />
</div>
<div class='facets'>
<a href='index.html'>&larr; back</a> <br />
<h2 id='title'></h2>
<ul>
<li>Taken: <span id='taken'></span></li>
<li>Filter: <span id='filter'></span></li>
<li>Likes: <span id='likes'></span></li>
<li><a id='instagram'>instagram</a></li>
</ul>
<div id='map'></div>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.