@@ -3019,11 +3019,47 @@ def __init__(self, plotly_name, **kwargs):
3019
3019
# properties is modified
3020
3020
self ._change_callbacks = {}
3021
3021
3022
+ # ### Backing property for backward compatible _validator property ##
3023
+ self .__validators = None
3024
+
3022
3025
def _get_validator (self , prop ):
3023
3026
from .validator_cache import ValidatorCache
3024
3027
3025
3028
return ValidatorCache .get_validator (self ._path_str , prop )
3026
3029
3030
+ @property
3031
+ def _validators (self ):
3032
+ """
3033
+ Validators used to stored in a private _validators property. This was
3034
+ eliminated when we switched to building validators on demand using the
3035
+ _get_validator method.
3036
+
3037
+ This property returns a simple object that
3038
+
3039
+ Returns
3040
+ -------
3041
+ dict-like interface for accessing the object's validators
3042
+ """
3043
+ obj = self
3044
+ if self .__validators is None :
3045
+ class ValidatorCompat (object ):
3046
+ def __getitem__ (self , item ):
3047
+ return obj ._get_validator (item )
3048
+
3049
+ def __contains__ (self , item ):
3050
+ return obj .__contains__ (item )
3051
+
3052
+ def __iter__ (self ):
3053
+ return iter (obj )
3054
+
3055
+ def items (self ):
3056
+ return [(k , self [k ]) for k in self ]
3057
+
3058
+ self .__validators = ValidatorCompat ()
3059
+
3060
+ return self .__validators
3061
+
3062
+
3027
3063
def _process_kwargs (self , ** kwargs ):
3028
3064
"""
3029
3065
Process any extra kwargs that are not predefined as constructor params
0 commit comments