@@ -3740,29 +3740,29 @@ def to_image(self, *args, **kwargs):
3740
3740
- 'webp'
3741
3741
- 'svg'
3742
3742
- 'pdf'
3743
- - 'eps' (deprecated ) (Requires the poppler library to be installed)
3743
+ - 'eps' (Kaleido v0.* only ) (Requires the poppler library to be installed)
3744
3744
3745
3745
If not specified, will default to:
3746
- - `plotly.io.defaults.default_format` if engine is "kaleido"
3747
- - `plotly.io.orca.config.default_format` if engine is "orca" (deprecated)
3746
+ - `plotly.io.defaults.default_format` or `plotly.io.kaleido.scope.default_format` if engine is "kaleido"
3747
+ - `plotly.io.orca.config.default_format` if engine is "orca"
3748
3748
3749
3749
width: int or None
3750
3750
The width of the exported image in layout pixels. If the `scale`
3751
3751
property is 1.0, this will also be the width of the exported image
3752
3752
in physical pixels.
3753
3753
3754
3754
If not specified, will default to:
3755
- - `plotly.io.defaults.default_width` if engine is "kaleido"
3756
- - `plotly.io.orca.config.default_width` if engine is "orca" (deprecated)
3755
+ - `plotly.io.defaults.default_width` or `plotly.io.kaleido.scope.default_width` if engine is "kaleido"
3756
+ - `plotly.io.orca.config.default_width` if engine is "orca"
3757
3757
3758
3758
height: int or None
3759
3759
The height of the exported image in layout pixels. If the `scale`
3760
3760
property is 1.0, this will also be the height of the exported image
3761
3761
in physical pixels.
3762
3762
3763
3763
If not specified, will default to:
3764
- - `plotly.io.defaults.default_height` if engine is "kaleido"
3765
- - `plotly.io.orca.config.default_height` if engine is "orca" (deprecated)
3764
+ - `plotly.io.defaults.default_height` or `plotly.io.kaleido.scope.default_height` if engine is "kaleido"
3765
+ - `plotly.io.orca.config.default_height` if engine is "orca"
3766
3766
3767
3767
scale: int or float or None
3768
3768
The scale factor to use when exporting the figure. A scale factor
@@ -3771,14 +3771,14 @@ def to_image(self, *args, **kwargs):
3771
3771
less than 1.0 will decrease the image resolution.
3772
3772
3773
3773
If not specified, will default to:
3774
- - `plotly.io.defaults.default_scale` if engine is "kaliedo"
3775
- - `plotly.io.orca.config.default_scale` if engine is "orca" (deprecated)
3774
+ - `plotly.io.defaults.default_scale` or `plotly.io.kaleido.scope.default_scale` if engine is "kaliedo"
3775
+ - `plotly.io.orca.config.default_scale` if engine is "orca"
3776
3776
3777
3777
validate: bool
3778
3778
True if the figure should be validated before being converted to
3779
3779
an image, False otherwise.
3780
3780
3781
- engine (deprecated) : str
3781
+ engine: str
3782
3782
Image export engine to use. This parameter is deprecated and Orca engine support will be
3783
3783
dropped in the next major Plotly version. Until then, the following values are supported:
3784
3784
- "kaleido": Use Kaleido for image export
@@ -3794,23 +3794,25 @@ def to_image(self, *args, **kwargs):
3794
3794
from plotly .io .kaleido import (
3795
3795
kaleido_available ,
3796
3796
kaleido_major ,
3797
+ ENABLE_KALEIDO_V0_DEPRECATION_WARNINGS ,
3797
3798
KALEIDO_DEPRECATION_MSG ,
3798
3799
ORCA_DEPRECATION_MSG ,
3799
3800
ENGINE_PARAM_DEPRECATION_MSG ,
3800
3801
)
3801
3802
3802
- if (
3803
- kwargs .get ("engine" , None ) in {None , "auto" , "kaleido" }
3804
- and kaleido_available ()
3805
- and kaleido_major () < 1
3806
- ):
3807
- warnings .warn (KALEIDO_DEPRECATION_MSG , DeprecationWarning , stacklevel = 2 )
3808
- if kwargs .get ("engine" , None ) == "orca" :
3809
- warnings .warn (ORCA_DEPRECATION_MSG , DeprecationWarning , stacklevel = 2 )
3810
- if kwargs .get ("engine" , None ):
3811
- warnings .warn (
3812
- ENGINE_PARAM_DEPRECATION_MSG , DeprecationWarning , stacklevel = 2
3813
- )
3803
+ if ENABLE_KALEIDO_V0_DEPRECATION_WARNINGS :
3804
+ if (
3805
+ kwargs .get ("engine" , None ) in {None , "auto" , "kaleido" }
3806
+ and kaleido_available ()
3807
+ and kaleido_major () < 1
3808
+ ):
3809
+ warnings .warn (KALEIDO_DEPRECATION_MSG , DeprecationWarning , stacklevel = 2 )
3810
+ if kwargs .get ("engine" , None ) == "orca" :
3811
+ warnings .warn (ORCA_DEPRECATION_MSG , DeprecationWarning , stacklevel = 2 )
3812
+ if kwargs .get ("engine" , None ):
3813
+ warnings .warn (
3814
+ ENGINE_PARAM_DEPRECATION_MSG , DeprecationWarning , stacklevel = 2
3815
+ )
3814
3816
3815
3817
return pio .to_image (self , * args , ** kwargs )
3816
3818
@@ -3832,31 +3834,31 @@ def write_image(self, *args, **kwargs):
3832
3834
- 'webp'
3833
3835
- 'svg'
3834
3836
- 'pdf'
3835
- - 'eps' (deprecated ) (Requires the poppler library to be installed)
3837
+ - 'eps' (Kaleido v0.* only ) (Requires the poppler library to be installed)
3836
3838
3837
3839
If not specified and `file` is a string then this will default to the
3838
3840
file extension. If not specified and `file` is not a string then this
3839
3841
will default to:
3840
- - `plotly.io.defaults.default_format` if engine is "kaleido"
3841
- - `plotly.io.orca.config.default_format` if engine is "orca" (deprecated)
3842
+ - `plotly.io.defaults.default_format` or `plotly.io.kaleido.scope.default_format` if engine is "kaleido"
3843
+ - `plotly.io.orca.config.default_format` if engine is "orca"
3842
3844
3843
3845
width: int or None
3844
3846
The width of the exported image in layout pixels. If the `scale`
3845
3847
property is 1.0, this will also be the width of the exported image
3846
3848
in physical pixels.
3847
3849
3848
3850
If not specified, will default to:
3849
- - `plotly.io.defaults.default_width` if engine is "kaleido"
3850
- - `plotly.io.orca.config.default_width` if engine is "orca" (deprecated)
3851
+ - `plotly.io.defaults.default_width` or `plotly.io.kaleido.scope.default_width` if engine is "kaleido"
3852
+ - `plotly.io.orca.config.default_width` if engine is "orca"
3851
3853
3852
3854
height: int or None
3853
3855
The height of the exported image in layout pixels. If the `scale`
3854
3856
property is 1.0, this will also be the height of the exported image
3855
3857
in physical pixels.
3856
3858
3857
3859
If not specified, will default to:
3858
- - `plotly.io.defaults.default_height` if engine is "kaleido"
3859
- - `plotly.io.orca.config.default_height` if engine is "orca" (deprecated)
3860
+ - `plotly.io.defaults.default_height` or `plotly.io.kaleido.scope.default_height` if engine is "kaleido"
3861
+ - `plotly.io.orca.config.default_height` if engine is "orca"
3860
3862
3861
3863
scale: int or float or None
3862
3864
The scale factor to use when exporting the figure. A scale factor
@@ -3865,14 +3867,14 @@ def write_image(self, *args, **kwargs):
3865
3867
less than 1.0 will decrease the image resolution.
3866
3868
3867
3869
If not specified, will default to:
3868
- - `plotly.io.defaults.default_scale` if engine is "kaleido"
3869
- - `plotly.io.orca.config.default_scale` if engine is "orca" (deprecated)
3870
+ - `plotly.io.defaults.default_scale` or `plotly.io.kaleido.scope.default_scale` if engine is "kaleido"
3871
+ - `plotly.io.orca.config.default_scale` if engine is "orca"
3870
3872
3871
3873
validate: bool
3872
3874
True if the figure should be validated before being converted to
3873
3875
an image, False otherwise.
3874
3876
3875
- engine (deprecated) : str
3877
+ engine: str
3876
3878
Image export engine to use. This parameter is deprecated and Orca engine support will be
3877
3879
dropped in the next major Plotly version. Until then, the following values are supported:
3878
3880
- "kaleido": Use Kaleido for image export
@@ -3887,24 +3889,26 @@ def write_image(self, *args, **kwargs):
3887
3889
from plotly .io .kaleido import (
3888
3890
kaleido_available ,
3889
3891
kaleido_major ,
3892
+ ENABLE_KALEIDO_V0_DEPRECATION_WARNINGS ,
3890
3893
KALEIDO_DEPRECATION_MSG ,
3891
3894
ORCA_DEPRECATION_MSG ,
3892
3895
ENGINE_PARAM_DEPRECATION_MSG ,
3893
3896
)
3894
3897
3895
- if (
3896
- kwargs .get ("engine" , None ) in {None , "auto" , "kaleido" }
3897
- and kaleido_available ()
3898
- and kaleido_major () < 1
3899
- ):
3900
- warnings .warn (KALEIDO_DEPRECATION_MSG , DeprecationWarning , stacklevel = 2 )
3901
- if kwargs .get ("engine" , None ) == "orca" :
3902
- warnings .warn (ORCA_DEPRECATION_MSG , DeprecationWarning , stacklevel = 2 )
3903
- if kwargs .get ("engine" , None ):
3904
- warnings .warn (
3905
- ENGINE_PARAM_DEPRECATION_MSG , DeprecationWarning , stacklevel = 2
3906
- )
3907
- return pio .write_image (self , * args , ** kwargs )
3898
+ if ENABLE_KALEIDO_V0_DEPRECATION_WARNINGS :
3899
+ if (
3900
+ kwargs .get ("engine" , None ) in {None , "auto" , "kaleido" }
3901
+ and kaleido_available ()
3902
+ and kaleido_major () < 1
3903
+ ):
3904
+ warnings .warn (KALEIDO_DEPRECATION_MSG , DeprecationWarning , stacklevel = 2 )
3905
+ if kwargs .get ("engine" , None ) == "orca" :
3906
+ warnings .warn (ORCA_DEPRECATION_MSG , DeprecationWarning , stacklevel = 2 )
3907
+ if kwargs .get ("engine" , None ):
3908
+ warnings .warn (
3909
+ ENGINE_PARAM_DEPRECATION_MSG , DeprecationWarning , stacklevel = 2
3910
+ )
3911
+ return pio .write_image (self , * args , ** kwargs )
3908
3912
3909
3913
# Static helpers
3910
3914
# --------------
0 commit comments