Declarative Dragging
Declarative dragging simplifies the process of making diagrams draggable. Instead of writing complex drag-and-drop code involving geometry, feedback, and animations, users specify which future states of the application the draggable element should lead to. The system speculatively renders these states to determine where the element can go, then combines these possibilities into a smooth, responsive drag-and-drop interaction.
The goal is to allow users to work within their familiar semantic contexts while creating rich tactile interactions within the digital realm. Dragology, a library developed for SVG interfaces on the web, implements this concept. It enables simple model-driven drag-and-drop behaviors to be composed into more complex ones and layered with features like floating, snapping, and transitions.
The concept originated from a desire to make a math game more interactive. Initially, the fundamental mechanic of selecting transformations from a menu lacked the tactile feel the creator desired. After a chance encounter with Andrew, who shared ideas about model-driven dragging, the concept took shape. A friend, Elliot, was experimenting with order-preserving maps between trees and drew a structure that inspired the creator to implement a library, Dragology, to bring declarative dragging to existing applications and restart work on a math game concept.
Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.
- Declarative Dragging declarative-dragging.github.io