Skip to content

Commit 1389935

Browse files
committed
Upload examples for README
1 parent 8421d19 commit 1389935

File tree

6 files changed

+6
-4
lines changed

6 files changed

+6
-4
lines changed

examples/DrawnAlgorithmExample.gif

377 KB
Loading

examples/GraphAlgorithmExample.gif

101 KB
Loading

examples/PathfindingExample.gif

869 KB
Loading
950 KB
Loading

src/pages/GraphVisualiser.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, {useState, useEffect} from 'react';
22
import { GraphCanvas } from 'reagraph';
3-
import GenerateRandomGraph from '../algorithms/graphs/GenerateRandomGraph';
43
import BreadthFirstSearch from '../algorithms/graphs/BreadthFirstSearch';
54
import DepthFirstSearch from '../algorithms/graphs/DepthFirstSearch';
65
import { Node } from '../algorithms/utils/GraphUtils';
@@ -11,7 +10,7 @@ import { GraphAlgorithm } from '../utils/GraphEnum';
1110
const GraphVisualiser: React.FC = () => {
1211
const [edges, setEdges] = useState([]);
1312
const [nodes, setNodes] = useState<{ id: string }[]>([]); // Specify the type of the nodes state variable
14-
const [algorithm, setAlgorithm] = useState(GraphAlgorithm.BFS);
13+
const [algorithm, setAlgorithm] = useState(GraphAlgorithm.DFS);
1514

1615
const nodeMap: Node[] = [
1716
new Node('0', '0', 'slateblue'),
@@ -63,8 +62,7 @@ const GraphVisualiser: React.FC = () => {
6362
<GraphCanvas
6463
nodes={nodes}
6564
edges={edges}
66-
onNodeDoubleClick={node => runAlgorithm(node.id)}
67-
/>
65+
onNodeDoubleClick={node => runAlgorithm(node.id)}/>
6866
</div>
6967
</div>
7068
);

src/styles/navbar.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,8 @@ ul {
3535
list-style-type: none;
3636
padding: 0;
3737
margin: 0;
38+
}
39+
40+
li > a {
41+
color: white;
3842
}

0 commit comments

Comments
 (0)