@@ -150,6 +150,31 @@ def _build_ui(self):
150150 click = f"utils.quickview.capturePanel('{ self .variable_name } ')" ,
151151 style = "transform: scale(0.75);" ,
152152 )
153+ self .state .setdefault ("picking_mode" , None )
154+ v3 .VIconBtn (
155+ v_tooltip_bottom = "'Extract information on click'" ,
156+ icon = "mdi-cursor-default-click-outline" ,
157+ size = "small" ,
158+ base_variant = "plain" ,
159+ active_variant = "tonal" ,
160+ click = "picking_mode = (picking_mode === 'click' ? null : 'click')" ,
161+ active = ("picking_mode === 'click'" ,),
162+ active_color = "white" ,
163+ hide_overlay = True ,
164+ rounded = False ,
165+ )
166+ v3 .VIconBtn (
167+ v_tooltip_bottom = "'Extract information on hover'" ,
168+ icon = "mdi-cursor-default-gesture-outline" ,
169+ size = "small" ,
170+ base_variant = "plain" ,
171+ active_variant = "tonal" ,
172+ click = "picking_mode = (picking_mode === 'hover' ? null : 'hover')" ,
173+ active = ("picking_mode === 'hover'" ,),
174+ active_color = "white" ,
175+ hide_overlay = True ,
176+ rounded = False ,
177+ )
153178
154179 v3 .VSpacer ()
155180 html .Div (
@@ -194,8 +219,11 @@ def _build_ui(self):
194219 enable_interaction = False ,
195220 bounds = (self ._bounds_key , (0 , 0 , 1 , 1 )),
196221 size = (self .update_size , "[$event]" ),
222+ send_mouse_click = (
223+ f"picking_mode === 'click' && hover_info === '{ self .variable_name } '" ,
224+ ),
197225 send_mouse_move = (
198- f"hover_info === '{ self .variable_name } '" ,
226+ f"picking_mode === 'hover' && hover_info === '{ self .variable_name } '" ,
199227 ),
200228 v_on_wheel = "window.scrollBy(0, $event.deltaY)" ,
201229 )
0 commit comments