我的D3代码有问题.
const hexagon = this.hexagonSVG.append('path')
.attr('id', 'active')
.attr('d', lineGenerator(<any>hexagonData))
.attr('stroke', 'url(#gradient)')
.attr('stroke-width', 3.5)
.attr('fill', 'none')
const totalLength = (<any>hexagon).node().getTotalLength()
const _transition = this.d3.transition()
.duration(DASH_ANIMATION)
.ease(this.d3.easeLinear)
hexagon
.attr('stroke-dasharray', totalLength + ' ' + totalLength)
.attr('stroke-dashoffset', totalLength)
.attr('stroke-dashoffset', 0)
.transition(_transition)
Run Code Online (Sandbox Code Playgroud)
这个代码在将近6个月的时间里运行良好,但今天出现了一个错误.
"hexagon.attr(...).attr(...).attr(...).transition不是函数"
有人可以告诉我如何解决这个问题吗?谢谢.
| 归档时间: |
|
| 查看次数: |
1682 次 |
| 最近记录: |