@@ -134,6 +134,7 @@ def get_partial_filled_template(self):
134
134
"data" ,
135
135
"shape" ,
136
136
"stroke_dash" ,
137
+ "tooltip" ,
137
138
"title" ,
138
139
"x_label" ,
139
140
"y_label" ,
@@ -210,6 +211,7 @@ def _process_optional_anchors(self, split_anchors: List[str]):
210
211
"row" ,
211
212
"shape" ,
212
213
"stroke_dash" ,
214
+ "tooltip" ,
213
215
"zoom_and_pan" ,
214
216
]
215
217
if self .template .has_anchor (anchor )
@@ -262,6 +264,7 @@ def _process_single_source_plot(
262
264
self ._fill_optional_anchor (
263
265
split_anchors , optional_anchors , "pivot_field" , "datum.rev"
264
266
)
267
+ self ._fill_tooltip (split_anchors , optional_anchors )
265
268
for anchor in optional_anchors :
266
269
self .template .fill_anchor (anchor , {})
267
270
@@ -327,8 +330,7 @@ def _fill_optional_multi_source_anchors(
327
330
split_anchors , optional_anchors , "row" , {"field" : concat_field }
328
331
)
329
332
330
- if not optional_anchors :
331
- return
333
+ self ._fill_tooltip (split_anchors , optional_anchors , [concat_field ])
332
334
333
335
for anchor in ["stroke_dash" , "shape" ]:
334
336
self ._fill_optional_anchor_mapping (
@@ -357,6 +359,26 @@ def _fill_group_by(
357
359
[* grouped_keys , self .properties .get ("y" )],
358
360
)
359
361
362
+ def _fill_tooltip (
363
+ self ,
364
+ split_anchors : List [str ],
365
+ optional_anchors : List [str ],
366
+ additional_fields : Optional [List [str ]] = None ,
367
+ ):
368
+ if not additional_fields :
369
+ additional_fields = []
370
+ self ._fill_optional_anchor (
371
+ split_anchors ,
372
+ optional_anchors ,
373
+ "tooltip" ,
374
+ [
375
+ {"field" : "rev" },
376
+ {"field" : self .properties .get ("x" )},
377
+ {"field" : self .properties .get ("y" )},
378
+ * [{"field" : field } for field in additional_fields ],
379
+ ],
380
+ )
381
+
360
382
def _fill_optional_anchor (
361
383
self ,
362
384
split_anchors : List [str ],
0 commit comments