source code from : https://developers.google.com/chart/interactive/docs/gallery/wordtree