I thought that it would be useful to add an updated answer after a long time to this post.
What we need to do is to define ToolsView to the link view.
const verticesTool = new joint.linkTools.Vertices();
const segmentsTool = new joint.linkTools.Segments();
const sourceArrowheadTool = new joint.linkTools.SourceArrowhead();
const targetArrowheadTool = new joint.linkTools.TargetArrowhead();
const sourceAnchorTool = new joint.linkTools.SourceAnchor();
const targetAnchorTool = new joint.linkTools.TargetAnchor();
const boundaryTool = new joint.linkTools.Boundary();
const removeButton = new joint.linkTools.Remove();
const toolsView = new joint.dia.ToolsView({
tools: [
verticesTool, segmentsTool,
sourceArrowheadTool, targetArrowheadTool,
sourceAnchorTool, targetAnchorTool,
boundaryTool, removeButton
]
});
After that, you need to add or remove this toolview upon hovering or leaving your links; for instance as below. Certainly, you can use other logic to show the toolview as required as opposed to on hover.
paper.on({
'blank:mouseover': ()=>{
paper.removeTools();
},
'link:mouseenter': (linkView)=>{
linkView.addTools(toolsView);
}
});
To follow the request in the original question, what we need is to discard removeButton from the toolview.
One more thing, if you want to override the default link that is used by paper when adding a new link, you will need to override your paper init parameters as follows:
new joint.dia.paper({
defaultLink: function (cellView, magnet) {
return new joint.shapes.standard.Link();
},
});
For more information:
[JointJS link tools]
[1]: https://resources.jointjs.com/tutorial/link-tools