more port docs

This commit is contained in:
Dylan Vorster
2019-08-11 13:25:35 +02:00
parent 98888f6d96
commit 4786208fe6
2 changed files with 15 additions and 9 deletions

View File

@@ -56,4 +56,18 @@ class DefaultPortModel extends PortModel{
return true;
}
}
```
## Specifying what type of link is generated from a port
When a user drags on a port to generate a link, the port is also responsible for specifying
what link is created. This happens through the `createLinkModel()` method:
```typescript
class DefaultPortModel extends PortModel{
...
createLinkModel(): LinkModel{
return new DefaultLinkModel(); // <-- here we generate a DefaultLinkModel
}
}
```

View File

@@ -26,15 +26,7 @@ The library includes it's dependencies as peer-dependencies, so yarn will output
yarn add closest lodash react mathjs dagre pathfinding paths-js
```
We do this, so that you can better control the versions of these libraries yourself since you might make use of `Lodash` in other parts of your software.
## Next steps
[Using the library](./using-the-library.md)
We do this, so that you can better control the versions of these libraries yourself since you might make use of `Lodash` in other parts of your software.