Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Commit 9af6bf1

Browse files
committed
Let getImage error when opts.format eq 'jpg'
1 parent 54c46f6 commit 9af6bf1

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ plotly.getFigure('fileOwner', 'fileId', function (err, figure) {
172172

173173
## plotly.getImage(figure[, options, callback])
174174
`figure` is a JSON object of the graph figure
175-
`options.format` | `jpg`, `jpeg`, `png`, `pdf`, `eps`, `webp`
175+
`options.format` | `jpeg`, `png`, `pdf`, `eps`, `webp`
176176
`options.width` | width in `px` (default : 700)
177177
`options.height` | height in `px` (default : 500)
178178

index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,6 @@ Plotly.prototype.getImage = function (figure, opts, callback) {
207207
if (!figure) return new Error('no figure provided!');
208208

209209
var self = this;
210-
211-
// allow both jpg and jpeg as file formats
212-
if (opts && opts.format === 'jpg') opts.format = 'jpeg';
213-
214210
var payload = JSON.stringify({
215211
figure: figure,
216212
format: opts.format || 'png',

0 commit comments

Comments
 (0)