0

I need to display no of orders/revenue/sales etcc in d3.js topojson based chloropleth map for 170 countries at county/state level . the user is allowed to select country from dropdown and corresponding country chloropleth map should be displayed .

I have to implement similar to this http://bl.ocks.org/thedod/4548858 for 170 countries . I will be integrating this html inside a jsf page in java j2ee project.

  1. Do i have to create 170 topojson files and load on demand when the user selects a country from dropdown.
  2. Is there any readymade database .If i just pass a country name/code just return me a topojson of that country with admin2 details.

Please provide me a solution / better practise. I want only open sourcejava based technology/librarries .

Alvin Pradeep
  • 618
  • 4
  • 13

1 Answers1

0
  1. No. You could have everything in one JSON file that you load at the beginning and then select the relevant part when the user selects a country instead of loading more data. This however means that the initial wait is longer because more data needs to be loaded. D3 doesn't put any restrictions on this, so you can solve this however you think is best for your application. It sounds as if you would be loading quite a lot of data, so loading each country on demand may be the best way to go performance-wise.
  2. Not to the best of my knowledge. While you should be able to find GeoJSON data for all countries relatively easily, TopoJSON is a much less common format, so the chances are smaller. You can however convert a number of other formats to TopoJSON.
Lars Kotthoff
  • 107,425
  • 16
  • 204
  • 204