66import warnings
77
88import plotly
9- from plotly .io ._utils import validate_coerce_fig_to_dict , as_individual_kwargs
9+ from plotly .io ._utils import validate_coerce_fig_to_dict , as_individual_args
1010
1111ENGINE_SUPPORT_TIMELINE = "September 2025"
1212
@@ -199,7 +199,7 @@ def to_image(
199199 """
200200
201201Kaleido requires Google Chrome to be installed. Install it by running:
202- $ plotly_install_chrome
202+ $ plotly_get_chrome
203203"""
204204 )
205205
@@ -362,7 +362,7 @@ def write_image(
362362 path .write_bytes (img_data )
363363
364364
365- def to_images (** kwargs ):
365+ def to_images (* args , * *kwargs ):
366366 """
367367 Convert multiple figures to static images and return a list of image bytes
368368
@@ -377,18 +377,18 @@ def to_images(**kwargs):
377377 list of bytes
378378 The image data
379379 """
380- individual_kwargs = as_individual_kwargs ( ** kwargs )
380+ individual_args , individual_kwargs = as_individual_args ( * args , ** kwargs )
381381
382382 if kaleido_available and kaleido_major > 0 :
383383 # Kaleido v1
384384 # TODO: Use a single shared kaleido instance for all images
385- return [to_image (** kw ) for kw in individual_kwargs ]
385+ return [to_image (* a , ** kw ) for a , kw in zip ( individual_args , individual_kwargs ) ]
386386 else :
387387 # Kaleido v0, or orca
388- return [to_image (** kw ) for kw in individual_kwargs ]
388+ return [to_image (* a , ** kw ) for a , kw in zip ( individual_args , individual_kwargs ) ]
389389
390390
391- def write_images (** kwargs ):
391+ def write_images (* args , * *kwargs ):
392392 """
393393 Write multiple images to files or writeable objects. This is much faster than
394394 calling write_image() multiple times.
@@ -404,25 +404,18 @@ def write_images(**kwargs):
404404 None
405405 """
406406
407- if "file" not in kwargs :
408- raise ValueError ("'file' argument is required" )
409-
410- # Get individual arguments, and separate out the 'file' argument
411- individual_kwargs = as_individual_kwargs (** kwargs )
412- files = [kw ["file" ] for kw in individual_kwargs ]
413- individual_kwargs = [
414- {k : v for k , v in kw .items () if k != "file" } for kw in individual_kwargs
415- ]
407+ # Get individual arguments
408+ individual_args , individual_kwargs = as_individual_args (* args , ** kwargs )
416409
417410 if kaleido_available and kaleido_major > 0 :
418411 # Kaleido v1
419412 # TODO: Use a single shared kaleido instance for all images
420- for f , kw in zip (files , individual_kwargs ):
421- write_image (file = f , ** kw )
413+ for a , kw in zip (individual_args , individual_kwargs ):
414+ write_image (** kw )
422415 else :
423416 # Kaleido v0, or orca
424- for f , kw in zip (files , individual_kwargs ):
425- write_image (file = f , ** kw )
417+ for a , kw in zip (individual_args , individual_kwargs ):
418+ write_image (* a , ** kw )
426419
427420
428421def full_figure_for_development (fig , warn = True , as_dict = False ):
@@ -494,10 +487,10 @@ def full_figure_for_development(fig, warn=True, as_dict=False):
494487 return go .Figure (fig , skip_invalid = True )
495488
496489
497- def install_chrome ():
490+ def get_chrome ():
498491 """
499492 Install Google Chrome for Kaleido
500- This function can be run from the command line using the command `plotly_install_chrome `
493+ This function can be run from the command line using the command `plotly_get_chrome `
501494 defined in pyproject.toml
502495 """
503496 if not kaleido_available or kaleido_major < 1 :
0 commit comments