We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7565d0b commit 3c42efbCopy full SHA for 3c42efb
src/plot_api/to_image.js
@@ -90,15 +90,15 @@ function toImage(gd, opts) {
90
config = gd._context;
91
}
92
93
- function isBadlySet(attr) {
+ function isImpliedOrValid(attr) {
94
return !(attr in opts) || Lib.validate(opts[attr], attrs[attr]);
95
96
97
- if(!isBadlySet('width') || !isBadlySet('height')) {
+ if(!isImpliedOrValid('width') || !isImpliedOrValid('height')) {
98
throw new Error('Height and width should be pixel values.');
99
100
101
- if(!isBadlySet('format')) {
+ if(!isImpliedOrValid('format')) {
102
throw new Error('Image format is not jpeg, png, svg or webp.');
103
104
0 commit comments