Skip to content

Commit

Permalink
Merge pull request #50 from highcharts-for-python/develop
Browse files Browse the repository at this point in the history
Release Candidate v.1.7. Closes #48 and Closes #47 and Closes #46
  • Loading branch information
hcpchris authored Apr 7, 2024
2 parents c39fe4e + c0213bc commit 0d2fe89
Show file tree
Hide file tree
Showing 17 changed files with 334 additions and 23 deletions.
35 changes: 35 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@

Release 1.7.0
=========================================

*NOTE:* This release skips the v.1.6 number to maintain alignment with the other Highcharts for Python
libraries.

* **ENHANCEMENT:** Align the API to **Highcharts Stock (JS) v.11.4** (#62). In particular, this includes:

* Updated requirements to depend on Highcharts Stock for Python v.1.7.
* Added ``.element_type`` support to the Stock Tools GUI.
* Added ``Accessibility.high_contrast_mode`` support.
* Added ``OrganizationOptions.hanging_side`` support.
* Added ``SankeyOptions.node_distance`` support.
* Added ``TreegraphOptions.node_distance`` support.
* Adjusted diagram (``ArcDiagramOptions``, ``TreegraphOptions``, ``DependencyWheelOptions``, and
``SankeyOptions``) ``.node_width`` support and documentation.
* Added ``NodeOptions.height`` support.

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

* Updated requirements to depend on Highcharts Stock 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 validation error in ``GanttSeries.from_pandas()`` (#46).
* **BUGFIX:** Fixed missing functionality for ``RangeSelectorButton.type`` property.
* **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
233 changes: 232 additions & 1 deletion LICENSE

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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.4.0.

**Highcharts Gantt for Python** is fully integrated with the broader Python ecosystem,
featuring native integrations with:
Expand Down Expand Up @@ -84,7 +84,7 @@ Before you install, please be aware of the following "hard" dependencies:
* Python 3.10 or higher
* Highcharts Gantt (JS) v.10.3 or higher (not technically a Python dependency, but
it won't work with earlier versions of Highcharts Stock)
* `Highcharts Stock for Python <https://stock-docs.highchartspython.com/en/latest/>`__ v.1.3 or higher
* `Highcharts Stock for Python <https://stock-docs.highchartspython.com/en/latest/>`__ v.1.7 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 Expand Up @@ -323,7 +323,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
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 Gantt for Python**
will not work properly if your rendering layer does not leverage Highcharts Gantt.

* `highcharts-stock <https://stock-docs.highchartspython.com>`_ v.1.3.0 or higher
* `highcharts-stock <https://stock-docs.highchartspython.com>`_ v.1.7.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 Gantt for Python

.. sidebar:: Version Compatibility

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

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

Expand Down Expand Up @@ -326,7 +326,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 Gantt 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 [email protected] 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_gantt/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.5.0'
__version__ = '1.7.0'
18 changes: 15 additions & 3 deletions highcharts_gantt/options/series/data/gantt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from highcharts_gantt.metaclasses import HighchartsMeta
from highcharts_gantt.options.series.data.connect import DataConnection
from highcharts_gantt.options.series.data.collections import DataPointCollection
from highcharts_gantt.utility_functions import validate_color, parse_jira_issue
from highcharts_gantt.utility_functions import validate_color, parse_jira_issue, datetime64_to_datetime
from highcharts_gantt.utility_classes.gradients import Gradient
from highcharts_gantt.utility_classes.patterns import Pattern

Expand Down Expand Up @@ -218,7 +218,13 @@ def end(self, value):
elif checkers.is_date(value):
self._end = validators.date(value, allow_empty = True)
else:
self._end = validators.datetime(value, allow_empty = True, coerce_value = True)
try:
self._end = validators.datetime(value, allow_empty = True, coerce_value = True)
except (ValueError, TypeError) as error:
if checkers.is_type(value, 'datetime64'):
self._end = datetime64_to_datetime(value)
else:
raise error

@property
def milestone(self) -> Optional[bool]:
Expand Down Expand Up @@ -279,7 +285,13 @@ def start(self, value):
elif checkers.is_date(value):
self._start = validators.date(value, allow_empty = True)
else:
self._start = validators.datetime(value, allow_empty = True, coerce_value = True)
try:
self._start = validators.datetime(value, allow_empty = True, coerce_value = True)
except (ValueError, TypeError) as error:
if checkers.is_type(value, 'datetime64'):
self._start = datetime64_to_datetime(value)
else:
raise error

@property
def y(self) -> Optional[int | float | Decimal]:
Expand Down
6 changes: 3 additions & 3 deletions highcharts_gantt/options/series/gantt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,13 +1129,13 @@ def _data_collection_class(cls):
:rtype: :class:`DataPointCollection <highcharts_core.options.series.data.collections.DataPointCollection>`
descendent
"""
return GanttData
return GanttDataCollection

@classmethod
def _data_point_class(cls):
"""Returns the class object used for individual data points.
:rtype: :class:`DataBase <highcharts_core.options.series.data.base.DataBase>`
descendent
"""
return GanttDataCollection
return GanttData
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ classifiers = [

requires-python = ">= 3.10"
dependencies = [
"highcharts-stock>=1.5.0",
"highcharts-stock>=1.7.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 @@ -15,4 +15,4 @@ sphinx-tabs>=3.4.1
requests==2.31.0
tox==4.0.0
validator-collection==1.5.0
highcharts-stock>=1.5.0
highcharts-stock>=1.7.0
2 changes: 1 addition & 1 deletion requirements.travis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ sphinx-tabs>=3.4.1
requests==2.31.0
tox==4.0.0
validator-collection==1.5.0
highcharts-stock>=1.5.0
highcharts-stock>=1.7.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-stock>=1.5.0
highcharts-stock>=1.7.0
5 changes: 5 additions & 0 deletions tests/input_files/series/base/bugfix162.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
task_id,name,start,end,parent,dependency
1,DoThing1,2023-01-01,2023-02-01,,
2,DoThing1-sub1,2023-01-11,2023-01-14,1,
3,DoThing1-sub2,2023-01-01,2023-02-01,1,2
4,DoThing2,2023-02-02,2023-03-01,,
22 changes: 22 additions & 0 deletions tests/options/series/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,3 +655,25 @@ def test_to_dict(kwargs, error):
])
def test_from_js_literal(input_files, filename, as_file, error):
Class_from_js_literal(cls, input_files, filename, as_file, error)

def test_bugfix162(input_files):
from highcharts_gantt.chart import Chart
from highcharts_gantt.options.series.gantt import GanttSeries

import pandas as pd
from collections import defaultdict

filename = "series/base/bugfix162.csv"
input_file = check_input_file(input_files, filename)

dtype = defaultdict(lambda: "str")

df = pd.read_csv(input_file, dtype=dtype, parse_dates=["start", "end"])

# Creating a Series from the DataFrame
my_series = GanttSeries.from_pandas(
df,
property_map={"id": "task_id", "name": "name", "start": "start", "end": "end"},
)

assert my_series is not None

0 comments on commit 0d2fe89

Please sign in to comment.