Skip to content

Commit d3ea11f

Browse files
committed
add scale tests for plot_ly images
1 parent 45e9d2f commit d3ea11f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: plotly/plotly/plotly.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ def get(figure_or_data, format='png', width=None, height=None, scale=None):
712712
describes a plotly figure.
713713
Same argument used in `py.plot`, `py.iplot`,
714714
see https://plot.ly/python for examples
715-
- format: 'png', 'svg', 'jpeg', 'pdf'
715+
- format: 'png', 'svg', 'jpeg', 'pdf', 'emf'
716716
- width: output width
717717
- height: output height
718718
- scale: Increase the resolution of the image by `scale`
@@ -730,7 +730,7 @@ def get(figure_or_data, format='png', width=None, height=None, scale=None):
730730
# TODO: format is a built-in name... we shouldn't really use it
731731
figure = tools.return_figure_from_figure_or_data(figure_or_data, True)
732732

733-
if format not in ['png', 'svg', 'jpeg', 'pdf']:
733+
if format not in ['png', 'svg', 'jpeg', 'pdf', 'emf']:
734734
raise exceptions.PlotlyError(
735735
"Invalid format. This version of your Plotly-Python "
736736
"package currently only supports png, svg, jpeg, and pdf. "
@@ -760,7 +760,8 @@ def get(figure_or_data, format='png', width=None, height=None, scale=None):
760760
if ('content-type' in headers and
761761
headers['content-type'] in ['image/png', 'image/jpeg',
762762
'application/pdf',
763-
'image/svg+xml']):
763+
'image/svg+xml',
764+
'image/emf']):
764765
return response.content
765766
elif ('content-type' in headers and
766767
'json' in headers['content-type']):
@@ -809,7 +810,7 @@ def save_as(cls, figure_or_data, filename, format=None, width=None,
809810
"""Save a image of the plot described by `figure_or_data` locally as
810811
`filename`.
811812
812-
Valid image formats are 'png', 'svg', 'jpeg', and 'pdf'.
813+
Valid image formats are 'png', 'svg', 'jpeg', 'pdf' and 'emf'.
813814
The format is taken as the extension of the filename or as the
814815
supplied format.
815816
@@ -819,7 +820,7 @@ def save_as(cls, figure_or_data, filename, format=None, width=None,
819820
Same argument used in `py.plot`, `py.iplot`,
820821
see https://plot.ly/python for examples
821822
- filename: The filepath to save the image to
822-
- format: 'png', 'svg', 'jpeg', 'pdf'
823+
- format: 'png', 'svg', 'jpeg', 'pdf', 'emf'
823824
- width: output width
824825
- height: output height
825826
- scale: Increase the resolution of the image by `scale` amount

0 commit comments

Comments
 (0)