Skip to content

Commit 749bc86

Browse files
authored
Merge pull request #39 from highcharts-for-python/develop
PR for v.1.4.0
2 parents 58a9bff + c255de2 commit 749bc86

File tree

140 files changed

+8148
-1458
lines changed

Some content is hidden

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

140 files changed

+8148
-1458
lines changed

CHANGES.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
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%.
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.
18+
* **ENHANCEMENT:** Added one-shot chart creation using ``series`` and ``data``/``series_type`` keywords.
19+
* **ENHANCEMENT:** Added ``.convert_to()`` convenience method to Series objects.
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.
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.
24+
25+
---------------------
26+
127
Release 1.3.0
228
=========================================
329

README.rst

Lines changed: 52 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -231,48 +231,53 @@ Hello World, and Basic Usage
231231

232232
.. code-block:: python
233233
234+
# from a primitive array, using keyword arguments
235+
my_chart = Chart(data = [[1, 23], [2, 34], [3, 45]],
236+
series_type = 'line')
237+
238+
# from a primitive array, using the .from_array() method
239+
my_chart = Chart.from_array([[1, 23], [2, 34], [3, 45]],
240+
series_type = 'line')
241+
242+
# from a Numpy ndarray, using keyword arguments
243+
my_chart = Chart(data = numpy_array, series_type = 'line')
244+
245+
# from a Numpy ndarray, using the .from_array() method
246+
my_chart = Chart.from_array(data = numpy_array, series_type = 'line')
247+
234248
# from a JavaScript file
235-
my_chart = highcharts.Chart.from_js_literal('my_js_literal.js')
249+
my_chart = Chart.from_js_literal('my_js_literal.js')
236250
237251
# from a JSON file
238-
my_chart = highcharts.Chart.from_json('my_json.json')
252+
my_chart = Chart.from_json('my_json.json')
239253
240254
# from a Python dict
241-
my_chart = highcharts.Chart.from_dict(my_dict_obj)
255+
my_chart = Chart.from_dict(my_dict_obj)
242256
243257
# from a Pandas dataframe
244-
my_chart = highcharts.Chart.from_pandas(df,
245-
property_map = {
246-
'x': 'transactionDate',
247-
'y': 'invoiceAmt',
248-
'id': 'id'
249-
},
250-
series_type = 'line')
258+
my_chart = Chart.from_pandas(df)
251259
252260
# from a PySpark dataframe
253-
my_chart = highcharts.Chart.from_pyspark(df,
254-
property_map = {
255-
'x': 'transactionDate',
256-
'y': 'invoiceAmt',
257-
'id': 'id'
258-
},
259-
series_type = 'line')
261+
my_chart = Chart.from_pyspark(df,
262+
property_map = {
263+
'x': 'transactionDate',
264+
'y': 'invoiceAmt',
265+
'id': 'id'
266+
},
267+
series_type = 'line')
260268
261269
# from a CSV
262-
my_chart = highcharts.Chart.from_csv('/some_file_location/filename.csv'
263-
column_property_map = {
264-
'x': 0,
265-
'y': 4,
266-
'id': 14
267-
},
268-
series_type = 'line')
270+
my_chart = Chart.from_csv('/some_file_location/filename.csv')
269271
270272
# from a HighchartsOptions configuration object
271-
my_chart = highcharts.Chart.from_options(my_options)
273+
my_chart = Chart.from_options(my_options)
272274
273-
# from a Series configuration
274-
my_chart = highcharts.Chart.from_series(my_series)
275+
# from a Series configuration, using keyword arguments
276+
my_chart = Chart(series = my_series)
275277
278+
# from a Series configuration, using .from_series()
279+
my_chart = Chart.from_series(my_series)
280+
276281
277282
3. Configure Global Settings (optional)
278283
=============================================
@@ -300,9 +305,10 @@ Hello World, and Basic Usage
300305

301306
.. code-block:: python
302307
303-
from highcharts_stock.options.title import Title
304-
from highcharts_stock.options.credits import Credits
308+
from highcharts_core.options.title import Title
309+
from highcharts_core.options.credits import Credits
305310
311+
# EXAMPLE 1.
306312
# Using dicts
307313
my_chart.title = {
308314
'align': 'center'
@@ -313,7 +319,7 @@ Hello World, and Basic Usage
313319
314320
my_chart.credits = {
315321
'enabled': True,
316-
'href': 'https://www.highcharts.com/',
322+
'href': 'https://www.highchartspython.com/',
317323
'position': {
318324
'align': 'center',
319325
'vertical_align': 'bottom',
@@ -328,14 +334,19 @@ Hello World, and Basic Usage
328334
'text': 'Chris Modzelewski'
329335
}
330336
337+
# EXAMPLE 2.
331338
# Using direct objects
332-
from highcharts_stock.options.title import Title
333-
from highcharts_stock.options.credits import Credits
339+
from highcharts_core.options.title import Title
340+
from highcharts_core.options.credits import Credits
334341
335-
my_title = Title(text = 'The Title for My Chart', floating = True, align = 'center')
342+
my_title = Title(text = 'The Title for My Chart',
343+
floating = True,
344+
align = 'center')
336345
my_chart.options.title = my_title
337346
338-
my_credits = Credits(text = 'Chris Modzelewski', enabled = True, href = 'https://www.highcharts.com')
347+
my_credits = Credits(text = 'Chris Modzelewski',
348+
enabled = True,
349+
href = 'https://www.highchartspython.com')
339350
my_chart.options.credits = my_credits
340351
341352
@@ -378,6 +389,13 @@ that will render the chart wherever it is you want it to go:
378389
my_image_bytes = my_chart.download_chart(filename = 'my_target_file.png',
379390
format = 'png')
380391
392+
8. Render Your Chart in a Jupyter Notebook
393+
===============================================
394+
395+
.. code-block:: python
396+
397+
my_chart.display()
398+
381399
--------------
382400

383401
***********************
53.7 KB
Loading
24.2 KB
Loading
22.2 KB
Loading
30.8 KB
Loading
19.5 KB
Loading
14 KB
Loading
13.8 KB
Loading
13.2 KB
Loading

0 commit comments

Comments
 (0)