Is there a way to add labels to links on the place where I dbclick? #2788
Answered
by
kumilingus
Naveena1321
asked this question in
Q&A
Replies: 1 comment 3 replies
-
paper.on('link:pointerdblclick', (linkView, evt, x, y) => {
const ratio = linkView.getClosestPointRatio({ x, y });
linkView.model.appendLabel({ attrs: { text: { text: 'Label' }}, position: { distance: ratio }});
// update the linkView immediately
paper.requireView(link);
const labelTextNode = linkView.findNodeLabel(0, 'text');
// edit the `labelTextNode` with the TextEditor
}); |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
Naveena1321
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
Have a require to add labels in links/elements where i doubleclicked and select it for text editor by default
Steps to reproduce
No response
Restrictions & Constraints
No response
Does your question relate to JointJS or JointJS+. Select both if applicable.
JointJS, JointJS+
Beta Was this translation helpful? Give feedback.
All reactions