<commit_before># aurelia-interactjs

Aurelia plugin to use the [interact.js](http://interactjs.io/) library.

# Installation

Register the plugin:

## JSPM

```
jspm i npm:aurelia-interactjs
```

Add the following line to main.js or main.ts
```diff
export function configure(aurelia) {
  aurelia.use
    .standardConfiguration()
    .developmentLogging()
+    .plugin("aurelia-interactjs");
```

# Generic attributes
Each attribute can be supplied with custom options that will be pased to interactjs, see the interactjs documentation for the options http://interactjs.io/docs/#action-options

## Usage:
```html
<div interact-draggable.bind="options" />
```

Each event can be used in the following way:

```html
<div interact-draggable interact-dragmove.delegate="func($event)" />
```

```javascript<commit_msg>docs: add Aurelia-CLI installation instructions<commit_after># aurelia-interactjs

Aurelia plugin to use the [interact.js](http://interactjs.io/) library.

# Installation

## JSPM
Install the package:
```
jspm i npm:aurelia-interactjs
```

Add the following line to main.js or main.ts
```diff
export function configure(aurelia) {
  aurelia.use
    .standardConfiguration()
    .developmentLogging()
+    .plugin("aurelia-interactjs");
```
## Aurelia-CLI
Install the package:
```
npm i aurelia-interactjs interact.js --save
```

Open up the file ```aurelia_project/aurelia.json``` and add the following in the bundles, vender-bundle.js dependencies section:
```diff
"aurelia-templating-binding",
+ {
+   "name": "interact.js",
+   "path": "../node_modules/interact.js/dist",
+   "main": "interact"
+ },
+ {
+   "name": "aurelia-interactjs",
+   "path": "../node_modules/aurelia-interactjs/dist/amd",
+   "main": "index"
+ },          
{
  "name": "text",
  "path": "../scripts/text"
},
```

# Generic attributes
Each attribute can be supplied with custom options that will be pased to interactjs, see the interactjs documentation for the options http://interactjs.io/docs/#action-options

## Usage:
```html
<div interact-draggable.bind="options" />
```

Each event can be used in the following way:

```html
<div interact-draggable interact-dragmove.delegate="func($event)" />
```

```javascript
{'fraction_non_alphanumeric': 0.1486854034451496, 'fraction_numerical': 0.0, 'mean_word_length': 4.503740648379052, 'pattern_counts': {'":': 8, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7089920', 'n_tokens_mistral': 745, 'n_tokens_neox': 714, 'n_words': 195}