@@ -70,7 +70,7 @@ def kaleido_available() -> bool:
70
70
71
71
def kaleido_major () -> int :
72
72
"""
73
- Returns the major version number of Kaleido if it is installed,
73
+ Returns the major version number of Kaleido if it is installed,
74
74
otherwise raises a ValueError.
75
75
"""
76
76
global _KALEIDO_MAJOR
@@ -194,13 +194,13 @@ def infer_format(path: Union[Path, None], format: Union[str, None]) -> Union[str
194
194
195
195
def to_image (
196
196
fig : Union [dict , plotly .graph_objects .Figure ],
197
- format : Union [str , None ]= None ,
198
- width : Union [int , None ]= None ,
199
- height : Union [int , None ]= None ,
200
- scale : Union [int , float , None ]= None ,
201
- validate : bool = True ,
197
+ format : Union [str , None ] = None ,
198
+ width : Union [int , None ] = None ,
199
+ height : Union [int , None ] = None ,
200
+ scale : Union [int , float , None ] = None ,
201
+ validate : bool = True ,
202
202
# Deprecated
203
- engine : Union [str , None ]= None ,
203
+ engine : Union [str , None ] = None ,
204
204
) -> bytes :
205
205
"""
206
206
Convert a figure to a static image bytes string
@@ -344,7 +344,9 @@ def to_image(
344
344
height = height or defaults .default_height ,
345
345
scale = scale or defaults .default_scale ,
346
346
),
347
- topojson = Path (defaults .topojson ).as_uri () if defaults .topojson else None ,
347
+ topojson = Path (defaults .topojson ).as_uri ()
348
+ if defaults .topojson
349
+ else None ,
348
350
# mathjax=Path(defaults.mathjax).as_uri() if defaults.mathjax else None,
349
351
)
350
352
except choreographer .errors .ChromeNotFoundError :
@@ -363,13 +365,13 @@ def to_image(
363
365
def write_image (
364
366
fig : Union [dict , plotly .graph_objects .Figure ],
365
367
file : Union [str , Path ],
366
- format : Union [str , None ]= None ,
367
- scale : Union [int , float , None ]= None ,
368
- width : Union [int , None ]= None ,
369
- height : Union [int , None ]= None ,
370
- validate : bool = True ,
368
+ format : Union [str , None ] = None ,
369
+ scale : Union [int , float , None ] = None ,
370
+ width : Union [int , None ] = None ,
371
+ height : Union [int , None ] = None ,
372
+ validate : bool = True ,
371
373
# Deprecated
372
- engine : Union [str , None ]= "auto" ,
374
+ engine : Union [str , None ] = "auto" ,
373
375
):
374
376
"""
375
377
Convert a figure to a static image and write it to a file or writeable
@@ -493,7 +495,10 @@ def write_image(
493
495
494
496
495
497
def write_images (
496
- fig : Union [List [Union [dict , plotly .graph_objects .Figure ]], Union [dict , plotly .graph_objects .Figure ]],
498
+ fig : Union [
499
+ List [Union [dict , plotly .graph_objects .Figure ]],
500
+ Union [dict , plotly .graph_objects .Figure ],
501
+ ],
497
502
file : Union [List [Union [str , Path ]], Union [str , Path ]],
498
503
format : Union [List [Union [str , None ]], Union [str , None ]] = None ,
499
504
scale : Union [List [Union [int , float , None ]], Union [int , float , None ]] = None ,
@@ -626,8 +631,8 @@ def write_images(
626
631
627
632
def full_figure_for_development (
628
633
fig : Union [dict , plotly .graph_objects .Figure ],
629
- warn : bool = True ,
630
- as_dict : bool = False ,
634
+ warn : bool = True ,
635
+ as_dict : bool = False ,
631
636
) -> Union [plotly .graph_objects .Figure , dict ]:
632
637
"""
633
638
Compute default values for all attributes not specified in the input figure and
0 commit comments