File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed
packages/python/plotly/plotly Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -5609,15 +5609,38 @@ def to_plotly_json(self):
5609
5609
"""
5610
5610
return deepcopy (self ._props if self ._props is not None else {})
5611
5611
5612
- def to_json (self ):
5612
+ def to_json (self , * args , ** kwargs ):
5613
5613
"""
5614
5614
Convert to a JSON string representation.
5615
5615
5616
+ Parameters
5617
+ ----------
5618
+ validate: bool (default True)
5619
+ True if the figure should be validated before being converted to
5620
+ JSON, False otherwise.
5621
+
5622
+ pretty: bool (default False)
5623
+ True if JSON representation should be pretty-printed, False if
5624
+ representation should be as compact as possible.
5625
+
5626
+ remove_uids: bool (default True)
5627
+ True if trace UIDs should be omitted from the JSON representation
5628
+
5629
+ engine: str (default None)
5630
+ The JSON encoding engine to use. One of:
5631
+ - "json" for an encoder based on the built-in Python json module
5632
+ - "orjson" for a fast encoder the requires the orjson package
5633
+ If not specified, the default encoder is set to the current value of
5634
+ plotly.io.json.config.default_encoder.
5635
+
5616
5636
Returns
5617
5637
-------
5618
5638
str
5639
+ Representation of figure as a JSON string
5619
5640
"""
5620
- return json .dumps (self .to_plotly_json (), cls = PlotlyJSONEncoder )
5641
+ import plotly .io as pio
5642
+
5643
+ return pio .to_json (self , * args , ** kwargs )
5621
5644
5622
5645
@staticmethod
5623
5646
def _vals_equal (v1 , v2 ):
You can’t perform that action at this time.
0 commit comments