Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ dmypy.json
.pyre/

# VENV
.py310/
.py31*/

# temp files
~$*.*
Expand Down
26 changes: 26 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@

Release 1.4.0
=========================================

* **MAJOR** performance gains in the ``.to_js_literal()`` method. Implementation seems to
improve performance by 50 - 90%.
* *SIGNIFICANT* performance gains in the ``.to_json()`` method. Implementation seems to
improve performance by 30 - 90%.
* **ENHANCEMENT:** Significantly simplified use of the ``.from_pandas()`` method to support:

* creation of multiple series from one DataFrame in one method call
* creation of series without needing to specify a full property map
* support for creating series by DataFrame row, rather than just by DataFrame column

* **ENHANCEMENT:** Added the ``.from_pandas_in_rows()`` method to support creation of
charts and series from simple two-dimensional DataFrames laid out in rows.
* **ENHANCEMENT:** Added one-shot chart creation and rendering from Series objects.
* **ENHANCEMENT:** Added one-shot chart creation using ``series`` and ``data``/``series_type`` keywords.
* **ENHANCEMENT:** Added ``.convert_to()`` convenience method to Series objects.
* **ENHANCEMENT:** Added ``CallbackFunction.from_python()`` method which converts a Python function
to its JavaScript equivalent using generative AI, with support for both OpenAI and Anthropic.
* **BUGFIX:** Fixed instability issues in Jupyter Notebooks, both when operating as a Notebook (outside of
Jupyter Lab) and when saved to a static HTML file.

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

Release 1.3.0
=========================================

Expand Down
94 changes: 52 additions & 42 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,55 +244,52 @@ Hello World, and Basic Usage

.. code-block:: python

# from a primitive array, using keyword arguments
my_chart = Chart(data = [[1, 23], [2, 34], [3, 45]],
series_type = 'line')

# from a primitive array, using the .from_array() method
my_chart = Chart.from_array([[1, 23], [2, 34], [3, 45]],
series_type = 'line')

# from a Numpy ndarray, using keyword arguments
my_chart = Chart(data = numpy_array, series_type = 'line')

# from a Numpy ndarray, using the .from_array() method
my_chart = Chart.from_array(data = numpy_array, series_type = 'line')

# from a JavaScript file
my_chart = highcharts.Chart.from_js_literal('my_js_literal.js')
my_chart = Chart.from_js_literal('my_js_literal.js')

# from a JSON file
my_chart = highcharts.Chart.from_json('my_json.json')
my_chart = Chart.from_json('my_json.json')

# from a Python dict
my_chart = highcharts.Chart.from_dict(my_dict_obj)

# from a GeoPandas GeoDataFrame
my_chart = highcharts.Chart.from_geopandas(gdf,
property_map = {
'z': 'caseCount',
'id': 'id',
},
series_type = 'mapbubble')
my_chart = Chart.from_dict(my_dict_obj)

# from a Pandas dataframe
my_chart = highcharts.Chart.from_pandas(df,
property_map = {
'x': 'transactionDate',
'y': 'invoiceAmt',
'id': 'id'
},
series_type = 'line')
my_chart = Chart.from_pandas(df)

# from a PySpark dataframe
my_chart = highcharts.Chart.from_pyspark(df,
property_map = {
'x': 'transactionDate',
'y': 'invoiceAmt',
'id': 'id'
},
series_type = 'line')
my_chart = Chart.from_pyspark(df,
property_map = {
'x': 'transactionDate',
'y': 'invoiceAmt',
'id': 'id'
},
series_type = 'line')

# from a CSV
my_chart = highcharts.Chart.from_csv('/some_file_location/filename.csv'
column_property_map = {
'x': 0,
'y': 4,
'id': 14
},
series_type = 'line')
my_chart = Chart.from_csv('/some_file_location/filename.csv')

# from a HighchartsOptions configuration object
my_chart = highcharts.Chart.from_options(my_options)
my_chart = Chart.from_options(my_options)

# from a Series configuration
my_chart = highcharts.Chart.from_series(my_series)
# from a Series configuration, using keyword arguments
my_chart = Chart(series = my_series)

# from a Series configuration, using .from_series()
my_chart = Chart.from_series(my_series)


3. Configure Global Settings (optional)
Expand Down Expand Up @@ -321,9 +318,10 @@ Hello World, and Basic Usage

.. code-block:: python

from highcharts_maps.options.title import Title
from highcharts_maps.options.credits import Credits
from highcharts_core.options.title import Title
from highcharts_core.options.credits import Credits

# EXAMPLE 1.
# Using dicts
my_chart.title = {
'align': 'center'
Expand All @@ -334,7 +332,7 @@ Hello World, and Basic Usage

my_chart.credits = {
'enabled': True,
'href': 'https://www.highcharts.com/',
'href': 'https://www.highchartspython.com/',
'position': {
'align': 'center',
'vertical_align': 'bottom',
Expand All @@ -349,14 +347,19 @@ Hello World, and Basic Usage
'text': 'Chris Modzelewski'
}

# EXAMPLE 2.
# Using direct objects
from highcharts_maps.options.title import Title
from highcharts_maps.options.credits import Credits
from highcharts_core.options.title import Title
from highcharts_core.options.credits import Credits

my_title = Title(text = 'The Title for My Chart', floating = True, align = 'center')
my_title = Title(text = 'The Title for My Chart',
floating = True,
align = 'center')
my_chart.options.title = my_title

my_credits = Credits(text = 'Chris Modzelewski', enabled = True, href = 'https://www.highcharts.com')
my_credits = Credits(text = 'Chris Modzelewski',
enabled = True,
href = 'https://www.highchartspython.com')
my_chart.options.credits = my_credits


Expand Down Expand Up @@ -399,6 +402,13 @@ that will render the chart wherever it is you want it to go:
my_image_bytes = my_chart.download_chart(filename = 'my_target_file.png',
format = 'png')

8. Render Your Chart in a Jupyter Notebook
===============================================

.. code-block:: python

my_chart.display()

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

***********************
Expand Down
Binary file added docs/_static/highcharts-chart-anatomy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/tutorials/census-time-series-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/tutorials/census-time-series-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/tutorials/census-time-series-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/tutorials/census-time-series-04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/tutorials/census-time-series-06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/tutorials/census-time-series-07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/tutorials/census-time-series-09.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/tutorials/census-time-series-10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/tutorials/raw-data-as-numpy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 36 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -473,27 +473,40 @@ Core Components
- :class:`DataPointAccessibility <highcharts_maps.options.series.data.accessibility.DataPointAccessibility>`
* - :mod:`.options.series.data.arcdiagram <highcharts_maps.options.series.data.arcdiagram>`
- :class:`ArcDiagramData <highcharts_maps.options.series.data.arcdiagram.ArcDiagramData>`
:class:`ArcDiagramDataCollection <highcharts_maps.options.series.data.arcidagram.ArcDiagramDataCollection>`
* - :mod:`.options.series.data.bar <highcharts_maps.options.series.data.bar>`
- :class:`BarData <highcharts_maps.options.series.data.bar.BarData>`
:class:`BarDataCollection <highcharts_maps.options.series.data.bar.BarDataCollection>`
:class:`WaterfallData <highcharts_maps.options.series.data.bar.WaterfallData>`
:class:`WaterfallDataCollection <highcharts_maps.options.series.data.bar.WaterfallDataCollection>`
:class:`WindBarbData <highcharts_maps.options.series.data.bar.WindBarbData>`
:class:`WindBarbDataCollection <highcharts_maps.options.series.data.bar.WindBarbDataCollection>`
:class:`XRangeData <highcharts_maps.options.series.data.bar.XRangeData>`
:class:`XRangeDataCollection <highcharts_maps.options.series.data.bar.XRangeDataCollection>`
* - :mod:`.options.series.data.base <highcharts_maps.options.series.data.base>`
- :class:`DataBase <highcharts_maps.options.series.data.base.DataBase>`
:class:`DataCore <highcharts_maps.options.series.data.base.DataCore>`
* - :mod:`.options.series.data.boxplot <highcharts_maps.options.series.data.boxplot>`
- :class:`BoxPlotData <highcharts_maps.options.series.data.boxplot.BoxPlotData>`
:class:`BoxPlotDataCollection <highcharts_maps.options.series.data.boxplot.BoxPlotDataCollection>`
* - :mod:`.options.series.data.bullet <highcharts_maps.options.series.data.bullet>`
- :class:`BulletData <highcharts_maps.options.series.data.bullet.BulletData>`
:class:`BulletDataCollection <highcharts_maps.options.series.data.bullet.BulletDataCollection>`
* - :mod:`.options.series.data.cartesian <highcharts_maps.options.series.data.cartesian>`
- :class:`CartesianData <highcharts_maps.options.series.data.cartesian.CartesianData>`
:class:`CartesianDataCollection <highcharts_maps.options.series.data.cartesian.CartesianDataCollection>`
:class:`Cartesian3DData <highcharts_maps.options.series.data.cartesian.Cartesian3DData>`
:class:`Cartesian3DDataCollection <highcharts_maps.options.series.data.cartesian.Cartesian3DDataCollection>`
:class:`CartesianValueData <highcharts_maps.options.series.data.cartesian.CartesianValueData>`
:class:`CartesianValueDataCollection <highcharts_maps.options.series.data.cartesian.CartesianValueDataCollection>`
* - :mod:`.options.series.data.collections <highcharts_maps.options.series.data.collections>`
- :class:`DataPointCollection <highcharts_maps.options.series.data.collections.DataPointCollection>`
* - :mod:`.options.series.data.connections <highcharts_maps.options.series.data.connections>`
- :class:`ConnectionData <highcharts_maps.options.series.data.connections.ConnectionData>`
:class:`FlowmapData <highcharts_maps.options.series.data.connections.FlowmapData>`
:class:`ConnectionDataCollection <highcharts_maps.options.series.data.connections.ConnectionDataCollection>`
:class:`WeightedConnectionData <highcharts_maps.options.series.data.connections.WeightedConnectionData>`
:class:`WeightedConnectionDataCollection <highcharts_maps.options.series.data.connections.WeightedConnectionDataCollection>`
:class:`OutgoingWeightedConnectionData <highcharts_maps.options.series.data.connections.OutgoingWeightedConnectionData>`
:class:`OutgoingWeightedConnectionDataCollection <highcharts_maps.options.series.data.connections.OutgoingWeightedConnectionDataCollection>`
:class:`ConnectionBase <highcharts_maps.options.series.data.connections.ConnectionBase>`
* - :mod:`.options.series.data.geometric <highcharts_maps.options.series.data.geometric>`
- :class:`GeometricData <highcharts_maps.options.series.data.GeometricData`
Expand All @@ -505,29 +518,44 @@ Core Components
:class:`AsyncMapData <highcharts_maps.options.series.data.map_data.AsyncMapData>`
* - :mod:`.options.series.data.pie <highcharts_maps.options.series.data.pie>`
- :class:`PieData <highcharts_maps.options.series.data.pie.PieData>`
:class:`PieDataCollection <highcharts_maps.options.series.data.pie.PieDataCollection>`
:class:`VariablePieData <highcharts_maps.options.series.data.pie.VariablePieData>`
:class:`VariablePieDataCollection <highcharts_maps.options.series.data.pie.VariablePieDataCollection>`
* - :mod:`.options.series.data.range <highcharts_maps.options.series.data.range>`
- :class:`RangeData <highcharts_maps.options.series.data.range.RangeData>`
:class:`RangeDataCollection <highcharts_maps.options.series.data.range.RangeDataCollection>`
:class:`ConnectedRangeData <highcharts_maps.options.series.data.range.ConnectedRangeData>`
:class:`ConnectedRangeDataCollection <highcharts_maps.options.series.data.range.ConnectedRangeDataCollection>`
* - :mod:`.options.series.data.single_point <highcharts_maps.options.series.data.single_point>`
- :class:`SinglePointData <highcharts_maps.options.series.data.single_point.SinglePointData>`
:class:`SinglePointDataCollection <highcharts_maps.options.series.data.single_point.SinglePointDataCollection>`
:class:`SingleValueData <highcharts_maps.options.series.data.single_point.SingleValueData>`
:class:`SingleValueDataCollection <highcharts_maps.options.series.data.single_point.SingleValueDataCollection>`
:class:`SingleXData <highcharts_maps.options.series.data.single_point.SingleXData>`
:class:`SingleXDataCollection <highcharts_maps.options.series.data.single_point.SingleXDataCollection>`
:class:`LabeledSingleXData <highcharts_maps.options.series.data.single_point.LabeledSingleXData>`
:class:`LabeledSingleXDataCollection <highcharts_maps.options.series.data.single_point.LabeledSingleXDataCollection>`
:class:`ConnectedSingleXData <highcharts_maps.options.series.data.single_point.ConnectedSingleXData>`
:class:`ConnectedSingleXDataCollection <highcharts_maps.options.series.data.single_point.ConnectedSingleXDataCollection>`
:class:`SinglePointBase <highcharts_maps.options.series.data.single_point.SinglePointBase>`
* - :mod:`.options.series.data.sunburst <highcharts_maps.options.series.data.sunburst>`
- :class:`SunburstData <highcharts_maps.options.series.data.sunburst.SunburstData>`
:class:`SunburstDataCollection <highcharts_maps.options.series.data.sunburst.SunburstDataCollection>`
* - :mod:`.options.series.data.treegraph <highcharts_maps.options.series.data.treegraph>`
- :class:`TreegraphData <highcharts_maps.options.series.data.treegraph.TreegraphData>`
:class:`TreegraphDataCollection <highcharts_maps.options.series.data.treegraph.TreegraphDataCollection>`
* - :mod:`.options.series.data.treemap <highcharts_maps.options.series.data.treemap>`
- :class:`TreemapData <highcharts_maps.options.series.data.treemap.TreemapData>`
:class:`TreemapDataCollection <highcharts_maps.options.series.data.treemap.TreemapDataCollection>`
* - :mod:`.options.series.data.vector <highcharts_maps.options.series.data.vector>`
- :class:`VectorData <highcharts_maps.options.series.data.vector.VectorData>`
:class:`VectorDataCollection <highcharts_maps.options.series.data.vector.VectorDataCollection>`
* - :mod:`.options.series.data.venn <highcharts_maps.options.series.data.venn>`
- :class:`VennData <highcharts_maps.options.series.data.venn.VennData>`
:class:`VennDataCollection <highcharts_maps.options.series.data.venn.VennDataCollection>`
* - :mod:`.options.series.data.wordcloud <highcharts_maps.options.series.data.wordcloud>`
- :class:`WordcloudData <highcharts_maps.options.series.data.wordcloud.WordcloudData>`
:class:`WordcloudDataCollection <highcharts_maps.options.series.data.wordcloud.WordcloudDataCollection>`
* - :mod:`.options.series.dependencywheel <highcharts_maps.options.series.dependencywheel>`
- :class:`DependencyWheelSeries <highcharts_maps.options.series.dependencywheel.DependencyWheelSeries>`
* - :mod:`.options.series.dumbbell <highcharts_maps.options.series.dumbbell>`
Expand Down Expand Up @@ -769,6 +797,12 @@ need to familiarize yourself with these internals.
:func:`validate_color() <highcharts_maps.utility_functions.validate_color>`
:func:`to_camelCase() <highcharts_maps.utility_functions.to_camelCase>`
:func:`parse_csv() <highcharts_maps.utility_functions.parse_csv>`
* - :mod:`.ai <highcharts_maps.ai>`
- :func:`convert_to_js() <highcharts_maps.ai.convert_to_js>`
:func:`openai_moderate() <highcharts_maps.ai.openai_moderate>`
:func:`openai_conversion() <highcharts_maps.ai.openai_conversion>`
:func:`anthropic_conversion() <highcharts_maps.ai.anthropic_conversion>`
:func:`get_source() <highcharts_maps.ai.get_source>`

.. target-notes::

Expand Down
24 changes: 22 additions & 2 deletions docs/api/options/series/data/arcdiagram.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

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

.. module:: highcharts_maps.options.series.data.arcdiagram
.. module:: highcharts_core.options.series.data.arcdiagram

********************************************************************************************************************
class: :class:`ArcDiagramData <highcharts_maps.options.series.data.arcdiagram.ArcDiagramData>`
Expand All @@ -22,7 +22,27 @@ class: :class:`ArcDiagramData <highcharts_maps.options.series.data.arcdiagram.Ar
.. collapse:: Class Inheritance

.. inheritance-diagram:: ArcDiagramData
:top-classes: highcharts_maps.metaclasses.HighchartsMeta, highcharts_core.metaclasses.HighchartsMeta
:top-classes: highcharts_core.metaclasses.HighchartsMeta
:parts: -1

|

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

.. module:: highcharts_core.options.series.data.arcdiagram

********************************************************************************************************************
class: :class:`ArcDiagramDataCollection <highcharts_maps.options.series.data.arcdiagram.ArcDiagramDataCollection>`
********************************************************************************************************************

.. autoclass:: ArcDiagramDataCollection
:members:
:inherited-members:

.. collapse:: Class Inheritance

.. inheritance-diagram:: ArcDiagramDataCollection
:top-classes: highcharts_core.metaclasses.HighchartsMeta
:parts: -1

|
Loading