File tree 1 file changed +16
-0
lines changed 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -458,6 +458,7 @@ plots.supplyDefaults = function(gd) {
458
458
459
459
// attach helper method to check whether a plot type is present on graph
460
460
newFullLayout . _has = plots . _hasPlotType . bind ( newFullLayout ) ;
461
+ newFullLayout . _hasCategory = plots . _hasCategory . bind ( newFullLayout ) ;
461
462
462
463
// special cases that introduce interactions between traces
463
464
var _modules = newFullLayout . _modules ;
@@ -576,6 +577,21 @@ plots._hasPlotType = function(category) {
576
577
return false ;
577
578
} ;
578
579
580
+ // check whether trace has a category
581
+ plots . _hasCategory = function ( category ) {
582
+ var modules = this . _modules || [ ] ;
583
+
584
+ // create canvases only in case if there is at least one regl component
585
+ for ( var i = 0 ; i < modules . length ; i ++ ) {
586
+ var _ = modules [ i ] ;
587
+ if ( _ . categories && _ . categories . indexOf ( category ) >= 0 ) {
588
+ return true ;
589
+ }
590
+ }
591
+
592
+ return false ;
593
+ } ;
594
+
579
595
plots . cleanPlot = function ( newFullData , newFullLayout , oldFullData , oldFullLayout ) {
580
596
var i , j ;
581
597
You can’t perform that action at this time.
0 commit comments