我正在尝试使用d3.js在svg中显示图像,并且我希望在缩放时调整它们的大小。我认为最好的方法是将图像设置为背景,以便可以调整“容器”的大小,但是我不确定。
我试图使它们看起来像代码中所示,但是我只能调整图像“容器”的大小,但是图像仍然相同。
this.images = this.features.append('svg:image')
.attr('xlink:href', (d: any) => d.image)
.attr('x', (d: any) => this.getXFromSeqPosition(d.start))
.attr('width', d => this.xScale(d.end - d.start))
.attr('height', this._height);