Skip to content
Related Articles

Related Articles

Improve Article
D3.js geoHammerRetroazimuthal() Function
  • Last Updated : 14 Oct, 2020

D3.js is a JavaScript library for producing dynamic, interactive data visualizations in web browsers. It makes use of Scalable Vector Graphics, HTML5, and Cascading Style Sheets standards.
The geoHammerRetroazimuthal() function in d3.js is used to draw The Hammer retroazimuthal projection.



Parameters: This method does not accept any parameters.

Return Value: This method creates HammerRetroazimuthal projection of world from given json data.

Example 1: The following example draws HammerRetroazimuthal projection of world with center at (0, 0) and 0 rotation.

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, 
        initial-scale=1.0" />
    <div style="width:700px; height:500px;">
            <h3 style="color:black">
        <svg width="600" height="450">
    <script src=""></script>
    <script src=
        var svg ="svg"),
            width = +svg.attr("width"),
            height = +svg.attr("height");
        // HammerRetroazimuthal projection
        // Center(0, 0) with 0 rotation
        var gfg = d3.geoHammerRetroazimuthal()
            .scale(width / 3.8 / Math.PI)
            .rotate([0, 0])
            .center([0, 0])
            .translate([width / 2, height / 2])
        // Loading the json data
        // Used json file stored at 
            + "janasayantan/datageojson/master/world.json",
            function (data) {
                // Drawing the map
                    .attr("fill", "black")
                    .attr("d", d3.geoPath()
                    .style("stroke", "#ffff")


HammerRetroazimuthal projection of World with no rotation and centered at (0, 0)

My Personal Notes arrow_drop_up
Recommended Articles
Page :