unorthodox123 / racialdotmap Goto Github PK
View Code? Open in Web Editor NEWPython code for creating a dataset for a dot density map for every person in the U.S., color-coded by race and ethnicity.
Python code for creating a dataset for a dot density map for every person in the U.S., color-coded by race and ethnicity.
I just sent this via email as well, but here's a rehashing:
I see you've adapted Brandon's census dotmap - very cool idea to do
the demographic breakdown. However, there's a bit of a problem with
your use of the map viewing application.
The source code you've adapted is still using the reference overlay
tiles I added to the dotmap application:
http://a.tiles.mapbox.com/v3/landplanner.map-mcowljes/page.html - I
happen to think they look great on your application as well, but
unfortunately they are being charged against my monthly Mapbox account
limit and your map is a popular one. I encourage you to plug a tileset
of your own into the application; you can sign up and get a URL here:
https://tiles.mapbox.com/newmap#3/0.00/-0.09 (go to "customize" then
uncheck every layer other than streets).
There are other reference overlay options as well if you want to go a
non-mapbox route:
http://geosprocket.blogspot.com/2013/01/context-for-cheap-map-reference-overlay.html
In any case, please let me know when you can switch tilesets - I don't
want to pull that function out from underneath your map but I will
have to shut down the feed if the expense goes much higher.
Thanks, and again great work adding depth to the analysis!
It's worth mentioning an easy solution is to plug in the Stamen Toner reference tiles, which are free of usage restrictions though they're a bit slower:
This race map is amazing. But it's also now 10 years out of date. I don't think @unorthodox123 maintains this repo anymore...
But either I or someone else should try and update the map with either Census data or other data! I'm not yet sure when census data will be released.
This came up because I'm actively using this map to plan where I'll live! My wife and I want to find some place safe and diverse in our area. And it's hard to tour every part of a town. This map sometimes shortcuts that for us.
Sorry if you get this twice, I wrote to the demographers without thinking it might be better to ask about the code! I was reading an article today talking about the incredible concentration of black people in jails, and how the Racial Dot Map reflects that. I was curious about my local jail, which showed up green (black) as predicted. However, my county is overwhelmingly white and then hispanic, so the incarceration rate for black people would have to be stratospheric. By finding the related Census data I was able to confirm that that institutionalized population for that area is in fact 70%+ white non-hispanic.
It's possible that data is wrong and the map is correct, but I am curious, so, I went digging into the code:
Line 179 in 478f6fd
If I'm reading this correctly, if the population density is so high you can't draw separate dots at max zoom, only the last dot is drawn since the transparency is set to zero. Since the dots are drawn in a certain order by race
https://github.com/unorthodox123/RacialDotMap/blob/master/dotfile.py#L155
you will pretty much always draw black people over white people, hispanic people over blacks, etc.
Does this make sense? If so, would it be possible to randomize either the writing to the CSV or the reading from it?
Thanks and Happy New Year,
Corey
This is a really cool project. The visualisation is excellent.
Could you clarify the license on this code? I'm thinking with regard to using it on data from other countries.
Currently, the lightness between dots differ according to the race. For example, the color of an asian dot is #FF0000, which is darker than #73B2FF, the color of a white dot. As a result, an area that contains asian dots visually looks more darker than an area of same size and density of white dots.
Let's change the dot color for better visualization.
The URL in the README is incorrect. It currently points to here:
http://demographics.coopercenter.org/DotMap/index.html
That points to a 404 page.
The URL should be changed to
http://demographics.coopercenter.org/racial-dot-map/
or
https://demographics.virginia.edu/DotMap/index.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.