However, when I let the example run in a jupyter notebook I get the error:
AttributeError: ‘tuple’ object has no attribute ‘append’
everytime the layout shape colors are set, e.g.
layout[‘shapes’].append(make_self_rel(l, ‘rgb(175,175,175)’ , ideo_colors[k], radius=radii_sribb[k]))
I am wondering whether plotly switched to representing layout.shapes as a tuple instead of a list.
Can anybody help me out how to work work around it?
@sebo1, Yes, you are right! That notebook was posted 3 years ago. Here http://nbviewer.jupyter.org/github/empet/Plotly-plots/blob/master/Chord-diagram.ipynb?flush_cache=true I updated it to work with Python 3.6.4 and Plotly 3.3+ (I wrote all strings as f-strings and this simplifies very much the svg paths description). Also I defined the layout as a dict, not as an instance of go.Layout, and so layout['shapes'].append() still works.
In case anyone who didn’t solve this problem. I found someone who collected the code in the plotly’s example of filled-chord-diagram and rearranged the code.
It works fine. The author published it on Github. Here’s the link: https://gist.github.com/rmarren1/d593535900f0da0ad52e8a160f3767bd
The input format is a Dataframe with a column of the labels.
Thanks @yoursugar for pointing out the file chord.py I created the notebook 5 years ago as a tutorial. At that time no Python plotting library provided methods to define a chord diagram That’s why I explained each step and did not save the involved functions in a module.