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

Font-size better be set as style rather attr

yyt1208732230 opened this issue · comments

Hi, author. The words' font-size of word cloud not work on page today, eventually I found that the font-size was set as a attribute in each 'text', while there are some global style I've set that covered the font-size attribute. Font-size of each word better be set as style rather attr, because of the low priority. So I change in local.Say .style('font-size') rather .attr('font-size').

Hi @yyt1208732230, I think this is a reasonable suggestion, although this would make the library backwards incompatible. Given that this is an edge case in your situation where you are customizing the attribute instead of the style, I am leaning on keeping the existing behavior in favor of how other people are using the library.

Is it possible that you can update your global style to ignore applying these styles to the wordcloud text nodes? I think if you have a className attached to a div that wraps the component, you should be able to exclude this with a CSS :not selector.

Let me know!