Heatmap with dendrogram not working


#1

I am trying to replicate the sample here…

I get this error…

AttributeError Traceback (most recent call last)
in ()
10
11 # Add Side Dendrogram Data to Figure
—> 12 figure[‘data’].extend(dendro_side[‘data’])
13
14 # Create Heatmap

AttributeError: ‘tuple’ object has no attribute ‘extend’

At this point, the figure[‘data’] and the dendro_side[‘data’] are both tuples, not lists, so extend will not work.

I have tried this instead.

figure['data'] = figure['data'] + dendro_side['data']

But then I get another error.

ValueError: The data property of a figure may only be assigned a list or tuple that contains a permutation of a subset of itself

What is the right pattern here?


#2

Ok figured it out. Figure () has methods for adding traces.

figure.add_traces(dendro_side[‘data’])

Happy to raise a PR if somebody can point out the location of the doco