newsworthycharts 1.68.1__py3-none-any.whl → 1.69.0__py3-none-any.whl
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.
- newsworthycharts/__init__.py +1 -1
- newsworthycharts/choroplethmap.py +4 -1
- {newsworthycharts-1.68.1.dist-info → newsworthycharts-1.69.0.dist-info}/METADATA +8 -2
- {newsworthycharts-1.68.1.dist-info → newsworthycharts-1.69.0.dist-info}/RECORD +7 -7
- {newsworthycharts-1.68.1.dist-info → newsworthycharts-1.69.0.dist-info}/LICENSE.txt +0 -0
- {newsworthycharts-1.68.1.dist-info → newsworthycharts-1.69.0.dist-info}/WHEEL +0 -0
- {newsworthycharts-1.68.1.dist-info → newsworthycharts-1.69.0.dist-info}/top_level.txt +0 -0
newsworthycharts/__init__.py
CHANGED
@@ -26,6 +26,7 @@ class ChoroplethMap(Map):
|
|
26
26
|
|
27
27
|
def __init__(self, *args, **kwargs):
|
28
28
|
super(ChoroplethMap, self).__init__(*args, **kwargs)
|
29
|
+
self.label_order = kwargs.get("label_order", None)
|
29
30
|
|
30
31
|
def _add_data(self):
|
31
32
|
|
@@ -143,7 +144,9 @@ class ChoroplethMap(Map):
|
|
143
144
|
|
144
145
|
# Geopandas does not handle legend if color keyword is used
|
145
146
|
# We need to add it ourselves
|
146
|
-
|
147
|
+
label_order = self.label_order or color_map.keys()
|
148
|
+
for label in reversed(label_order):
|
149
|
+
color = color_map[label]
|
147
150
|
# A bit of an hack:
|
148
151
|
# Check if this corresponds to one of our predefined
|
149
152
|
# color names:
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: newsworthycharts
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.69.0
|
4
4
|
Summary: Matplotlib wrapper to create charts and publish them on Amazon S3
|
5
5
|
Home-page: https://github.com/jplusplus/newsworthycharts
|
6
|
-
Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.
|
6
|
+
Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.69.0.tar.gz
|
7
7
|
Author: Jens Finnäs and Leo Wallentin, J++ Stockholm
|
8
8
|
Author-email: stockholm@jplusplus.org
|
9
9
|
License: MIT
|
@@ -208,6 +208,8 @@ For example, `se-4` will show Swedish counties, while `se|03-7` will show munici
|
|
208
208
|
|
209
209
|
_ Inherits from Map _
|
210
210
|
|
211
|
+
- `label_order` = None # A list of categorical values, to control the order of the labels in the legend
|
212
|
+
|
211
213
|
**BubbleMap**
|
212
214
|
|
213
215
|
_ Inherits from Map _
|
@@ -259,6 +261,10 @@ Roadmap
|
|
259
261
|
Changelog
|
260
262
|
---------
|
261
263
|
|
264
|
+
- 1.69.0
|
265
|
+
|
266
|
+
- New `label_order` argument in ChoroplethMap
|
267
|
+
|
262
268
|
- 1.68.1
|
263
269
|
|
264
270
|
- Fixed crash in `ChoroplethMap` with non-numerical values
|
@@ -1,8 +1,8 @@
|
|
1
|
-
newsworthycharts/__init__.py,sha256=
|
1
|
+
newsworthycharts/__init__.py,sha256=T6gjXLs0nw7uxganRfJNHYcX2rnMPvb8A8wIdBTTNXY,1160
|
2
2
|
newsworthycharts/bubblemap.py,sha256=nkocWmpiFgfjEuJGAsthjY5X7Q56jXWsZHUGXw4PwgE,2587
|
3
3
|
newsworthycharts/categoricalchart.py,sha256=YL3pzq8a7U5F0MpeRIAEwCAHw1BRDyKjoaAhf-UyRDo,18179
|
4
4
|
newsworthycharts/chart.py,sha256=jurOkIrm8TRpuL-Fj0AdBJXmjrdkZ-U2w_TaOysQvAs,34489
|
5
|
-
newsworthycharts/choroplethmap.py,sha256=
|
5
|
+
newsworthycharts/choroplethmap.py,sha256=Si-01213rWqDKINkhmKV6x5iSMumQveJfrlCnqYcIJM,8173
|
6
6
|
newsworthycharts/datawrapper.py,sha256=RRkAVTpfP4updKxUIBaSmKuBi2RUVPaBRF8HDQhlGGA,11250
|
7
7
|
newsworthycharts/map.py,sha256=c409jEO4L8Yr780sJRC0RchR44roAlgOUDAkuk1SfRg,6057
|
8
8
|
newsworthycharts/rangeplot.py,sha256=NE1W9TnmlpK6T3RvBJOU3nd73EXqkj17OY9i5zlw_cQ,8366
|
@@ -28,8 +28,8 @@ newsworthycharts/rc/newsworthy,sha256=yOIZvYS6PG1u19VMcdtfj9vbihKQsey5IprwqK59Kg
|
|
28
28
|
newsworthycharts/translations/datawrapper_regions.csv,sha256=fzZcQRX6RFMlNNP8mpgfYNdR3Y0QAlQxDXk8FXTaWWI,9214
|
29
29
|
newsworthycharts/translations/regions.py,sha256=Nv1McQjggD4S3JRu82rDMTG3pqUVR13E5-FBpSYbm98,239
|
30
30
|
newsworthycharts/translations/se_municipalities.csv,sha256=br_mm-IvzQtj_W55_ATREhJ97jWnCweBFlDAVY2EBxA,7098
|
31
|
-
newsworthycharts-1.
|
32
|
-
newsworthycharts-1.
|
33
|
-
newsworthycharts-1.
|
34
|
-
newsworthycharts-1.
|
35
|
-
newsworthycharts-1.
|
31
|
+
newsworthycharts-1.69.0.dist-info/LICENSE.txt,sha256=Sq6kGICrehbhC_FolNdXf0djKjTpv3YqjFCIYsxdQN4,1069
|
32
|
+
newsworthycharts-1.69.0.dist-info/METADATA,sha256=EmNhWPAZNkRgFXrwex1HWbY1v1A0wraUWEuogQg1CuY,31654
|
33
|
+
newsworthycharts-1.69.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
34
|
+
newsworthycharts-1.69.0.dist-info/top_level.txt,sha256=dn_kzIj8UgUCMsh1PHdVEQJHVGSsN7Z8YJF-8xXa8n0,17
|
35
|
+
newsworthycharts-1.69.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|