retejs / rete

JavaScript framework for visual programming
https://retejs.org
MIT License
10.17k stars 653 forks source link

Prevent dragging nodes and keep the ability to add connections #680

Closed AnastasiaLL closed 7 months ago

AnastasiaLL commented 10 months ago

Hi, in my angular app I want to turn off dragging all nodes, but leave the ability for users to create connections between nodes. Here's my code:

area.addPipe(context => { if (context.type === 'rendered') { if (context.data.type === 'node') { context.data.element.addEventListener('pointerdown', event => event.stopPropagation()); } } return context})

What am I doing wrong? Thanks a lot!!

Ni55aN commented 9 months ago

dragging causes the node's position change, so nodetranslate can be prevented as it is done in the readonly plugin.

https://github.com/retejs/readonly-plugin/blob/main/src/index.ts#L39 https://discord.com/channels/1081223198055604244/1156215577023627387/1156268661317828651

rete-js[bot] commented 8 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

rete-js[bot] commented 7 months ago

This issue was closed because it has been stalled for 10 days with no activity.