From f3d22ce2ac93a980b671ca35289e9229b238496c Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Thu, 15 Nov 2018 13:41:02 -0600 Subject: [PATCH] Properly retain original opacity of 0 (0 is falsy in JavaScript), closes #1406 --- inst/htmlwidgets/plotly.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/htmlwidgets/plotly.js b/inst/htmlwidgets/plotly.js index 5babe83890..56b78353bc 100644 --- a/inst/htmlwidgets/plotly.js +++ b/inst/htmlwidgets/plotly.js @@ -522,7 +522,7 @@ function TraceManager(graphDiv, highlight) { // avoid doing this over and over this.origOpacity = []; for (var i = 0; i < this.origData.length; i++) { - this.origOpacity[i] = this.origData[i].opacity || 1; + this.origOpacity[i] = this.origData[i].opacity === 0 ? 0 : (this.origData[i].opacity || 1); } // key: group name, value: null or array of keys representing the