nrgapple / historic-country-borders-app

Visualize country borders from different times in history (2000 BC-1994)
https://historicborders.app
145 stars 5 forks source link

Strange color for Italy #14

Closed nrgapple closed 2 years ago

nrgapple commented 2 years ago

based off this issue from @giosonego

italy

nrgapple commented 2 years ago

https://github.com/nrgapple/historic-country-borders-app/commit/52e333f261c809fa6f6c0148754eab274faa4808

aourednik commented 2 years ago

@ngrapple : wow, this was fast :-)

I've noticed you assing a color to each name which keeps colors identical for same countries throughout history; a great feature. Its only backdrop is taht it makes the graph coloring problem more difficult, I guess. Parhaps one could write a two-type constraint graph algorithm:

  1. nodes with relation "neighbors" must not have the same color
  2. nodes with relation "same country" must have the same color

Beyond my mathematical / graph-theory skills at this point.

But the number of different colors could be reduced if you take the SUBJECTO variable instead. It is now informed for every country, every year. If it is identical to NAME, the country is independant. If it different to name, the country is a semi-autonomous region or a colony. This would also be semantically more accurate, imo. Using SUBJECTO instead of NAME makes the colonial history more readable (yes, I still need to harmonize this var for all of the British Empire... ):

image
nrgapple commented 2 years ago

Yeah so I am calculating on the first coordinate as well now but that might be a good solution as well!

https://github.com/nrgapple/historic-country-borders-app/blob/52e333f261c809fa6f6c0148754eab274faa4808/pages/api/borders/%5B%5B...slug%5D%5D.ts#L74-L75

nrgapple commented 2 years ago

@aourednik done! https://github.com/nrgapple/historic-country-borders-app/issues/16