newsworthycharts 1.57.0__tar.gz → 1.57.2__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.57.0/newsworthycharts.egg-info → newsworthycharts-1.57.2}/PKG-INFO +13 -3
  2. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/README.rst +11 -1
  3. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/__init__.py +1 -1
  4. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/categoricalchart.py +3 -2
  5. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/chart.py +6 -6
  6. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/choroplethmap.py +2 -17
  7. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2/newsworthycharts.egg-info}/PKG-INFO +13 -3
  8. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts.egg-info/requires.txt +2 -2
  9. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/setup.py +2 -2
  10. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/LICENSE.txt +0 -0
  11. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/MANIFEST.in +0 -0
  12. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/bubblemap.py +0 -0
  13. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/custom/__init__.py +0 -0
  14. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/custom/climate_cars.py +0 -0
  15. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/datawrapper.py +0 -0
  16. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/lib/__init__.py +0 -0
  17. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/lib/color_fn.py +0 -0
  18. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/lib/colors.py +0 -0
  19. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/lib/datalist.py +0 -0
  20. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/lib/formatter.py +0 -0
  21. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/lib/geography.py +0 -0
  22. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/lib/locator.py +0 -0
  23. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/lib/mimetypes.py +0 -0
  24. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/lib/utils.py +0 -0
  25. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/map.py +0 -0
  26. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/maps/se-4.gpkg +0 -0
  27. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/maps/se-7.gpkg +0 -0
  28. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/rangeplot.py +0 -0
  29. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/rc/newsworthy +0 -0
  30. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/scatterplot.py +0 -0
  31. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/seasonalchart.py +0 -0
  32. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/serialchart.py +0 -0
  33. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/storage.py +0 -0
  34. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/stripechart.py +0 -0
  35. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/translations/datawrapper_regions.csv +0 -0
  36. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/translations/regions.py +0 -0
  37. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts/translations/se_municipalities.csv +0 -0
  38. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts.egg-info/SOURCES.txt +0 -0
  39. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts.egg-info/dependency_links.txt +0 -0
  40. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts.egg-info/not-zip-safe +0 -0
  41. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/newsworthycharts.egg-info/top_level.txt +0 -0
  42. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/setup.cfg +0 -0
  43. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/test/test_categorical_chart.py +0 -0
  44. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/test/test_choropleth_maps.py +0 -0
  45. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/test/test_custom_climate_cars.py +0 -0
  46. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/test/test_data_list.py +0 -0
  47. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/test/test_datawrapper.py +0 -0
  48. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/test/test_main.py +0 -0
  49. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/test/test_rangeplot.py +0 -0
  50. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/test/test_scatterplot.py +0 -0
  51. {newsworthycharts-1.57.0 → newsworthycharts-1.57.2}/test/test_serial_chart.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: newsworthycharts
3
- Version: 1.57.0
3
+ Version: 1.57.2
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.57.0.tar.gz
6
+ Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.57.2.tar.gz
7
7
  Author: Jens Finnäs and Leo Wallentin, J++ Stockholm
8
8
  Author-email: stockholm@jplusplus.org
9
9
  License: MIT
@@ -224,9 +224,19 @@ Roadmap
224
224
  Changelog
225
225
  ---------
226
226
 
227
+ - 1.57.2
228
+
229
+ - reduce excessive padding in ctagoerical vertical charts
230
+ - improved padding and margin logic for titles/subtitles (taking line spacing into account)
231
+
232
+ - 1.57.1
233
+
234
+ - Fix missing outline in choropleth maps
235
+ - matplotlib==3.8.4; Pillow==10.3.0
236
+
227
237
  - 1.57.0
228
238
 
229
- - Changes z-ordering so that line are always on top of bars, and ylines/zero lines are behind lines but in front of bars
239
+ - Changed z-ordering so that line are always on top of bars, and ylines/zero lines are behind lines but in front of bars
230
240
  - Avoid using the same color for trendline and lines
231
241
  - `yline` was moved to the SerialChart class, where it makes sense.
232
242
 
@@ -211,9 +211,19 @@ Roadmap
211
211
  Changelog
212
212
  ---------
213
213
 
214
+ - 1.57.2
215
+
216
+ - reduce excessive padding in ctagoerical vertical charts
217
+ - improved padding and margin logic for titles/subtitles (taking line spacing into account)
218
+
219
+ - 1.57.1
220
+
221
+ - Fix missing outline in choropleth maps
222
+ - matplotlib==3.8.4; Pillow==10.3.0
223
+
214
224
  - 1.57.0
215
225
 
216
- - Changes z-ordering so that line are always on top of bars, and ylines/zero lines are behind lines but in front of bars
226
+ - Changed z-ordering so that line are always on top of bars, and ylines/zero lines are behind lines but in front of bars
217
227
  - Avoid using the same color for trendline and lines
218
228
  - `yline` was moved to the SerialChart class, where it makes sense.
219
229
 
@@ -1,4 +1,4 @@
1
- __version__ = "1.57.0"
1
+ __version__ = "1.57.2"
2
2
 
3
3
  from .chart import Chart
4
4
  from .choroplethmap import ChoroplethMap
@@ -16,7 +16,7 @@ class CategoricalChart(Chart):
16
16
  self.stacked = False
17
17
  self.legend = True
18
18
 
19
- # Optional: specify a list of colors (for mulitple datasets)
19
+ # Optional: specify a list of colors (for multiple datasets)
20
20
  self.colors = None
21
21
 
22
22
  def _add_data(self):
@@ -144,8 +144,8 @@ class CategoricalChart(Chart):
144
144
  kwargs["bottom"] = cum_values[i - 1]
145
145
  self.ax.bar(bar_pos, values, **kwargs)
146
146
 
147
- margin = 0.02 # above and below first/last bar on horizontal
148
147
  if self.bar_orientation == "horizontal":
148
+ margin = 0.02 # above and below first/last bar on horizontal
149
149
  self.ax.set_yticks(bar_pos)
150
150
  self.ax.set_yticklabels(categories)
151
151
  self.ax.invert_yaxis()
@@ -158,6 +158,7 @@ class CategoricalChart(Chart):
158
158
  self._fig.subplots_adjust(left=margin)
159
159
 
160
160
  elif self.bar_orientation == "vertical":
161
+ margin = 0.01 # above and below first/last bar on horizontal
161
162
  self.ax.margins(margin, 0)
162
163
  self.ax.set_xticks(bar_pos)
163
164
  self.ax.set_xticklabels(categories)
@@ -168,7 +168,7 @@ class Chart(object):
168
168
  ismath=False,
169
169
  )
170
170
  num_lines = len(obj._get_wrapped_text().split("\n"))
171
- return (h * num_lines) / float(self._h)
171
+ return (h * (num_lines * 1.4)) / float(self._h) # 1.4 is the line spacing used everywhere
172
172
 
173
173
  def _rel_height(self, obj):
174
174
  """ Get the relative height of a chart object to the whole canvas.
@@ -273,7 +273,7 @@ class Chart(object):
273
273
  def _add_title(self, title_text):
274
274
  """Add a title."""
275
275
  # y=1 wraps title heavily, hence .9999
276
- text = self._fig.suptitle(title_text, wrap=True, x=0, y=0.985,
276
+ text = self._fig.suptitle(title_text, wrap=True, x=0, y=0.999,
277
277
  horizontalalignment="left",
278
278
  multialignment="left",
279
279
  fontproperties=self._title_font)
@@ -755,7 +755,7 @@ class Chart(object):
755
755
  rel_height = 0
756
756
  if self._title_elem:
757
757
  rel_height += self._text_rel_height(self._title_elem)
758
- # Adds a fixes margin below
758
+ # Adds a fixed margin below
759
759
  rel_height += 30 / self._h
760
760
  return rel_height
761
761
 
@@ -764,8 +764,8 @@ class Chart(object):
764
764
  rel_height = 0
765
765
  if self._subtitle_elem:
766
766
  rel_height += self._text_rel_height(self._subtitle_elem)
767
- # Adds a fixes margin below
768
- rel_height += 30 / self._h
767
+ # Adds a fixed margin below
768
+ rel_height += 15 / self._h
769
769
  return rel_height
770
770
 
771
771
  @property
@@ -773,7 +773,7 @@ class Chart(object):
773
773
  rel_height = 0
774
774
  if self._note_elem:
775
775
  rel_height += self._text_rel_height(self._note_elem)
776
- # Adds a fixes margin below
776
+ # Adds a fixed margin below
777
777
  rel_height += 10 / self._h
778
778
  return rel_height
779
779
 
@@ -2,7 +2,6 @@
2
2
  Simple choropleths for common administrative areas
3
3
  """
4
4
  from .map import Map
5
- from shapely.geometry.multipolygon import MultiPolygon
6
5
  import geopandas as gpd
7
6
  import numpy as np
8
7
  import pandas as pd
@@ -112,27 +111,13 @@ class ChoroplethMap(Map):
112
111
 
113
112
  fig = df.plot(ax=self.ax, **args)
114
113
  # Add outer edge
115
- # unary_union does not work with Multipolygons
116
- mp = MultiPolygon([g for g in df.explode(index_parts=True).geometry])
117
- gpd.GeoSeries(mp.boundary).plot(
114
+ gpd.GeoSeries(df.unary_union).plot(
118
115
  ax=self.ax,
119
116
  edgecolor="lightgrey",
120
117
  linewidth=0.2,
118
+ facecolor="none",
121
119
  color="none",
122
120
  )
123
- """
124
- unary = df.unary_union
125
- if unary.geom_type == "Polygon":
126
- # We don't know in advance if unary_union will produce a polugon or a multipolygon
127
- unary = MultiPolygon([unary])
128
- for uu in unary.geoms:
129
- gpd.GeoSeries(uu).plot(
130
- ax=self.ax,
131
- edgecolor="lightgrey",
132
- linewidth=0.2,
133
- facecolor="none",
134
- )
135
- """
136
121
  self.ax.axis("off")
137
122
 
138
123
  # Format numbers in legend
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: newsworthycharts
3
- Version: 1.57.0
3
+ Version: 1.57.2
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.57.0.tar.gz
6
+ Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.57.2.tar.gz
7
7
  Author: Jens Finnäs and Leo Wallentin, J++ Stockholm
8
8
  Author-email: stockholm@jplusplus.org
9
9
  License: MIT
@@ -224,9 +224,19 @@ Roadmap
224
224
  Changelog
225
225
  ---------
226
226
 
227
+ - 1.57.2
228
+
229
+ - reduce excessive padding in ctagoerical vertical charts
230
+ - improved padding and margin logic for titles/subtitles (taking line spacing into account)
231
+
232
+ - 1.57.1
233
+
234
+ - Fix missing outline in choropleth maps
235
+ - matplotlib==3.8.4; Pillow==10.3.0
236
+
227
237
  - 1.57.0
228
238
 
229
- - Changes z-ordering so that line are always on top of bars, and ylines/zero lines are behind lines but in front of bars
239
+ - Changed z-ordering so that line are always on top of bars, and ylines/zero lines are behind lines but in front of bars
230
240
  - Avoid using the same color for trendline and lines
231
241
  - `yline` was moved to the SerialChart class, where it makes sense.
232
242
 
@@ -1,5 +1,5 @@
1
1
  Babel<3,>=2.14.0
2
- Pillow==10.2.0
2
+ Pillow==10.3.0
3
3
  PyYAML>=3
4
4
  adjustText==0.7.3
5
5
  boto3>=1.26
@@ -7,7 +7,7 @@ geopandas==0.14.3
7
7
  langcodes>=3.3
8
8
  mapclassify==2.6.1
9
9
  matplotlib-label-lines==0.5.1
10
- matplotlib==3.8.3
10
+ matplotlib==3.8.4
11
11
  numpy<2,>=1.21.0
12
12
  python-dateutil<3,>=2
13
13
  requests>=2.22
@@ -25,14 +25,14 @@ setup(
25
25
  python_requires='>=3.9',
26
26
  install_requires=[
27
27
  "boto3>=1.26",
28
- "matplotlib==3.8.3",
28
+ "matplotlib==3.8.4",
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>=1.21.0,<2",
34
34
  "python-dateutil>=2,<3",
35
- "Pillow==10.2.0",
35
+ "Pillow==10.3.0",
36
36
  "requests>=2.22",
37
37
  "matplotlib-label-lines==0.5.1",
38
38
  "geopandas==0.14.3",