File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 16
16
* ` ggplotly() ` now respects ` guide(aes = "none") ` (e.g., ` guide(fill = "none") ` ) when constructing legend entries. (#2067 )
17
17
* Fixed an issue with translating ` GGally::ggcorr() ` via ` ggplotly() ` . (#2012 )
18
18
* Fixed an issue where clearing a crosstalk filter would raise an error in the JS console (#2087 )
19
+ * Fixed an issue with ` {crosstalk} ` where running ` selectionHandle.clear() ` from another visual causes plotly to throw an error. (#2098 )
20
+
19
21
20
22
## Improvements
21
23
Original file line number Diff line number Diff line change @@ -628,15 +628,15 @@ TraceManager.prototype.updateFilter = function(group, keys) {
628
628
} ;
629
629
630
630
TraceManager . prototype . updateSelection = function ( group , keys ) {
631
-
632
- if ( keys !== null && ! Array . isArray ( keys ) ) {
631
+
632
+ if ( keys !== null && keys !== undefined && ! Array . isArray ( keys ) ) {
633
633
throw new Error ( "Invalid keys argument; null or array expected" ) ;
634
634
}
635
635
636
636
// if selection has been cleared, or if this is transient
637
637
// selection, delete the "selection traces"
638
638
var nNewTraces = this . gd . data . length - this . origData . length ;
639
- if ( keys === null || ! this . highlight . persistent && nNewTraces > 0 ) {
639
+ if ( keys === null || keys === undefined || ! this . highlight . persistent && nNewTraces > 0 ) {
640
640
var tracesToRemove = [ ] ;
641
641
for ( var i = 0 ; i < this . gd . data . length ; i ++ ) {
642
642
if ( this . gd . data [ i ] . _isCrosstalkTrace ) tracesToRemove . push ( i ) ;
@@ -655,7 +655,7 @@ TraceManager.prototype.updateSelection = function(group, keys) {
655
655
}
656
656
}
657
657
658
- if ( keys === null ) {
658
+ if ( keys === null || keys === undefined ) {
659
659
660
660
Plotly . restyle ( this . gd , { "opacity" : this . origOpacity } ) ;
661
661
You can’t perform that action at this time.
0 commit comments