running-elephant / datart

Datart is a next generation Data Visualization Open Platform
https://running-elephant.github.io/datart-docs/
Apache License 2.0
1.95k stars 587 forks source link

Support for other country maps #1119

Open clementchong opened 2 years ago

clementchong commented 2 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Current map visualization has only China map. How can we extend to add other countries?

Describe the solution you'd like A clear and concise description of what you want to happen.

Option to choose the map for another country or even add new if not available.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Can reference https://superset.apache.org/docs/miscellaneous/country-map-tools https://github.com/apache-superset/superset-ui/blob/master/plugins/legacy-plugin-chart-country-map/scripts/Country%20Map%20GeoJSON%20Generator.ipynb

clementchong commented 2 years ago

It looks like normal outline map tsx relies on basic outline map tsx. When I change config.ts for basic outline map, it does not appear on screen after build. Do I only need to change config.ts for normal outline map? Changing this does show change after build.

clementchong commented 2 years ago

After multiple tests, I don't think the config.ts file from basic outline map is used when normal outline map/scatter outline map viz is used. The country json file should be configured within config.ts of normal and scatter outline map only.

There is also specified requirements for geojson files for the map to display properly. The Aliyun site used to generate the geojson files for china and china-city does not cover other countries.

clementchong commented 2 years ago

Quick update. I was able to add a new map for Philippines. The geojson file is about 1mb. Other countries can be added the same. How can I change the map icon to a globe icon for internationalizing the map function?

image

clementchong commented 2 years ago

If there is interest to include this as additional feature, I can submit a PR to include few other countries.

xieliuduo commented 2 years ago

The following articles may help you develop custom charts

https://mp.weixin.qq.com/s/a4DVf-5LHVQAknmKKE6DJA

https://mp.weixin.qq.com/s/nYMAaiT97NPkm71FpW8LSw

https://mp.weixin.qq.com/s/9hBNSla86Fzouy0WdXqSQQ

This plugin repository might give you some hints :https://github.com/running-elephant/datart-extension-charts