Infovis JIT: add click listener to edge

后端 未结 1 803
情深已故
情深已故 2021-01-16 15:59

I\'m trying to capture a click event on an edge of a sunburst graph. I\'ve already captured click events on nodes. This is what I\'m trying:

//..sunburst ex         


        
相关标签:
1条回答
  • 2021-01-16 16:39

    The problem is that 'contains' method, for the edge type 'hyperline'(which sunburst uses) is not yet implemented in the infovis library.

    Contains method is used by library to know if some position specified in parameters is within the edge or not. You can not get events without contains method. So, you can either implement your own contains method for type hyperline in jit.js or you can simply change the edge type to 'line' from 'hyperline' in init method.

    Edge: {
      overridable: true,
      type: 'line',  //'hyperline'
      lineWidth: 2,
      color: '#777'
    } 
    

    You will be able to capture events for edge type 'line' because contains method is defined for 'line' type.

    0 讨论(0)
提交回复
热议问题