[英]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.