newsworthycharts 1.54.1__py3-none-any.whl → 1.54.4__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.
@@ -1,4 +1,4 @@
1
- __version__ = "1.54.1"
1
+ __version__ = "1.54.4"
2
2
 
3
3
  from .chart import Chart
4
4
  from .choroplethmap import ChoroplethMap
newsworthycharts/chart.py CHANGED
@@ -376,7 +376,6 @@ class Chart(object):
376
376
  loc = get_best_locator(delta, len(dates), self.interval)
377
377
  self.ax.xaxis.set_major_locator(loc)
378
378
  formatter = Formatter(self._language)
379
- print(self._language)
380
379
 
381
380
  # if isinstance(loc, WeekdayLocator):
382
381
  if self.interval == "weekly":
@@ -473,13 +472,20 @@ class Chart(object):
473
472
  keep_trying = False
474
473
  try_dec += 1
475
474
  # If we still have duplicates; remove them!
476
- """
477
- tl = [x.get_text() for x in self.value_axis.get_ticklabels()]
478
- tl_ = [x for (i, x) in enumerate(tl) if tl[i - 1] != x]
479
- if len(tl_) < len(tl):
480
- tl = [x if i < len(tl) - 1 and tl[i + 1] != x else "" for (i, x) in enumerate(tl)]
481
- self.value_axis.set_ticklabels(tl)
482
- """
475
+ # If we still have duplicates; remove them!
476
+ ticks = self.value_axis.get_ticklabels()
477
+ ticks_ = [x for (i, x) in enumerate(ticks) if ticks[i - 1].get_text() != x.get_text()]
478
+ if len(ticks_) < len(ticks):
479
+ y = [float(x._y) for x in ticks_]
480
+ if self.decimals == 0:
481
+ # Recrate with integeres
482
+ import math
483
+ _bottom = min(y)
484
+ _top = math.ceil(max(y))
485
+ _bottom, _top = int(_bottom), int(_top)
486
+ y = range(_bottom, _top + 1)
487
+ y = [float(x) for x in y]
488
+ self.value_axis.set_ticks(y)
483
489
 
484
490
  for a in self.annotations:
485
491
  self._annotate_point(a["text"], a["xy"], a["direction"])
@@ -67,7 +67,7 @@ class Formatter(object):
67
67
  pattern[1] = ".#" + pattern[1]
68
68
  pattern = "0".join(pattern)
69
69
  string = format_decimal(x, locale=self.l, format=pattern)
70
- minus = self.l.number_symbols["minusSign"]
70
+ minus = self.l.number_symbols["latn"]["minusSign"]
71
71
  string = string.replace("-", minus)
72
72
  return string
73
73
 
@@ -79,7 +79,7 @@ class Formatter(object):
79
79
 
80
80
  x = round(Decimal(x), decimals)
81
81
  string = format_unit(x, 'temperature-generic', "short", locale=self.l)
82
- minus = self.l.number_symbols["minusSign"]
82
+ minus = self.l.number_symbols["latn"]["minusSign"]
83
83
  string = string.replace("-", minus)
84
84
  # if x > 0:
85
85
  # string = "+" + string
@@ -94,7 +94,7 @@ class Formatter(object):
94
94
  scale = "temperature-{}".format(self.scale)
95
95
  x = round(Decimal(x), decimals)
96
96
  string = format_unit(x, scale, "short", locale=self.l)
97
- minus = self.l.number_symbols["minusSign"]
97
+ minus = self.l.number_symbols["latn"]["minusSign"]
98
98
  string = string.replace("-", minus)
99
99
  return string
100
100
 
@@ -117,7 +117,7 @@ class Formatter(object):
117
117
  pattern[1] = "0" * decimals + pattern[1]
118
118
  pattern = ".".join(pattern)
119
119
  string = format_decimal(x, locale=self.l, format=pattern)
120
- minus = self.l.number_symbols["minusSign"]
120
+ minus = self.l.number_symbols["latn"]["minusSign"]
121
121
  string = string.replace("-", minus)
122
122
  return string
123
123
 
@@ -529,7 +529,8 @@ class SerialChart(Chart):
529
529
  # title is assumed to self-explanatory
530
530
  if len(self.labels) > 1:
531
531
  if self.label_placement == "legend":
532
- self.ax.legend(loc="best")
532
+ _ = self.ax.legend(loc="best")
533
+ _.set(zorder=10)
533
534
  elif self.label_placement == "outside":
534
535
  self.ax.legend(bbox_to_anchor=(0, 1, 1, 0), loc="lower right")
535
536
  elif self.label_placement == "inline":
@@ -1,27 +1,27 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: newsworthycharts
3
- Version: 1.54.1
3
+ Version: 1.54.4
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.54.1.tar.gz
6
+ Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.54.4.tar.gz
7
7
  Author: Jens Finnäs and Leo Wallentin, J++ Stockholm
8
8
  Author-email: stockholm@jplusplus.org
9
9
  License: MIT
10
10
  Requires-Python: >=3.9
11
11
  Description-Content-Type: text/x-rst
12
12
  License-File: LICENSE.txt
13
- Requires-Dist: Babel >=2.12
13
+ Requires-Dist: Babel <3,>=2.14.0
14
14
  Requires-Dist: Pillow ==10.1.0
15
15
  Requires-Dist: PyYAML >=3
16
16
  Requires-Dist: adjustText ==0.7.3
17
17
  Requires-Dist: boto3 >=1.26
18
- Requires-Dist: geopandas ==0.14.0
18
+ Requires-Dist: geopandas ==0.14.1
19
19
  Requires-Dist: langcodes >=3.3
20
20
  Requires-Dist: mapclassify ==2.6.1
21
21
  Requires-Dist: matplotlib-label-lines ==0.5.1
22
- Requires-Dist: matplotlib ==3.8.1
23
- Requires-Dist: numpy <2,>=1.19.1
24
- Requires-Dist: python-dateutil >=2
22
+ Requires-Dist: matplotlib ==3.8.2
23
+ Requires-Dist: numpy <2,>=1.21.0
24
+ Requires-Dist: python-dateutil <3,>=2
25
25
  Requires-Dist: requests >=2.22
26
26
 
27
27
  This module contains methods for producing graphs and publishing them on Amazon S3, or in the location of your choice.
@@ -181,6 +181,25 @@ Roadmap
181
181
  Changelog
182
182
  ---------
183
183
 
184
+ - 1.54.4
185
+
186
+ - Use Babel 2.14, and pin version
187
+ - Require numpy>=1.21.0 (now required by Matplotlib)
188
+ - Patch upgrades: matplotlib==3.8.2; geopandas==0.14.1
189
+
190
+ - 1.54.3
191
+
192
+ - Fix duplicated integer values in y axis
193
+
194
+ - 1.54.2
195
+
196
+ - Make sure that legend is always on top of bars in stacked bar charts
197
+ - Support more stacked categories in serial bar charts
198
+
199
+ - 1.52.2+
200
+
201
+ - Backport various 1.54.x fixes
202
+
184
203
  - 1.54.1
185
204
 
186
205
  - Patch upgrade Matplotlib to 3.8.1
@@ -1,7 +1,7 @@
1
- newsworthycharts/__init__.py,sha256=Zjv_yvTRWqwCfiUEt-nfCUeitUuKmx6NQdff_vXxIiM,1160
1
+ newsworthycharts/__init__.py,sha256=lUar7rzqonwWFT9D99y-rjteKifHZ4_3CizWrEFoSk8,1160
2
2
  newsworthycharts/bubblemap.py,sha256=_AMj3RkmKDKVmrtj3FuuY776xRUSEf2qE8tG0vQ3Lyg,2619
3
3
  newsworthycharts/categoricalchart.py,sha256=k2cd96pNysbVU88nZduiLGpzyjMsDXTbASAVu6ov-kI,14686
4
- newsworthycharts/chart.py,sha256=5mbqaaInC7XEknXDj1eGEJbGa4AwXCLNIvMTYSnBqeY,30253
4
+ newsworthycharts/chart.py,sha256=FX8aMTAZCUYtDpY4UNvKAly7NevZSFAVraK4JNdxp5Q,30557
5
5
  newsworthycharts/choroplethmap.py,sha256=KXtdiRBe-_j_zUozUgdhAWyoYN-eUdFxt9mneN10H1w,6670
6
6
  newsworthycharts/datalist.py,sha256=pQTzWg1lKslAstiF04oK7FwvoxTK2-1jOvrlOy7bGpk,3721
7
7
  newsworthycharts/datawrapper.py,sha256=RRkAVTpfP4updKxUIBaSmKuBi2RUVPaBRF8HDQhlGGA,11250
@@ -12,7 +12,7 @@ newsworthycharts/mimetypes.py,sha256=t_wD5FD2o1Di7NWAQGwc8ScPry48S1_7hX03_1Do-G8
12
12
  newsworthycharts/rangeplot.py,sha256=NE1W9TnmlpK6T3RvBJOU3nd73EXqkj17OY9i5zlw_cQ,8366
13
13
  newsworthycharts/scatterplot.py,sha256=6iaMoiZx__Gc-2Hcdw-8Ga5dSonrFo3oexKNmSFuir4,4959
14
14
  newsworthycharts/seasonalchart.py,sha256=rr55yqJUkaYDR9Ik98jes6574oY1U8t8LwoLE3gClW4,1967
15
- newsworthycharts/serialchart.py,sha256=AZwzSKdpJHF8G2OxSurTGnd5Hq95z8k-puLUzSQMUHQ,24526
15
+ newsworthycharts/serialchart.py,sha256=mEE-9Yahas7o86wTaynJY4hyhBm1If5qPYB8gExMXlo,24563
16
16
  newsworthycharts/storage.py,sha256=myERhlpvXyExXxUByBq9eW1bWkCyfH9SwTZbsWSyy3Q,4301
17
17
  newsworthycharts/stripechart.py,sha256=9B6PX2MyLuKNQ8W0OGdKbP0-U32kju0K_NHHwwz_J68,1547
18
18
  newsworthycharts/utils.py,sha256=aC3OF-HAsEe_WnNV2Ah_oq0QYcAETUscRZ6nQBpazQg,2842
@@ -22,7 +22,7 @@ newsworthycharts/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
22
22
  newsworthycharts/lib/color_fn.py,sha256=ck65GzTS9oPgHUCnKDwX2z8zlnNyzncw97MmhXwi8z8,1282
23
23
  newsworthycharts/lib/colors.py,sha256=U04TDkvoMQkcldRFXfnwyLOTwq1SWW2se-Ad-DNcw9o,485
24
24
  newsworthycharts/lib/datalist.py,sha256=fsO_esZBt4Aw_4n_l2LuswAYArbM-8Z8G9DAXo1oVZU,5376
25
- newsworthycharts/lib/formatter.py,sha256=jSMAohvf6rppjwXlnySCEHnBo6my2_vBN83C1xDIn00,4806
25
+ newsworthycharts/lib/formatter.py,sha256=GNH43hE0bC17OgiV8LYH3YUrEhm7OJh9XzfSV4HVtHo,4838
26
26
  newsworthycharts/lib/geography.py,sha256=K0_teFmuPJwXX7Py-amJB_1YY5_gL2kBYhz1LrRCyTg,584
27
27
  newsworthycharts/lib/locator.py,sha256=Jdi6P6Z-3DSoG_lhYQKh97_asWt9JqBV3vBzHnf1k0I,2825
28
28
  newsworthycharts/lib/mimetypes.py,sha256=bL9HtVWbn2Of39LcBt4u4yelkr4bGZiyebq3OfLnfFY,237
@@ -33,8 +33,8 @@ newsworthycharts/rc/newsworthy,sha256=X0btLNrmk2DRrfOsKj_WCSIgeD6btacEN2tRF_B4m8
33
33
  newsworthycharts/translations/datawrapper_regions.csv,sha256=fzZcQRX6RFMlNNP8mpgfYNdR3Y0QAlQxDXk8FXTaWWI,9214
34
34
  newsworthycharts/translations/regions.py,sha256=Nv1McQjggD4S3JRu82rDMTG3pqUVR13E5-FBpSYbm98,239
35
35
  newsworthycharts/translations/se_municipalities.csv,sha256=br_mm-IvzQtj_W55_ATREhJ97jWnCweBFlDAVY2EBxA,7098
36
- newsworthycharts-1.54.1.dist-info/LICENSE.txt,sha256=Sq6kGICrehbhC_FolNdXf0djKjTpv3YqjFCIYsxdQN4,1069
37
- newsworthycharts-1.54.1.dist-info/METADATA,sha256=GjYefiB5IKSbJ_AXIbcuKSFSabfi2RQ5NIxH7uihR58,23239
38
- newsworthycharts-1.54.1.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
39
- newsworthycharts-1.54.1.dist-info/top_level.txt,sha256=dn_kzIj8UgUCMsh1PHdVEQJHVGSsN7Z8YJF-8xXa8n0,17
40
- newsworthycharts-1.54.1.dist-info/RECORD,,
36
+ newsworthycharts-1.54.4.dist-info/LICENSE.txt,sha256=Sq6kGICrehbhC_FolNdXf0djKjTpv3YqjFCIYsxdQN4,1069
37
+ newsworthycharts-1.54.4.dist-info/METADATA,sha256=iqOoG5714-3F9uiMWbM8pePOJHo089roKIdHkRCD8f0,23648
38
+ newsworthycharts-1.54.4.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
39
+ newsworthycharts-1.54.4.dist-info/top_level.txt,sha256=dn_kzIj8UgUCMsh1PHdVEQJHVGSsN7Z8YJF-8xXa8n0,17
40
+ newsworthycharts-1.54.4.dist-info/RECORD,,