mirror of
https://github.com/projectstorm/react-diagrams.git
synced 2026-03-13 09:50:09 +08:00
more port docs
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -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.
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user