@@ -323,6 +323,18 @@ def trim_dict(untrimmed: dict,
323323 trimmed_value = str (value )
324324 if trimmed_value and trimmed_value != 'None' :
325325 as_dict [key ] = trimmed_value
326+ # MapData -> dict --> object
327+ elif checkers .is_type (value , 'MapData' ) and to_json and for_export :
328+ untrimmed_value = value ._to_untrimmed_dict ()
329+ updated_context = value .__class__ .__name__
330+ topology = untrimmed_value .get ('topology' , None )
331+ if topology :
332+ trimmed_value = topology .to_dict ()
333+ else :
334+ trimmed_value = None
335+
336+ if trimmed_value :
337+ as_dict [key ] = trimmed_value
326338 # HighchartsMeta -> dict --> object
327339 elif value and hasattr (value , '_to_untrimmed_dict' ):
328340 untrimmed_value = value ._to_untrimmed_dict ()
@@ -704,7 +716,7 @@ def from_js_literal(cls,
704716 return cls .from_js_literal (prefixed_str ,
705717 _break_loop_on_failure = True )
706718 elif not checkers .is_type (body , 'VariableDeclaration' ):
707- raise errors .HighchartsVariableDeclarationError ('To parse a JavaScriot '
719+ raise errors .HighchartsVariableDeclarationError ('To parse a JavaScript '
708720 'object literal, it is '
709721 'expected to be either a '
710722 'variable declaration or a'
@@ -1338,7 +1350,7 @@ def from_js_literal(cls,
13381350 return cls .from_js_literal (prefixed_str ,
13391351 _break_loop_on_failure = True )
13401352 elif not checkers .is_type (body , 'VariableDeclaration' ):
1341- raise errors .HighchartsVariableDeclarationError ('To parse a JavaScriot '
1353+ raise errors .HighchartsVariableDeclarationError ('To parse a JavaScript '
13421354 'object literal, it is '
13431355 'expected to be either a '
13441356 'variable declaration or a'
0 commit comments