【发布时间】:2015-06-12 09:02:04
【问题描述】:
我正在使用库 SVGWRITE 创建一个生物信息学工具。
我在使用 animate 模块(如 animateColor、animateMotion...)方面需要一些帮助,因为即使我阅读了文档,也阅读了 svgwrite 包中的所有示例,但我找不到方法了解如何正确使用它。
我正在创建的 SVG 绘图仅由矩形组成,我称之为外显子,这就是我创建它们的方式:
def drawExon(dwg,lineNumber,start,end,rvb):
"""
A function which draw a new exon on a opened dwg draw
it draw that exon from 'start', to 'end' (x position)
at the line 'lineNumber' (y position) with the color'rvb'
"""
dwg.add(dwg.rect((start,lineNumber*line_height),(end - start,
exon_height),fill=svgwrite.rgb(rvb[0],rvb[1],rvb[2])))
我想添加这些矩形的动画,当我飞越矩形时,我希望该矩形上出现一个 ID(在其上方的文本框中),并且该矩形可以改变颜色。
问题是我不知道如何以及在哪里应用动画模块,也不知道我必须给出什么样的参数......
好吧,我在过去两个小时内尝试做这样的事情,我在以下链接上阅读了很多内容: http://svgwrite.readthedocs.org/en/latest/classes/animate.html#animate
但这并没有帮助我找到答案。
【问题讨论】:
-
看,我找到了这个……codereview.stackexchange.com/questions/69338/…祝你好运