# almost-joint

> __ALMOsT__ is an **A**gi**L**e **MO**del **T**ransformation framework for JavaScript

Latest version **1.0.0-beta.20** (published 2020-08-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install almost-joint
pnpm add almost-joint
yarn add almost-joint
bun add almost-joint
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-beta.20 |
| Published | 2020-08-30 |
| First published | 2017-02-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 608.9 KB |
| Known vulnerabilities | 0 (+9 in 2 direct dependencies) |
| Install scripts | no |
| Author | Carlo Bernaschina |
| Maintainers | b3rn475 |

## Links

- npm: https://www.npmjs.com/package/almost-joint
- Repository: https://github.com/B3rn475/almostjs-joint
- Homepage: https://github.com/B3rn475/almostjs-joint#readme
- Issues: https://github.com/B3rn475/almostjs-joint/issues
- npm.io page: https://npm.io/package/almost-joint

## Dependencies (6)

- [jquery](https://npm.io/package/jquery.md) ^3.1.1
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [jointjs](https://npm.io/package/jointjs.md) ^2.0.1
- [backbone](https://npm.io/package/backbone.md) ^1.3.3
- [mousetrap](https://npm.io/package/mousetrap.md) ^1.6.1
- [save-svg-as-png](https://npm.io/package/save-svg-as-png.md) ^1.3.1

## Recent versions

- 1.0.0-beta.20 (latest) — 2020-08-30
- 1.0.0-beta.19 — 2020-08-30
- 1.0.0-beta.18 — 2019-02-22
- 1.0.0-beta.17 — 2019-02-22
- 1.0.0-beta.16 — 2019-02-12
- 1.0.0-beta.15 — 2019-02-12
- 1.0.0-beta.14 — 2019-02-12
- 1.0.0-beta.13 — 2018-07-25
- 1.0.0-beta.12 — 2018-06-18
- 1.0.0-beta.11 — 2018-06-08
- 1.0.0-beta.10 — 2018-06-08
- 1.0.0-beta.9 — 2018-06-08
- 1.0.0-beta.8 — 2018-06-07
- 1.0.0-beta.7 — 2018-06-07
- 1.0.0-beta.6 — 2018-06-06
- … 27 more at https://npm.io/package/almost-joint/versions

## README

# almostjs-joint
__ALMOsT__ is an **A**gi**L**e **MO**del **T**ransformation framework for JavaScript

[![NPM Version][npm-image]][npm-url]
[![MIT licensed][license-image]][license-url]

__ALMOsT_Joint__ is an opinionated plug-in for [JointJs][joint-url] which facilitates the development of __Model Editors__.

__ALMOsT_Joint__ is built on top of __JointJs__ concepts like:
 - __Graph__: the structure of the diagram [see][joint-graph-url]
 - __Cell__: a component of the diagram [see][joint-cell-url]
 - __Element__: a __Cell__ with position, size and a graphical representation  [see][joint-element-url]
 - __Link__: a __Cell__ with a line-ish graphical representation (line, arrow, ...) connecting two elements [see][joint-link-url]

It just adds the concept of __Board__, an abstraction over the [Paper][joint-paper-url] concept in __JoinJs__ which provides you a set of functionalities out of the box.

The minimum required code is the following:
```JavaScript
var model = new joint.dia.Graph(),
var board = almost.plugins.joint.createBoard({
    el: '#board',
    model: model
});
```
This will create a __Graph__ and initialize a board.

The `createBoard` constructor function has the following options:
- `el: [dom node, jquery collection, a jquery selector string]` the dom element in the page where the board will be created.
- `model: [joint.dia.Graph]` the __Graph__ which contains the displayed diagram.
- _optional_ `isValidParent: [function (elementView, parentElementView)]` a function which validates the parent/child relationship between elements, a negative response will reject the previous operation by the user.
  The __parent__ can be `undefined` if the element is in a free area of the __Board__, at least one element must have no parent.
- _optional_ `defaultLink: [function (elementView, magnet)]` this function serves the same functionality as the [JointJs counterpart][joint-defaultlink-url].

[npm-image]: https://img.shields.io/npm/v/almost-joint.svg
[npm-url]: https://npmjs.org/package/almost-joint
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg
[license-url]: https://raw.githubusercontent.com/B3rn475/almostjs-joint/master/LICENSE
[joint-url]: https://jointjs.com
[joint-graph-url]: http://resources.jointjs.com/docs/jointjs/v2.1/joint.html#dia.Graph
[joint-cell-url]: http://resources.jointjs.com/docs/jointjs/v2.1/joint.html#dia.Cell
[joint-element-url]: http://resources.jointjs.com/docs/jointjs/v2.1/joint.html#dia.Element
[joint-link-url]: http://resources.jointjs.com/docs/jointjs/v2.1/joint.html#dia.Link
[joint-paper-url]: http://resources.jointjs.com/docs/jointjs/v2.1/joint.html#dia.Paper
[joint-defaultlink-url]: http://resources.jointjs.com/docs/jointjs/v2.1/joint.html#dia.Paper.prototype.options.defaultLink

---
_Source: https://npm.io/package/almost-joint · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
