例如,如果我想转换yAxis域,我可以这样做
this.yAxis
.transition()
.call(this.createYAxis)
.attr('transform', `translate( ${this.Axes.Y.offset}, 0 )`);
Run Code Online (Sandbox Code Playgroud)
我还想在相同的选择中设置文本大小,但我不想为文本大小设置动画.这可能在同一个链中吗?例如,
this.yAxis
.transition()
.call(this.createYAxis)
.attr('transform', `translate( ${this.Axes.Y.offset}, 0 )`)
//I don't want anything past this point to be a part of the transition
.selectAll('text')
.style('font-size', '15px');
Run Code Online (Sandbox Code Playgroud)
现在我只是使用两个单独的调用
this.yAxis
.transition()
.call(this.createYAxis)
.attr('transform', `translate( ${this.Axes.Y.offset}, 0 )`);
this.yAxis.selectAll( 'text')
.style( 'font-size', '15px' )
Run Code Online (Sandbox Code Playgroud)