Skip to content

Commit 26c20e3

Browse files
authored
Merge pull request #117 from highcharts-for-python/develop
PR for v.1.4.0
2 parents a3aceb7 + 215e998 commit 26c20e3

File tree

153 files changed

+14042
-915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+14042
-915
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ venv/
109109
ENV/
110110
env.bak/
111111
venv.bak/
112-
.py310/
112+
.py31*/
113113

114114
# Spyder project settings
115115
.spyderproject

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
language: python
22
job:
33
include:
4-
#- python: "3.8"
5-
# env: TOXENV=py38
6-
#- python: "3.9"
7-
# env: TOXENV=py39
84
- python: "3.10"
95
dist: focal
106
env: TOXENV=py310

CHANGES.rst

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

2+
Release 1.4.0
3+
=========================================
4+
5+
* **MAJOR** performance gains in the ``.to_js_literal()`` method. Implementation seems to
6+
improve performance by 50 - 90%. (#51)
7+
* *SIGNIFICANT* performance gains in the ``.to_json()`` method. Implementation seems to
8+
improve performance by 30 - 90%.
9+
* **ENHANCEMENT:** Significantly simplified use of the ``.from_pandas()`` method to support:
10+
11+
* creation of multiple series from one DataFrame in one method call
12+
* creation of series without needing to specify a full property map
13+
* support for creating series by DataFrame row, rather than just by DataFrame column
14+
15+
* **ENHANCEMENT:** Added the ``.from_pandas_in_rows()`` method to support creation of
16+
charts and series from simple two-dimensional DataFrames laid out in rows.
17+
* **ENHANCEMENT:** Added one-shot chart creation and rendering from Series objects (#89).
18+
* **ENHANCEMENT:** Added one-shot chart creation using ``series`` and ``data``/``series_type`` keywords. (#90).
19+
* **ENHANCEMENT:** Added ``.convert_to()`` convenience method to Series objects (#107).
20+
* **ENHANCEMENT:** Added ``CallbackFunction.from_python()`` method which converts a Python function
21+
to its JavaScript equivalent using generative AI, with support for both OpenAI and Anthropic (#109).
22+
* **BUGFIX:** Fixed instability issues in Jupyter Notebooks, both when operating as a Notebook (outside of
23+
Jupyter Lab) and when saved to a static HTML file (#66).
24+
25+
--------------------
26+
227
Release 1.3.7
328
=========================================
429

README.rst

Lines changed: 51 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -212,49 +212,53 @@ Hello World, and Basic Usage
212212

213213
.. code-block:: python
214214
215+
# from a primitive array, using keyword arguments
216+
my_chart = Chart(data = [[1, 23], [2, 34], [3, 45]],
217+
series_type = 'line')
218+
219+
# from a primitive array, using the .from_array() method
220+
my_chart = Chart.from_array([[1, 23], [2, 34], [3, 45]],
221+
series_type = 'line')
222+
223+
# from a Numpy ndarray, using keyword arguments
224+
my_chart = Chart(data = numpy_array, series_type = 'line')
225+
226+
# from a Numpy ndarray, using the .from_array() method
227+
my_chart = Chart.from_array(data = numpy_array, series_type = 'line')
228+
215229
# from a JavaScript file
216-
my_chart = highcharts.Chart.from_js_literal('my_js_literal.js')
230+
my_chart = Chart.from_js_literal('my_js_literal.js')
217231
218232
# from a JSON file
219-
my_chart = highcharts.Chart.from_json('my_json.json')
233+
my_chart = Chart.from_json('my_json.json')
220234
221235
# from a Python dict
222-
my_chart = highcharts.Chart.from_dict(my_dict_obj)
236+
my_chart = Chart.from_dict(my_dict_obj)
223237
224238
# from a Pandas dataframe
225-
my_chart = highcharts.Chart.from_pandas(df,
226-
property_map = {
227-
'x': 'transactionDate',
228-
'y': 'invoiceAmt',
229-
'id': 'id'
230-
},
231-
series_type = 'line')
239+
my_chart = Chart.from_pandas(df)
232240
233241
# from a PySpark dataframe
234-
my_chart = highcharts.Chart.from_pyspark(df,
235-
property_map = {
236-
'x': 'transactionDate',
237-
'y': 'invoiceAmt',
238-
'id': 'id'
239-
},
240-
series_type = 'line')
242+
my_chart = Chart.from_pyspark(df,
243+
property_map = {
244+
'x': 'transactionDate',
245+
'y': 'invoiceAmt',
246+
'id': 'id'
247+
},
248+
series_type = 'line')
241249
242250
# from a CSV
243-
my_chart = highcharts.Chart.from_csv('/some_file_location/filename.csv'
244-
column_property_map = {
245-
'x': 0,
246-
'y': 4,
247-
'id': 14
248-
},
249-
series_type = 'line')
251+
my_chart = Chart.from_csv('/some_file_location/filename.csv')
250252
251253
# from a HighchartsOptions configuration object
252-
my_chart = highcharts.Chart.from_options(my_options)
253-
254-
# from a Series configuration
255-
my_chart = highcharts.Chart.from_series(my_series)
254+
my_chart = Chart.from_options(my_options)
256255
256+
# from a Series configuration, using keyword arguments
257+
my_chart = Chart(series = my_series)
257258
259+
# from a Series configuration, using .from_series()
260+
my_chart = Chart.from_series(my_series)
261+
258262
3. Configure Global Settings (optional)
259263
=============================================
260264

@@ -284,6 +288,7 @@ Hello World, and Basic Usage
284288
from highcharts_core.options.title import Title
285289
from highcharts_core.options.credits import Credits
286290
291+
# EXAMPLE 1.
287292
# Using dicts
288293
my_chart.title = {
289294
'align': 'center'
@@ -294,7 +299,7 @@ Hello World, and Basic Usage
294299
295300
my_chart.credits = {
296301
'enabled': True,
297-
'href': 'https://www.highcharts.com/',
302+
'href': 'https://www.highchartspython.com/',
298303
'position': {
299304
'align': 'center',
300305
'vertical_align': 'bottom',
@@ -309,17 +314,21 @@ Hello World, and Basic Usage
309314
'text': 'Chris Modzelewski'
310315
}
311316
317+
# EXAMPLE 2.
312318
# Using direct objects
313319
from highcharts_core.options.title import Title
314320
from highcharts_core.options.credits import Credits
315321
316-
my_title = Title(text = 'The Title for My Chart', floating = True, align = 'center')
322+
my_title = Title(text = 'The Title for My Chart',
323+
floating = True,
324+
align = 'center')
317325
my_chart.options.title = my_title
318326
319-
my_credits = Credits(text = 'Chris Modzelewski', enabled = True, href = 'https://www.highcharts.com')
327+
my_credits = Credits(text = 'Chris Modzelewski',
328+
enabled = True,
329+
href = 'https://www.highchartspython.com')
320330
my_chart.options.credits = my_credits
321331
322-
323332
5. Generate the JavaScript Code for Your Chart
324333
=================================================
325334

@@ -328,9 +337,11 @@ that will render the chart wherever it is you want it to go:
328337

329338
.. code-block:: python
330339
340+
# EXAMPLE 1.
331341
# as a string
332342
js_as_str = my_chart.to_js_literal()
333343
344+
# EXAMPLE 2.
334345
# to a file (and as a string)
335346
js_as_str = my_chart.to_js_literal(filename = 'my_target_file.js')
336347
@@ -359,6 +370,14 @@ that will render the chart wherever it is you want it to go:
359370
my_image_bytes = my_chart.download_chart(filename = 'my_target_file.png',
360371
format = 'png')
361372
373+
374+
8. Render Your Chart in a Jupyter Notebook
375+
===============================================
376+
377+
.. code-block:: python
378+
379+
my_chart.display()
380+
362381
--------------
363382

364383
***********************

docs/_dependencies.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,14 @@
5656
$ pip install highcharts-core[soft]
5757
5858
* `IPython <https://ipython.org/>`__ v. 8.10 or higher
59+
* `Jupyter Notebook <https://jupyter.org/>`__ v.6.4 or higher
5960
* `orjson <https://github.com/ijl/orjson>`__ v.3.7.7 or higher
61+
* `NumPy <https://numpy.org>`__ v.1.19.3 or higher
6062
* `pandas <https://pandas.pydata.org/>`_ v. 1.3 or higher
6163
* `pyspark <https://spark.apache.org/docs/latest/api/python/index.html>`_ v.3.3 or
6264
higher
6365

66+
6467
.. tab:: Developer
6568

6669
.. warning::
25.3 KB
Loading
53.7 KB
Loading
24.2 KB
Loading
22.2 KB
Loading
30.8 KB
Loading

0 commit comments

Comments
 (0)