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
10 changes: 10 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@

Release 1.9.3
=========================================

* **BUGFIX:** Fixed incorrect export serialization of Highcharts Maps for Python map topologies.
* **BUGFIX:** Added support for value ``'allow'`` to ``DataLabel.overflow`` property. Fixes #198.
* **DOCS:** Fixed some typos in documentation (courtesy of @JulienBacquart).

----


Release 1.9.2
=========================================

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Naming Conventions
noun that describes what information is contained in the variable. If a ``bool``,
preface with ``is_`` or ``has_`` or similar question-word that can be answered
with a yes-or-no.
* ``function_name`` and not ``function_name`` or ``functionName``. Should be an
* ``function_name`` and not ``functionName`` or ``FunctionName``. Should be an
imperative that describes what the function does (e.g. ``get_next_page``).
* ``CONSTANT_NAME`` and not ``constant_name`` or ``ConstantName``.
* ``ClassName`` and not ``class_name`` or ``Class_Name``.
Expand Down
4 changes: 2 additions & 2 deletions docs/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Glossary

JavaScript Object Literal Notation *is* JavaScript source code. JSON is not. JSON is
a way of encoding data into a text form that JavaScript is able to parse and
deserialize. Because Highcharts JS relies heavily on JavaScriot object literal
deserialize. Because Highcharts JS relies heavily on JavaScript object literal
notation to support the definition of :term:`event handlers <event handler>` and
:term:`callback functions <callback function>`, **Highcharts for Python** is designed
to serialize and deserialize Python representations to/from their JavaScript object
Expand All @@ -254,7 +254,7 @@ Glossary
:widths: 50 50
:header-rows: 1

* - JavaScriot Object Literal Notation
* - JavaScript Object Literal Notation
- JSON
* - |
.. code-block:: JavaScript
Expand Down
2 changes: 1 addition & 1 deletion highcharts_core/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.9.2'
__version__ = '1.9.3'
16 changes: 14 additions & 2 deletions highcharts_core/metaclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,18 @@ def trim_dict(untrimmed: dict,
trimmed_value = str(value)
if trimmed_value and trimmed_value != 'None':
as_dict[key] = trimmed_value
# MapData -> dict --> object
elif checkers.is_type(value, 'MapData') and to_json and for_export:
untrimmed_value = value._to_untrimmed_dict()
updated_context = value.__class__.__name__
topology = untrimmed_value.get('topology', None)
if topology:
trimmed_value = topology.to_dict()
else:
trimmed_value = None

if trimmed_value:
as_dict[key] = trimmed_value
# HighchartsMeta -> dict --> object
elif value and hasattr(value, '_to_untrimmed_dict'):
untrimmed_value = value._to_untrimmed_dict()
Expand Down Expand Up @@ -704,7 +716,7 @@ def from_js_literal(cls,
return cls.from_js_literal(prefixed_str,
_break_loop_on_failure = True)
elif not checkers.is_type(body, 'VariableDeclaration'):
raise errors.HighchartsVariableDeclarationError('To parse a JavaScriot '
raise errors.HighchartsVariableDeclarationError('To parse a JavaScript '
'object literal, it is '
'expected to be either a '
'variable declaration or a'
Expand Down Expand Up @@ -1338,7 +1350,7 @@ def from_js_literal(cls,
return cls.from_js_literal(prefixed_str,
_break_loop_on_failure = True)
elif not checkers.is_type(body, 'VariableDeclaration'):
raise errors.HighchartsVariableDeclarationError('To parse a JavaScriot '
raise errors.HighchartsVariableDeclarationError('To parse a JavaScript '
'object literal, it is '
'expected to be either a '
'variable declaration or a'
Expand Down
4 changes: 2 additions & 2 deletions highcharts_core/utility_classes/data_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,8 @@ def overflow(self, value):
self._overflow = None
else:
value = value.lower()
if value not in ['justify', 'none']:
raise errors.HighchartsValueError(f'overflow accepts "justify" or "none".'
if value not in ['justify', 'allow', 'none']:
raise errors.HighchartsValueError(f'overflow accepts "justify", "allow", or "none".'
f' Was: {value}')
self._overflow = value

Expand Down