d3-cloud

D3 word cloud layout circle and rectangular

穿精又带淫゛_ 提交于 2021-02-08 09:01:51
问题 I'm a D3 newbie and trying to build word cloud page using JasonDavies d3-cloud. But sometimes all words are showing in circle layout, but sometimes in rectangular. How can I make them always locate in circle layout? 回答1: d3-cloud 's layout algorithm places words within an ellipse starting from the center of the rectangle you've provided ( d3.layout.cloud().size([width, height]) ). If you have a container ( size([width, height]) ) big enough compared to your number of words and the size you've

Dynamically sized word-cloud using d3-cloud

时光毁灭记忆、已成空白 提交于 2020-07-18 06:29:09
问题 I am creating a wordcloud by modifying code from : https://github.com/jasondavies/d3-cloud. I can change the size by modifying w & h but I want to scale the word cloud as the browser window changes. What would be the best method to achieve this? Code also posted at http://plnkr.co/edit/AZIi1gFuq1Vdt06VIETn?p=preview <script> myArray = [{"text":"First","size":15},{"text":"Not","size":29},{"text":"Bird","size":80}, {"text":"Hello","size":40},{"text":"Word","size":76},{"text":"Marketplaces",