File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
tests/test_core/test_graph_objs Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -2619,7 +2619,19 @@ def _get_prop_validator(self, prop):
26192619 -------
26202620 BaseValidator
26212621 """
2622- return self ._validators [prop ]
2622+
2623+ # Handle remapping
2624+ # ----------------
2625+ if prop in self ._mapped_properties :
2626+ prop_path = self ._mapped_properties [prop ]
2627+ plotly_obj = self [prop_path [:- 1 ]]
2628+ prop = prop_path [- 1 ]
2629+ else :
2630+ plotly_obj = self
2631+
2632+ # Return validator
2633+ # ----------------
2634+ return plotly_obj ._validators [prop ]
26232635
26242636 @property
26252637 def parent (self ):
Original file line number Diff line number Diff line change @@ -59,6 +59,14 @@ def test_title_as_string_layout(self):
5959 self .assertEqual (obj .to_plotly_json (),
6060 {'title' : {'text' : 'A title 2' }})
6161
62+ # Update titlefont
63+ obj .update (titlefont = {'size' : 23 })
64+ self .assertEqual (obj .title .font .size , 23 )
65+ self .assertEqual (obj .to_plotly_json (),
66+ {'title' :
67+ {'text' : 'A title 2' ,
68+ 'font' : {'size' : 23 }}})
69+
6270 # Pie
6371 obj = go .Pie ()
6472 obj .title = 'A title'
@@ -67,6 +75,22 @@ def test_title_as_string_layout(self):
6775 {'title' : {'text' : 'A title' },
6876 'type' : 'pie' })
6977
78+ # And update
79+ obj .update (title = 'A title 2' )
80+ self .assertEqual (obj .title .text , 'A title 2' )
81+ self .assertEqual (obj .to_plotly_json (),
82+ {'type' : 'pie' ,
83+ 'title' : {'text' : 'A title 2' }})
84+
85+ # Update titlefont
86+ obj .update (titlefont = {'size' : 23 })
87+ self .assertEqual (obj .title .font .size , 23 )
88+ self .assertEqual (obj .to_plotly_json (),
89+ {'type' : 'pie' ,
90+ 'title' :
91+ {'text' : 'A title 2' ,
92+ 'font' : {'size' : 23 }}})
93+
7094 def test_legacy_title_props_remapped (self ):
7195
7296 # plain Layout
You can’t perform that action at this time.
0 commit comments