Fork of D3 Scatter Plot: geonames_cities100000.csv
This visualization displays a scatter plot of global cities with a population exceeding 100,000, projecting geographic coordinates onto a world map. Point color is interpolated from blue to red based on population with d3.interpolate, encoding magnitude. The plot uses SVG circles with a fixed radius and 0.8 opacity, rendered via D3 v6 imported APIs. The axes employ linear scales for longitude and latitude across fixed ranges, with data loaded asynchronously from a CSV using the d3.csv function.
AI-generated descriptionA vanilla HTML implementation of a D3 scatter plot.
Forked and authored by Daniel Ribaudo.
This is the link to the Gist: Geonames Cities
Within this dataset, city names are provided alongside their latitude, longitude, and population.
I added comments to this file to demonstrate understanding of various pieces of code. I edited the required segments (import, circle radius, and circle opacity) as well as other segments. I interpolated between colors using d3.interpolate to communicate the population in a city. Blue is lower population and red is higher population. I manually scaled the axis between [-90, 90] for y (latitude) and [-180, 180] for x (longitude). These bounds follow the boundaries on these values, rather than be based on the dataset. It is wonderful that such a clear map of the world is within this image.