Add SVG contour support to WordCloud class #759
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Modification in
wordcloud.py
: Theto_svg
function inwordcloud.py
has been updated to include the contour outlines if thecontour
attribute is set. The contour is converted into an SVG path command and added to the SVG output.New test function in
test_wordcloud.py
: A new test function,test_svg_contour
, has been added totest_wordcloud.py
. This function tests whether the SVG output includes the contour path when thecontour
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