Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add font_path arg for wordcloud #1598

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

DongHyun-JO
Copy link
Contributor

This PR is a proposed solution to issue #1466.
The default font in Wordcloud is DruidSansMono.ttf, and if the languages ​​of the values ​​are different, the image may be broken.

  • Example data (language: korean)
    image
    image

This is a known solution when using wordcloud, but the problem could not be solved because the 'font_path' argument was not specified in ydata_profiling.

I added a setting variable to 'Settings.plot' to pass the value to the font_path argument of word cloud.
Actually, I'm not sure if it's appropriate to put it here.
I just thought that it was a variable for wordcloud plot rendering, and the criterion for judgment was that I thought it could be used in other matplotlib plots as well.

If you do the following, you can check that the wordcloud is displayed normally.

profile_report = ProfileReport(df, title="test", minimal=True, plot={"font_path": "/Users/user/Downloads/Nanum_Gothic/NanumGothic-Regular.ttf"})

image

@DongHyun-JO DongHyun-JO changed the title Add font_path arg for wordcloud feat: Add font_path arg for wordcloud May 31, 2024
@fabclmnt fabclmnt requested a review from alexbarros June 7, 2024 17:38
@fabclmnt
Copy link
Contributor

fabclmnt commented Jun 7, 2024

Hi @DongHyun-JO ,

thank you for your contribution! This is really helpful.

The team will be reviewing the PR shortly.

Copy link
Contributor

@alexbarros alexbarros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks for the contribution

Using font_path argument in Wordcloud
If we don't use a font in Wordcloud,
   multi-language be broken

Adjust lint for commit
@alexbarros alexbarros force-pushed the feat/font_param_wordcloud branch from 4f3c113 to da7485b Compare June 17, 2024 15:15
@alexbarros alexbarros merged commit 0e8fedd into ydataai:develop Jun 17, 2024
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants