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

Add SVG contour support to WordCloud class #759

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sans-dev
Copy link

@sans-dev sans-dev commented Jan 17, 2024

This pull request introduces the ability to generate SVG contour outlines in the WordCloud library. This feature enhances the visual representation of word clouds by providing an option to include contour outlines around the words.

Changes include:

  1. Modification in wordcloud.py: The to_svg function in wordcloud.py has been updated to include the contour outlines if the contour attribute is set. The contour is converted into an SVG path command and added to the SVG output.

  2. New test function in test_wordcloud.py: A new test function, test_svg_contour, has been added to test_wordcloud.py. This function tests whether the SVG output includes the contour path when the contour attribute is set.

These changes ensure that users can now generate word clouds with contour outlines in SVG format, providing more flexibility in the visual representation of word clouds. The added test ensures that the new feature works as expected.

Please review the changes and let me know if any adjustments are required.

Fixes #694

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.

SVG images don't have any contour lines
1 participant