Skip to content

Commit 5d6a04c

Browse files
committed
Revised documentation.
1 parent a47c494 commit 5d6a04c

File tree

11 files changed

+53
-67
lines changed

11 files changed

+53
-67
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ And thanks to all those who've already contributed!
382382
Testing
383383
*********************
384384

385-
We use `TravisCI <https://travisci.org>`_ for our build automation and
386-
`ReadTheDocs <https://readthedocs.org>`_ for our documentation.
385+
We use `TravisCI <https://travisci.com>`_ for our build automation and
386+
`ReadTheDocs <https://readthedocs.com>`_ for our documentation.
387387

388388
Detailed information about our test suite and how to run tests locally can be
389389
found in our Testing Reference.

docs/_versus_alternatives.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ some commonly-used alternatives:
9898
.. tab:: panel-highcharts
9999

100100
The `panel-highcharts <https://pypi.org/project/panel-highcharts/>`_ library is -
101-
honestly - fantastic. It is a excellent wrapper for the Highcharts Core (JS) library to
101+
honestly - fantastic. It is a excellent wrapper for the Highcharts (JS) suite to
102102
enable exploratory data analysis (EDA) in Jupyter Notebooks or in Holoviz web
103103
applications.
104104

@@ -110,14 +110,17 @@ some commonly-used alternatives:
110110
to the Highcharts API. In practice, this forces the developer to switch between
111111
Pythonic ``snake_case`` convention and JavaScript ``camelCase`` conventions
112112
within the same code. Not a big problem, but annoying.
113+
* To really benefit from its capabilities, it requires a fair bit of Holoviz
114+
boilerplate and widget configuration, which can be complicated, verbose, and
115+
"fiddly".
113116

114117
.. tip::
115118

116119
**When to use it?**
117120

118-
If your use case was satisfied with Highcharts Core visualizations only, and involved
119-
highly-interactive exploratory data analysis in a Jupyter Labs/Notebook environment,
120-
it may be worth considering this library.
121+
If your use case is limited to highly-interactive exploratory data analysis in a
122+
Jupyter Labs/Notebook environment and you are willing to construct some complicated
123+
Holoviz widget configuration code, it may be worth considering this library.
121124

122125
However, those are some pretty specific gating conditions. For integration with
123126
a non-Jupyter application? That's not what the **Highcharts for Python Toolkit** was

docs/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class in **Highcharts Core for Python**. These classes generally inherit from th
2727
:class:`HighchartsMeta <highcharts_core.metaclasses.HighchartsMeta>` metaclass, which
2828
provides each class with a number of standard methods.
2929

30-
These methods are the "workhorses" of the **Highcharts for Python Tolkit** and you will be relying
30+
These methods are the "workhorses" of the **Highcharts for Python Toolkit** and you will be relying
3131
heavily on them when using the library. Thankfully, their signatures and behavior is
3232
generally consistent - even if what happens "under the hood" is class-specific at times.
3333

docs/api/_handling_defaults.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
*Explicit is better than implicit.*
22
-- The Zen of Python
33

4-
`Highcharts JS <https://www.highcharts.com/>`_ has a *lot* of default values. These
4+
`Highcharts <https://www.highcharts.com/>`_ has a *lot* of default values. These
55
default values are generally applied if a JavaScript property is ``undefined`` (missing or
66
otherwise not specified), which is different from the JavaScript value of ``null``.
77

@@ -15,23 +15,23 @@ While my Pythonic instinct is to:
1515
doing so would introduce a massive problem: It would bloat data transferred on the wire
1616
*unnecessarily*.
1717

18-
The way that `Highcharts JS <https://www.highcharts.com>`__ handles defaults is an elegant
18+
The way that `Highcharts (JS) <https://www.highcharts.com>`__ handles defaults is an elegant
1919
compromise between explicitness and the practical reality of making your code readable.
2020
Why make a property explicit in a configuration string if you don't care about it? Purity
2121
is only valuable to a point. And with thousands of properties across the
22-
`Highcharts JS <https://www.highcharts.com>`__ library, *nobody* wants to transmit or
22+
`Highcharts (JS) <https://www.highcharts.com>`__ suite, *nobody* wants to transmit or
2323
maintain thousands of property configurations if it can be avoided.
2424

25-
For that reason, the **Highcharts for Python** toolkit explicitly breaks Pythonic
25+
For that reason, the **Highcharts for Python Toolkit** explicitly breaks Pythonic
2626
convention: when an object's property returns :obj:`None <python:None>`, that has the
27-
equivalent meaning of "Highcharts JS/Stock will apply the Highcharts default for this
27+
equivalent meaning of "Highcharts (JS) will apply the Highcharts default for this
2828
property". These properties will *not* be serialized, either to a JS literal, nor to a
2929
:class:`dict <python:dict>`, nor to JSON. This has the advantage of maintaining consistent
30-
behavior with `Highcharts JS <https://www.highcharts.com/products/highcharts/>`__ while
30+
behavior with the `Highcharts (JS) <https://www.highcharts.com/>`__ suite while
3131
still providing an internally consistent logic to follow.
3232

3333
.. note::
3434

35-
There's an item on the **Highcharts for Python** :doc:`roadmap <../toolkit>` (:issue:`1`)
35+
There's an item on the **Highcharts for Python** :doc:`roadmap <../toolkit>` (:issue:`12`)
3636
to *optionally* surface defaults when explicitly requested. Not sure when it will be
3737
implemented, but we'll get there at some point.

docs/api/_module_structure.rst

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
The structure of the **Highcharts for Python** library closely matches the structure
3-
of the `Highcharts JS <https://www.highcharts.com/>`_ options object (see the relevant
4-
`reference documentation <https://api.highcharts.com/highcharts/>`_).
2+
The structure of the **Highcharts Core for Python** library closely matches the structure
3+
of the `Highcharts Core <https://api.highcharts.com/highcharts/>`_ options object (see the
4+
relevant `reference documentation <https://api.highcharts.com/highcharts/>`_).
55

66
At the root of the library - importable from ``highcharts_core`` you will find the
77
:mod:`highcharts_core.highcharts` module. This module is a catch-all importable module,
@@ -10,11 +10,13 @@ modules.
1010

1111
.. note::
1212

13-
Whlie you can access all of the **Highcharts for Python** classes from
13+
Whlie you can access all of the **Highcharts Core for Python** classes from
1414
``highcharts_core.highcharts``, if you want to more precisely navigate to specific
1515
class definitions you can do fairly easily using the folder organization and naming
1616
conventions used in the library.
1717

18+
*This is the recommended best practice to maximize performance*.
19+
1820
In the root of the ``highcharts_core`` library you can find universally-shared
1921
class definitions, like :mod:`.metaclasses <highcharts_core.metaclasses>` which
2022
contains the :class:`HighchartsMeta` definition and the :class:`JavaScriptDict`
@@ -25,33 +27,10 @@ modules.
2527
definitions for classes that are referenced or used throughout the other class
2628
definitions.
2729

28-
And you can find the Highcharts JS ``options`` object and all of its
30+
And you can find the Highcharts Core ``options`` object and all of its
2931
properties defined in the :mod:`.options <highcharts_core.options>` module, with
3032
specific (complicated or extensive) sub-folders providing property-specific classes
3133
(e.g. the :mod:`.options.plot_options <highcharts_core.options.plot_options>`
3234
module defines all of the different configuration options for different series types,
3335
while the :mod:`.options.series <highcharts_core.options.series>` module defines all
3436
of the classes that represent :term:`series` of data in a given chart).
35-
36-
.. tip::
37-
38-
To keep things simple, we recommend importing classes you need directly from the
39-
:mod:`highcharts_core.highcharts` module. There are two paths to do so easily:
40-
41-
.. code-block:: python
42-
43-
# APPROACH #1: Import the highcharts module, and access its child classes directly.
44-
# for example by now calling highcharts.Chart().
45-
from highcharts_core import highcharts
46-
47-
my_chart = highcharts.Chart()
48-
my_shared_options = highcharts.SharedOptions()
49-
50-
my_line_series = highcharts.options.series.area.LineSeries()
51-
52-
# APPROACH #2: Import a specific class or module by name from the "highcharts" module.
53-
from highcharts_core.highcharts import Chart, SharedOptions, options
54-
55-
my_chart = Chart()
56-
my_shared_options = SharedOptions()
57-
my_line_series = options.series.area.LineSeries()

docs/contributing.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,16 @@ Docstrings
213213
Design Patterns and Standards
214214
***************************************************
215215

216-
`Highcharts JS <https://www.highcharts.com>`__ is a large, robust, and complicated JavaScript library. If in doubt, take
217-
a look at their extensive `documentation <https://www.highcharts.com/docs/index>`_ and in
218-
particular their `API reference <https://api.highcharts.com/highcharts>`_. Because
219-
**Highcharts for Python** wraps the Highcharts JS API, its design is heavily shaped by
216+
`Highcharts <https://www.highcharts.com>`__ is a large, robust, and complicated suite of
217+
JavaScript libraries. If in doubt, take a look at the extensive
218+
`documentation <https://www.highcharts.com/docs/index>`_ and in particular the
219+
`API reference <https://api.highcharts.com/highcharts>`_. Because
220+
**Highcharts for Python** wraps the Highcharts JS API, its design is heavily shaped by
220221
Highcharts JS' own design - as one should expect.
221222

222223
However, one of the main goals of **Highcharts for Python** is to make the Highcharts JS
223-
library a little more Pythonic in terms of its design to make it easier for Python
224-
developers to leverage it. Here are the notable design patterns that have been adopted
225-
that you should be aware of:
224+
library a little more Pythonic to make it easier for Python developers to leverage it.
225+
Here are the notable design patterns that have been adopted that you should be aware of:
226226

227227
Code Style: Python vs JavaScript Naming Conventions
228228
=======================================================

docs/faq.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ This documentation is a great place to start, but we're here to help!
2020

2121
-----------------
2222

23+
.. _faq_licensing:
24+
2325
***********************
2426
Licensing
2527
***********************
@@ -60,9 +62,11 @@ Open Source
6062
Yes. The **Highcharts for Python Toolkit** toolkit is open source (but not free -
6163
see :ref:`licensing <faq_licensing>` above).
6264

63-
You are welcome to review the source code for any library in the toolkit on `Github <https://github.com/highcharts-for-python>`__, including for `Highcharts Core for Python <https://github.com/highcharts-for-python/highcharts-core>`__.
65+
You are welcome to review the source code for any library in the toolkit on
66+
`Github <https://github.com/highcharts-for-python>`__, including for
67+
`Highcharts Core for Python <https://github.com/highcharts-for-python/highcharts-core>`__.
6468

65-
**Can I fork the toolkit?**
69+
**Can I fork the toolkit or a library in the toolkit?**
6670

6771
.. warning::
6872

docs/using.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,8 @@ literally - any frontend framework. Whether your Python application is relying o
150150
`Flask <https://flask.palletsprojects.com/en/2.2.x/>`_,
151151
`Django <https://www.djangoproject.com/>`_, `FastAPI <https://fastapi.tiangolo.com/>`_,
152152
`Pyramid <https://trypyramid.com/>`_, `Tornado <https://www.tornadoweb.org/en/stable/>`_,
153-
or some completely home-grown solution all Highcharts for
154-
Python needs is a place where `Highcharts <https://www.highcharts.com>`__ JavaScript
155-
code can be executed.
153+
or some completely home-grown solution all, Highcharts for Python needs is a place where
154+
`Highcharts <https://www.highcharts.com>`__ JavaScript code can be executed.
156155

157156
All of those frameworks mentioned have their own best practices for organizing their
158157
application structures, and those best practices should *always* take priority. Even in a

docs/using/_code_style_naming_conventions.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
*There are only two hard things in Computer Science: cache invalidation and naming
22
things.* -- Phil Karlton
33

4-
Highcharts Stock is a JavaScript library, and as such it adheres to the code conventions
4+
Highcharts Core is a JavaScript library, and as such it adheres to the code conventions
55
that are popular (practically standard) when working in JavaScript. Chief among these
66
conventions is that variables and object properties (keys) are typically written in
77
``camelCase``.
@@ -14,27 +14,28 @@ convention, Python generally skews towards the ``snake_case`` convention.
1414

1515
For most Python developers, using ``snake_case`` is the "default" mindset. Most of your
1616
Python code will use ``snake_case``. So having to switch into ``camelcase`` to interact
17-
with Highcharts Stock forces us to context switch, increases cognitive load, and is an
17+
with Highcharts Core forces us to context switch, increases cognitive load, and is an
1818
easy place for us to overlook things and make a mistake that can be quite annoying to
1919
track down and fix later.
2020

21-
Therefore, when designing the **Highcharts for Python** toolkit, we made several carefully
21+
Therefore, when designing the **Highcharts for Python Toolkit**, we made several carefully
2222
considered design choices when it comes to naming conventions:
2323

2424
#. All **Highcharts for Python** classes follow the Pythonic ``PascalCase`` class-naming
2525
convention.
2626
#. All **Highcharts for Python** properties and methods follow the Pythonic
2727
``snake_case`` property/method/variable/function-naming convention.
2828
#. All *inputs* to properties and methods support *both* ``snake_case`` and
29-
``camelCase`` (aka ``mixedCase``) convention by default. This means that you can take
30-
something directly from Highcharts JavaScript code and supply it to the
31-
**Highcharts for Python** toolkit without having to convert case or conventions. But if
32-
you are constructing and configuring something directly in Python using explicit
33-
:ref:`deserialization methods <deserialization_methods>`, you can use ``snake_case``
34-
if you prefer (and most Python developers will prefer).
29+
``camelCase`` (aka ``mixedCase``) convention by default.
30+
31+
This means that you can take something directly from Highcharts JavaScript code and
32+
supply it to the **Highcharts for Python Toolkit** without having to convert case or
33+
conventions. But if you are constructing and configuring something directly in Python
34+
using explicit :ref:`deserialization methods <deserialization_methods>`, you can use
35+
``snake_case`` if you prefer (and most Python developers will prefer).
3536

3637
For example, if you supply a JSON file to a ``from_json()`` method, that file can
37-
leverage Highcharts JS natural ``camelCase`` convention OR Highcharts for Python's
38+
leverage Highcharts (JS) natural ``camelCase`` convention OR Highcharts for Python's
3839
``snake_case`` convention.
3940

4041
.. warning::
@@ -45,7 +46,7 @@ considered design choices when it comes to naming conventions:
4546
methods expect ``snake_case`` properties to be supplied as keywords.
4647

4748
#. All *outputs* from serialization methods (e.g. ``to_dict()`` or ``to_js_literal()``)
48-
will produce outputs that are Highcharts JS-compatible, meaning that they apply the
49+
will produce outputs that are Highcharts (JS)-compatible, meaning that they apply the
4950
``camelCase`` convention.
5051

5152
.. tip::

docs/using/_importing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
This method of importing **Highcharts for Python** objects yields the fastest
1010
performance for the ``import`` statement. However, it is more verbose and requires
11-
you to navigate the extensive :doc:`Highcharts for Python API </api>`.
11+
you to navigate the extensive :doc:`Highcharts Core for Python API </api>`.
1212

1313
.. code-block:: python
1414

0 commit comments

Comments
 (0)