Invisible Links

Hello,

I am new to go.js. I want to know if there is in gojs something like wen i click on a node some invisible links appears and wen i click on other place the links disappears.

Best regards

Sure – implement a click event handler on some GraphObject in your Node (maybe a “Button”?) that changes the opacity of each Link of the Node.findLinksConnected() from 0.0 to 1.0 or vice versa.

Actually, what you are requesting is quite ambiguous. I’m now wondering if what you really want is not implement a GraphObject.click event handler, but instead a GraphObject.selectionChanged event handler. Maybe something like:

  $(go.Node, . . .,
      {
        selectionChanged: function(node) {
            node.findLinksConnected().each(function(link) {
                link.opacity = (node.isSelected ? 1.0 : 0.0);
            });
        }
      }
  )

However it is still unclear to me what you want to happen when multiple nodes are selected.

hello and thank for your response, i have this code

I don’t want all the link to disappear, just a group of specific links so, I declared some link with opacity = 0.0, but the problem that always all link have opacity = 1.0 even when i set it to 0 before adding the link to the dataLinkArray, So i want to know if you have a solution for this problem.

You are binding the Shape.opacity property but are checking the Link.opacity property.