谷歌通过谷歌图表工具为此做出了巨大贡献
https://developers.google.com/chart/interactive/docs/gallery/wordtree
只需如下更改数据数组即可。
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {packages:['wordtree']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable(
[ ['Phrases'],
['abd adalet bakanligi fiat chrysler sorustur'],
['abd adalet bakanligi fiat chrysler sorusturma acti'],
['abd adalet bakanligi fiat chrysler sorusturma acti abd adalet bakanliginin fiat chrysler fca hakkinda dizel'],
['abd adalet bakanligi fiat chrysler sorusturma acti abd adalet bakanliginin fiat chrysler fca hakkinda dizel araclarinda emisyon'],
['abd adalet bakanligi fiat chrysler sorusturma acti haberin detaylari icin tiklayiniz'],
['abd adalet bakanligi fiat chrysler sorusturma acti kazakistan haber'],
['abd adalet bakanligi fiat chrysler sorusturma acti sondakika'],
]
);
var options = {
wordtree: {
format: 'implicit',
word: 'cats'
}
};
var chart = new google.visualization.WordTree(document.getElementById('wordtree_basic'));
chart.draw(data, options);
}
</script>
<body>
<div id="wordtree_basic" style="width: 900px; height: 500px;"></div>
</body>