newsworthycharts 1.65.4__py3-none-any.whl → 1.66.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/categoricalchart.py +28 -21
- {newsworthycharts-1.65.4.dist-info → newsworthycharts-1.66.0.dist-info}/METADATA +7 -2
- {newsworthycharts-1.65.4.dist-info → newsworthycharts-1.66.0.dist-info}/RECORD +7 -7
- {newsworthycharts-1.65.4.dist-info → newsworthycharts-1.66.0.dist-info}/LICENSE.txt +0 -0
- {newsworthycharts-1.65.4.dist-info → newsworthycharts-1.66.0.dist-info}/WHEEL +0 -0
- {newsworthycharts-1.65.4.dist-info → newsworthycharts-1.66.0.dist-info}/top_level.txt +0 -0
newsworthycharts/__init__.py
CHANGED
@@ -25,32 +25,39 @@ class CategoricalChart(Chart):
|
|
25
25
|
return self.stacked
|
26
26
|
|
27
27
|
def _add_pie_data(self):
|
28
|
-
if len(self.data) > 1:
|
29
|
-
raise ValueError("Pie chart takes one data series only.")
|
30
28
|
self.legend = False
|
31
29
|
self.show_ticks = False
|
32
30
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
colors = [self._nwc_style["qualitative_colors"][i] for i in range(len(values))]
|
31
|
+
if len(self.data) > 1:
|
32
|
+
subaxes = self._fig.subplots(1, len(self.data))
|
33
|
+
for idx, serie in enumerate(self.data):
|
34
|
+
if len(self.data) == 1:
|
35
|
+
subax = self.ax
|
36
|
+
else:
|
37
|
+
subax = subaxes[idx]
|
41
38
|
|
42
|
-
|
39
|
+
values = [to_float(x[1]) for x in serie]
|
40
|
+
labels = [x[0] for x in serie]
|
43
41
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
explode=
|
50
|
-
|
51
|
-
|
42
|
+
if self.colors is not None:
|
43
|
+
colors = self.colors
|
44
|
+
else:
|
45
|
+
colors = [self._nwc_style["qualitative_colors"][i] for i in range(len(values))]
|
46
|
+
|
47
|
+
explode = [0.1 if x == self.highlight else 0 for x in labels]
|
48
|
+
subax.pie(
|
49
|
+
values,
|
50
|
+
labels=labels,
|
51
|
+
startangle=90,
|
52
|
+
colors=colors,
|
53
|
+
explode=explode
|
54
|
+
)
|
55
|
+
subax.axis('equal')
|
56
|
+
# `labels` in pie charts are used to label the series, not the values
|
57
|
+
if self.labels:
|
58
|
+
subax.set_title(self.labels[idx], loc='center', y=0.04)
|
52
59
|
|
53
|
-
self.
|
60
|
+
self.ax.axis('off')
|
54
61
|
|
55
62
|
def _add_data(self):
|
56
63
|
if self.type == "pie":
|
@@ -339,7 +346,7 @@ class ProgressChart(CategoricalChart):
|
|
339
346
|
|
340
347
|
# rect.set_linewidth(1)
|
341
348
|
# rect.set_edgecolor(color_progress)
|
342
|
-
|
349
|
+
|
343
350
|
# LABELING: Target
|
344
351
|
if self.target_label:
|
345
352
|
offset = 25
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: newsworthycharts
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.66.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.66.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
|
@@ -259,6 +259,11 @@ Roadmap
|
|
259
259
|
Changelog
|
260
260
|
---------
|
261
261
|
|
262
|
+
- 1.66.0
|
263
|
+
|
264
|
+
- Support multiple data series in pie charts (displayed as small multiples)
|
265
|
+
|
266
|
+
|
262
267
|
- 1.65.4
|
263
268
|
|
264
269
|
- Revert some of the title margin changes
|
@@ -1,6 +1,6 @@
|
|
1
|
-
newsworthycharts/__init__.py,sha256=
|
1
|
+
newsworthycharts/__init__.py,sha256=dPnI3-O29XlaYmTwMFQBa7XfStx-E5cEUxSrGXbB8iw,1160
|
2
2
|
newsworthycharts/bubblemap.py,sha256=nkocWmpiFgfjEuJGAsthjY5X7Q56jXWsZHUGXw4PwgE,2587
|
3
|
-
newsworthycharts/categoricalchart.py,sha256=
|
3
|
+
newsworthycharts/categoricalchart.py,sha256=iU0itO0_wTxXP_ebp_2mq0hxTYiPqM23BX1dDouLUhA,16101
|
4
4
|
newsworthycharts/chart.py,sha256=FEQRAvdfX0x3KWFBxFEpGhh3w6dRMX5dTw-VIFPo4jA,34374
|
5
5
|
newsworthycharts/choroplethmap.py,sha256=bCLf4kcchp1C2djg5AxcOM8BdbaMj0xg7UHrZsDafhI,8013
|
6
6
|
newsworthycharts/datawrapper.py,sha256=RRkAVTpfP4updKxUIBaSmKuBi2RUVPaBRF8HDQhlGGA,11250
|
@@ -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.66.0.dist-info/LICENSE.txt,sha256=Sq6kGICrehbhC_FolNdXf0djKjTpv3YqjFCIYsxdQN4,1069
|
32
|
+
newsworthycharts-1.66.0.dist-info/METADATA,sha256=SqN-YYHap7GyKv7Xy8y5yGQ4pHUtEFzDE_WO_4C__sI,30995
|
33
|
+
newsworthycharts-1.66.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
34
|
+
newsworthycharts-1.66.0.dist-info/top_level.txt,sha256=dn_kzIj8UgUCMsh1PHdVEQJHVGSsN7Z8YJF-8xXa8n0,17
|
35
|
+
newsworthycharts-1.66.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|