Skip to content
Related Articles

Related Articles

Improve Article

D3.js geoBaker() Function

  • Last Updated : 18 Sep, 2020

The geoBaker() function in d3.js is used to draw the Baker Dinomic projection from the given geojson data.



Parameters: This method does not accept any parameters.

Returns: This method returns the Baker Dinomic projection.

Example: The following example makes the Baker Dinomic projection of the world.


<!DOCTYPE html>
    <script src="">
    <script src=
    <div style="width:800px; height:600px;">
            <h3 style="color:red">
                Baker Dinomic Projection of World
        <svg width="700" height="550">
        var svg ="svg"),
            width = +svg.attr("width"),
            height = +svg.attr("height");
        // Baker Dinomic projection
        var gfg = d3.geoBaker()
            .scale(width / 1.5 / Math.PI)
            .translate([width / 2, height / 2])
        // Loading the json data 
        d3.json("" +
            "janasayantan/datageojson/master/" +
            function (data) {
                // Draw the map
                    .attr("fill", "black")
                    .attr("d", d3.geoPath()
                    .style("stroke", "#ffff")


My Personal Notes arrow_drop_up
Recommended Articles
Page :