Treemap in the banner of the Bicyle Helmet example

In the Bicylce Helmet example, shown on this site, a sort of context-menu is shown in the banner, indicating at what level of the tree concepts the user is.

Would it be possible to share the script that generates this view of the tree?

Context Menu

I'll write a how and add it to the book about publishing.

Link from here.