newsworthycharts 1.69.0__tar.gz → 1.70.1__tar.gz

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.
Files changed (51) hide show
  1. {newsworthycharts-1.69.0/newsworthycharts.egg-info → newsworthycharts-1.70.1}/PKG-INFO +17 -6
  2. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/README.rst +13 -1
  3. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/__init__.py +1 -1
  4. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/chart.py +16 -7
  5. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1/newsworthycharts.egg-info}/PKG-INFO +17 -6
  6. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts.egg-info/requires.txt +2 -3
  7. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/setup.py +2 -3
  8. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/LICENSE.txt +0 -0
  9. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/MANIFEST.in +0 -0
  10. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/bubblemap.py +0 -0
  11. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/categoricalchart.py +0 -0
  12. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/choroplethmap.py +0 -0
  13. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/custom/__init__.py +0 -0
  14. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/custom/climate_cars.py +0 -0
  15. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/datawrapper.py +0 -0
  16. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/lib/__init__.py +0 -0
  17. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/lib/color_fn.py +0 -0
  18. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/lib/colors.py +0 -0
  19. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/lib/datalist.py +0 -0
  20. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/lib/formatter.py +0 -0
  21. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/lib/geography.py +0 -0
  22. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/lib/locator.py +0 -0
  23. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/lib/mimetypes.py +0 -0
  24. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/lib/utils.py +0 -0
  25. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/map.py +0 -0
  26. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/maps/se-4.gpkg +0 -0
  27. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/maps/se-7.gpkg +0 -0
  28. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/rangeplot.py +0 -0
  29. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/rc/newsworthy +0 -0
  30. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/scatterplot.py +0 -0
  31. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/seasonalchart.py +0 -0
  32. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/serialchart.py +0 -0
  33. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/storage.py +0 -0
  34. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/stripechart.py +0 -0
  35. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/translations/datawrapper_regions.csv +0 -0
  36. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/translations/regions.py +0 -0
  37. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts/translations/se_municipalities.csv +0 -0
  38. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts.egg-info/SOURCES.txt +0 -0
  39. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts.egg-info/dependency_links.txt +0 -0
  40. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts.egg-info/not-zip-safe +0 -0
  41. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/newsworthycharts.egg-info/top_level.txt +0 -0
  42. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/setup.cfg +0 -0
  43. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/test/test_categorical_chart.py +0 -0
  44. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/test/test_choropleth_maps.py +0 -0
  45. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/test/test_custom_climate_cars.py +0 -0
  46. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/test/test_data_list.py +0 -0
  47. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/test/test_datawrapper.py +0 -0
  48. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/test/test_main.py +0 -0
  49. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/test/test_rangeplot.py +0 -0
  50. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/test/test_scatterplot.py +0 -0
  51. {newsworthycharts-1.69.0 → newsworthycharts-1.70.1}/test/test_serial_chart.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: newsworthycharts
3
- Version: 1.69.0
3
+ Version: 1.70.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.69.0.tar.gz
6
+ Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.70.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
@@ -11,19 +11,18 @@ Requires-Python: >=3.9
11
11
  Description-Content-Type: text/x-rst
12
12
  License-File: LICENSE.txt
13
13
  Requires-Dist: boto3>=1.26
14
- Requires-Dist: matplotlib==3.9.3
14
+ Requires-Dist: matplotlib==3.10.0
15
15
  Requires-Dist: langcodes>=3.3
16
16
  Requires-Dist: Babel<3,>=2.14.0
17
17
  Requires-Dist: PyYAML>=3
18
18
  Requires-Dist: adjustText==0.7.3
19
19
  Requires-Dist: numpy>2
20
20
  Requires-Dist: python-dateutil<3,>=2
21
- Requires-Dist: Pillow==11.0.0
21
+ Requires-Dist: Pillow==11.1.0
22
22
  Requires-Dist: requests>=2.22
23
23
  Requires-Dist: matplotlib-label-lines==0.5.1
24
24
  Requires-Dist: geopandas>=1
25
25
  Requires-Dist: mapclassify==2.8.1
26
- Requires-Dist: puremagic>=1
27
26
 
28
27
  This module contains methods for producing graphs and publishing them on Amazon S3, or in the location of your choice.
29
28
 
@@ -168,7 +167,7 @@ These settings are available for all chart types:
168
167
  - value_labels = False # Print out values at points on line?
169
168
  - highlighted_x_ranges = [] # List of tuples with start and end of highlighted areas
170
169
  - x_range_labels = [] # List of labels for highlighted areas
171
- - label_placement = "legend" # legend|inline|outside|line
170
+ - label_placement = "legend" # legend|inline|outside|line|none
172
171
  - color_labels = None # A dictionary of label/color, to override style colors
173
172
 
174
173
  **SeasonalChart**
@@ -187,6 +186,7 @@ _ Inherits from SerialChart _
187
186
  - legend = True
188
187
  - stacked = False
189
188
  - type = "bars" # [bars|pie]
189
+ - label_placement = "legend" # legend|outside|none
190
190
 
191
191
  **CategoricalChartWithReference**
192
192
 
@@ -261,6 +261,17 @@ Roadmap
261
261
  Changelog
262
262
  ---------
263
263
 
264
+ - 1.70.1
265
+
266
+ - Make sure y axis is cut at 100 % unless we are really, really certain it should be higher
267
+ - Revert some more padding changes from 1.65.2 and 1.65.3
268
+
269
+ - 1.70.0
270
+
271
+ - Pillow==11.1.0 (possibly faster png rendering)
272
+ - Matplotlib==3.10.0 (no known changes affecting us)
273
+ - Remove puremagic from setup requirements (only used in testing)
274
+
264
275
  - 1.69.0
265
276
 
266
277
  - New `label_order` argument in ChoroplethMap
@@ -141,7 +141,7 @@ These settings are available for all chart types:
141
141
  - value_labels = False # Print out values at points on line?
142
142
  - highlighted_x_ranges = [] # List of tuples with start and end of highlighted areas
143
143
  - x_range_labels = [] # List of labels for highlighted areas
144
- - label_placement = "legend" # legend|inline|outside|line
144
+ - label_placement = "legend" # legend|inline|outside|line|none
145
145
  - color_labels = None # A dictionary of label/color, to override style colors
146
146
 
147
147
  **SeasonalChart**
@@ -160,6 +160,7 @@ _ Inherits from SerialChart _
160
160
  - legend = True
161
161
  - stacked = False
162
162
  - type = "bars" # [bars|pie]
163
+ - label_placement = "legend" # legend|outside|none
163
164
 
164
165
  **CategoricalChartWithReference**
165
166
 
@@ -234,6 +235,17 @@ Roadmap
234
235
  Changelog
235
236
  ---------
236
237
 
238
+ - 1.70.1
239
+
240
+ - Make sure y axis is cut at 100 % unless we are really, really certain it should be higher
241
+ - Revert some more padding changes from 1.65.2 and 1.65.3
242
+
243
+ - 1.70.0
244
+
245
+ - Pillow==11.1.0 (possibly faster png rendering)
246
+ - Matplotlib==3.10.0 (no known changes affecting us)
247
+ - Remove puremagic from setup requirements (only used in testing)
248
+
237
249
  - 1.69.0
238
250
 
239
251
  - New `label_order` argument in ChoroplethMap
@@ -1,4 +1,4 @@
1
- __version__ = "1.69.0"
1
+ __version__ = "1.70.1"
2
2
 
3
3
  from .chart import Chart
4
4
  from .choroplethmap import ChoroplethMap
@@ -556,10 +556,10 @@ class Chart(object):
556
556
  if len(ticks_) <= 1 and self.data:
557
557
  self.value_axis.set_ticks([0, self.data.max_val])
558
558
 
559
- # Special handling for stacked percents, where, we want to fix any rounding errors,
560
- # to make sure value max is 100 %, and not something like 100.00000000000001 (which
561
- # may cause an extra tick to show up
562
559
  if self.units == "percent" and self.values_will_be_stacked:
560
+ # Special handling for stacked percents, where, we want to fix any rounding errors,
561
+ # to make sure value max is 100 %, and not something like 100.00000000000001 (which
562
+ # may cause an extra tick to show up
563
563
  max_val = max(self.data.stacked_values)
564
564
  diff = abs(1 - max_val)
565
565
  _decimals = self.decimals if self.decimals is not None else 2
@@ -569,6 +569,15 @@ class Chart(object):
569
569
  self.ax.set_ylim(value_lim[0], 1)
570
570
  else:
571
571
  self.ax.set_xlim(value_lim[0], 1)
572
+ elif self.units == "percent":
573
+ # Cut y axis at 100 percent if not value is above
574
+ value_lim = self.ax.get_ylim() if value_axis == "_y" else self.ax.get_xlim()
575
+ if self.data.max_val < 1 and value_lim[1] > 1:
576
+ value_lim = self.ax.get_ylim() if value_axis == "_y" else self.ax.get_xlim()
577
+ if value_axis == "_y":
578
+ self.ax.set_ylim(value_lim[0], 1)
579
+ else:
580
+ self.ax.set_xlim(value_lim[0], 1)
572
581
 
573
582
  for a in self.annotations:
574
583
  self._annotate_point(a["text"], a["xy"], a["direction"])
@@ -651,7 +660,7 @@ class Chart(object):
651
660
  # ticks labels
652
661
  tick_label_height
653
662
  # some padding
654
- + 15 / self._h
663
+ + 30 / self._h
655
664
  # chart notes (if any)
656
665
  + self._note_rel_height
657
666
  # chart caption and logo (if any)
@@ -850,7 +859,7 @@ class Chart(object):
850
859
  if self._title_elem:
851
860
  rel_height += self._text_rel_height(self._title_elem)
852
861
  # Adds a fixed margin below
853
- rel_height += 0.008
862
+ rel_height += 30 / self._h
854
863
  return rel_height
855
864
 
856
865
  @property
@@ -859,8 +868,8 @@ class Chart(object):
859
868
  if self._subtitle_elem:
860
869
  rel_height += self._text_rel_height(self._subtitle_elem)
861
870
  # Adds a fixed margin below
862
- rel_height += 0.012
863
- # rel_height += 15 / self._h
871
+ # rel_height += 0.012
872
+ rel_height += 15 / self._h
864
873
  return rel_height
865
874
 
866
875
  @property
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: newsworthycharts
3
- Version: 1.69.0
3
+ Version: 1.70.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.69.0.tar.gz
6
+ Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.70.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
@@ -11,19 +11,18 @@ Requires-Python: >=3.9
11
11
  Description-Content-Type: text/x-rst
12
12
  License-File: LICENSE.txt
13
13
  Requires-Dist: boto3>=1.26
14
- Requires-Dist: matplotlib==3.9.3
14
+ Requires-Dist: matplotlib==3.10.0
15
15
  Requires-Dist: langcodes>=3.3
16
16
  Requires-Dist: Babel<3,>=2.14.0
17
17
  Requires-Dist: PyYAML>=3
18
18
  Requires-Dist: adjustText==0.7.3
19
19
  Requires-Dist: numpy>2
20
20
  Requires-Dist: python-dateutil<3,>=2
21
- Requires-Dist: Pillow==11.0.0
21
+ Requires-Dist: Pillow==11.1.0
22
22
  Requires-Dist: requests>=2.22
23
23
  Requires-Dist: matplotlib-label-lines==0.5.1
24
24
  Requires-Dist: geopandas>=1
25
25
  Requires-Dist: mapclassify==2.8.1
26
- Requires-Dist: puremagic>=1
27
26
 
28
27
  This module contains methods for producing graphs and publishing them on Amazon S3, or in the location of your choice.
29
28
 
@@ -168,7 +167,7 @@ These settings are available for all chart types:
168
167
  - value_labels = False # Print out values at points on line?
169
168
  - highlighted_x_ranges = [] # List of tuples with start and end of highlighted areas
170
169
  - x_range_labels = [] # List of labels for highlighted areas
171
- - label_placement = "legend" # legend|inline|outside|line
170
+ - label_placement = "legend" # legend|inline|outside|line|none
172
171
  - color_labels = None # A dictionary of label/color, to override style colors
173
172
 
174
173
  **SeasonalChart**
@@ -187,6 +186,7 @@ _ Inherits from SerialChart _
187
186
  - legend = True
188
187
  - stacked = False
189
188
  - type = "bars" # [bars|pie]
189
+ - label_placement = "legend" # legend|outside|none
190
190
 
191
191
  **CategoricalChartWithReference**
192
192
 
@@ -261,6 +261,17 @@ Roadmap
261
261
  Changelog
262
262
  ---------
263
263
 
264
+ - 1.70.1
265
+
266
+ - Make sure y axis is cut at 100 % unless we are really, really certain it should be higher
267
+ - Revert some more padding changes from 1.65.2 and 1.65.3
268
+
269
+ - 1.70.0
270
+
271
+ - Pillow==11.1.0 (possibly faster png rendering)
272
+ - Matplotlib==3.10.0 (no known changes affecting us)
273
+ - Remove puremagic from setup requirements (only used in testing)
274
+
264
275
  - 1.69.0
265
276
 
266
277
  - New `label_order` argument in ChoroplethMap
@@ -1,14 +1,13 @@
1
1
  boto3>=1.26
2
- matplotlib==3.9.3
2
+ matplotlib==3.10.0
3
3
  langcodes>=3.3
4
4
  Babel<3,>=2.14.0
5
5
  PyYAML>=3
6
6
  adjustText==0.7.3
7
7
  numpy>2
8
8
  python-dateutil<3,>=2
9
- Pillow==11.0.0
9
+ Pillow==11.1.0
10
10
  requests>=2.22
11
11
  matplotlib-label-lines==0.5.1
12
12
  geopandas>=1
13
13
  mapclassify==2.8.1
14
- puremagic>=1
@@ -25,19 +25,18 @@ setup(
25
25
  python_requires='>=3.9',
26
26
  install_requires=[
27
27
  "boto3>=1.26",
28
- "matplotlib==3.9.3",
28
+ "matplotlib==3.10.0",
29
29
  "langcodes>=3.3",
30
30
  "Babel>=2.14.0,<3",
31
31
  "PyYAML>=3",
32
32
  "adjustText==0.7.3",
33
33
  "numpy>2",
34
34
  "python-dateutil>=2,<3",
35
- "Pillow==11.0.0",
35
+ "Pillow==11.1.0",
36
36
  "requests>=2.22",
37
37
  "matplotlib-label-lines==0.5.1",
38
38
  "geopandas>=1",
39
39
  "mapclassify==2.8.1",
40
- "puremagic>=1",
41
40
  ],
42
41
  setup_requires=["flake8"],
43
42
  include_package_data=True,