Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(linkTools.Vertices): add vertexAdding interactiveLinkNode option #2689

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kumilingus
Copy link
Contributor

@kumilingus kumilingus commented Jun 8, 2024

Description

The current solution with the linkTools.Vertices and its extra path overlay has several disadvantages. For example, it was not possible to move labels and create vertices at the same time (because an invisible path was rendered above the link and the labels).

This PR allows you to choose an existing node from the link view to serve as an interactive hit area for creating vertices.

Docs

https://docs.jointjs.com/api/linkTools/#vertices

vertexAdding

Can the user add new vertices (by clicking a segment of the link)?

Value Description
false The user can not add new vertices.
true An invisible path is rendered above the link which creates vertices upon interaction with it.
{} See VertexAddingOptions

VertexAddingOptions

Option Description
interactiveLinkNode: string; A selector of an existing link node, e.g. "wrapper". When the node is interacted with, a vertex is created.

The default is true.

const verticesTool = new linkTools.Vertices({ vertexAdding: { interactiveLinkNode: 'outline' }}),

Implements #2688.
Solves: #2370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant