[英]d3 v4 accessing x and y value from Object _data_
转换属性中的dx和dy返回“未定义”。
this.nodeElements = this.nodeGroup.selectAll('circle')
.data(this.sensors);
console.log(this.sensors[0].x); // this returns the correct x value
const nodeEnter = this.nodeElements
.enter()
.append('svg:g')
.attr('transform', d => 'translate(' + d.x + ', ' + d.y + ')');
该问题实际上与离子寿命周期有关。 谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.