1

I need to show "?" instead of the standard arrows types in my visjs network.

I followed this solution: How to change arrows in vis.js to chicken feet or cardinality

However I also need to hide and show nodes based on a property on it. Once the nodes are hidden and shown again, the "?" on edges is lost and the edges default to the standard arrow heads.

Fiddle: https://jsfiddle.net/gu2kwze0/51/

network.getEdgeById('1').drawArrows = function drawArrows(ctx, arrowData) {
    ctx.font = "20px OpenSans";  

  if (this.options.arrows.to.enabled === true) {
        //'to' side suspect
        ctx.fillText('?', arrowData.to.point.x, arrowData.to.point.y);
  }
  if (this.options.arrows.from.enabled === true) {
          //only 'from' side suspect
    ctx.fillText(' ? ', arrowData.from.point.x, arrowData.from.point.y);

  }
  }

Click in the network to hide & then show the edges. What could be wrong?

YakovL
  • 7,557
  • 12
  • 62
  • 102
Leena A
  • 11
  • 3

0 Answers0