11 Jul CREATE A CHOROPLETH MAP THAT SHOWS THE NUMBER OF TOP WOMEN’S PLAYERS
Top 20 Women’s Soccer Players
Create a choropleth map that shows the number of top women’s players in each country using the FIFA data and the countries.geo.json file. Use a sequential color scale to indicate the number of players from each country.
Remember that you will need to choose a projection for the map. D3 includes a number of standard projections in the default bundle, but you may also use those from d3-geo-projection. Note that d3-geo-projection requires an extra JavaScript library to be loaded. You may choose the projection, but it must show the entire world. The countries.geo.json file contains a three-character id attribute for each feature (which in this file is a country’s boundary). It also provides a longer name attribute in the properties object of the feature. Given a feature d, we can access the country’s name via d.properties.name.
You will need to generate the counts of Top 20 players for each country. The fifa-17-women.json file has an object for each player with three properties: Name, Rating, and Country. You may use an object or a d3.map to generate these counts. The Country attribute will match a feature’s name property (as described above) in the countries.geo.json file.
For the map, you will want to use each country as a separate feature. Thus, instead of mapping all of the data using the .datum(mapData) as we did in class, you should use mapData.features with the normal selection plus data binding. Each feature will have an id attribute that can be used with the counts to derive the fill color.
Finally, to load multiple external data files using D3, use the queue library by Mike Bostock. This is part of the default D3 v4 bundle so you do not need to add another JavaScript libraries (as you did with D3 v3) Then, to load the three JSON files file1.json, file2.json, and file3.json:
function processData(errors, file1data, file2data, file3data) { // code } d3.queue() .defer(d3.json, “http://example.com/path/to/file1.json”) .defer(d3.json, “http://example.com/path/to/file2.json”) .defer(d3.json, “http://example.com/path/to/file3.json”) .await(processData);
Example Solution for Part 1
Example Solution for Part 1
Hints
Each country is a feature so if mapData is the variable loaded by d3.json, mapData.features is a list of all of the states (and territories).
Remember that d3.geoPath can have an associated projection and can be used to translate GeoJSON features into paths on screen.
d3.scaleSequential can help with colormapping. Remember to check the type of the values you are displaying to determine a correct colormap.
Create a second choropleth map that shows the number of top men’s players in each country using The Guardian’s data in guardian-16-men.json and the same countries.geo.json file. The men’s data has the fields: Name, Age, Club, League, Nationality, Position, and Rank. Important: To map to a country, use the Nationality field (different from the women’s data).
Most of this visualization will overlap with the logic for Part 1. Create a function that will draw a map and has parameters for the data, divId, etc., that can be called for both Part 1 and Part 2. You will lose 6 points if you do not have such a reusable function.
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.
