Skip to content

Instantly share code, notes, and snippets.

@ThomasThoren
Last active October 1, 2017 20:38
Show Gist options
  • Save ThomasThoren/8116135710c53794c425 to your computer and use it in GitHub Desktop.
Save ThomasThoren/8116135710c53794c425 to your computer and use it in GitHub Desktop.
New York Times map reproduction II
height: 1000

An example of how to use ai2html to take SVG graphics at different sizes and export to PNG and HTML files. This is an optional step that follows my previous block about how to make this map using command line tools and D3.

Both of the blocks are modeled after this map by the New York Times.

Note that in order for bl.ocks.org to display the correct file, I've renamed index.html as snippet.html and index.preview.html as index.html.

Depending on what device you're using, you might need to click the "Open" link to see this without the iframe cutting off the bottom.

Visit this block's Gist page to download the associated Adobe Illustrator file. See the ai2html page for installation instructions and how to get Illustrator set up.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{headline}}</title>
</head>
<body>
<h1>{{headline}}</h1>
<div>
<p>
{{leadin}}
</p>
<div>
{{ai2htmlPartial}}
</div>
</div>
</body>
</html>
This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment