chrisrzhou / react-wordcloud

☁️ Simple React + D3 wordcloud component with powerful features.

Home Page:https://react-wordcloud.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please document the `scale` and `spiral` options

dandv opened this issue · comments

At https://react-wordcloud.netlify.com/props#options:

scale - "Control how words are spaced and laid out." - how exactly?

Same for spiral - how should one think of archimedean vs. rectangular?

I'm trying to produce a 90-degree layout like this, but can't tell how to configure those options.

image

A compact all-horizontal one would be fine too:

image

Words are very spaced out though.

Thanks for the feedback!

To be honest with you, I'm not sure how to describe archimedean and rectangular (source reference: https://www.jasondavies.com/wordcloud/). I think it's a mathematical pattern of laying out the spiral and is somewhat visually noticeable. When first working on this project, I was implementing features based on Jason Davies' wordcloud generator and kept this feature. If there's a formal definition for this prop, I would totally be happy to update the Props page lol.

But to get to the two layouts you need, you should use rotationAngles and rotations

It's covered super sparsely in https://react-wordcloud.netlify.app/usage/options#rotations, and I'll update the docs to include examples of these common layouts. The way to think about it is: The number of rotations I can use between specified min/max rotation angles.

image

Closing issues as docs will be updated based on feedback in this issue. Thanks!