Skip to content

Instantly share code, notes, and snippets.

Last active January 23, 2020 07:32
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
d3.geoPath + Canvas
license: gpl-3.0
height: 600
border: no
<!DOCTYPE html>
<canvas width="960" height="600"></canvas>
<script src=""></script>
<script src=""></script>
var context ="canvas").node().getContext("2d"),
path = d3.geoPath().context(context);
d3.json("", function(error, us) {
if (error) throw error;
Copy link

It should be noted that beginPath() should be called manually if you want to redraw after panning or zooming.

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