# drag

Fires on `mousemove` / `touchmove`.

***

The callback has two parameters which returns the orignal event and coordinates of the selection area (lasso) as an `Object`.

```javascript
selectable.on("drag", function(e, coords) {

});
```

The `coords` parameter returns an `Object` of the following format:

```javascript
{
    x1: Number, // the origin x offset
    y1: Number, // the origin y offset
    x2: Number, // the x offset from x1
    y2: Number, // the y offset from y1
}
```

```
x1,y1 (origin)
      +----------------------+
      |                      |
      |                      |
      |                      |
      |                      |
      |                      |
      |                      |
      +----------------------+
                              x2, y2 (mouse pointer)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mobius-studios.gitbook.io/selectable/api/events/drag.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
