Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 22a598b

Browse filesBrowse files
committed
rm 'blend' special setBackground value
- and make 'opaque' use Color.combine instead of hard-setting _paperdiv.
1 parent e5e35c0 commit 22a598b
Copy full SHA for 22a598b

File tree

Expand file treeCollapse file tree

3 files changed

+6
-15
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+6
-15
lines changed

‎src/plot_api/plot_api.js

Copy file name to clipboardExpand all lines: src/plot_api/plot_api.js
+2-11Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,6 @@ function setBackground(gd, bgColor) {
400400
}
401401

402402
function opaqueSetBackground(gd, bgColor) {
403-
gd._fullLayout._paperdiv.style('background', 'white');
404-
setBackground(gd, bgColor);
405-
}
406-
407-
function blendSetBackground(gd, bgColor) {
408403
var blend = Color.combine(bgColor, 'white');
409404
setBackground(gd, blend);
410405
}
@@ -421,12 +416,8 @@ function setPlotContext(gd, config) {
421416
key = keys[i];
422417
if(key === 'editable' || key === 'edits') continue;
423418
if(key in context) {
424-
if(key === 'setBackground') {
425-
if(config[key] === 'opaque') {
426-
context[key] = opaqueSetBackground;
427-
} else if(config[key] === 'blend') {
428-
context[key] = blendSetBackground;
429-
}
419+
if(key === 'setBackground' && config[key] === 'opaque') {
420+
context[key] = opaqueSetBackground;
430421
} else {
431422
context[key] = config[key];
432423
}

‎src/plot_api/plot_config.js

Copy file name to clipboardExpand all lines: src/plot_api/plot_config.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ module.exports = {
106106
// increase the pixel ratio for Gl plot images
107107
plotGlPixelRatio: 2,
108108

109-
// function to add the background color to a different container
110-
// or 'opaque' to ensure there's white behind it,
111-
// or 'blend' to blend bg color with white,
109+
// background setting function
110+
// 'transparent' sets the background `layout.paper_color`
111+
// 'opaque' blends bg color with white ensuring an opaque background
112112
// or any other custom function of gd
113113
setBackground: 'transparent',
114114

‎src/plot_api/to_image.js

Copy file name to clipboardExpand all lines: src/plot_api/to_image.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var attrs = {
4747
'Sets the image background mode.',
4848
'By default, the image background is determined by `layout.paper_bgcolor`,',
4949
'the *transparent* mode.',
50-
'One might consider setting `setBackground` to *opaque* or *blend*',
50+
'One might consider setting `setBackground` to *opaque*',
5151
'when exporting a *jpeg* image as JPEGs do not support opacity.'
5252
].join(' ')
5353
},

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.