This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URL = http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/physical/ne_50m_land.zip | |
ne_50m_land.zip: | |
curl -LO $(URL) | |
ne_50m_land.shp: ne_50m_land.zip | |
unzip ne_50m_land.zip | |
touch ne_50m_land.shp | |
land.json: ne_50m_land.shp |
This gist shows how to include an SVG image that adapts to the size of its container.
For this technique to work, the SVG element should have the attribute viewBox
set with the image dimensions, and the attribute preserveAspectRatio="xMinYMin meet"
, and it shouldn't have the attributes width
and height
.
The container should have a width defined, as a percent or as a size in pixels.
Inserting SVG images as DOM nodes instead of inserting them as images or objects. In this example, we load an image stored as JST templates and insert the image into the DOM, allowing to modify its style via CSS and its attributes with JavaScript.
In this gist, we change the whale color and make it move using D3.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URL = http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_countries.zip | |
ne_50m_admin_0_countries.zip: | |
curl -LO $(URL) | |
ne_50m_admin_0_countries.shp: ne_50m_admin_0_countries.zip | |
unzip ne_50m_admin_0_countries.zip | |
touch ne_50m_admin_0_countries.shp | |
countries.json: ne_50m_admin_0_countries.shp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download and Transform the 1:50m Country Shapefiles from Natural Earth | |
# http://www.naturalearthdata.com/downloads/110m-physical-vectors/ | |
URL = http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_land.zip | |
# Download the zip file from the Natural Earth server | |
ne_110m_land.zip: | |
curl -LO $(URL) | |
# Unzip the shapefiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download and Transform the 1:50m Country Shapefiles from Natural Earth | |
# http://www.naturalearthdata.com/downloads/110m-physical-vectors/ | |
URL = http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_land.zip | |
# Download the zip file from the Natural Earth server | |
ne_110m_land.zip: | |
curl -LO $(URL) | |
# Unzip the shapefiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download and Transform the 1:50m Country Shapefiles from Natural Earth | |
# http://www.naturalearthdata.com/downloads/110m-physical-vectors/ | |
URL = http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_land.zip | |
# Download the zip file from the Natural Earth server | |
ne_110m_land.zip: | |
curl -LO $(URL) | |
# Unzip the shapefiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download and Transform the 1:50m Country Shapefiles from Natural Earth | |
# http://www.naturalearthdata.com/downloads/50m-cultural-vectors/ | |
URL = http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_countries.zip | |
# Download the zip file from the Natural Earth server | |
ne_50m_admin_0_countries.zip: | |
curl -LO $(URL) | |
# Unzip the shapefiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Zoom and Rotating (Reprojecting)</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script> |
OlderNewer