# Photo explorer

This demo arranges collections of photos into Voronoi treemaps. Polygon size represents view count. All photos come from Flickr, hover over a photo for more details and copyright information.

Show
photos of the day
photos by user
Failed to load photos

Click on photo for full view. Click again to get back to all photos.
Click and hold for more from the author. Click and hold to return.

### What's in the code?

- Getting photo lists from Flickr API and converting them into FoamTree JSON.
- Using the `groupContentDecorator` callback along with geometry utilities to lay out and render photos inside polygons.
- Loading low- and high-resolution photos and using the `viewportScale` property in `groupContentDecorator` implementation to determine when the high-resolution photo needs to be used for drawing.
- Implementing a `onGroupClick` event listener to prevent group selection on single click and expose the group instead.
- Using a fast JavaScript image blur to produce an appealing background for the full view of the image. Blur is applied unless we hit the Flickr image request with CORS headers bug.

Experiment with this code on CodePen.