【发布时间】:2018-07-28 07:23:16
【问题描述】:
我正在尝试构建一个包含线条的 SVG,每条线条都将链接到同一文档中其他地方的某个部分。但是,我不断收到ValueError,指出“Invalid children 'line' for svg-element <a>.”
此 MWE 重现错误:
import svgwrite
test = svgwrite.Drawing('test.svg', profile='tiny',size=(100, 100))
link = test.add(test.a('http://stackoverflow.com'))
link.add(test.line(start=(0,0),end=(100,100)))
test.save()
我在使用其他绘图元素(省略号、矩形等)时遇到同样的错误,但这些元素当然可以作为链接的子元素。
我错过了什么?
Python 版本:2.7.10
svgwrite 版本:1.1.6(pkg_resources报告)
【问题讨论】: