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

Words overlap

antunespedro80 opened this issue · comments

Hello guys !
I'm facing an issue on react-wordcloud about word overlaping...
Can someone tell me why this is happening ?

VERSIONS
react: "^17.0.1"
react-dom: "^17.0.1"
react-scripts: "^4.0.3",

CODE SAMPLE

const options = useMemo(() => {
        return {
            enableTooltip: true,
            fontSizes: [12, 100],
            padding: 1,
            rotations: 0,
            rotationAngles: [0, 0],
            scale: 'sqrt',
            spiral: 'archimedean',
            transitionDuration: 0,
        };
    }, []);

<div style={{ width: '100%', height: '100%' }}>
 <ReactWordcloud
      words={calc.normalize(words).map((keyword, index) => {
          let text = keyword.key;
          if (prefix) {
              text = prefix + text;
          }
  
          return {
              text,
              value: words[index].value,
              normalizedValue: keyword.value,
          };
      })}
      options={options}
  />
</div>

ISSUE
image