Skip to content

Commit

Permalink
Merge pull request #60 from highcharts-for-python/rc-v.1.6
Browse files Browse the repository at this point in the history
Release Candidate v.1.6.0
  • Loading branch information
hcpchris authored Apr 7, 2024
2 parents cd2b3bf + 1fe2420 commit fc5d345
Show file tree
Hide file tree
Showing 19 changed files with 136 additions and 29 deletions.
19 changes: 19 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@

Release 1.6.0
=========================================

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

* Updated requirements to depend on Highcharts Core for Python v.1.6.
* Added ``ChartOptions.axis_layout_runs`` property.
* Added ``ColorAxis.height`` property.
* Added ``ColorAxis.width`` property.
* Added ``Data.column_types`` property.
* Added ``Exporting.fetch_options`` property.
* Implemented support for verbose axis date-time unit labelling configuration (see: ``DateTimeLabelFormats``).

* **BUGFIX:** Fixed missing functionality for ``RangeSelectorButton.type`` property (#56).
* **BUGFIX:** Fixed missing ``FlagData.text`` property (courtesy of `@szemek <https://github.com/szemek>`__ )
* **DOCUMENTATION:** Fixed typos in **Getting Started** tutorial.

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

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

Expand Down
9 changes: 7 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Without prejudice to the limited right to download and test the Wrapper for eval

A Wrapper License (as defined below) or renewal thereof can only be purchased by a Licensee either already holding a License to the Software, or at the same time as purchasing such a License, as an add-on product to such License, and only by a Licensee holding an active and valid enrolment in the Highcharts Advantage plan. The purchase of, and right to use the Licensed Software shall remain governed by the terms and conditions of the License issued by Highsoft to Licensee, whether this is Highsoft Standard License Agreement, Highsoft Terms and Conditions for Subscription to Annual License to Highsoft Software, or another licensing agreement as agreed between Highsoft and Licensee, as applicable (such terms and conditions between Highsoft and Licensee hereinafter collectively referred to as the “Main Agreement”).

A Wrapper License (as defined below) can additionally be obtained by holding an active and valid Educational or Personal License to the Software. The right to use the Licensed Software shall remain governed by the terms and conditions of the Authorized User issued by Highsoft to Authorized User, as defined in the Educational and Personal License 1.0, (such terms and conditions between Highsoft and Authorized User hereinafter collectively referred to as the "Main Agreement").

These Wrapper T&Cs constitute an addendum to the Main Agreement and an integral part thereof and apply to the use of the Wrapper only.

In the case of any discrepancy between the Main Agreement and these Wrapper T&Cs related to the licensing of the Wrapper, these Wrapper T&Cs shall prevail.
Expand Down Expand Up @@ -86,13 +88,16 @@ Licensee shall not modify, delete or obscure any notices of proprietary rights o
6. Wrapper Support
***********************************************

A Wrapper License entitles Licensee to the support services and access to new Releases of the Wrapper as set out herein. While support for the Wrapper is contingent upon Licensee’s valid enrollment in the Highcharts Advantage plan and the annual number of hours of support available for support of the Licensed Software for each successive twelve month term during the period that Licensee is enrolled in Highcharts Advantage (each, a “Support Year”) are inclusive of the number of hours of support offered during such Support Year for the Wrapper, support of the Wrapper is not covered under Licensee’s enrollment in Highcharts Advantage, but is offered by Highsoft for a separate fee and provided separately, directly and independently by HCP.
A Wrapper License entitles Licensee to the support services and access to new Releases of the Wrapper as set out herein. While support for the Wrapper is contingent upon Licensee’s valid enrollment in the Highcharts Advantage plan and the annual number of hours of support available for support of the Licensed Software for each successive twelve month term during the period that Licensee is enrolled in Highcharts Advantage (each, a “Support Year”) are inclusive of the number of hours of support offered during such Support Year for the Wrapper, support of the Wrapper is not covered under Licensee’s enrollment in Highcharts Advantage, but is offered by Highsoft for a separate fee and provided separately, directly and independently by HCP. In the event that the Licensee is not enrolled in the Highcharts Advantage Plan, for example if the Main Agreement grants the Licensee a Personal or Educational License, then the Licensee shall not be entitled to the support services outlined herein.

All support inquiries related to the Wrapper shall be sent to support@highchartspython.com or filed at https://www.highchartspython.com.

Under a valid and effective Wrapper License, Licensee shall be entitled to receive from HCP:
Under a valid and effective Wrapper License, Licensee shall be entitled to receive from HCP:

i. All new releases or updates of the Wrapper released during the applicable Advantage Period;

Under a valid and effective Wrapper License, contingent upon the Licensee’s valid enrollment in the Highcharts Advantage Plan and payment of applicable fees, Licensee shall be entitled to receive from HCP:

ii. Up to ten (10) hours of the personalized technical support for the Wrapper and/or the Licensed Software
(combined) per Developer per Support Year based on the number of Developers stated in the License Statement for
the License. Licensee may freely distribute its included total of ten (10) hours of personalized technical
Expand Down
4 changes: 2 additions & 2 deletions 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.2.0.
The library supports Highcharts (JS) v.10.2 and higher, including Highcharts (JS) v.11.3.0.

**Highcharts Stock for Python** is fully integrated with the broader Python ecosystem,
in particular:
Expand Down Expand Up @@ -80,7 +80,7 @@ Before you install, please be aware of the following "hard" dependencies:
* Python 3.10 or higher
* Highcharts Stock (JS) v.10.2 or higher (not technically a Python dependency, but
it won't work with earlier versions of Highcharts Stock)
* `Highcharts Core for Python <https://core-docs.highchartspython.com/en/latest/>`__ v.1.3 or higher
* `Highcharts Core for Python <https://core-docs.highchartspython.com/en/latest/>`__ v.1.6 or higher
* `esprima-python <https://github.com/Kronuz/esprima-python>`__ v.4.0 or higher
* `requests <https://requests.readthedocs.io/en/latest/>`__ v.2.31 or higher
* `validator-collection <https://validator-collection.readthedocs.io/en/latest/>`__
Expand Down
1 change: 1 addition & 0 deletions docs/_contributors.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* Chris Modzelewski (`@hcpchris <https://github.com/hcpchris>`__ / `@insightindustry <https://github.com/insightindustry>`_)
* Przemysław Dąbek (`@szemek <https://github.com/szemek>`__ )
2 changes: 1 addition & 1 deletion docs/_dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Not technically a Python dependency, but obviously **Highcharts Stock for Python**
will not work properly if your rendering layer does not leverage Highcharts Stock.

* `highcharts-core <https://core-docs.highchartspython.com>`_ v.1.3.0 or higher
* `highcharts-core <https://core-docs.highchartspython.com>`_ v.1.6.0 or higher
* `esprima-python <https://github.com/Kronuz/esprima-python>`_ v.4.0 or higher
* `requests <https://requests.readthedocs.io/en/latest/>`_ v.2.31 or higher
* `validator-collection <https://validator-collection.readthedocs.io/en/latest/>`_
Expand Down
4 changes: 2 additions & 2 deletions 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.2.0
**Latest Highcharts (JS) version supported:** v.11.3.0

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

Expand Down Expand Up @@ -310,7 +310,7 @@ Hello World, and Basic Usage
# EXAMPLE 1.
# Using dicts
my_chart.title = {
'align': 'center'
'align': 'center',
'floating': True,
'text': 'The Title for My Chart',
'use_html': False,
Expand Down
12 changes: 9 additions & 3 deletions docs/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ Terms and Conditions for the Highcharts for Python Toolkit License

.. warning::

The **Highcharts for Python** toolkit as a whole, and the **Highcharts Core for Python** library specifically,
The **Highcharts for Python Toolkit** as a whole, and the **Highcharts Stock for Python** library specifically,
are made available subject to a *paid* commercial license. This means that while the code is open-source, in order
to use it you **must** purchase a license from `Highsoft A/S <https://www.highcharts.com>`__, the
creators of the Highcharts JavaScript library.

**TO PURCHASE A LICENSE:** `https://shop.highcharts.com/ <https://shop.highcharts.com/>`__
**TO APPLY FOR A PERSONAL / EDUCATIONAL LICENSE:** `https://shop.highcharts.com/contact/educational <https://shop.highcharts.com/contact/educational>`__

***********************************************
1. Acceptance of the Terms and Conditions
Expand All @@ -27,6 +28,8 @@ Without prejudice to the limited right to download and test the Wrapper for eval

A Wrapper License (as defined below) or renewal thereof can only be purchased by a Licensee either already holding a License to the Software, or at the same time as purchasing such a License, as an add-on product to such License, and only by a Licensee holding an active and valid enrolment in the Highcharts Advantage plan. The purchase of, and right to use the Licensed Software shall remain governed by the terms and conditions of the License issued by Highsoft to Licensee, whether this is Highsoft Standard License Agreement, Highsoft Terms and Conditions for Subscription to Annual License to Highsoft Software, or another licensing agreement as agreed between Highsoft and Licensee, as applicable (such terms and conditions between Highsoft and Licensee hereinafter collectively referred to as the “Main Agreement”).

A Wrapper License (as defined below) can additionally be obtained by holding an active and valid Educational or Personal License to the Software. The right to use the Licensed Software shall remain governed by the terms and conditions of the Authorized User issued by Highsoft to Authorized User, as defined in the Educational and Personal License 1.0, (such terms and conditions between Highsoft and Authorized User hereinafter collectively referred to as the "Main Agreement").

These Wrapper T&Cs constitute an addendum to the Main Agreement and an integral part thereof and apply to the use of the Wrapper only.

In the case of any discrepancy between the Main Agreement and these Wrapper T&Cs related to the licensing of the Wrapper, these Wrapper T&Cs shall prevail.
Expand Down Expand Up @@ -95,13 +98,16 @@ Licensee shall not modify, delete or obscure any notices of proprietary rights o
6. Wrapper Support
***********************************************

A Wrapper License entitles Licensee to the support services and access to new Releases of the Wrapper as set out herein. While support for the Wrapper is contingent upon Licensees valid enrollment in the Highcharts Advantage plan and the annual number of hours of support available for support of the Licensed Software for each successive twelve month term during the period that Licensee is enrolled in Highcharts Advantage (each, a “Support Year”) are inclusive of the number of hours of support offered during such Support Year for the Wrapper, support of the Wrapper is not covered under Licensee’s enrollment in Highcharts Advantage, but is offered by Highsoft for a separate fee and provided separately, directly and independently by HCP.
A Wrapper License entitles Licensee to the support services and access to new Releases of the Wrapper as set out herein. While support for the Wrapper is contingent upon Licensee's valid enrollment in the Highcharts Advantage plan and the annual number of hours of support available for support of the Licensed Software for each successive twelve month term during the period that Licensee is enrolled in Highcharts Advantage (each, a “Support Year”) are inclusive of the number of hours of support offered during such Support Year for the Wrapper, support of the Wrapper is not covered under Licensee’s enrollment in Highcharts Advantage, but is offered by Highsoft for a separate fee and provided separately, directly and independently by HCP. In the event that the Licensee is not enrolled in the Highcharts Advantage Plan, for example if the Main Agreement grants the Licensee a Personal or Educational License, then the Licensee shall not be entitled to the support services outlined herein.

All support inquiries related to the Wrapper shall be sent to support@highchartspython.com or filed at https://www.highchartspython.com.

Under a valid and effective Wrapper License, Licensee shall be entitled to receive from HCP:
Under a valid and effective Wrapper License, Licensee shall be entitled to receive from HCP:

i. All new releases or updates of the Wrapper released during the applicable Advantage Period;

Under a valid and effective Wrapper License, contingent upon the Licensee’s valid enrollment in the Highcharts Advantage Plan and payment of applicable fees, Licensee shall be entitled to receive from HCP:

ii. Up to ten (10) hours of the personalized technical support for the Wrapper and/or the Licensed Software
(combined) per Developer per Support Year based on the number of Developers stated in the License Statement for
the License. Licensee may freely distribute its included total of ten (10) hours of personalized technical
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/_assembling_a_chart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ from a :class:`pandas.DataFrame <pandas:pandas.DataFrame>`,
# From a Numpy ndarray
my_chart = Chart.from_array(data = as_ndarray, series_type = 'line')
my_chart = Chart.from_array(as_ndarray, series_type = 'line')
# From a Python dict
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ or Python :class:`dict <python:dict>`:
df = pandas.DataFrame(my_iterable, columns=['x', 'y'])
# As a Numpy ndarray
as_ndarray = numpy.as_ndarray(my_iterable)
as_ndarray = numpy.asarray(my_iterable)
# As a Python dict
as_dict = {'x': x[0], 'y': x[1] for x in my_iterable}
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.5.0'
__version__ = '1.6.0'
16 changes: 15 additions & 1 deletion highcharts_stock/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,18 @@
STOCK_TOOLS_INCLUDE_STR = """
<link rel="stylesheet" type="text/css" href="https://code.highcharts.com/css/stocktools/gui.css">
<link rel="stylesheet" type="text/css" href="https://code.highcharts.com/css/annotations/popup.css">
"""
"""


RANGE_SELECTOR_BUTTON_TYPES = [
'all',
'millisecond',
'second',
'minute',
'hour',
'day',
'week',
'month',
'ytd',
'year',
]
38 changes: 37 additions & 1 deletion highcharts_stock/options/range_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from validator_collection import validators

from highcharts_stock import errors
from highcharts_stock import errors, constants
from highcharts_stock.metaclasses import HighchartsMeta
from highcharts_stock.decorators import class_sensitive
from highcharts_stock.utility_classes.data_grouping import DataGroupingOptions
Expand Down Expand Up @@ -254,6 +254,40 @@ def title(self) -> Optional[str]:
def title(self, value):
self._title = validators.string(value, allow_empty = True)

@property
def type(self) -> Optional[str]:
"""The time span for the button. Accepts the following values:
* ``'all'``
* ``'millisecond'``
* ``'second'``
* ``'minute'``
* ``'hour'``
* ``'day'``
* ``'week'``
* ``'month'``
* ``'year'``
* ``'ytd'``
Defaults to :obj:`None <python:None>`
:rtype: :class:`str <python:str>`
"""
return self._type

@type.setter
def type(self, value):
if not value:
self._type = None
else:
value = validators.string(value, allow_empty = False)
value = value.lower()
if value not in constants.RANGE_SELECTOR_BUTTON_TYPES:
raise errors.HighchartsValueError(
f'type expects one of {constants.RANGE_SELECTOR_BUTTON_TYPES}. Received: "{value}"'
)
self._type = value

@classmethod
def _get_kwargs_from_dict(cls, as_dict):
kwargs = {
Expand All @@ -265,6 +299,7 @@ def _get_kwargs_from_dict(cls, as_dict):
'preserve_data_grouping': as_dict.get('preserveDataGrouping', None),
'text': as_dict.get('text', None),
'title': as_dict.get('title', None),
'type': as_dict.get('type', None),
}

return kwargs
Expand All @@ -279,6 +314,7 @@ def _to_untrimmed_dict(self, in_cls = None) -> dict:
'preserveDataGrouping': self.preserve_data_grouping,
'text': self.text,
'title': self.title,
'type': self.type,
}

return untrimmed
Expand Down
27 changes: 23 additions & 4 deletions highcharts_stock/options/series/data/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,21 @@


class FlagData(SingleXData):
"""Data point that features a single ``x`` point with a ``title``."""
"""Data point that features a single ``x`` point with a ``title`` and ``text``."""

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

self._text = None

self.title = kwargs.get('title', None)

self.text = kwargs.get('text', None)

super().__init__(**kwargs)

@property
def title(self) -> Optional[str]:
"""The short text to be shown on the flag.
:rtype: :class:`str <python:str>` or :obj:`None <python:None>`
"""
return self._title
Expand All @@ -32,6 +34,21 @@ def title(self, value):
else:
self._title = validators.string(value, coerce_value = True)

@property
def text(self) -> Optional[str]:
"""The longer text to be shown in the flag's tooltip.
:rtype: :class:`str <python:str>` or :obj:`None <python:None>`
"""
return self._text

@text.setter
def text(self, value):
if not value:
self._text = None
else:
self._text = validators.string(value, coerce_value = True)

@classmethod
def from_list(cls, value):
if not value:
Expand Down Expand Up @@ -116,13 +133,15 @@ class from a Highcharts Javascript-compatible :class:`dict <python:dict>` object
'x': as_dict.get('x', None),

'title': as_dict.get('title', None),
'text': as_dict.get('text', None),
}

return kwargs

def _to_untrimmed_dict(self, in_cls = None) -> dict:
untrimmed = {
'title': self.title,
'text': self.text,
'x': self.x,

'dataLabels': self.data_labels,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ classifiers = [

requires-python = ">= 3.10"
dependencies = [
"highcharts-core>=1.5.0",
"highcharts-core>=1.6.0",
"esprima>=4.0.1",
"validator-collection>=1.5.0",
"requests>=2.31.0"
Expand Down
2 changes: 1 addition & 1 deletion requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ validator-collection==1.5.0
anthropic==0.3.11
dill==0.3.7
openai==0.28.0
highcharts-core>=1.5.0
highcharts-core>=1.6.0
2 changes: 1 addition & 1 deletion requirements.travis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ sphinx-tabs==3.4.1
tox==4.4.6
requests==2.31.0
validator-collection==1.5.0
highcharts-core>=1.5.0
highcharts-core>=1.6.0
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
esprima==4.0.1
requests==2.31.0
validator-collection==1.5.0
highcharts-core>=1.5.0
highcharts-core>=1.6.0
Loading

0 comments on commit fc5d345

Please sign in to comment.