newsworthycharts 1.57.3__tar.gz → 1.58.0__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 (53) hide show
  1. newsworthycharts-1.58.0/PKG-INFO +983 -0
  2. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/README.rst +8 -2
  3. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/__init__.py +1 -1
  4. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/chart.py +1 -1
  5. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/serialchart.py +15 -0
  6. newsworthycharts-1.58.0/newsworthycharts.egg-info/PKG-INFO +983 -0
  7. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts.egg-info/requires.txt +2 -2
  8. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/setup.py +4 -3
  9. newsworthycharts-1.57.3/PKG-INFO +0 -13
  10. newsworthycharts-1.57.3/newsworthycharts.egg-info/PKG-INFO +0 -13
  11. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/LICENSE.txt +0 -0
  12. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/MANIFEST.in +0 -0
  13. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/bubblemap.py +0 -0
  14. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/categoricalchart.py +0 -0
  15. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/choroplethmap.py +0 -0
  16. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/custom/__init__.py +0 -0
  17. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/custom/climate_cars.py +0 -0
  18. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/datawrapper.py +0 -0
  19. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/lib/__init__.py +0 -0
  20. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/lib/color_fn.py +0 -0
  21. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/lib/colors.py +0 -0
  22. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/lib/datalist.py +0 -0
  23. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/lib/formatter.py +0 -0
  24. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/lib/geography.py +0 -0
  25. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/lib/locator.py +0 -0
  26. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/lib/mimetypes.py +0 -0
  27. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/lib/utils.py +0 -0
  28. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/map.py +0 -0
  29. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/maps/se-4.gpkg +0 -0
  30. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/maps/se-7.gpkg +0 -0
  31. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/rangeplot.py +0 -0
  32. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/rc/newsworthy +0 -0
  33. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/scatterplot.py +0 -0
  34. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/seasonalchart.py +0 -0
  35. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/storage.py +0 -0
  36. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/stripechart.py +0 -0
  37. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/translations/datawrapper_regions.csv +0 -0
  38. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/translations/regions.py +0 -0
  39. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts/translations/se_municipalities.csv +0 -0
  40. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts.egg-info/SOURCES.txt +0 -0
  41. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts.egg-info/dependency_links.txt +0 -0
  42. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts.egg-info/not-zip-safe +0 -0
  43. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/newsworthycharts.egg-info/top_level.txt +0 -0
  44. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/setup.cfg +0 -0
  45. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/test/test_categorical_chart.py +0 -0
  46. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/test/test_choropleth_maps.py +0 -0
  47. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/test/test_custom_climate_cars.py +0 -0
  48. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/test/test_data_list.py +0 -0
  49. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/test/test_datawrapper.py +0 -0
  50. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/test/test_main.py +0 -0
  51. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/test/test_rangeplot.py +0 -0
  52. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/test/test_scatterplot.py +0 -0
  53. {newsworthycharts-1.57.3 → newsworthycharts-1.58.0}/test/test_serial_chart.py +0 -0
@@ -0,0 +1,983 @@
1
+ Metadata-Version: 2.1
2
+ Name: newsworthycharts
3
+ Version: 1.58.0
4
+ Summary: Matplotlib wrapper to create charts and publish them on Amazon S3
5
+ Home-page: https://github.com/jplusplus/newsworthycharts
6
+ Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.58.0.tar.gz
7
+ Author: Jens Finnäs and Leo Wallentin, J++ Stockholm
8
+ Author-email: stockholm@jplusplus.org
9
+ License: MIT
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/x-rst
12
+ License-File: LICENSE.txt
13
+
14
+ This module contains methods for producing graphs and publishing them on Amazon S3, or in the location of your choice.
15
+
16
+ It is written and maintained for `Newsworthy <https://www.newsworthy.se/en/>`_, but could possibly come in handy for other people as well.
17
+
18
+ By `Journalism++ Stockholm <http://jplusplus.org/sv>`_.
19
+
20
+ Installing
21
+ ----------
22
+
23
+ .. code-block:: bash
24
+
25
+ pip install newsworthycharts
26
+
27
+
28
+ Using
29
+ -----
30
+
31
+ This module comes with two classes, `Chart` and `Storage` (and it's subclasses).
32
+ When using the Chart class, the generated chart will be saved as a local file:
33
+
34
+ .. code-block:: python3
35
+
36
+ from newsworthycharts import SerialChart as Chart
37
+
38
+
39
+ c = Chart(600, 800)
40
+ c.title = "Number of smiles per second"
41
+ c.xlabel = "Time"
42
+ c.ylabel = "Smiles"
43
+ c.caption = "Source: Ministry of smiles."
44
+ data_serie_1 = [("2008-01-01", 6.1), ("2009-01-01", 5.9), ("2010-01-01", 6.8)]
45
+ c.data.append(data_serie_1)
46
+ c.highlight = "2010-01-01"
47
+ c.render("test", "png")
48
+
49
+ You can use one of the predefine chart classes to make common chart types. Or you can use Newsworthycharts together with Matplotlib. This is useful is you just want to add text elements such as subtitle, notes or apply a predefine theme.
50
+
51
+ Here is how you would make a pie chart:
52
+
53
+ .. code-block:: python3
54
+
55
+ # data
56
+ labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
57
+ sizes = [15, 30, 45, 10]
58
+
59
+ # setup chart
60
+ chart = Chart(width=800, height=600, storage=local_storage)
61
+ chart.title = "My pie chart"
62
+ chart.subtitle = "Look at all those colors"
63
+
64
+ # NB: Render the chart to `chart.ax`
65
+ chart.ax.pie(sizes, labels=labels, autopct='%1.1f%%')
66
+
67
+ # Save the chart
68
+ chart.render("tailored_chart", "png")
69
+
70
+ You can use a _storage_ object to save file to
71
+ a specific location or cloud service:
72
+
73
+ .. code-block:: python3
74
+
75
+ from newsworthycharts import Chart
76
+ from newsworthycharts import S3Storage
77
+
78
+ s3 = S3Storage("my_bucket")
79
+ c = Chart(600, 800, storage=s3)
80
+ c.title = "Number of smiles per second"
81
+ c.subtitle = "This chart tells you something very important."
82
+ c.xlabel = "Time"
83
+ c.ylabel = "Smiles"
84
+ c.note = "There are some missing smiles in data"
85
+ c.caption = "Source: Ministry of smiles."
86
+ c.render("test", "png")
87
+
88
+
89
+ To store a file in a local folder, use the `LocalStorage` class:
90
+
91
+ .. code-block:: python3
92
+
93
+ from newsworthycharts import LocalStorage
94
+
95
+ storage = LocalStorage("/path/to/generated/charts")
96
+
97
+ Charts are styled using built-in or user-defined styles:
98
+
99
+ .. code-block:: python3
100
+
101
+ from newsworthycharts import Chart
102
+
103
+ # This chart has the newsworthy default style
104
+ c = Chart(600, 800, style="newsworthy")
105
+
106
+ # Style can also be the path to a style file (absolute or relative to current working directory)
107
+ c2 = Chart(600, 800, style="path/to/styles/mystyle.mplstyle")
108
+
109
+ To set up you own style, copy the build-in default: <https://github.com/jplusplus/newsworthycharts/blob/master/newsworthycharts/rc/newsworthy>
110
+
111
+ Newsworthycharts will look first among the predefined style files for the requested style, so if you have a custom style file in you working directory you need to give it a unique name not already in use.
112
+
113
+ Options
114
+ -------
115
+
116
+ **Chart**
117
+
118
+ These settings are available for all chart types:
119
+
120
+ - data: A list of datasets
121
+ - annotate_trend = True # Print out values at points on trendline?
122
+ - trendline = [] # List of x positions, or data points
123
+ - yline = None # A horizontal line across the chart (Matplotlib: axhline)
124
+ - labels = [] # Optionally one label for each dataset
125
+ - annotations = [] # Manually added annotations
126
+ - interval = None # yearly|quarterly|monthly|weekly|daily
127
+ - units = 'number' # number|percent|degrees
128
+ - show_ticks = True # toggle category names, dates, etc
129
+ - subtitle = None
130
+ - note = None
131
+ - xlabel = None
132
+ - ylabel = None
133
+ - caption = None
134
+ - highlight = A position (typically a date, category label or index) to highlight. The semantics may differ somewhat between chart types.
135
+ - decimals = None # None means automatically chose the best number
136
+ - logo = None # Path to image that will be embedded in the caption area. Can also be set though a style property
137
+ - color_fn = None # Custom coloring function
138
+
139
+ **SerialChart**
140
+
141
+ - type = 'line' # line|bar|stacked_bar
142
+ - bar_width = 0.9 # percent of data point width
143
+ - allow_broken_y_axis = True|False # default depends on chart type
144
+ - baseline = 0 # The “zero” line. Useful for plotting deviations, e.g. temperatures above/below mean
145
+ - baseline_annotation = None # A label for the baseline
146
+ - line_width = None # To override style settings
147
+ - max_ticks = 7 # Maximum number of ticks on the x axis
148
+ - ticks = None # Custom ticks on the x axis, as a list of lists or tuples: `[(2013-01-01, "-13"), (2014-01-01, "-14"), (2015-01-01, "-15")]`
149
+ - ymin = None # Minimum value on y axis. If None, it will be calculated from data
150
+ - ymax = None # Maximum value on y axis. If None, it will be calculated from data
151
+ - colors = None # A list of colors, each correspoding to one dataseries. Default behaviour is to use the style colors
152
+ - value_labels = False # Print out values at points on line?
153
+ - highlighted_x_ranges = [] # List of tuples with start and end of highlighted areas
154
+ - x_range_labels = [] # List of labels for highlighted areas
155
+ - label_placement = "legend" # legend|inline|outside
156
+ - color_labels = None # A dictionary of label/color, to override style colors
157
+
158
+ **SeasonalChart**
159
+
160
+ **BubbleMap**
161
+
162
+ - bubble_size = 1 # The size of the bubbles
163
+
164
+ **CategoricalChart**
165
+
166
+ - bar_orientation = "horizontal" # [horizontal|vertical]
167
+ - annotation_rotation = 0
168
+ - stacked = False
169
+ - legend = True
170
+ - colors = None
171
+
172
+ **CategoricalChartWithReference**
173
+
174
+ **Map**
175
+
176
+ - bins = 9 # Number of bins for continuous data
177
+ - binning_method = "natural_breaks"
178
+ - colors = None
179
+ - color_ramp = "YlOrRd"
180
+ - categorical = False # If True, the map will be colored by category. If False, it will be colored by a continuous value
181
+ - base_map = None
182
+ - missing_label = None # Add a label for no data
183
+
184
+ `basemap` can be `{ISO}-{level}` or `{ISO}|{subset}-{level}`.
185
+ For example, `se-4` will show Swedish counties, while `se|03-7` will show municipalities (`se-7`) starting with `03`.
186
+
187
+ **ChoroplethMap**
188
+
189
+ _ Inherits from Map _
190
+
191
+ **ProgressChart**
192
+
193
+ **RangePlot**
194
+
195
+ **ScatterPlot**
196
+
197
+ **StripeChart**
198
+
199
+ Developing
200
+ ----------
201
+
202
+ To run tests:
203
+
204
+ .. code-block:: python3
205
+
206
+ python3 -m flake8
207
+ python3 -m pytest
208
+
209
+ Deployment
210
+ ----------
211
+
212
+ To deploy a new version to [PyPi](https://pypi.org/project/newsworthycharts):
213
+
214
+ 1. Update Changelog below.
215
+ 2. Update the version number in newsworthycharts/__init__.py
216
+ 3. Create and push a git tag: `git tag VERSION; git push --tags` (not strictly needed, but nice)
217
+ 4. Build: `python3 setup.py sdist bdist_wheel`
218
+ 5. Check: `python3 -m twine check dist/newsworthycharts-X.Y.X*`
219
+ 6. Upload: `python3 -m twine upload dist/newsworthycharts-X.Y.X*`
220
+
221
+ ...assuming you have Twine installed (`pip3 install twine`) and configured.
222
+
223
+ Roadmap
224
+ -------
225
+ - Adding more base maps
226
+ - Getting rid of custom settings-hack
227
+ - Custom month locator with equal-width month bars
228
+
229
+ Changelog
230
+ ---------
231
+
232
+ - 1.58.0
233
+
234
+ - Matplotlib==3.9
235
+ - Added `.x_range_labels` to SerialChart
236
+ - Some tweaks to title placement to avoid cropping of diactritics
237
+
238
+ - 1.57.3
239
+
240
+ - Make NW region keys work with map subsets (e.g. `SE|03-7`)
241
+ - Don't crash on subsequent calls to basemap parser
242
+
243
+ - 1.57.2
244
+
245
+ - reduce excessive padding in categorical vertical charts
246
+ - improved padding and margin logic for titles/subtitles (taking line spacing into account)
247
+
248
+ - 1.57.1
249
+
250
+ - Fix missing outline in choropleth maps
251
+ - matplotlib==3.8.4; Pillow==10.3.0
252
+
253
+ - 1.57.0
254
+
255
+ - Changed z-ordering so that line are always on top of bars, and ylines/zero lines are behind lines but in front of bars
256
+ - Avoid using the same color for trendline and lines
257
+ - `yline` was moved to the SerialChart class, where it makes sense.
258
+
259
+ - 1.56.0
260
+
261
+ - Reverted trendline behaviour to 1.54
262
+ - Added `yline` to add a horizontal line across the chart (Matplotlib: axhline).
263
+
264
+ - 1.55.0
265
+
266
+ - Always use neutral color for trendline
267
+
268
+ - 1.54.6
269
+
270
+ - Improved logic for trendline coloring
271
+ - Somewhat thinner trendline
272
+
273
+ - 1.54.5
274
+
275
+ - Improved tick placement in daily charts
276
+ - Minor upgrades: matplotlib==3.8.3; Pillow==10.2.0; geopandas==0.14.3
277
+
278
+ - 1.54.4
279
+
280
+ - Use Babel 2.14, and pin version
281
+ - Require numpy>=1.21.0 (now required by Matplotlib)
282
+ - Patch upgrades: matplotlib==3.8.2; geopandas==0.14.1
283
+
284
+ - 1.54.3
285
+
286
+ - Fix duplicated integer values in y axis
287
+
288
+ - 1.54.2
289
+
290
+ - Make sure that legend is always on top of bars in stacked bar charts
291
+ - Support more stacked categories in serial bar charts
292
+
293
+ - 1.52.2+
294
+
295
+ - Backport various 1.54.x fixes
296
+
297
+ - 1.54.1
298
+
299
+ - Patch upgrade Matplotlib to 3.8.1
300
+
301
+ - 1.54.0
302
+
303
+ - Treat 'jpeg' format as 'jpg'
304
+ - Fixed a rendering bug in stacked bar charts with multiple values being 0
305
+ - Pillow upgraded to 10.1
306
+
307
+ - 1.53.0
308
+
309
+ - Fixed bug in value_labels, trying to access a color value that didn't exist
310
+ - Dropped Python 3.8 support (upstream)
311
+ - Uses Matplotlib 3.8
312
+ - Uses Pillow 10
313
+
314
+ - 1.52.1
315
+
316
+ - Fixed date formatting issue in daily charts
317
+
318
+ - 1.52.0
319
+
320
+ - No longer render EPS files by default.
321
+
322
+ - 1.51.2
323
+
324
+ - _Really_ fix dependencies
325
+
326
+ - 1.51.1
327
+
328
+ - Fix error in dependency verison
329
+
330
+ - 1.51.0
331
+
332
+ - Added `BubbleMap`
333
+ - Added `se-4` basemap for Swedish counties
334
+ - Basemaps can now have multiplygons
335
+ - Downgraded adjustText to 0.7.3, as upgrade broke rendering constistency in some places
336
+
337
+ - 1.50.2
338
+
339
+ - Revert `matplotlib-label-lines` to previous version.
340
+
341
+ - 1.50.0
342
+
343
+ - Dropped Python 3.7 support (upstream)
344
+ - Pinned Pillow to exact version in setup.py, for consistent rendering
345
+ - `StripeChart`: First draft
346
+
347
+ - 1.49.1
348
+
349
+ - `ProgressChart`: Better value label placement.
350
+
351
+ - 1.49.0
352
+
353
+ - `ProgressChart`: Enable custom value labels as third argument in data serie.
354
+
355
+ - 1.48.2
356
+
357
+ - Bug fix: Handle translation in inset maps in `ChoroplethMap`.
358
+
359
+ - 1.48.1
360
+
361
+ - Bug fix: Path to translation file in `ChoroplethMap`.
362
+
363
+ - 1.48.0
364
+
365
+ - `ChoroplethMap`: Allow Newsworthy region names.
366
+ - `RangePlot`: Re-add `start_label` that had been (mistakenly?) commented out.
367
+
368
+ - 1.47.2
369
+
370
+ - Bug fix: Fixes legend issue in `ProgressChart`.
371
+
372
+ - 1.47.1
373
+
374
+ - Data point annotation now works for serial charts as well
375
+ - Bug fix: Re-enable `qualitative_colors` as `color` argument in SerialChart (line).
376
+
377
+ - 1.47.0
378
+
379
+ - Support for rendering jpeg files, as `jpg`
380
+ - Minimum required Python version is now 3.7 (jumping from 3.5)
381
+ - Matplotlib@3.7.1
382
+
383
+ - 1.46.3
384
+
385
+ - Fix z-ordering issue on multiple series (n > 2)
386
+
387
+ - 1.46.2
388
+
389
+ - Fix tag mismatch in dist
390
+
391
+ - 1.46.1
392
+
393
+ - Add missing haversine transform for non-projected crs
394
+
395
+ - 1.46.0
396
+
397
+ - `height` can be set to None for automatic ratio, for chart types that support it. Will default to 1:1 for most chart types, but maps will try to provide a reasonable default based on geometry. Some chart types still require explicit height
398
+ - It is now possible to use subsets of basemaps, by specifying a prefix: `se|03-7` means regions starting with `03` in `se-7`
399
+ - Added .missing_label to ChoroplethMap. If None (default), no label will be printed.
400
+ - Always accentuate base_line (/y=0), and make sure that line is on top of any bars to avoid “floating” bars
401
+ - Improved error handling in ChoroplethMap
402
+ - Clean up figure layout logic (this should speed up rendering somewhat)
403
+
404
+ - 1.45.0
405
+
406
+ - Increased default `max_ticks` in SerialChart to 7
407
+ - Matplotlib==3.7.0
408
+ - adjustText==0.8.0
409
+ - ChoroplethMap legend formatting, following language, decimals and units settings, etc
410
+ - Minor tweaks to the layout algorithm. Might affect padding in some charts.
411
+ - ChoroplethMap now does some basic normalizing of region codes
412
+ - Added some data sanity checks, and improved error messages in ChoroplethMap
413
+ - Added tests for ChoroplethMap
414
+
415
+ - 1.44.4
416
+
417
+ - Do not default to broken y axis if chart contains a bar series.
418
+
419
+ - 1.44.3
420
+
421
+ - Fix bug and occasional crash when using baseline with None values
422
+
423
+ - 1.44.2
424
+
425
+ - Fix crash in serialchart coloring chain
426
+
427
+ - 1.44.1
428
+
429
+ - Fix regression in SeasonalChart bar coloring
430
+
431
+ - 1.44.0
432
+
433
+ - Added grey outline to choropleth maps
434
+ - The `type` argument is now a list with one type per data serie. Using a string is still supported for backwards compability. This makes it possible to make mixed type charts.
435
+ - Reworked, simpler and more stable bar coloring algorithm
436
+ - The `type` argument is no longer a getter/setter
437
+ - Reduced edge for bar chartswith many bars
438
+ - Removed unused, undocumented special colors value `"qualitative_colors"`. We have reasonable defaults for all chart types, that can already be overridden. The qualitative colors are used by default for qualitative data.
439
+ - Removed unused, undocumented support for highlighting a series by label, rather than a value. The first series is highlighted by default, and that behaviour can already be overriden by the `.colors` setting
440
+
441
+ - 1.43.4
442
+
443
+ - Add more space for label title on se-7 maps
444
+
445
+ - 1.43.3
446
+
447
+ - Don't try to render map insets with no data
448
+ - Use style colors in categorical choropleth maps
449
+ - Added missing support for coloring categorical maps with `.colors`
450
+ - Make automatic labeling work on categorical maps with `.colors`
451
+ - Somewhat lighter fill for missing values in choropleth maps (lightgray -> gainsboro)
452
+ - Testing experimental label_title support, to be documented in 1.44.0
453
+
454
+ - 1.43.2
455
+
456
+ - Fixed weird ymax in some baseline cases
457
+ - Added bottom padding when baseline was below data-min
458
+
459
+ - 1.43.1
460
+
461
+ - Fixed cut off-bug with negative baseline
462
+ - Fix coloring bug in warm_cold color_fn with baseline
463
+ - Fix regression with quarterly locator
464
+
465
+ - 1.43.0
466
+
467
+ - Default to weekdays on x-axis if data spans 7 days or less
468
+ - Added `.color_labels` to label bar colors set by `.color_fn`
469
+
470
+ - 1.42.0
471
+
472
+ - Added `.baseline` setting for bar charts
473
+ - `warm_cold` coloring algorithm now works relative `.baseline`
474
+ - Added `.baseline_annotation`
475
+ - `.color_fn` can now be a lambda function (or the name of one of the built in functions), e.g. `chart.color_fn = lambda x: "red" if x < 1.4 else "green"`
476
+ - Bar charts will now always have a small white edge
477
+ - Don't break y axis if data is close to 0
478
+ - Offset quarters will be recognosed as quarters now (e.g. Feb, May, Aug, Nov)
479
+ - Fixed bug in .allow_broken_y_axis implementation, causing y-axis to be broken in too many places
480
+ - Various dependency updates
481
+ - Replaced deprecated PIL.Image.ANTIALIAS with PIL.Image.Resampling.LANCZOS for logotype resizing.
482
+ - Get rid of warnings about missing “glyph 10” when prerendering text to calculate text bos sizes
483
+ - Fixed bug where single values surrounded my None's were not printed out in serial-data line charts. This was an earlier regression that was not noticed for many releases.
484
+
485
+ - 1.41.0
486
+
487
+ - New, experimental chart type: Choropleth maps! Supports both categorical and continuous data.
488
+ - Better support for monthly time series spanning years
489
+ - Fixed bug where missing annotation slots could crash CategoricalChart
490
+
491
+ - 1.40.2
492
+
493
+ - Don't crash on deprecation warning
494
+ - Matplotlib upgraded from 3.6.2 to 3.6.3
495
+ - Pin some critical requirement versions
496
+
497
+ - 1.40.1
498
+
499
+ - Fix floating point bug in percent labels
500
+ - Test fixes
501
+
502
+ - 1.40.0
503
+
504
+ - Auto-decide `.decimals` if None
505
+ - Round 0.5 to 1, etc in value axis labels and annotations (the `ROUND_HALF_UP` behaviour)
506
+ - Add `.force_decimals` to print out e.g. ”1.0”. Requires `.decimals` to be explicitly set
507
+ - Serial Chart: Allow disabling ”broken y axis” feature by setting `allow_broken_y_axis=False`
508
+ - Deprecated `units="count"`. Make all numbers equal. Use `units="number"` and `decimals=0` to get the earlier behaviour.
509
+ - Remove overriding of decimal settings by units = count
510
+ - Remove noisy deprecation warning on user settings in rc files
511
+ - Formatters will now use the correct minus signs for the given locale.
512
+
513
+ - 1.39.1
514
+
515
+ - Added missing metadata to svg
516
+ - Added .__version__ attribute to the package
517
+
518
+ - 1.39.0
519
+
520
+ - Added pdf export, now more widely used than eps
521
+ - Author and software metadata now added to pdf and png, including the exakt NWCharts version used to produce an image
522
+
523
+ - 1.38.2
524
+
525
+ - `S3Storage`: Handle text files.
526
+
527
+ - 1.38.1
528
+
529
+ - Prevent logo from ever being > 155px, to restore previous behaviour.
530
+
531
+ - 1.38.0
532
+
533
+ - Made multi series bar seasonal bar charts work for opposite signs, so that we can make +/- charts
534
+
535
+ - 1.37.3
536
+
537
+ - Bug fix: Don't crash with factor argument in DW charts.
538
+
539
+ - 1.37.2
540
+
541
+ - Fixed rendering bug in non-transparent eps exports with transparent logos
542
+
543
+ - 1.37.1
544
+
545
+ - Fixed bug in argument parsing in S3Storage.save()
546
+
547
+ - 1.37.0
548
+
549
+ - Added `storage_options` argument to `render()` and `render_all()`
550
+ - Unified function signatures across storage classes.
551
+
552
+ - 1.36.0
553
+
554
+ - Added options argument to `S3Storage.save()`
555
+
556
+ - 1.35.0
557
+
558
+ - Enable logo scaling. Provided logos can now be any size, and will be scaled down to an appopriate format.
559
+
560
+ - 1.34.0
561
+
562
+ - Adds `factor` argument to `.render()` and `.render_all()`.
563
+ - Adds missing `transparent` argument to `.render_all()`.
564
+ - Matplotlib @ 3.6.2
565
+ - langcodes @ 3.3 to ensure consistent handling of macro languages (`no` is a valid language)
566
+
567
+ - 1.33.0:
568
+
569
+ - Adds `transparent` argument to render method.
570
+
571
+ - 1.32.3
572
+
573
+ - `ScatterPlot`: Mark labeled dots more clearly.
574
+
575
+ - 1.32.2
576
+
577
+ - `SerialChart`: Better error when timepoints are duplicated.
578
+
579
+ - 1.32.1
580
+
581
+ - Bug fixes: Handle negative values when `ymin=0` in SerialChart and remove line stroke from `highlighted_x_ranges`.
582
+
583
+ - 1.32.0
584
+
585
+ - `SerialChart`: New options: `line_width` and `highlighted_x_ranges`.
586
+
587
+ - 1.31.0
588
+
589
+ - Added `label_placement='outside'` option to SerialChart
590
+
591
+ - 1.30.0
592
+
593
+ - Matplotlib updated from 3.3 to 3.6, including among many, many other things:
594
+ - support for .webp
595
+ - a lot of additions and improvements to rcParams
596
+ - new backends
597
+ - Custom NWCharts parameters to the rc style file is being deprecated, and should eventually be phased out
598
+ - Matplotlib and related modules are now pinned to a specific version
599
+ - Added support for generating webp images!
600
+ - Upgraded pytest to support Python 3.10+
601
+ - Fixed date locators to use thecorrect langauge/locale
602
+ - Added padding on top of title, to avoid cropping diactritics
603
+
604
+ - 1.29.0
605
+
606
+ - `CategoricalChart`: Make it possible to hide legend.
607
+
608
+ - 1.28.1
609
+
610
+ - `CategoricalChartWithReference`: Handle multi color bars.
611
+
612
+ - 1.28.0
613
+
614
+ - `Chart` / `SerialChart`: New feature: Mark broken y axis with symbol.
615
+
616
+ - 1.27.1
617
+
618
+ - `SerialChart`: Force y axis range to to given values when `ymax` and `ymin` is defined.
619
+
620
+ - 1.27.0
621
+
622
+ - `SerialChart`: Enable value labeling of each point on line.
623
+
624
+ - 1.26.1
625
+
626
+ - Highlight only current value in SeasonalChart; use different shades of grey for the rest
627
+
628
+ - 1.26.0
629
+
630
+ - Add `SeasonalChart`, a.k.a the Olsson chart
631
+
632
+ - 1.25.3
633
+
634
+ - ProgressChart: Handle missing values
635
+ - `lib.formatter.Formatter`: Handle null values
636
+
637
+ - 1.25.2
638
+
639
+ - ScatterPlot: Enable ymin and xmin in scatterplot.
640
+
641
+ - 1.25.1
642
+
643
+ - Color annoation outline by background color.
644
+
645
+ - 1.25.0
646
+
647
+ - Improved ScatterPlot.
648
+
649
+ - 1.24.1
650
+
651
+ - Bug fix: Inline labeling on charts with missing data.
652
+
653
+ - 1.24.0
654
+
655
+ - CategoricalChartWithReference: Adds highlight option
656
+
657
+ - 1.23.1
658
+
659
+ - Adds missing dependency.
660
+
661
+ - 1.23.0
662
+
663
+ - SerialChart: Introduces inline labeling on lines
664
+
665
+ - 1.22.1
666
+
667
+ - Tweeks on line labeling
668
+
669
+ - 1.22.0
670
+
671
+ - SerialChart: Introduces labeling on lines (rather than just legends)
672
+
673
+ - 1.21.5
674
+
675
+ - Bug fix: Handle charts without ticks to be able to render pie charts again
676
+
677
+ - 1.21.4
678
+
679
+ - Beter height handling in header and footer.
680
+ - Make Noto Sans default font.
681
+
682
+ - 1.21.3
683
+
684
+ - Enable colors property in stacked bar SerialChart.
685
+
686
+ - 1.21.2
687
+
688
+ - Adjusts x margin in RangePlot to fit value labels better.
689
+ - Increases line spacing in subtitle.
690
+
691
+ - 1.21.1
692
+
693
+ - Bug fix: Small change in Datawrapper API.
694
+ - Make ticks option work with SerialChart.init_from
695
+
696
+ - 1.21.0
697
+
698
+ - New feature: Use base `Chart` class to make custom charts.
699
+ - Bug fix: Labels outside canvas in RangePlot
700
+
701
+ - 1.20.2
702
+
703
+ - ClimateCars: Tweeks on 2030 chart.
704
+
705
+ - 1.20.1
706
+
707
+ - Handle np.int as years.
708
+
709
+ - 1.20.0
710
+
711
+ - CategoricalChart: Highlight multiple values with list
712
+ - Bug fix: ylabel placed outside canvas
713
+ - Style: Align caption with note
714
+
715
+ - 1.19.2
716
+
717
+ - RangePlot: Better label margins and bold labels.
718
+
719
+ - 1.19.1
720
+
721
+ - RangePlot: Rename argument values_labels => value_labels.
722
+
723
+
724
+ - 1.19.0
725
+
726
+ - Pick up qualitative colors from style file.
727
+
728
+ - 1.18.1
729
+
730
+ - Fixed coloring on highlighted progress charts.
731
+ - Adds ability to highlight both ends on range plot.
732
+
733
+ - 1.18.0
734
+
735
+ - Added `ticks` option to SerialChart, to set custom x-axis ticks
736
+ - Added color option to CategoricalChart, to work exactly as in SerialChart
737
+ - Fixed bug with highlight in line charts where some line was outside the highlighted date.
738
+
739
+
740
+ - 1.17.0
741
+
742
+ - Enable multiple targets in progress chart.
743
+
744
+ - 1.16.2
745
+
746
+ - Fixes highlight bug in progress chart.
747
+
748
+ - 1.16.1
749
+
750
+ - Small changes in range plot.
751
+
752
+ - 1.16.0
753
+
754
+ - Adds CO2 budget chart
755
+
756
+ - 1.15.2
757
+
758
+ - ClimateCar chart tweeks.
759
+
760
+ - 1.15.1
761
+
762
+ - Bug fix: Adds newsworthycharts.custom to build.
763
+
764
+ - 1.15.0
765
+
766
+ - Introduces progress charts and removes hard coded font sizes.
767
+
768
+ - 1.14.0
769
+
770
+ - Introduces range plots and enables custom coloring in serial charts.
771
+
772
+ - 1.13.3
773
+
774
+ - Fit long ticks on y axis.
775
+
776
+ - 1.13.2
777
+
778
+ - Set annotation fontsize to same as ticks by default.
779
+
780
+ - 1.13.1
781
+
782
+ - Bug fix: Subtitle placement
783
+
784
+ - 1.13.0
785
+
786
+ - Introduces subtitle and note.
787
+ - Updates default styles to align with Newsworthy style guide.
788
+
789
+
790
+ - 1.12.1
791
+
792
+ - Fit footer by logo height. Fixes bug that caused axis overlag when logo was large.
793
+
794
+ - 1.12.0
795
+
796
+ - Introduces stacked categorical bar charts
797
+
798
+ - 1.11.2
799
+
800
+ - Bug fix: Remove failing attemt to store chart in dw format
801
+
802
+
803
+ - 1.11.1
804
+
805
+ - Corrects zorder and centers tick on CategoricalChartWithReference
806
+
807
+ - 1.11.0
808
+
809
+ - Introduces new chart: CategoricalChartWithReference
810
+
811
+ - 1.10.1
812
+
813
+ - Fixes bad X ticks in weekly SerialChart (and charts that don't start in January).
814
+
815
+ - 1.10.0
816
+
817
+ - Add annotation_rotation option to categorical charts
818
+ - Fix a crash in some special cases with serial charts shorter than a year.
819
+ - Fix a bug where diff between series was not highlighted if one value was close to zero.
820
+
821
+ - 1.9.2
822
+
823
+ - Include translations in build.
824
+
825
+ - 1.9.1
826
+
827
+ - Translates region to Datawrapper standard when making maps.
828
+
829
+ - 1.9.0
830
+
831
+ - Allows list of dicts to be passed to DatawrapperChart to be make tables, categorical maps etc.
832
+
833
+ - 1.8.2
834
+
835
+ - Require requests.
836
+
837
+ - 1.8.1
838
+
839
+ - Bug fixes.
840
+
841
+ - 1.8.0
842
+
843
+ - Introduces Datawrapper Chart type.
844
+
845
+ - 1.7.0
846
+
847
+ - Adds ymax argument (to SerialChart)
848
+ - Bug fix: Handle missing values in SerialChart with line.
849
+
850
+ - 1.6.12
851
+
852
+ - Bug fix: Set y max to stacked max in stacked bar chart.
853
+
854
+ - 1.6.11
855
+
856
+ - Introduces stacked bars to SerialChart.
857
+
858
+ - 1.6.10
859
+
860
+ - Fixes bar_orientation bug with `init_from()`
861
+
862
+ - 1.6.9
863
+
864
+ - Fix an ugly bug where type=line would not work with `init_from()`
865
+
866
+ - 1.6.8
867
+
868
+ - Some cosmetic changes: no legend if only one series, color updates, thinner zero line.
869
+
870
+
871
+ - 1.6.7
872
+
873
+ - Make title and units work with `init_from` again
874
+
875
+ - 1.6.6
876
+
877
+ - Add warm/cold color function
878
+
879
+ - 1.6.5
880
+
881
+ - Really, really make `init_from` work, by allowingly allowing allowed attributes
882
+
883
+ - 1.6.4
884
+
885
+ - Fix bug where `init_from` would sometime duplicate data.
886
+ - Make sure `init_from` does not overwrite class methods.
887
+
888
+ - 1.6.3
889
+
890
+ - Protect private properties from being overwritten by `init_from`
891
+ - When `units` is count, `decimal` should default to 0 if not provided. This sometimes didn't work. Now it does.
892
+
893
+ - 1.6.2
894
+
895
+ - Make `init_from` work as expected with a language argument
896
+
897
+ - 1.6.1
898
+
899
+ - Make `init_from` work as expected with multiple data series
900
+
901
+ - 1.6.0
902
+
903
+ - Added a factory method to create charts from a JSON-like Python object, like so: `SerialChart.init_from(config, storage)`
904
+
905
+ - 1.5.1
906
+
907
+ - Fix packaging error in 1.5.0
908
+
909
+ - 1.5.0
910
+
911
+ - Expose available chart engines in `CHART_ENGINES` constant for dynamic loading
912
+ - Add `color_fn` property, for coloring bars based on value
913
+ - Increase line width in default style
914
+ - Upgrading Numpy could potentially affect how infinity is treated in serial charts.
915
+
916
+ - 1.4.1
917
+
918
+ - Revert text adjusting for categorical charts, as it had issues
919
+
920
+ - 1.4.0
921
+
922
+ - Add new ScatterPlot chart class
923
+ - Improved text adjusting in serial charts
924
+ - More secure YAML file parsing
925
+
926
+ - 1.3.3
927
+
928
+ - Make small bar charts with very many bars look better
929
+
930
+ - 1.3.2
931
+
932
+ - Make labels work again, 1.3.1 broke those in some circumstances
933
+
934
+ - 1.3.1
935
+
936
+ - Make inner_max/min_x work with leading / trailing None values
937
+ - Make sure single, orphaned values are visible (as points) in line charts
938
+
939
+ - 1.3.0
940
+
941
+ - Allow (and recommend) using Matplotlib 3. This may affect how some charts are rendered.
942
+ - Removed undocumented and incomplete Latex support from caption.
943
+ - Don't highlight diff outside either series' extreme ends.
944
+
945
+ - 1.2.1
946
+
947
+ - Use strong color if there is nothing to highlight.
948
+
949
+ - 1.2.0
950
+
951
+ - Fix a bug where `decimals` setting was not used in all annotations. Potentially breaking in some implementations.
952
+ - Make the annotation offset 80% of the fontsize (used to be a hardcoded number of pixels)
953
+
954
+ - 1.1.5
955
+
956
+ - Small cosmetic update: Decrease offset of annotation.
957
+
958
+ - 1.1.4
959
+
960
+ - Require Matplotlib < 3, because we are still relying on some features that are deprecated there. Also, internal changes to Matplot lib may cause some charts to look different depending on version.
961
+
962
+ - 1.1.3
963
+
964
+ - Make annotation use default font size, as relative sizing didn't work here anyway
965
+
966
+ - 1.1.2
967
+
968
+ - Move class properties to method properties to make sure multiple Chart instances work as intended/documented. This will make tests run again.
969
+ - None values in bar charts are not annotated (trying to annotate None values used to result in a crash)
970
+ - More tests
971
+
972
+ - 1.1.1
973
+
974
+ - Annotations should now work as expected on series with missing data
975
+
976
+ - 1.1.0
977
+
978
+ - Fix bug where decimal setting wasn't always respected
979
+ - Make no decimals the default if unit is "count"
980
+
981
+ - 1.0.0
982
+
983
+ - First version