Why one option is to map the information that you want to communicate?
Should the country borders or state border or whatever thing you're visualizing,
that's not always possible or not always recommended.
So, in some cases,
color is a problem for people to understand what's happening.
They are also affected by the area of the country.
So if you want to avoid these problems,
you may want to add the new marks instead of just using the ones that you have.
Another situation where you want to add new marks is when
what you are mapping doesn't map to a specific country,
for example, but mapping to a specific longitude and latitude.
So, for example, if I'm visualizing cities,
I going to draw first the countries to know where the cities are,
and then you're going to draw a dot on each country to
represent where in the country the city is.
So, those are the cases where we need additional mark
and we won't be using the ones that we draw as base for a map.
So, for example, here we created a base-map where we are
visualizing the countries and the region just as reference to the user.
Those map doesn't contain any data that we are looking to communicate.
But then, on top of that,
we draw dots representing each earthquake that we had in the past 100 years.
So this means that I can look where the earthquake happens,
but now I can also correlate to the countries and see if there is
a specific regions of the globe where we have more earthquakes than other regions.
The way it happens is,
if I have something that has a latitude and a longitude,
I can translate that to x and y in the pixel's coordinate using the projection.
So we have been using projections,just passing it to the geo-path,
but now we can also use projections the same way we use the scales.
We used the scales in the past to map, for example,
a date time to a x and y position,
and we values categorical values as well to x and y are callers.
Projection works as a scale,
so you can give latitude and longitude to projections and get back x and y positions.
For example, I can create a geoMercator projection,
and then using this projection I can create my marks.
So the way create marks is the exact same way
I would create anything in any correlative authorization.
So think about the scatterplot.
It would be adding those circles,
and you would set the x and y position of the circle.
So, the difference here is that the way I set the x and y position.
So instead of using the scale,
I going to use my projection theta I called p and I going to pass
the longitude and latitude of my data as parameter to just projection,
and I going to get also an array that contains the x and y position.
So that's why here, for example,
I am changing to zero and to one because I'm getting both.
I get an array as outputs so the zero is going to represent the x,
and the one is going to represent the y position of the circle.
Once I did that,
the circle is going to be in their
geographical position that I expect it to expected to be,
representing that specific event, for example,
happened on that specific region and you get your final map.
Those type of association is really powerful because by combining multiple dots,
you end up with some patterns and trends that would be harder to see another way.
So, for example here,
you can almost see the borders of the tectonic plates that cause some of
the earthquakes that we had by merging those points
together and seeing how they position themselves around the globe.