@@ -121,7 +121,9 @@ def make_mapping(args, variable):
121
121
)
122
122
123
123
124
- def make_trace_kwargs (args , trace_spec , g , mapping_labels , sizeref , color_range ):
124
+ def make_trace_kwargs (
125
+ args , trace_spec , g , mapping_labels , sizeref , color_range , show_colorbar
126
+ ):
125
127
126
128
if "line_close" in args and args ["line_close" ]:
127
129
g = g .append (g .iloc [0 ])
@@ -235,13 +237,10 @@ def make_trace_kwargs(args, trace_spec, g, mapping_labels, sizeref, color_range)
235
237
[(1.0 * i ) / (1.0 * d ), x ]
236
238
for i , x in enumerate (args ["color_continuous_scale" ])
237
239
]
238
- if color_range is None :
239
- colorbar_container ["showscale" ] = False
240
- else :
241
- colorbar_container ["showscale" ] = True
242
- colorbar_container ["colorbar" ] = dict (title = v_label )
243
- colorbar_container [color_letter + "min" ] = color_range [0 ]
244
- colorbar_container [color_letter + "max" ] = color_range [1 ]
240
+ colorbar_container ["showscale" ] = show_colorbar
241
+ colorbar_container [color_letter + "min" ] = color_range [0 ]
242
+ colorbar_container [color_letter + "max" ] = color_range [1 ]
243
+ colorbar_container ["colorbar" ] = dict (title = v_label )
245
244
elif k == "animation_group" :
246
245
result ["ids" ] = g [v ]
247
246
elif k == "locations" :
@@ -811,7 +810,8 @@ def make_figure(args, constructor, trace_patch={}, layout_patch={}):
811
810
group ,
812
811
mapping_labels .copy (),
813
812
sizeref ,
814
- color_range = color_range if frame_name not in frames else None ,
813
+ color_range = color_range ,
814
+ show_colorbar = (frame_name not in frames ),
815
815
)
816
816
)
817
817
if frame_name not in frames :
0 commit comments