Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8754399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:36:41+00:00 2026-06-13T13:36:41+00:00

This tutorial is a great intro to creating choropleths with d3, but it’s data

  • 0

This tutorial is a great intro to creating choropleths with d3, but it’s data is US-centric. Where do I get the corresponding data for a world map?

I’m sure it’s in the docs somewhere, but I can’t find it. This is the closest I’ve found, but the one world map on there specifically says it’s not recommended for choropleths. Also,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:36:42+00:00Added an answer on June 13, 2026 at 1:36 pm

    NOTE: This answer was written for version 2 of d3. Version 3 is out now, and it has awesome new features that create better geometry segmentation and solve the fill issue mentioned below. Also, the interface for setting up projections _may_ have changed in V3 (not sure bc I haven’t tried).

    There is a json file available for the entire world, and you can render it equivalently to the us-states.json coropleth (using an Albers equal area projection) – assuming you understand (and are ok with) the fact that an Albers-projected world map looks like this, which is not quite how most people recognize a world map.

    First you need the json data for the entire world, which is the same data used by the world mercator projection example.

    Then you need to render the world json data using a customized Albers projection:

    <!DOCTYPE html>
    <meta charset="utf-8">
    <title>Mercator Projection</title>
    
    <style>
      path {
        fill: #ccc;
        stroke: #fff;
      }
    </style>
    
    <svg width="960" height="500"></svg>
    
    <script src="http://d3js.org/d3.v2.js?2.9.1"></script>
    <script type="text/javascript">
      d3.json("world-countries.json", function(collection) {
        d3.select("svg").selectAll("path")
            .data(collection.features)
          .enter().append("path")
            .attr("d", d3.geo.path().projection(
              d3.geo.albers()
                .parallels([10, 80])
                .origin([0,40])
                .translate([500,250])
                .scale(100)
            ));
      });
    </script>
    

    origin(), parallels(), translate(), and scale() values can be tweaked to get different results.

    There’s a problem with Antartica, which – due to the nature of this projection – gets “flipped” and is not a closed shape, so its fill covers the whole world. You either have to remove it from the json, or don’t apply fill to it.

    Also for some reason Brazil (and couple of others) didn’t get rendered properly when I tried this. Dunno why. You’d have to examine the svg and the data to figure out why.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using this tutorial: http://www.c-sharpcorner.com/uploadfile/UrmimalaPal/creating-a-windows-phone-7-application-consuming-data-using-a-wcf-service/ I have created sample/hello world application on the windows phone
I have just found this great tutorial as it is something that I need.
I made a twitter integration to my android app. I used this great tutorial,
This tutorial suggests nesting tables in content controls but every time I'm trying to
This is my first website attempt and I've been following a great tutorial while
Been following this great tutorial on how to integrate twitter into your app. I
I'm following a great intro level tutorial to Rails , and it's been a
I just started getting into node.js and followed this great tutorial on node.js at
I read over a great tutorial on how to encrypt the data using a
This is the best tutorial I found so far on migrating data across apps:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.