@@ -264,14 +264,7 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref):
264
264
mapping_labels ["%{xaxis.title.text}" ] = "%{x}"
265
265
mapping_labels ["%{yaxis.title.text}" ] = "%{y}"
266
266
267
- elif (
268
- attr_value is not None
269
- or (trace_spec .constructor == go .Histogram and attr_name in ["x" , "y" ])
270
- or (
271
- trace_spec .constructor in [go .Histogram2d , go .Histogram2dContour ]
272
- and attr_name == "z"
273
- )
274
- ):
267
+ elif attr_value is not None :
275
268
if attr_name == "size" :
276
269
if "marker" not in trace_patch :
277
270
trace_patch ["marker" ] = dict ()
@@ -464,13 +457,15 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref):
464
457
else :
465
458
trace_patch [attr_name ] = trace_data [attr_value ]
466
459
else :
467
- if attr_value :
468
- trace_patch [attr_name ] = trace_data [attr_value ]
460
+ trace_patch [attr_name ] = trace_data [attr_value ]
469
461
mapping_labels [attr_label ] = "%%{%s}" % attr_name
470
- if trace_spec .constructor not in [
471
- go .Parcoords ,
472
- go .Parcats ,
473
- ]:
462
+ elif (trace_spec .constructor == go .Histogram and attr_name in ["x" , "y" ]) or (
463
+ trace_spec .constructor in [go .Histogram2d , go .Histogram2dContour ]
464
+ and attr_name == "z"
465
+ ):
466
+ # ensure that stuff like "count" gets into the hoverlabel
467
+ mapping_labels [attr_label ] = "%%{%s}" % attr_name
468
+ if trace_spec .constructor not in [go .Parcoords , go .Parcats ]:
474
469
# Modify mapping_labels according to hover_data keys
475
470
# if hover_data is a dict
476
471
mapping_labels_copy = OrderedDict (mapping_labels )
0 commit comments