For today’s #30DayChartChallenge, the theme is “Family.” I must admit, my mind initially wandered to the Kardashians – but let’s move on from that little embarrassment! I’ve been eager to experiment with Sunburst charts during this challenge. In my opinion, these visually striking charts have a unique ability to convey hierarchical relationships in a captivating way.
Fortunately for me, the Python Plotly library comes equipped with a pre-built sunburst module, making my task a whole lot easier!
Initially, I had planned to entirely map children -> parent relationships so every concentric circle would represent 1 generation. However, I ran into an issue representing both parents in the same layer.
The intricate web of multiple marriages among various members of the Kardashian family further convoluted the hierarchical relationships, making the task more complex…
So I eventually, figured to keep the Kardashian Matriarch (Kris Jenner) in the centre of the chart as she is the common denominator between all households and compromised by starting with mapping spousal relationships in the inner circle, followed by children -> parent mappings as we expand outwards.
So the end product is not semantically consistent but I think the chart still manages to summarise the family tree which was what I was going for.
TIL
I find the branchvalues parameter that controls the width of each segment of Plotly’s sunburst chart quite difficult to grok. But I discovered that on the default branchvalues='remainder' setting, setting the value of parents to 0 is a nice trick to ensure segments have no gaps.
Seeing that Plotly accepted HTML tags when configuring it’s title, I was pleasantly surprised to see that it accepted Emoji unicodes! 😁
In order to add captions to a Plotly chart, one has to use annotations which requires a lot of manual tweaking.