Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR for v.1.5.0 #53

Merged
merged 9 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@

Release 1.5.0
=========================================

* **ENHANCEMENT:** Align the API to **Highcharts (JS) v.11.2** (#127). In particular, this includes:

* Added Navigator ``.accessibility`` support.
* Added ``.class_name`` to Stock Tools definitions.
* Added reversal support to Fibonacci Stock Tools.
* Added ``AxisEvents.point_break_out`` property.
* Added ``.node_alignment`` property to ``SankeyOptions`` and ``SankeySeries``.
* Added ``.link_color_mode`` property to ``SankeyOptions`` and ``SankeySeries``.
* Added ``.inactive_other_points`` property to multiple series types.
* Added ``.grouping`` property to Lollipop series type.
* Added ``.low_marker`` property Area Range and Dumbell series types.
* Added ``.show_export_in_progress`` and ``.export_in_progress`` support.
* Added ``.drag`` annotation event support.

* **BUGFIX:** Fixed missing ``.levels`` support in ``TreegraphOptions`` and ``TreegraphSeries``.

-----------------------

Release 1.4.6
=========================================

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ JavaScript data visualization library.
* The **Highcharts Export Server** - enabling the programmatic creation of static
(downloadable) data visualizations

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

**Highcharts Stock for Python** is fully integrated with the broader Python ecosystem,
in particular:
Expand Down
1 change: 1 addition & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ Core Components
* - :mod:`.options.navigator <highcharts_stock.options.navigator>`
- :class:`Navigator <highcharts_stock.options.navigator.Navigator>`
:class:`HandleOptions <highcharts_stock.options.navigator.HandleOptions>`
:class:`NavigatorAccessibilityOptions <highcharts_stock.options.navigator.NavigatorAccessibilityOptions>`
* - :mod:`.options.no_data <highcharts_stock.options.no_data>`
- :class:`NoData <highcharts_stock.options.no_data.NoData>`
* - :mod:`.options.pane <highcharts_stock.options.pane>`
Expand Down
1 change: 1 addition & 0 deletions docs/api/options/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ Sub-components
* - :mod:`.options.navigator <highcharts_stock.options.navigator>`
- :class:`Navigator <highcharts_stock.options.navigator.Navigator>`
:class:`HandleOptions <highcharts_stock.options.navigator.HandleOptions>`
:class:`NavigatorAccessibilityOptions <highcharts_stock.options.navigator.NavigatorAccessibilityOptions>`
* - :mod:`.options.no_data <highcharts_stock.options.no_data>`
- :class:`NoData <highcharts_stock.options.no_data.NoData>`
* - :mod:`.options.pane <highcharts_stock.options.pane>`
Expand Down
18 changes: 18 additions & 0 deletions docs/api/options/navigator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,21 @@ class: :class:`HandleOptions <highcharts_stock.options.navigator.HandleOptions>`
:parts: -1

|

------------------

********************************************************************************************************************
class: :class:`NavigatorAccessibilityOptions <highcharts_stock.options.navigator.NavigatorAccessibilityOptions>`
********************************************************************************************************************

.. autoclass:: NavigatorAccessibilityOptions
:members:
:inherited-members:

.. collapse:: Class Inheritance

.. inheritance-diagram:: NavigatorAccessibilityOptions
:top-classes: highcharts_stock.metaclasses.HighchartsMeta, highcharts_core.metaclasses.HighchartsMeta
:parts: -1

|
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Highcharts Stock for Python

.. sidebar:: Version Compatibility

**Latest Highcharts (JS) version supported:** v.11.1.0
**Latest Highcharts (JS) version supported:** v.11.2.0

**Highcharts Stock for Python** is designed to be compatible with:

Expand Down
2 changes: 1 addition & 1 deletion highcharts_stock/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.4.6'
__version__ = '1.5.0'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from highcharts_core.global_options.language.accessibility.navigator import NavigatorLanguageOptions

Check warning on line 1 in highcharts_stock/global_options/language/accessibility/navigator.py

View check run for this annotation

Codecov / codecov/patch

highcharts_stock/global_options/language/accessibility/navigator.py#L1

Added line #L1 was not covered by tests
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
self._points = None
self._x_axis = None
self._y_axis = None
self._reversed = None

self.background_colors = kwargs.get('background_colors', None)
self.height = kwargs.get('height', None)
Expand All @@ -35,6 +36,7 @@
self.points = kwargs.get('points', None)
self.x_axis = kwargs.get('x_axis', None)
self.y_axis = kwargs.get('y_axis', None)
self.reversed = kwargs.get('reversed', None)

@property
def background_colors(self) -> Optional[List[str]]:
Expand Down Expand Up @@ -151,6 +153,22 @@
def points(self, value):
self._points = value

@property
def reversed(self) -> Optional[bool]:
"""Flag which determines whether the annotation levels should be reversed.
Defaults to ``False``, meaning that they go from ``0`` to ``1``.

:rtype: :class:`bool <python:bool>`
"""
return self._reversed

@reversed.setter
def reversed(self, value):
if value is None:
self._reversed = None
else:
self._reversed = bool(value)

Check warning on line 170 in highcharts_stock/options/annotations/stock_tools/type_options/fibonacci.py

View check run for this annotation

Codecov / codecov/patch

highcharts_stock/options/annotations/stock_tools/type_options/fibonacci.py#L170

Added line #L170 was not covered by tests

@property
def x_axis(self) -> Optional[str | int]:
"""This number defines which xAxis the point is connected to.
Expand Down Expand Up @@ -219,6 +237,7 @@
'line_color': as_dict.get('lineColor', None),
'line_colors': as_dict.get('lineColors', None),
'points': as_dict.get('points', None),
'reversed': as_dict.get('reversed', None),
'x_axis': as_dict.get('xAxis', None),
'y_axis': as_dict.get('yAxis', None),
}
Expand All @@ -234,6 +253,7 @@
'lineColor': self.line_color,
'lineColors': self.line_colors,
'points': self.points,
'reversed': self.reversed,
'xAxis': self.x_axis,
'yAxis': self.y_axis,
}
Expand Down
66 changes: 66 additions & 0 deletions highcharts_stock/options/navigator.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,61 @@
return untrimmed


class NavigatorAccessibilityOptions(HighchartsMeta):
"""Accessibility options for the Navigator."""

def __init__(self, **kwargs):
self._enabled = None

Check warning on line 180 in highcharts_stock/options/navigator.py

View check run for this annotation

Codecov / codecov/patch

highcharts_stock/options/navigator.py#L180

Added line #L180 was not covered by tests

self.enabled = kwargs.get('enabled')

Check warning on line 182 in highcharts_stock/options/navigator.py

View check run for this annotation

Codecov / codecov/patch

highcharts_stock/options/navigator.py#L182

Added line #L182 was not covered by tests

@property
def _dot_path(self) -> Optional[str]:
"""The dot-notation path to the options key for the current class.

:rtype: :class:`str <python:str>` or :obj:`None <python:None>`
"""
return 'accessibility'

Check warning on line 190 in highcharts_stock/options/navigator.py

View check run for this annotation

Codecov / codecov/patch

highcharts_stock/options/navigator.py#L190

Added line #L190 was not covered by tests

@property
def enabled(self) -> Optional[bool]:
"""If ``True``, enables accessibility support for the navigator.
Defaults to ``True``.

:rtype: :class:`bool <python:bool>`
"""
return self._enabled

Check warning on line 199 in highcharts_stock/options/navigator.py

View check run for this annotation

Codecov / codecov/patch

highcharts_stock/options/navigator.py#L199

Added line #L199 was not covered by tests

@enabled.setter
def enabled(self, value):
if value is None:
self._enabled = None

Check warning on line 204 in highcharts_stock/options/navigator.py

View check run for this annotation

Codecov / codecov/patch

highcharts_stock/options/navigator.py#L204

Added line #L204 was not covered by tests
else:
self._enabled = bool(value)

Check warning on line 206 in highcharts_stock/options/navigator.py

View check run for this annotation

Codecov / codecov/patch

highcharts_stock/options/navigator.py#L206

Added line #L206 was not covered by tests

@classmethod
def _get_kwargs_from_dict(cls, as_dict):
kwargs = {

Check warning on line 210 in highcharts_stock/options/navigator.py

View check run for this annotation

Codecov / codecov/patch

highcharts_stock/options/navigator.py#L210

Added line #L210 was not covered by tests
'enabled': as_dict.get('enabled', None),
}

return kwargs

Check warning on line 214 in highcharts_stock/options/navigator.py

View check run for this annotation

Codecov / codecov/patch

highcharts_stock/options/navigator.py#L214

Added line #L214 was not covered by tests

def _to_untrimmed_dict(self, in_cls = None) -> dict:
untrimmed = {

Check warning on line 217 in highcharts_stock/options/navigator.py

View check run for this annotation

Codecov / codecov/patch

highcharts_stock/options/navigator.py#L217

Added line #L217 was not covered by tests
'enabled': self.enabled,
}

return untrimmed

Check warning on line 221 in highcharts_stock/options/navigator.py

View check run for this annotation

Codecov / codecov/patch

highcharts_stock/options/navigator.py#L221

Added line #L221 was not covered by tests


class Navigator(HighchartsMeta):
"""The navigator is a small series below the main series, displaying a view of the
entire data set. It provides tools to zoom in and out on parts of the data as well as
panning across the dataset."""

def __init__(self, **kwargs):
self._accessibility = None
self._adapt_to_updated_data = None
self._enabled = None
self._handles = None
Expand All @@ -193,6 +242,7 @@
self._x_axis = None
self._y_axis = None

self.accessibility = kwargs.get('accessibility', None)
self.adapt_to_updated_data = kwargs.get('adapt_to_updated_data', None)
self.enabled = kwargs.get('enabled', None)
self.handles = kwargs.get('handles', None)
Expand All @@ -215,6 +265,20 @@
"""
return 'navigator'

@property
def accessibility(self) -> Optional[NavigatorAccessibilityOptions]:
"""Options for configuring accessibility for the navigator.

:rtype: :class:`NavigatorAccessibilityOptions <highcharts_stock.options.navigator.NavigatorAccessibilityOptions>`
or :obj:`None <python:None>`
"""
return self._accessibility

@accessibility.setter
@class_sensitive(NavigatorAccessibilityOptions)
def accessibility(self, value):
self._accessibility = value

@property
def adapt_to_updated_data(self) -> Optional[bool]:
"""If ``True``, the navigator and scroll will adapt to updated data in the base
Expand Down Expand Up @@ -457,6 +521,7 @@
@classmethod
def _get_kwargs_from_dict(cls, as_dict):
kwargs = {
'accessibility': as_dict.get('accessibility', None),
'adapt_to_updated_data': as_dict.get('adaptToUpdatedData', None),
'enabled': as_dict.get('enabled', None),
'handles': as_dict.get('handles', None),
Expand All @@ -476,6 +541,7 @@

def _to_untrimmed_dict(self, in_cls = None) -> dict:
untrimmed = {
'accessibility': self.accessibility,
'adaptToUpdatedData': self.adapt_to_updated_data,
'enabled': self.enabled,
'handles': self.handles,
Expand Down
2 changes: 2 additions & 0 deletions highcharts_stock/options/plot_options/abands.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'data_sorting': as_dict.get('dataSorting', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_width': as_dict.get('lineWidth', None),
'relative_x_value': as_dict.get('relativeXValue', None),
Expand Down Expand Up @@ -369,6 +370,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'data_sorting': as_dict.get('dataSorting', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_width': as_dict.get('lineWidth', None),
'relative_x_value': as_dict.get('relativeXValue', None),
Expand Down
2 changes: 2 additions & 0 deletions highcharts_stock/options/plot_options/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'fill_opacity': as_dict.get('fillOpacity', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_color': as_dict.get('lineColor', None),
'line_width': as_dict.get('lineWidth', None),
Expand Down Expand Up @@ -246,6 +247,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'fill_opacity': as_dict.get('fillOpacity', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_color': as_dict.get('lineColor', None),
'line_width': as_dict.get('lineWidth', None),
Expand Down
1 change: 1 addition & 0 deletions highcharts_stock/options/plot_options/aroon.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'data_sorting': as_dict.get('dataSorting', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_width': as_dict.get('lineWidth', None),
'relative_x_value': as_dict.get('relativeXValue', None),
Expand Down
5 changes: 5 additions & 0 deletions highcharts_stock/options/plot_options/bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'drag_drop': as_dict.get('dragDrop', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_width': as_dict.get('lineWidth', None),
'negative_color': as_dict.get('negativeColor', None),
Expand Down Expand Up @@ -189,6 +190,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'drag_drop': as_dict.get('dragDrop', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_width': as_dict.get('lineWidth', None),
'negative_color': as_dict.get('negativeColor', None),
Expand Down Expand Up @@ -408,6 +410,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'drag_drop': as_dict.get('dragDrop', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_width': as_dict.get('lineWidth', None),
'negative_color': as_dict.get('negativeColor', None),
Expand Down Expand Up @@ -541,6 +544,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'drag_drop': as_dict.get('dragDrop', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_width': as_dict.get('lineWidth', None),
'negative_color': as_dict.get('negativeColor', None),
Expand Down Expand Up @@ -685,6 +689,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'drag_drop': as_dict.get('dragDrop', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_width': as_dict.get('lineWidth', None),
'negative_color': as_dict.get('negativeColor', None),
Expand Down
1 change: 1 addition & 0 deletions highcharts_stock/options/plot_options/bellcurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'fill_opacity': as_dict.get('fillOpacity', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_color': as_dict.get('lineColor', None),
'line_width': as_dict.get('lineWidth', None),
Expand Down
1 change: 1 addition & 0 deletions highcharts_stock/options/plot_options/boxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'fill_opacity': as_dict.get('fillOpacity', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_color': as_dict.get('lineColor', None),
'line_width': as_dict.get('lineWidth', None),
Expand Down
1 change: 1 addition & 0 deletions highcharts_stock/options/plot_options/bubble.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'drag_drop': as_dict.get('dragDrop', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_width': as_dict.get('lineWidth', None),
'negative_color': as_dict.get('negativeColor', None),
Expand Down
1 change: 1 addition & 0 deletions highcharts_stock/options/plot_options/bullet.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'fill_opacity': as_dict.get('fillOpacity', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_color': as_dict.get('lineColor', None),
'line_width': as_dict.get('lineWidth', None),
Expand Down
1 change: 1 addition & 0 deletions highcharts_stock/options/plot_options/candlestick.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'drag_drop': as_dict.get('dragDrop', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_width': as_dict.get('lineWidth', None),
'negative_color': as_dict.get('negativeColor', None),
Expand Down
1 change: 1 addition & 0 deletions highcharts_stock/options/plot_options/dmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'data_sorting': as_dict.get('dataSorting', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_width': as_dict.get('lineWidth', None),
'relative_x_value': as_dict.get('relativeXValue', None),
Expand Down
1 change: 1 addition & 0 deletions highcharts_stock/options/plot_options/dumbbell.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'drag_drop': as_dict.get('dragDrop', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'group_padding': as_dict.get('groupPadding', None),
'linecap': as_dict.get('linecap', None),
'line_color': as_dict.get('lineColor', None),
Expand Down
1 change: 1 addition & 0 deletions highcharts_stock/options/plot_options/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'data_sorting': as_dict.get('dataSorting', None),
'find_nearest_point_by': as_dict.get('findNearestPointBy', None),
'get_extremes_from_all': as_dict.get('getExtremesFromAll', None),
'inactive_other_points': as_dict.get('inactiveOtherPoints', None),
'linecap': as_dict.get('linecap', None),
'line_width': as_dict.get('lineWidth', None),
'relative_x_value': as_dict.get('relativeXValue', None),
Expand Down
Loading