Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
German dialects visualization
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>German dialects visualization</title>
<script type="text/javascript" src=""></script>
<style type="text/css">
#map {
position: absolute;
top: 10px;
left: 10px;
<div id="map"></div>
<script type="text/javascript">
//Width and height
var w = 500;
var h = 500;
//Define map projection
var projection = d3.geo.mercator()
.center([5, 55.2])
.translate([w/100, h/1000])
//Define path generator
var path = d3.geo.path()
//Create SVG element
var svg ="body")
.attr("width", w)
.attr("height", h);
//Load in GeoJSON data
d3.json("3_mittel.geojson", function(json) {
//Bind data and create one path per GeoJSON feature
.attr("d", path)
.style("fill", "#eee")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment