newsworthycharts 1.64.0__py3-none-any.whl → 1.64.1__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.64.0"
1
+ __version__ = "1.64.1"
2
2
 
3
3
  from .chart import Chart
4
4
  from .choroplethmap import ChoroplethMap
newsworthycharts/chart.py CHANGED
@@ -527,20 +527,21 @@ class Chart(object):
527
527
 
528
528
  ticks = self.value_axis.get_ticklabels()
529
529
  ticks_ = [x for (i, x) in enumerate(ticks) if ticks[i - 1].get_text() != x.get_text()]
530
+ value_axis = "_y" if self.value_axis == self.ax.yaxis else "_x"
530
531
  # remove non integer ticks
531
532
  if self.decimals == 0:
532
- y = [float(x._y) for x in ticks]
533
+ y = [float(getattr(x, value_axis)) for x in ticks]
533
534
  if self.units == "percent":
534
- y = [x for x in y if (x * 100).is_integer()]
535
+ y = [x for x in y if round(x * 100, 5).is_integer()]
535
536
  else:
536
- y = [x for x in y if x.is_integer()]
537
+ y = [x for x in y if round(x, 5).is_integer()]
537
538
  self.value_axis.set_ticks(y)
538
539
  # Remove duplicate y ticks (most should be gone as per above)
539
540
  elif len(ticks_) == 2 and self.data:
540
541
  # When only two ticks we want them on top and bottom
541
- self.value_axis.set_ticks([float(ticks[0]._y), self.data.max_val])
542
+ self.value_axis.set_ticks([float(getattr(ticks[0], value_axis)), self.data.max_val])
542
543
  elif len(ticks_) < len(ticks):
543
- y = [float(x._y) for x in ticks_]
544
+ y = [float(getattr(x, value_axis)) for x in ticks_]
544
545
  self.value_axis.set_ticks(y)
545
546
 
546
547
  # Force a second tick if we ended up having just one
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: newsworthycharts
3
- Version: 1.64.0
3
+ Version: 1.64.1
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.64.0.tar.gz
6
+ Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.64.1.tar.gz
7
7
  Author: Jens Finnäs and Leo Wallentin, J++ Stockholm
8
8
  Author-email: stockholm@jplusplus.org
9
9
  License: MIT
@@ -214,6 +214,10 @@ _ Inherits from Map _
214
214
 
215
215
  **ProgressChart**
216
216
 
217
+ _ Inherits from CategoricalChart _
218
+
219
+ - `target` = None # A target value to compare to, often 1 (when using percentages)
220
+
217
221
  **RangePlot**
218
222
 
219
223
  **ScatterPlot**
@@ -255,6 +259,11 @@ Roadmap
255
259
  Changelog
256
260
  ---------
257
261
 
262
+ - 1.64.1
263
+
264
+ - Fixed assumption about y axis being the value axis in tick cleaning
265
+ - Fix floating point bug in label handling, causing some integer labels to disappear when decimals=0
266
+
258
267
  - 1.64.0
259
268
 
260
269
  - Improved handling of value axis in categorical charts
@@ -1,7 +1,7 @@
1
- newsworthycharts/__init__.py,sha256=Ar8KT2Z_t3lWJ367gTYTFtMKii3FmyxKPDhlK3qrz2s,1160
1
+ newsworthycharts/__init__.py,sha256=dmPNkMtUZM0_DdBiIY2EBtI1-pTzeqER4SH0paV-6fU,1160
2
2
  newsworthycharts/bubblemap.py,sha256=nkocWmpiFgfjEuJGAsthjY5X7Q56jXWsZHUGXw4PwgE,2587
3
3
  newsworthycharts/categoricalchart.py,sha256=4qzx17QcJX-Xw7COwyL_atIEgeVkNnlgS3B1v4-Q6dQ,15648
4
- newsworthycharts/chart.py,sha256=5JqEsWZUNefgXyhpznXcV5U1j-IOScsGWQoCijVMo9c,32841
4
+ newsworthycharts/chart.py,sha256=KIb-x0krYD7KStlqwsZK2aGn3CRxIUAdetJXKVCUc5w,32989
5
5
  newsworthycharts/choroplethmap.py,sha256=bCLf4kcchp1C2djg5AxcOM8BdbaMj0xg7UHrZsDafhI,8013
6
6
  newsworthycharts/datawrapper.py,sha256=RRkAVTpfP4updKxUIBaSmKuBi2RUVPaBRF8HDQhlGGA,11250
7
7
  newsworthycharts/map.py,sha256=c409jEO4L8Yr780sJRC0RchR44roAlgOUDAkuk1SfRg,6057
@@ -28,8 +28,8 @@ newsworthycharts/rc/newsworthy,sha256=vbYTav1w3DmB5tpaaV7Xl5q7TQJsc9eou6pLCoWc2v
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.64.0.dist-info/LICENSE.txt,sha256=Sq6kGICrehbhC_FolNdXf0djKjTpv3YqjFCIYsxdQN4,1069
32
- newsworthycharts-1.64.0.dist-info/METADATA,sha256=Bd6gWjBOcSYe5uGZju_Ohtt_lqmkd1I_KOjsTzyFpZs,30226
33
- newsworthycharts-1.64.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
34
- newsworthycharts-1.64.0.dist-info/top_level.txt,sha256=dn_kzIj8UgUCMsh1PHdVEQJHVGSsN7Z8YJF-8xXa8n0,17
35
- newsworthycharts-1.64.0.dist-info/RECORD,,
31
+ newsworthycharts-1.64.1.dist-info/LICENSE.txt,sha256=Sq6kGICrehbhC_FolNdXf0djKjTpv3YqjFCIYsxdQN4,1069
32
+ newsworthycharts-1.64.1.dist-info/METADATA,sha256=koJ9oSSiQ0dqjLNaj1D2qLzYAQHzca6qT5G2mHGHsz0,30533
33
+ newsworthycharts-1.64.1.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
34
+ newsworthycharts-1.64.1.dist-info/top_level.txt,sha256=dn_kzIj8UgUCMsh1PHdVEQJHVGSsN7Z8YJF-8xXa8n0,17
35
+ newsworthycharts-1.64.1.dist-info/RECORD,,