# echarts-countries-js

[![npm version](https://badge.fury.io/js/echarts-countries-js.svg)](https://badge.fury.io/js/echarts-countries-js)

It collects all geo-jsons in javascript of {{num_cities}} countries and regions
and acts as a static asset to jupyter-echarts or your echarts collection.

## Installation

```
npm i echarts-countries-js
```

This library will be included in [pyecharts](https://github.com/chenjiandongx/pyecharts). No action is required from pyecharts user.

## echarts usage

```
<html>
  <head>
    <meta charset="utf-8" />
	<style>
	  .citymap{
	  width: 100%;
	  height: 100%;
	  }
	</style>
  	<script src="https://echarts-maps.github.io/echarts-countries-js/echarts.min.js"></script>
	<script src="https://echarts-maps.github.io/echarts-countries-js/echarts-countries-js/Switzerland.js"></script>
  </head>
  <body>
	<div id='map' class='citymap'></div>
	<script src='demo.js'></script>
	<script>
	  make_map('瑞士', 'map');
	</script>
  </body>
</html>
```

![Usage with echarts](https://echarts-maps.github.io/echarts-countries-js/demo.png)

## Featuring Cities(or for Single Download)

Cities:
{% for english_name, chinese_name in countries %}
1. [{{chinese_name}}](https://pyecharts.github.io/echarts-countries-js/dist/{{english_name|replace(' ', '_', 'g')}}.js) ({{english_name}}) {% endfor %}


## Development

```shell
$ npm install
$ gulp switzerland # as this is special fix
$ gulp
```

## Credit and geojson source

[pissang](https://github.com/pissang) and his [starbucks](https://github.com/pissang/starbucks) project.

Switzerland map comes from [natural earth data](https://www.naturalearthdata.com/downloads/10m-cultural-vectors/)

## License

Unlicense. No guarantee, no liability and no politics provided. You use it at your own risk.