Skip to content

Commit 590a327

Browse files
authored
Merge pull request #41 from highcharts-for-python/develop
PR for v.1.5.0
2 parents 869fe5a + 575d2dc commit 590a327

File tree

23 files changed

+151
-13
lines changed

23 files changed

+151
-13
lines changed

CHANGES.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11

2+
Release 1.5.0
3+
=========================================
4+
5+
* **ENHANCEMENT:** Align the API to **Highcharts (JS) v.11.2** (#127). In particular, this includes:
6+
7+
* Added interpolation support to GeoHeatmap series type.
8+
* Added ``AxisEvents.point_break_out`` property.
9+
* Added ``.node_alignment`` property to ``SankeyOptions`` and ``SankeySeries``.
10+
* Added ``.link_color_mode`` property to ``SankeyOptions`` and ``SankeySeries``.
11+
* Added ``.inactive_other_points`` property to multiple series types.
12+
* Added ``.grouping`` property to Lollipop series type.
13+
* Added ``.low_marker`` property Area Range and Dumbell series types.
14+
* Added ``.show_export_in_progress`` and ``.export_in_progress`` support.
15+
* Added ``.drag`` annotation event support.
16+
17+
* **BUGFIX:** Fixed missing ``.levels`` support in ``TreegraphOptions`` and ``TreegraphSeries``.
18+
19+
-----------------------
20+
221
Release 1.4.1
322
=========================================
423

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ JavaScript data visualization library.
1616
* The **Highcharts Export Server** - enabling the programmatic creation of static
1717
(downloadable) data visualizations
1818

19-
The library supports Highcharts (JS) v.10.2 and higher, including Highcharts (JS) v.11.1.0.
19+
The library supports Highcharts (JS) v.10.2 and higher, including Highcharts (JS) v.11.2.0.
2020

2121
**Highcharts Maps for Python** is fully integrated with the broader Python ecosystem,
2222
offerin gnative integrations with:

docs/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ Core Components
343343
* - :mod:`.options.plot_options.flowmap <highcharts_maps.options.plot_options.flowmap>`
344344
- :class:`FlowmapOptions <highcharts_maps.options.plot_options.flowmap.FlowmapOptions>`
345345
:class:`GeoHeatmapOptions <highcharts_maps.options.plot_options.flowmap.GeoHeatmapOptions>`
346+
:class:`InterpolationOptions <highcharts_maps.options.plot_options.flowmap.InterpolationOptions>`
346347
* - :mod:`.options.plot_options.funnel <highcharts_maps.options.plot_options.funnel>`
347348
- :class:`FunnelOptions <highcharts_maps.options.plot_options.funnel.FunnelOptions>`
348349
:class:`Funnel3DOptions <highcharts_maps.options.plot_options.funnel.Funnel3DOptions>`

docs/api/options/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ Sub-components
295295
:class:`LollipopOptions <highcharts_maps.options.plot_options.dumbbell.LollipopOptions>`
296296
* - :mod:`.options.plot_options.flowmap <highcharts_maps.options.plot_options.flowmap>`
297297
- :class:`FlowmapOptions <highcharts_maps.options.plot_options.flowmap.FlowmapOptions>`
298-
:class:`GeoHeatmapOptions <highcharts_maps.options.series.flowmap.GeoHeatmapOptions>`
298+
:class:`GeoHeatmapOptions <highcharts_maps.options.plot_options.flowmap.GeoHeatmapOptions>`
299+
:class:`InterpolationOptions <highcharts_maps.options.plot_options.flowmap.InterpolationOptions>`
299300
* - :mod:`.options.plot_options.funnel <highcharts_maps.options.plot_options.funnel>`
300301
- :class:`FunnelOptions <highcharts_maps.options.plot_options.funnel.FunnelOptions>`
301302
:class:`Funnel3DOptions <highcharts_maps.options.plot_options.funnel.Funnel3DOptions>`

docs/api/options/plot_options/flowmap.rst

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class: :class:`FlowmapOptions <highcharts_maps.options.plot_options.flowmap.Flow
2929

3030
--------------
3131

32-
.. module:: highcharts_maps.options.plot_options.flowmap
33-
3432
********************************************************************************************************************
3533
class: :class:`GeoHeatmapOptions <highcharts_maps.options.plot_options.flowmap.GeoHeatmapOptions>`
3634
********************************************************************************************************************
@@ -47,3 +45,21 @@ class: :class:`GeoHeatmapOptions <highcharts_maps.options.plot_options.flowmap.G
4745

4846
|
4947

48+
--------------
49+
50+
********************************************************************************************************************
51+
class: :class:`InterpolationOptions <highcharts_maps.options.plot_options.flowmap.InterpolationOptions>`
52+
********************************************************************************************************************
53+
54+
.. autoclass:: InterpolationOptions
55+
:members:
56+
:inherited-members:
57+
58+
.. collapse:: Class Inheritance
59+
60+
.. inheritance-diagram:: InterpolationOptions
61+
:top-classes: highcharts_maps.metaclasses.HighchartsMeta, highcharts_core.metaclasses.HighchartsMeta
62+
:parts: -1
63+
64+
|
65+

docs/api/options/plot_options/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ Sub-components
146146
* - :mod:`.options.plot_options.flowmap <highcharts_maps.options.plot_options.flowmap>`
147147
- :class:`FlowmapOptions <highcharts_maps.options.plot_options.flowmap.FlowmapOptions>`
148148
:class:`GeoHeatmapOptions <highcharts_maps.options.plot_options.flowmap.GeoHeatmapOptions>`
149+
:class:`InterpolationOptions <highcharts_maps.options.plot_options.flowmap.InterpolationOptions>`
149150
* - :mod:`.options.plot_options.funnel <highcharts_maps.options.plot_options.funnel>`
150151
- :class:`FunnelOptions <highcharts_maps.options.plot_options.funnel.FunnelOptions>`
151152
:class:`Funnel3DOptions <highcharts_maps.options.plot_options.funnel.Funnel3DOptions>`

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Highcharts Maps for Python
3737

3838
.. sidebar:: Version Compatibility
3939

40-
**Latest Highcharts (JS) version supported:** v.11.1.0
40+
**Latest Highcharts (JS) version supported:** v.11.2.0
4141

4242
**Highcharts Maps for Python** is designed to be compatible with:
4343

highcharts_maps/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.4.1'
1+
__version__ = '1.5.0'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from highcharts_core.global_options.language.accessibility.navigator import NavigatorLanguageOptions

highcharts_maps/options/plot_options/flowmap.py

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,81 @@
44
from validator_collection import validators
55

66
from highcharts_maps import constants
7-
from highcharts_maps.decorators import class_sensitive
7+
from highcharts_maps.metaclasses import HighchartsMeta
8+
from highcharts_maps.decorators import class_sensitive, validate_types
89
from highcharts_maps.options.plot_options.generic import GenericTypeOptions
910
from highcharts_maps.utility_classes.gradients import Gradient
1011
from highcharts_maps.utility_classes.patterns import Pattern
1112
from highcharts_maps.utility_classes.markers import FlowmapMarker
1213
from highcharts_maps.options.plot_options.map import MapOptions
1314

1415

16+
class InterpolationOptions(HighchartsMeta):
17+
"""Options to configure map interpolation."""
18+
19+
def __init__(self, **kwargs):
20+
self._blur = None
21+
self._enabled = None
22+
23+
self.blur = kwargs.get('blur', None)
24+
self.enabled = kwargs.get('enabled', None)
25+
26+
@property
27+
def blur(self) -> Optional[int | float | Decimal]:
28+
"""Represents how much blur should be added to the interpolated
29+
image. Defaults to ``1``.
30+
31+
.. tip::
32+
33+
Works best in the range of ``0 - 1``, all higher values would need
34+
higher perfomance to calculate more detailed interpolation.
35+
36+
.. note::
37+
38+
This is useful, if the data is spread into wide range of\n longitue and
39+
latitude values.
40+
41+
:rtype: numeric or :obj:`None <python:None>`
42+
"""
43+
return self._blur
44+
45+
@blur.setter
46+
def blur(self, value):
47+
self._blur = validators.numeric(value, allow_empty = True)
48+
49+
@property
50+
def enabled(self) -> Optional[bool]:
51+
"""Enables or disables interpolation. Defaults to ``False``.
52+
53+
:rtype: :class:`bool <python:bool>` or :obj:`None <python:None>`
54+
"""
55+
return self._enabled
56+
57+
@enabled.setter
58+
def enabled(self, value):
59+
if value is None:
60+
self._enabled = None
61+
else:
62+
self._enabled = bool(value)
63+
64+
@classmethod
65+
def _get_kwargs_from_dict(cls, as_dict):
66+
kwargs = {
67+
'blur': as_dict.get('blur', None),
68+
'enabled': as_dict.get('enabled', None),
69+
}
70+
71+
return kwargs
72+
73+
def _to_untrimmed_dict(self, in_cls = None) -> dict:
74+
untrimmed = {
75+
'blur': self.blur,
76+
'enabled': self.enabled,
77+
}
78+
79+
return untrimmed
80+
81+
1582
class FlowmapOptions(GenericTypeOptions):
1683
"""A :term:`flowmap` series is a series laid out on top of a map series that displays route paths (e.g. flight
1784
or naval routes), or directional flows on a map. It creates a link between two points on a map chart.
@@ -509,11 +576,13 @@ def __init__(self, **kwargs):
509576
self._border_color = None
510577
self._border_width = None
511578
self._colsize = None
579+
self._interpolation = None
512580
self._rowsize = None
513581

514582
self.border_color = kwargs.get('border_color', None)
515583
self.border_width = kwargs.get('border_width', None)
516584
self.colsize = kwargs.get('colsize', None)
585+
self.interpolation = kwargs.get('interpolation', None)
517586
self.rowsize = kwargs.get('rowsize', None)
518587

519588
super().__init__(**kwargs)
@@ -549,6 +618,26 @@ def colsize(self, value):
549618
allow_empty = True,
550619
minimum = 1)
551620

621+
@property
622+
def interpolation(self) -> Optional[bool | InterpolationOptions]:
623+
"""If enabled, render data points as an interpolated image. It can be used to
624+
show temperature map-like charts. Defaults to ``False``.
625+
626+
:rtype: :class:`bool <python:bool>` or
627+
:class:`InterpolationOptions <highcharts_maps.options.plot_options.flowmap.InterpolationOptions>`
628+
or :obj:`None <python:None>`
629+
"""
630+
return self._interpolation
631+
632+
@interpolation.setter
633+
def interpolation(self, value):
634+
if value is None:
635+
self._interpolation = None
636+
elif isinstance(value, bool):
637+
self._interpolation = value
638+
else:
639+
self._interpolation = validate_types(value, InterpolationOptions)
640+
552641
@property
553642
def join_by(self) -> Optional[str | List[str] | constants.EnforcedNullType]:
554643
"""The property which should be used to join the series'
@@ -667,6 +756,7 @@ def _get_kwargs_from_dict(cls, as_dict):
667756
'border_color': as_dict.get('borderColor', None),
668757
'border_width': as_dict.get('borderWidth', None),
669758
'colsize': as_dict.get('colsize', None),
759+
'interpolation': as_dict.get('interpolation', None),
670760
'rowsize': as_dict.get('rowsize', None),
671761

672762
}
@@ -678,6 +768,7 @@ def _to_untrimmed_dict(self, in_cls = None) -> dict:
678768

679769
untrimmed = {
680770
'colsize': self.colsize,
771+
'interpolation': self.interpolation,
681772
'rowsize': self.rowsize,
682773
}
683774
parent_as_dict = mro__to_untrimmed_dict(self, in_cls = in_cls)

0 commit comments

Comments
 (0)