Skip to content

Commit 5c7cdc9

Browse files
committed
turn off the selected/unselected API
1 parent 5cdf471 commit 5c7cdc9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

inst/htmlwidgets/plotly.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ HTMLWidgets.widget({
3333

3434
// Enable persistent selection when shift key is down
3535
// https://stackoverflow.com/questions/1828613/check-if-a-key-is-down
36-
var persistOnShift = function(e) {
36+
var persistOnShift = function(e) {
3737
if (!e) window.event;
3838
if (e.shiftKey) {
3939
x.highlight.persistent = true;
@@ -609,7 +609,7 @@ TraceManager.prototype.updateSelection = function(group, keys) {
609609
/ (2) highlight(selected = attrs_selected(...))
610610
*/
611611
// TODO: it would be neat to have a dropdown to dynamically specify these!
612-
$.extend(true, trace, this.highlight.selected, d.selected);
612+
$.extend(true, trace, this.highlight.selected);
613613

614614
// if it is defined, override color with the "dynamic brush color""
615615
if (d.marker) {
@@ -721,9 +721,8 @@ TraceManager.prototype.updateSelection = function(group, keys) {
721721

722722
if (tracesToDim.length > 0) {
723723
Plotly.restyle(this.gd, {"opacity": opacities}, tracesToDim);
724-
// this is an unfortunate consequence of the selected/unselected API
725-
// https://codepen.io/cpsievert/pen/opOawp
726-
Plotly.restyle(this.gd, {"unselected": {"marker": {"opacity": 1}}});
724+
// turn off the selected/unselected API
725+
Plotly.restyle(gd, {"selectedpoints": null});
727726
}
728727

729728
}

0 commit comments

Comments
 (0)