Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
blutorange committed Jun 11, 2018
1 parent aa42787 commit 6850ae7
Show file tree
Hide file tree
Showing 30 changed files with 1,169 additions and 387 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ main.js
index.d.ts
main.d.ts
*.tgz
*.zip

# ---> Linux
*~
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ tslint.json
/src
/index.ts
*.tgz
*.zip
sandbox.ts

# ---> Linux
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ that makes the graph cyclic.

```javascript
const { GenericGraphAdapter } = require("incremental-cycle-detect");
const graph = new GenericGraphAdapter();
const graph = GenericGraphAdapter.create();
graph.addEdge(0, 1) // => true
graph.addEdge(1, 2) // => true
graph.addEdge(2, 3) // => true
Expand All @@ -67,7 +67,7 @@ Example for using the GraphlibAdapter:

```javascript
const { Graph } = require("graphlib");
const graph = new GraphlibAdapter({graphlib: Graph});
const graph = GraphlibAdapter.create({graphlib: Graph});
graph.addEdge(0, 1) // => true
```

Expand Down Expand Up @@ -100,7 +100,7 @@ Some parts need `Map`. You can either

```javascript
import * as Map from "core-js/es6/map";
const graph = new GenericGraphAdapter({mapConstructor: Map}):
const graph = GenericGraphAdapter.create({mapConstructor: Map}):
```

# Use your own graph data structure
Expand Down Expand Up @@ -141,6 +141,10 @@ I use the following keywords:

From newest to oldest:

# 0.3.0
- Added a `clone` and `map` method for creating a copy of a graph.
- Changed the graph adapter implementations so that instances are now created with the factory method `create` instead of the constructor. This was necessary for the `clone` method.

# 0.2.2
- Added two methods for accessing edge data of incoming / outgoing edges: `getEdgeDataFrom`, `getEdgeDataTo`
- Added a method for checking whether an edge can be added: `canAddEdge`.
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/search.js

Large diffs are not rendered by default.

246 changes: 187 additions & 59 deletions docs/classes/genericgraphadapter.html

Large diffs are not rendered by default.

237 changes: 176 additions & 61 deletions docs/classes/graphlibadapter.html

Large diffs are not rendered by default.

279 changes: 214 additions & 65 deletions docs/classes/multigraphadapter.html

Large diffs are not rendered by default.

52 changes: 43 additions & 9 deletions docs/classes/pearcekellydetector.html
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,9 @@
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="pearcekellydetector.html#isreachable" class="tsd-kind-icon">is<wbr>Reachable</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter">
<a href="pearcekellydetector.html#map" class="tsd-kind-icon">map</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="pearcekellydetector.html#onvertexdeletion" class="tsd-kind-icon">on<wbr>Vertex<wbr>Deletion</a>
</li>
Expand Down Expand Up @@ -966,8 +969,8 @@
<li class=" tsd-kind-type-alias">
<a href="../globals.html#graphlibconstructor" class="tsd-kind-icon">Graphlib<wbr>Constructor</a>
</li>
<li class=" tsd-kind-type-alias tsd-has-type-parameter">
<a href="../globals.html#partialexcept" class="tsd-kind-icon">Partial<wbr>Except</a>
<li class=" tsd-kind-variable tsd-is-private">
<a href="../globals.html#dummydetector" class="tsd-kind-icon">Dummy<wbr>Detector</a>
</li>
<li class=" tsd-kind-function tsd-has-type-parameter tsd-is-private">
<a href="../globals.html#assign" class="tsd-kind-icon">assign</a>
Expand Down Expand Up @@ -1068,6 +1071,7 @@ <h3>Methods</h3>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="pearcekellydetector.html#createvertexdata" class="tsd-kind-icon">create<wbr>Vertex<wbr>Data</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="pearcekellydetector.html#getorder" class="tsd-kind-icon">get<wbr>Order</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="pearcekellydetector.html#isreachable" class="tsd-kind-icon">is<wbr>Reachable</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="pearcekellydetector.html#map" class="tsd-kind-icon">map</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="pearcekellydetector.html#onvertexdeletion" class="tsd-kind-icon">on<wbr>Vertex<wbr>Deletion</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="pearcekellydetector.html#supportsorder" class="tsd-kind-icon">supports<wbr>Order</a></li>
</ul>
Expand All @@ -1087,7 +1091,7 @@ <h3>constructor</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/6b69b29/src/PearceKellyDetector.ts#L68">PearceKellyDetector.ts:68</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/aa42787/src/PearceKellyDetector.ts#L69">PearceKellyDetector.ts:69</a></li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <a href="pearcekellydetector.html" class="tsd-signature-type">PearceKellyDetector</a></h4>
Expand All @@ -1108,7 +1112,7 @@ <h3>can<wbr>Add<wbr>Edge</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#canaddedge">canAddEdge</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/6b69b29/src/PearceKellyDetector.ts#L111">PearceKellyDetector.ts:111</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/aa42787/src/PearceKellyDetector.ts#L130">PearceKellyDetector.ts:130</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -1138,7 +1142,7 @@ <h3>create<wbr>Vertex<wbr>Data</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#createvertexdata">createVertexData</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/6b69b29/src/PearceKellyDetector.ts#L97">PearceKellyDetector.ts:97</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/aa42787/src/PearceKellyDetector.ts#L116">PearceKellyDetector.ts:116</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -1165,7 +1169,7 @@ <h3>get<wbr>Order</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#getorder">getOrder</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/6b69b29/src/PearceKellyDetector.ts#L123">PearceKellyDetector.ts:123</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/aa42787/src/PearceKellyDetector.ts#L142">PearceKellyDetector.ts:142</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -1192,7 +1196,7 @@ <h3>is<wbr>Reachable</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#isreachable">isReachable</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/6b69b29/src/PearceKellyDetector.ts#L78">PearceKellyDetector.ts:78</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/aa42787/src/PearceKellyDetector.ts#L97">PearceKellyDetector.ts:97</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -1211,6 +1215,36 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter">
<a name="map" class="tsd-anchor"></a>
<h3>map</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter">
<li class="tsd-signature tsd-kind-icon">map&lt;TClonedVertex&gt;<span class="tsd-signature-symbol">(</span>vertexMapper<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">TypedFunction</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TVertex</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">TClonedVertex</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="pearcekellydetector.html" class="tsd-signature-type">PearceKellyDetector</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TClonedVertex</span><span class="tsd-signature-symbol">&gt;</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#map">map</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/aa42787/src/PearceKellyDetector.ts#L79">PearceKellyDetector.ts:79</a></li>
</ul>
</aside>
<h4 class="tsd-type-parameters-title">Type parameters</h4>
<ul class="tsd-type-parameters">
<li>
<h4>TClonedVertex</h4>
</li>
</ul>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>vertexMapper: <span class="tsd-signature-type">TypedFunction</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TVertex</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">TClonedVertex</span><span class="tsd-signature-symbol">&gt;</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="pearcekellydetector.html" class="tsd-signature-type">PearceKellyDetector</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TClonedVertex</span><span class="tsd-signature-symbol">&gt;</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="onvertexdeletion" class="tsd-anchor"></a>
<h3>on<wbr>Vertex<wbr>Deletion</h3>
Expand All @@ -1222,7 +1256,7 @@ <h3>on<wbr>Vertex<wbr>Deletion</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#onvertexdeletion">onVertexDeletion</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/6b69b29/src/PearceKellyDetector.ts#L105">PearceKellyDetector.ts:105</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/aa42787/src/PearceKellyDetector.ts#L124">PearceKellyDetector.ts:124</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -1249,7 +1283,7 @@ <h3>supports<wbr>Order</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#supportsorder">supportsOrder</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/6b69b29/src/PearceKellyDetector.ts#L119">PearceKellyDetector.ts:119</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/aa42787/src/PearceKellyDetector.ts#L138">PearceKellyDetector.ts:138</a></li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
Expand Down
Loading

0 comments on commit 6850ae7

Please sign in to comment.