svgmap 1.3.4 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019 Stephan Wagner
3
+ Copyright (c) 2020 Stephan Wagner
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -6,7 +6,7 @@ Live demo: https://stephanwagner.me/create-world-map-charts-with-svgmap#svgMapDe
6
6
 
7
7
  ## Install
8
8
 
9
- ```
9
+ ```bash
10
10
  npm install svgmap
11
11
  ```
12
12
 
@@ -55,9 +55,9 @@ You can pass the following options into svgMap:
55
55
 
56
56
  * `targetElementID` (`string`) The ID of the element where the world map will render (Required)
57
57
 
58
- * `minZoom`, `maxZoom` (`float`) Minimal and maximal zoom level between 1 and 10. Default: `1` for `minZoom`, `10` for `maxZoom`
58
+ * `minZoom`, `maxZoom` (`float`) Minimal and maximal zoom level. Default: `1` for `minZoom`, `25` for `maxZoom`
59
59
 
60
- * `initialZoom` (`float`) Initial zoom level between 1 and 10. Default: `1.06`
60
+ * `initialZoom` (`float`) Initial zoom level. Default: `1.06`
61
61
 
62
62
  * `zoomScaleSensitivity` (`float`) Sensitivity when zooming. Default: `0.2`
63
63
 
@@ -73,7 +73,11 @@ You can pass the following options into svgMap:
73
73
 
74
74
  * `noDataText` (`string`) The default text to be shown when no data is present
75
75
 
76
- * `data` (`object`) The chart data to use for coloring and to show in the tooltip. Use a unique data-id as key and provide
76
+ * `countries` (`object`) Additional options specific to countries:
77
+
78
+ * `EH` (`boolean`) When set to `false`, Western Sahara (EH) will be combined with Morocco (MA)
79
+
80
+ * `data` (`object`) The chart data to use for coloring and to show in the tooltip. Use a unique data-id as key and provide following options as value:
77
81
 
78
82
  * `name` (`string`) The name of the data, it will be shown in the tooltip
79
83
 
@@ -106,3 +110,15 @@ svgMap uses [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [Anders R
106
110
  The country flag images are from [country-flags](https://github.com/hjnilsson/country-flags) by [Hampus Nilsson](https://github.com/hjnilsson).
107
111
 
108
112
  Most data in the demos was taken from [Wikipedia](https://www.wikipedia.org).
113
+
114
+ ---
115
+
116
+ ## Appendix - Internet Explorer 11 Support
117
+
118
+ The library uses both `Object.assign` and `classlist.add`, which are not supported by IE11. In order to make this library work in IE11, you need to use a polyfill, which adds this functionalty to the browser. You can create a bundle by going to https://polyfill.io/v3/, or can use the pre-defined one below, which adds both of these two polyfills.
119
+
120
+ ```html
121
+ <script src="https://polyfill.io/v3/polyfill.min.js?features=Element.prototype.classList%2CObject.assign"></script>
122
+ ```
123
+
124
+ Ensure to include this script before the svgMap scripts.