You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using an SVG plot with a legend (below), Manim passes a NoneType to svgelements. This results in an error: TypeError: object of type 'NoneType' has no len()
When using an otherwise identical plot with no legend (below), there is no such error and Manim is able to parse the SVG image successfully.
I'm unsure if this is fundamentally an issue with Manim or svgelements.
Expected behavior
Both plots should be easily parsable without modifying svgelements.
How to reproduce the issue
Create the following simple scene with Manim using the two attached plots.
I was able to avoid the error by modifying svgelements/svgelements.py class SVGLexicalParser method parse. I replaced
defparse(self, parser, pathd):
self.parser=parserself.parser.start()
self.pathd=pathdself.pos=0self.limit=len(pathd)
# the rest of the method
with
defparse(self, parser, pathd):
self.parser=parserself.parser.start()
self.pathd=pathdself.pos=0ifpathdisnotNone:
self.limit=len(pathd)
else:
self.limit=0# the rest of the method
The text was updated successfully, but these errors were encountered:
Description of bug / unexpected behavior
When using an SVG plot with a legend (below), Manim passes a NoneType to svgelements. This results in an error:
TypeError: object of type 'NoneType' has no len()
When using an otherwise identical plot with no legend (below), there is no such error and Manim is able to parse the SVG image successfully.
I'm unsure if this is fundamentally an issue with Manim or svgelements.
Expected behavior
Both plots should be easily parsable without modifying svgelements.
How to reproduce the issue
Create the following simple scene with Manim using the two attached plots.
Code for reproducing the problem
Additional media files
Images/GIFs
Logs
Terminal output
After running the command:
manim -qh -v DEBUG scene.py LoadSVGPlotsmanim -qh -v DEBUG scene.py LoadSVGPlots
System specifications
System Details
python/py/python3 --version
): Python 3.10.14pip list
):LaTeX details
Additional comments
I was able to avoid the error by modifying
svgelements/svgelements.py
classSVGLexicalParser
methodparse
. I replacedwith
The text was updated successfully, but these errors were encountered: