newsworthycharts 1.71.0__tar.gz → 1.71.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 (52) hide show
  1. {newsworthycharts-1.71.0/newsworthycharts.egg-info → newsworthycharts-1.71.1}/PKG-INFO +11 -3
  2. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/README.rst +9 -1
  3. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/__init__.py +1 -1
  4. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/chart.py +11 -6
  5. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/rankchart.py +6 -1
  6. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/serialchart.py +12 -9
  7. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1/newsworthycharts.egg-info}/PKG-INFO +11 -3
  8. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/LICENSE.txt +0 -0
  9. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/MANIFEST.in +0 -0
  10. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/bubblemap.py +0 -0
  11. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/categoricalchart.py +0 -0
  12. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/choroplethmap.py +0 -0
  13. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/custom/__init__.py +0 -0
  14. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/custom/climate_cars.py +0 -0
  15. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/datawrapper.py +0 -0
  16. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/lib/__init__.py +0 -0
  17. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/lib/color_fn.py +0 -0
  18. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/lib/colors.py +0 -0
  19. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/lib/datalist.py +0 -0
  20. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/lib/formatter.py +0 -0
  21. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/lib/geography.py +0 -0
  22. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/lib/locator.py +0 -0
  23. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/lib/mimetypes.py +0 -0
  24. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/lib/utils.py +0 -0
  25. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/map.py +0 -0
  26. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/maps/se-4.gpkg +0 -0
  27. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/maps/se-7.gpkg +0 -0
  28. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/rangeplot.py +0 -0
  29. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/rc/newsworthy +0 -0
  30. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/scatterplot.py +0 -0
  31. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/seasonalchart.py +0 -0
  32. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/storage.py +0 -0
  33. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/stripechart.py +0 -0
  34. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/translations/datawrapper_regions.csv +0 -0
  35. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/translations/regions.py +0 -0
  36. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts/translations/se_municipalities.csv +0 -0
  37. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts.egg-info/SOURCES.txt +0 -0
  38. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts.egg-info/dependency_links.txt +0 -0
  39. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts.egg-info/not-zip-safe +0 -0
  40. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts.egg-info/requires.txt +0 -0
  41. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/newsworthycharts.egg-info/top_level.txt +0 -0
  42. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/setup.cfg +0 -0
  43. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/setup.py +0 -0
  44. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/test/test_categorical_chart.py +0 -0
  45. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/test/test_choropleth_maps.py +0 -0
  46. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/test/test_custom_climate_cars.py +0 -0
  47. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/test/test_data_list.py +0 -0
  48. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/test/test_datawrapper.py +0 -0
  49. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/test/test_main.py +0 -0
  50. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/test/test_rangeplot.py +0 -0
  51. {newsworthycharts-1.71.0 → newsworthycharts-1.71.1}/test/test_scatterplot.py +0 -0
  52. {newsworthycharts-1.71.0 → newsworthycharts-1.71.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.71.0
3
+ Version: 1.71.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.71.0.tar.gz
6
+ Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.71.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
@@ -178,7 +178,9 @@ _ Inherits from SerialChart _
178
178
 
179
179
  _ Inherits from SerialChart _
180
180
 
181
- - highlight: The label value to of a line to highlight
181
+ - highlight = None # The label value to of a line to highlight
182
+ - line_marker = "o-" # Matplotlib line marker type.
183
+ - line_marker_size = 5 # Matplotlib line marker size
182
184
 
183
185
  **BubbleMap**
184
186
 
@@ -267,6 +269,12 @@ Roadmap
267
269
  Changelog
268
270
  ---------
269
271
 
272
+ - 1.71.1
273
+
274
+ - Allow setting line marker size and style in `BumpChart`
275
+ - Various fixes in `BumpChart`
276
+ - Take font size into account when positioning annotations
277
+
270
278
  - 1.71.0
271
279
 
272
280
  - Add `BumpChart`
@@ -152,7 +152,9 @@ _ Inherits from SerialChart _
152
152
 
153
153
  _ Inherits from SerialChart _
154
154
 
155
- - highlight: The label value to of a line to highlight
155
+ - highlight = None # The label value to of a line to highlight
156
+ - line_marker = "o-" # Matplotlib line marker type.
157
+ - line_marker_size = 5 # Matplotlib line marker size
156
158
 
157
159
  **BubbleMap**
158
160
 
@@ -241,6 +243,12 @@ Roadmap
241
243
  Changelog
242
244
  ---------
243
245
 
246
+ - 1.71.1
247
+
248
+ - Allow setting line marker size and style in `BumpChart`
249
+ - Various fixes in `BumpChart`
250
+ - Take font size into account when positioning annotations
251
+
244
252
  - 1.71.0
245
253
 
246
254
  - Add `BumpChart`
@@ -1,4 +1,4 @@
1
- __version__ = "1.71.0"
1
+ __version__ = "1.71.1"
2
2
 
3
3
  from .chart import Chart
4
4
  from .choroplethmap import ChoroplethMap
@@ -207,9 +207,14 @@ class Chart(object):
207
207
  c = color_name
208
208
  return c
209
209
 
210
- def _annotate_point(self, text, xy,
211
- direction, offset=12,
212
- **kwargs):
210
+ def _annotate_point(
211
+ self,
212
+ text,
213
+ xy,
214
+ direction,
215
+ offset=12,
216
+ **kwargs
217
+ ):
213
218
  """Add a label to a given point.
214
219
 
215
220
  :param text: text content of label
@@ -237,11 +242,11 @@ class Chart(object):
237
242
  elif direction == "left":
238
243
  opts["verticalalignment"] = "center"
239
244
  opts["horizontalalignment"] = "right"
240
- opts["xytext"] = (-offset, 0)
245
+ opts["xytext"] = (-offset, -self._nwc_style["annotation.fontsize"] / 0.75)
241
246
  elif direction == "right":
242
247
  opts["verticalalignment"] = "center"
243
248
  opts["horizontalalignment"] = "left"
244
- opts["xytext"] = (offset, 0)
249
+ opts["xytext"] = (offset, -self._nwc_style["annotation.fontsize"] / 0.75)
245
250
  else:
246
251
  msg = f"'{direction}' is an unknown direction for an annotation"
247
252
  raise Exception(msg)
@@ -679,7 +684,7 @@ class Chart(object):
679
684
  self.ax.invert_yaxis()
680
685
  value_axis = self.ax.get_yaxis()
681
686
  value_ticks = self.ax.get_yticks()
682
- value_ticks = [x for x in value_ticks if x <= self.data.max_val]
687
+ value_ticks = [x for x in value_ticks if x <= self.data.max_val and x >= self.ymin]
683
688
  value_axis.set_ticks(value_ticks)
684
689
  # self.ax.set_ylim(self.data.max_val, self.ymin)
685
690
 
@@ -14,7 +14,9 @@ class BumpChart(SerialChart):
14
14
 
15
15
  def __init__(self, *args, **kwargs):
16
16
  super(BumpChart, self).__init__(*args, **kwargs)
17
- self.line_width = 0.5
17
+
18
+ if self.line_width is None:
19
+ self.line_width = 0.9
18
20
  self.label_placement = 'line'
19
21
  self.type = "line"
20
22
  self.decimals = 0
@@ -22,7 +24,10 @@ class BumpChart(SerialChart):
22
24
  self.ymin = 1
23
25
  self.allow_broken_y_axis = False
24
26
  self.grid = False
27
+ self.accentuate_baseline = False
28
+
25
29
  self.line_marker = "o-"
30
+ self.line_marker_size = 5
26
31
 
27
32
  def _get_line_colors(self, i, *args):
28
33
  if not self.data:
@@ -28,6 +28,7 @@ class SerialChart(Chart):
28
28
  # draw bars and cut ay axis from this line
29
29
  self.baseline = kwargs.get("baseline", 0)
30
30
  self.baseline_annotation = kwargs.get("baseline_annotation", None)
31
+ self.accentuate_baseline = True
31
32
 
32
33
  self.color_labels = kwargs.get("color_labels", None)
33
34
 
@@ -37,6 +38,7 @@ class SerialChart(Chart):
37
38
  self.grid = True
38
39
  self.point_marker = "."
39
40
  self.line_marker = "-"
41
+ self.line_marker_size = 3
40
42
 
41
43
  self.max_ticks = 10
42
44
 
@@ -256,7 +258,7 @@ class SerialChart(Chart):
256
258
  dates,
257
259
  values,
258
260
  self.line_marker,
259
- markersize=4,
261
+ markersize=self.line_marker_size,
260
262
  color=color,
261
263
  zorder=zo,
262
264
  lw=lw,
@@ -303,7 +305,7 @@ class SerialChart(Chart):
303
305
  "right",
304
306
  offset=15,
305
307
  color=color,
306
- va="center"
308
+ va="center",
307
309
  )
308
310
  # store labels to check for overlap later
309
311
  line_label_elems.append(lbl)
@@ -503,13 +505,14 @@ class SerialChart(Chart):
503
505
 
504
506
  # Accentuate y=0 || y=baseline
505
507
  # if (self.data.min_val < self.baseline) or self.baseline_annotation:
506
- self.ax.axhline(
507
- y=self.baseline,
508
- linewidth=1,
509
- color="#444444",
510
- zorder=11,
511
- linestyle="--" if self.baseline else "-"
512
- )
508
+ if self.accentuate_baseline:
509
+ self.ax.axhline(
510
+ y=self.baseline,
511
+ linewidth=1,
512
+ color="#444444",
513
+ zorder=11,
514
+ linestyle="--" if self.baseline else "-"
515
+ )
513
516
  if self.baseline_annotation:
514
517
  xy = (to_date(self.data.outer_min_x), self.baseline)
515
518
  # We only allow baseline to be set for single series bar charts
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: newsworthycharts
3
- Version: 1.71.0
3
+ Version: 1.71.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.71.0.tar.gz
6
+ Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.71.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
@@ -178,7 +178,9 @@ _ Inherits from SerialChart _
178
178
 
179
179
  _ Inherits from SerialChart _
180
180
 
181
- - highlight: The label value to of a line to highlight
181
+ - highlight = None # The label value to of a line to highlight
182
+ - line_marker = "o-" # Matplotlib line marker type.
183
+ - line_marker_size = 5 # Matplotlib line marker size
182
184
 
183
185
  **BubbleMap**
184
186
 
@@ -267,6 +269,12 @@ Roadmap
267
269
  Changelog
268
270
  ---------
269
271
 
272
+ - 1.71.1
273
+
274
+ - Allow setting line marker size and style in `BumpChart`
275
+ - Various fixes in `BumpChart`
276
+ - Take font size into account when positioning annotations
277
+
270
278
  - 1.71.0
271
279
 
272
280
  - Add `BumpChart`