Skip to content

Commit

Permalink
Merge pull request #83 from datavis-tech/upgrade-deps-432758943543
Browse files Browse the repository at this point in the history
Upgrade dependencies, run prettier
  • Loading branch information
curran authored Aug 19, 2024
2 parents 72e9793 + 8189bc7 commit 07b00b1
Show file tree
Hide file tree
Showing 40 changed files with 2,480 additions and 2,837 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: bahmutov/npm-install@v1

- name: Check types
run: npm run type-check
run: npm run tsc

- name: Test
run: npm run test
Expand Down
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This library is distributed only via [NPM](npmjs.com). Install by running
Require it in your code like this.

```javascript
const { Graph } = require("graph-data-structure");
const { Graph } = require('graph-data-structure');
```

## Examples
Expand All @@ -39,15 +39,15 @@ var graph = Graph();
Add some nodes and edges with **[addNode](#add-node)** and **[addEdge](#add-edge)**.

```javascript
graph.addNode("a");
graph.addNode("b");
graph.addEdge("a", "b");
graph.addNode('a');
graph.addNode('b');
graph.addEdge('a', 'b');
```

Nodes are added implicitly when edges are added.

```javascript
graph.addEdge("b", "c");
graph.addEdge('b', 'c');
```

Now we have the following graph. <img src="https://cloud.githubusercontent.com/assets/68416/15385597/44a10522-1dc0-11e6-9054-2150f851db46.png">
Expand All @@ -68,14 +68,14 @@ Here's an example of topological sort with getting dressed (from Cormen et al. "

```javascript
var graph = Graph()
.addEdge("socks", "shoes")
.addEdge("shirt", "belt")
.addEdge("shirt", "tie")
.addEdge("tie", "jacket")
.addEdge("belt", "jacket")
.addEdge("pants", "shoes")
.addEdge("underpants", "pants")
.addEdge("pants", "belt");
.addEdge('socks', 'shoes')
.addEdge('shirt', 'belt')
.addEdge('shirt', 'tie')
.addEdge('tie', 'jacket')
.addEdge('belt', 'jacket')
.addEdge('pants', 'shoes')
.addEdge('underpants', 'pants')
.addEdge('pants', 'belt');

// prints [ "underpants", "pants", "shirt", "tie", "belt", "jacket", "socks", "shoes" ]
console.log(graph.topologicalSort());
Expand Down Expand Up @@ -172,8 +172,8 @@ Here's example code for serializing a graph.

```javascript
var graph = Graph();
graph.addEdge("a", "b");
graph.addEdge("b", "c");
graph.addEdge('a', 'b');
graph.addEdge('b', 'c');
var serialized = graph.serialize();
```

Expand Down
Loading

0 comments on commit 07b00b1

Please sign in to comment.