简体   繁体   English

d3 v4从对象_data_访问x和y值

[英]d3 v4 accessing x and y value from Object _data_

dx and dy inside the transform attribute return 'undefined'. 转换属性中的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 + ')');
  • how can I get the defined dx or dy ? 如何获得定义的dx或dy? Thank you in advance. 先感谢您。

The problem was actually related to ionic life cycles. 该问题实际上与离子寿命周期有关。 Thank you. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM