Graphite icon indicating copy to clipboard operation
Graphite copied to clipboard

Shake a node to un-wire its connection through its primary input/output

Open Keavon opened this issue 3 years ago • 2 comments

We need some kind of robust shake detection algorithm in JS that has very minimal false positives/negatives.

Keavon avatar Dec 23 '22 03:12 Keavon

Hey @Keavon , if I wanted to tackle this as a first contribution to Graphite, where should I start from?

pwbh avatar Feb 08 '24 12:02 pwbh

@pwbh Nice, welcome! The hard part for this issue is just devising an algorithm that heuristically detects that a shake has occurred with a good level of accuracy. That will require some tuning. You likely want to save the previous half-second of pointer deltas and look for minimal change of displacement but significant change of direction. You can try writing this JS in a fiddle or a blank JS project for now, or put it in Graph.svelte and just make it call alert(); when it detects a shake. Then post the fiddle link or open a PR and push that function which alerts, so I can test it and give feedback to help you tune it further.

Keavon avatar Feb 08 '24 19:02 Keavon