@@ -546,7 +546,10 @@ class RGB(Effect):
546
546
547
547
_model_name = Unicode ('RGBModel' ).tag (sync = True )
548
548
549
- input = Union ((Tuple (trait = Unicode , minlen = 2 , maxlen = 2 ), Unicode (), CFloat (0. ))).tag (sync = True )
549
+ @property
550
+ def input_dim (self ):
551
+ """Input dimension."""
552
+ return 3
550
553
551
554
552
555
class IsoColor (Effect ):
@@ -568,48 +571,45 @@ class IsoSurface(Effect):
568
571
569
572
_model_name = Unicode ('IsoSurfaceModel' ).tag (sync = True )
570
573
571
- input = Union ((Tuple (trait = Unicode , minlen = 2 , maxlen = 2 ), Unicode (), CFloat (0. ))).tag (sync = True )
572
-
573
574
value = CFloat (0. ).tag (sync = True )
574
575
dynamic = Bool (False ).tag (sync = True )
575
576
576
- @default ('input' )
577
- def _default_input (self ):
578
- return self .parent .data [0 ].name
577
+ @property
578
+ def input_dim (self ):
579
+ """Input dimension."""
580
+ return 1
579
581
580
582
581
583
class Threshold (Effect ):
582
584
"""An Threshold effect to another block."""
583
585
584
586
_model_name = Unicode ('ThresholdModel' ).tag (sync = True )
585
587
586
- input = Union ((Tuple (trait = Unicode , minlen = 2 , maxlen = 2 ), Unicode (), CFloat (0. ))).tag (sync = True )
587
-
588
588
min = CFloat (0. ).tag (sync = True )
589
589
max = CFloat (0. ).tag (sync = True )
590
590
dynamic = Bool (False ).tag (sync = True )
591
591
inclusive = Bool (True ).tag (sync = True )
592
592
593
- @default ('input' )
594
- def _default_input (self ):
595
- return self .parent .data [0 ].name
593
+ @property
594
+ def input_dim (self ):
595
+ """Input dimension."""
596
+ return 1
596
597
597
598
598
599
class UnderWater (Effect ):
599
600
"""An nice UnderWater effect to another block."""
600
601
601
602
_model_name = Unicode ('UnderWaterModel' ).tag (sync = True )
602
603
603
- input = Union ((Tuple (trait = Unicode , minlen = 2 , maxlen = 2 ), Unicode (), CFloat (0. ))).tag (sync = True )
604
-
605
604
default_color = Color ('#F2FFD2' ).tag (sync = True )
606
605
texture = Instance (Image , allow_none = True , default_value = None ).tag (sync = True , ** widget_serialization )
607
606
texture_scale = CFloat (2. ).tag (sync = True )
608
607
texture_position = Tuple (minlen = 2 , maxlen = 2 , default_value = (1. , 1. , 0. )).tag (sync = True )
609
608
610
- @default ('input' )
611
- def _default_input (self ):
612
- return self .parent .data [0 ].name
609
+ @property
610
+ def input_dim (self ):
611
+ """Input dimension."""
612
+ return 1
613
613
614
614
615
615
class Water (Effect ):
0 commit comments