earthjs
Version:
D3 Earth JS using SVG, Canvas & THREE js, build with some plugins.
26 lines (24 loc) • 920 B
HTML
<html>
<head>
<meta charset="utf-8">
<link type="text/css" rel="stylesheet" href="../css/earthjs.css">
<script type='text/javascript' src="../js/d3.min.js"></script>
<script type='text/javascript' src="../js/topojson.min.js"></script>
<script type='text/javascript' src='../js/earthjs.js'></script>
</head>
<body>
<svg id="earth-js"></svg>
<script>
const {offsetWidth, offsetHeight} = d3.select('body').node();
const g = earthjs({width: offsetWidth, height: offsetHeight, padding:5, transparent: true})
g.register(earthjs.plugins.inertiaPlugin());
g.register(earthjs.plugins.oceanSvg());
g.register(earthjs.plugins.worldSvg('../d/world-110m.json'));
g.register(earthjs.plugins.countryTooltipSvg('../d/world-110m-country-names.tsv'));
g.ready(function(){
g.create();
})
</script>
</body>
</html>