@@ -169,7 +169,7 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref):
169
169
custom_data_len = 0
170
170
for attr_name in trace_spec .attrs :
171
171
attr_value = args [attr_name ]
172
- v_label = get_decorated_label (args , attr_value , attr_name )
172
+ attr_label = get_decorated_label (args , attr_value , attr_name )
173
173
if attr_name == "dimensions" :
174
174
dims = [
175
175
(name , column )
@@ -210,7 +210,7 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref):
210
210
result ["marker" ]["size" ] = trace_data [attr_value ]
211
211
result ["marker" ]["sizemode" ] = "area"
212
212
result ["marker" ]["sizeref" ] = sizeref
213
- mapping_labels [v_label ] = "%{marker.size}"
213
+ mapping_labels [attr_label ] = "%{marker.size}"
214
214
elif attr_name == "marginal_x" :
215
215
if trace_spec .constructor == go .Histogram :
216
216
mapping_labels ["count" ] = "%{y}"
@@ -294,13 +294,15 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref):
294
294
)
295
295
else :
296
296
result ["customdata" ] = trace_data [col ].values [:, None ]
297
- v_label_col = get_decorated_label (args , col , None )
298
- mapping_labels [v_label_col ] = "%%{customdata[%d]}" % (position )
297
+ attr_label_col = get_decorated_label (args , col , None )
298
+ mapping_labels [attr_label_col ] = "%%{customdata[%d]}" % (
299
+ position
300
+ )
299
301
elif attr_name == "color" :
300
302
if trace_spec .constructor in [go .Choropleth , go .Choroplethmapbox ]:
301
303
result ["z" ] = trace_data [attr_value ]
302
304
result ["coloraxis" ] = "coloraxis1"
303
- mapping_labels [v_label ] = "%{z}"
305
+ mapping_labels [attr_label ] = "%{z}"
304
306
elif trace_spec .constructor in [
305
307
go .Sunburst ,
306
308
go .Treemap ,
@@ -313,7 +315,7 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref):
313
315
if args .get ("color_is_continuous" ):
314
316
result ["marker" ]["colors" ] = trace_data [attr_value ]
315
317
result ["marker" ]["coloraxis" ] = "coloraxis1"
316
- mapping_labels [v_label ] = "%{color}"
318
+ mapping_labels [attr_label ] = "%{color}"
317
319
else :
318
320
result ["marker" ]["colors" ] = []
319
321
mapping = {}
@@ -331,23 +333,23 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref):
331
333
result [colorable ] = dict ()
332
334
result [colorable ]["color" ] = trace_data [attr_value ]
333
335
result [colorable ]["coloraxis" ] = "coloraxis1"
334
- mapping_labels [v_label ] = "%%{%s.color}" % colorable
336
+ mapping_labels [attr_label ] = "%%{%s.color}" % colorable
335
337
elif attr_name == "animation_group" :
336
338
result ["ids" ] = trace_data [attr_value ]
337
339
elif attr_name == "locations" :
338
340
result [attr_name ] = trace_data [attr_value ]
339
- mapping_labels [v_label ] = "%{location}"
341
+ mapping_labels [attr_label ] = "%{location}"
340
342
elif attr_name == "values" :
341
343
result [attr_name ] = trace_data [attr_value ]
342
- _label = "value" if v_label == "values" else v_label
344
+ _label = "value" if attr_label == "values" else attr_label
343
345
mapping_labels [_label ] = "%{value}"
344
346
elif attr_name == "parents" :
345
347
result [attr_name ] = trace_data [attr_value ]
346
- _label = "parent" if v_label == "parents" else v_label
348
+ _label = "parent" if attr_label == "parents" else attr_label
347
349
mapping_labels [_label ] = "%{parent}"
348
350
elif attr_name == "ids" :
349
351
result [attr_name ] = trace_data [attr_value ]
350
- _label = "id" if v_label == "ids" else v_label
352
+ _label = "id" if attr_label == "ids" else attr_label
351
353
mapping_labels [_label ] = "%{id}"
352
354
elif attr_name == "names" :
353
355
if trace_spec .constructor in [
@@ -357,14 +359,14 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref):
357
359
go .Funnelarea ,
358
360
]:
359
361
result ["labels" ] = trace_data [attr_value ]
360
- _label = "label" if v_label == "names" else v_label
362
+ _label = "label" if attr_label == "names" else attr_label
361
363
mapping_labels [_label ] = "%{label}"
362
364
else :
363
365
result [attr_name ] = trace_data [attr_value ]
364
366
else :
365
367
if attr_value :
366
368
result [attr_name ] = trace_data [attr_value ]
367
- mapping_labels [v_label ] = "%%{%s}" % attr_name
369
+ mapping_labels [attr_label ] = "%%{%s}" % attr_name
368
370
if trace_spec .constructor not in [
369
371
go .Parcoords ,
370
372
go .Parcats ,
0 commit comments