I have a script that is supposed to show GeoJson data. When I run this script I am able to enter a page and, however page is empty, it doesn't have any errors in the console. Also, I can see svg element in the html and it has values.
Code:
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<title>geoPath measures</title>
</head>
<body>
<div align="center">
<svg id="my_dataviz" width="400" height="560"></svg>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.9.1/d3.min.js"></script>
<script src="//d3js.org/topojson.v1.min.js"></script>
<script>
var svg = d3.select('#my_dataviz');
var projection = d3.geoMercator().scale(400).translate([200, 280]).center([0, 5]);
var geoGenerator = d3.geoPath().projection(projection);
// REQUEST DATA
d3.json(
'https://raw.githubusercontent.com/EugeneBorshch/ukraine_geojson/master/Ukraine.json',
function(err, json) {
svg.append("g")
.selectAll("path")
.data(json.features)
.enter()
.append('path')
.attr('d', geoGenerator)
.attr('fill', 'steelblue');
}
);
</script>
</body>
</html>
What is the problem? Why I can't visualize data?