Skip to content

Commit c990736

Browse files
committed
format
1 parent 53d486a commit c990736

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

plotly/io/_kaleido.py

+22-17
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def kaleido_available() -> bool:
7070

7171
def kaleido_major() -> int:
7272
"""
73-
Returns the major version number of Kaleido if it is installed,
73+
Returns the major version number of Kaleido if it is installed,
7474
otherwise raises a ValueError.
7575
"""
7676
global _KALEIDO_MAJOR
@@ -194,13 +194,13 @@ def infer_format(path: Union[Path, None], format: Union[str, None]) -> Union[str
194194

195195
def to_image(
196196
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,
202202
# Deprecated
203-
engine: Union[str, None]=None,
203+
engine: Union[str, None] = None,
204204
) -> bytes:
205205
"""
206206
Convert a figure to a static image bytes string
@@ -344,7 +344,9 @@ def to_image(
344344
height=height or defaults.default_height,
345345
scale=scale or defaults.default_scale,
346346
),
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,
348350
# mathjax=Path(defaults.mathjax).as_uri() if defaults.mathjax else None,
349351
)
350352
except choreographer.errors.ChromeNotFoundError:
@@ -363,13 +365,13 @@ def to_image(
363365
def write_image(
364366
fig: Union[dict, plotly.graph_objects.Figure],
365367
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,
371373
# Deprecated
372-
engine: Union[str, None]="auto",
374+
engine: Union[str, None] = "auto",
373375
):
374376
"""
375377
Convert a figure to a static image and write it to a file or writeable
@@ -493,7 +495,10 @@ def write_image(
493495

494496

495497
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+
],
497502
file: Union[List[Union[str, Path]], Union[str, Path]],
498503
format: Union[List[Union[str, None]], Union[str, None]] = None,
499504
scale: Union[List[Union[int, float, None]], Union[int, float, None]] = None,
@@ -626,8 +631,8 @@ def write_images(
626631

627632
def full_figure_for_development(
628633
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,
631636
) -> Union[plotly.graph_objects.Figure, dict]:
632637
"""
633638
Compute default values for all attributes not specified in the input figure and

0 commit comments

Comments
 (0)