Skip to content

Commit 701f8a7

Browse files
authored
Merge pull request #35 from highcharts-for-python/develop
PR for v.1.4.0
2 parents 0e64792 + 4858b23 commit 701f8a7

File tree

119 files changed

+7282
-582
lines changed

Some content is hidden

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

119 files changed

+7282
-582
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ dmypy.json
130130
.pyre/
131131

132132
# VENV
133-
.py310/
133+
.py31*/
134134

135135
# temp files
136136
~$*.*

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 & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -244,55 +244,52 @@ Hello World, and Basic Usage
244244

245245
.. code-block:: python
246246
247+
# from a primitive array, using keyword arguments
248+
my_chart = Chart(data = [[1, 23], [2, 34], [3, 45]],
249+
series_type = 'line')
250+
251+
# from a primitive array, using the .from_array() method
252+
my_chart = Chart.from_array([[1, 23], [2, 34], [3, 45]],
253+
series_type = 'line')
254+
255+
# from a Numpy ndarray, using keyword arguments
256+
my_chart = Chart(data = numpy_array, series_type = 'line')
257+
258+
# from a Numpy ndarray, using the .from_array() method
259+
my_chart = Chart.from_array(data = numpy_array, series_type = 'line')
260+
247261
# from a JavaScript file
248-
my_chart = highcharts.Chart.from_js_literal('my_js_literal.js')
262+
my_chart = Chart.from_js_literal('my_js_literal.js')
249263
250264
# from a JSON file
251-
my_chart = highcharts.Chart.from_json('my_json.json')
265+
my_chart = Chart.from_json('my_json.json')
252266
253267
# from a Python dict
254-
my_chart = highcharts.Chart.from_dict(my_dict_obj)
255-
256-
# from a GeoPandas GeoDataFrame
257-
my_chart = highcharts.Chart.from_geopandas(gdf,
258-
property_map = {
259-
'z': 'caseCount',
260-
'id': 'id',
261-
},
262-
series_type = 'mapbubble')
268+
my_chart = Chart.from_dict(my_dict_obj)
263269
264270
# from a Pandas dataframe
265-
my_chart = highcharts.Chart.from_pandas(df,
266-
property_map = {
267-
'x': 'transactionDate',
268-
'y': 'invoiceAmt',
269-
'id': 'id'
270-
},
271-
series_type = 'line')
271+
my_chart = Chart.from_pandas(df)
272272
273273
# from a PySpark dataframe
274-
my_chart = highcharts.Chart.from_pyspark(df,
275-
property_map = {
276-
'x': 'transactionDate',
277-
'y': 'invoiceAmt',
278-
'id': 'id'
279-
},
280-
series_type = 'line')
274+
my_chart = Chart.from_pyspark(df,
275+
property_map = {
276+
'x': 'transactionDate',
277+
'y': 'invoiceAmt',
278+
'id': 'id'
279+
},
280+
series_type = 'line')
281281
282282
# from a CSV
283-
my_chart = highcharts.Chart.from_csv('/some_file_location/filename.csv'
284-
column_property_map = {
285-
'x': 0,
286-
'y': 4,
287-
'id': 14
288-
},
289-
series_type = 'line')
283+
my_chart = Chart.from_csv('/some_file_location/filename.csv')
290284
291285
# from a HighchartsOptions configuration object
292-
my_chart = highcharts.Chart.from_options(my_options)
286+
my_chart = Chart.from_options(my_options)
293287
294-
# from a Series configuration
295-
my_chart = highcharts.Chart.from_series(my_series)
288+
# from a Series configuration, using keyword arguments
289+
my_chart = Chart(series = my_series)
290+
291+
# from a Series configuration, using .from_series()
292+
my_chart = Chart.from_series(my_series)
296293
297294
298295
3. Configure Global Settings (optional)
@@ -321,9 +318,10 @@ Hello World, and Basic Usage
321318

322319
.. code-block:: python
323320
324-
from highcharts_maps.options.title import Title
325-
from highcharts_maps.options.credits import Credits
321+
from highcharts_core.options.title import Title
322+
from highcharts_core.options.credits import Credits
326323
324+
# EXAMPLE 1.
327325
# Using dicts
328326
my_chart.title = {
329327
'align': 'center'
@@ -334,7 +332,7 @@ Hello World, and Basic Usage
334332
335333
my_chart.credits = {
336334
'enabled': True,
337-
'href': 'https://www.highcharts.com/',
335+
'href': 'https://www.highchartspython.com/',
338336
'position': {
339337
'align': 'center',
340338
'vertical_align': 'bottom',
@@ -349,14 +347,19 @@ Hello World, and Basic Usage
349347
'text': 'Chris Modzelewski'
350348
}
351349
350+
# EXAMPLE 2.
352351
# Using direct objects
353-
from highcharts_maps.options.title import Title
354-
from highcharts_maps.options.credits import Credits
352+
from highcharts_core.options.title import Title
353+
from highcharts_core.options.credits import Credits
355354
356-
my_title = Title(text = 'The Title for My Chart', floating = True, align = 'center')
355+
my_title = Title(text = 'The Title for My Chart',
356+
floating = True,
357+
align = 'center')
357358
my_chart.options.title = my_title
358359
359-
my_credits = Credits(text = 'Chris Modzelewski', enabled = True, href = 'https://www.highcharts.com')
360+
my_credits = Credits(text = 'Chris Modzelewski',
361+
enabled = True,
362+
href = 'https://www.highchartspython.com')
360363
my_chart.options.credits = my_credits
361364
362365
@@ -399,6 +402,13 @@ that will render the chart wherever it is you want it to go:
399402
my_image_bytes = my_chart.download_chart(filename = 'my_target_file.png',
400403
format = 'png')
401404
405+
8. Render Your Chart in a Jupyter Notebook
406+
===============================================
407+
408+
.. code-block:: python
409+
410+
my_chart.display()
411+
402412
--------------
403413

404414
***********************
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

0 commit comments

Comments
 (0)