diff --git a/CHANGES.rst b/CHANGES.rst index 0935d4a..8370f30 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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 ========================================= diff --git a/docs/contributing.rst b/docs/contributing.rst index 867dc41..e3d1e6b 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -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``. diff --git a/docs/glossary.rst b/docs/glossary.rst index 3e4d250..4dfce60 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -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 ` and :term:`callback functions `, **Highcharts for Python** is designed to serialize and deserialize Python representations to/from their JavaScript object @@ -254,7 +254,7 @@ Glossary :widths: 50 50 :header-rows: 1 - * - JavaScriot Object Literal Notation + * - JavaScript Object Literal Notation - JSON * - | .. code-block:: JavaScript diff --git a/highcharts_core/__version__.py b/highcharts_core/__version__.py index 4175d39..be0b610 100644 --- a/highcharts_core/__version__.py +++ b/highcharts_core/__version__.py @@ -1 +1 @@ -__version__ = '1.9.2' +__version__ = '1.9.3' diff --git a/highcharts_core/metaclasses.py b/highcharts_core/metaclasses.py index 529ed69..6e6efc5 100644 --- a/highcharts_core/metaclasses.py +++ b/highcharts_core/metaclasses.py @@ -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() @@ -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' @@ -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' diff --git a/highcharts_core/utility_classes/data_labels.py b/highcharts_core/utility_classes/data_labels.py index e5d0933..b56bb78 100644 --- a/highcharts_core/utility_classes/data_labels.py +++ b/highcharts_core/utility_classes/data_labels.py @@ -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