I am new to d3.js library, and I am trying to understand the concept of domain and ranges.
I read Scott Murray\'s book, but I don\'t know how to calculate it.
<
Yes I will try to explain why you get 180.
We have that 300 is the value that ideally divide your domain into two subdomains of the same size, so we can do:
500 - 100 / 2 = 200 (this is the subdomain size),
this implies that the middle value is located at:
200 + 100 = 300 (note that we add the starting point 100)
So with the range we do the same:
350 - 10 / 2 = 170
and then we add the starting point
170 + 10 = 180