summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md39
-rw-r--r--src/Graph.py (renamed from Graph.py)0
-rw-r--r--src/Node.py (renamed from Node.py)0
-rw-r--r--src/builder.py (renamed from builder.py)9
-rw-r--r--src/finalGraph.txt (renamed from finalGraph.txt)0
-rw-r--r--src/globals.py (renamed from globals.py)0
-rw-r--r--src/main.py (renamed from main.py)0
-rw-r--r--src/parse.py (renamed from parse.py)0
8 files changed, 43 insertions, 5 deletions
diff --git a/README.md b/README.md
index b0fb7d5..f35c33f 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,39 @@
-# graph-explorer
+# Graph Explorer
This is a WOK (wealth of knowledge) explorer that I made for fun and profit for CSE280.
+
+## Installation
+
+All you need is pygame!
+
+```bash
+pip install pygame
+```
+
+## Usage
+```bash
+python3 main.py
+```
+Select a node by clicking it; this will focus the links that are directed out of that node.
+
+Press "P" to select all nodes.
+
+Press "F" to find a node (this is done as a prompt in the shell).
+
+Press "Space" to pause the visualization.
+
+Press "C" to clear all the selected nodes.
+
+
+## Using the WOK Builder
+
+```bash
+python3 builder.py
+```
+
+The builder is a simple one; click anywhere where there is not a node to create a new one (prompted in terminal).
+
+You can add links between nodes by selecting first the source node and then the directed node. A description for the link will be prompted in the terminal.
+
+If you accidentally link two nodes, you can cancel the link by typing "no" in the description.
+
+Press "F" to search for a node. If found, this node will turn blue.
diff --git a/Graph.py b/src/Graph.py
index 49f0378..49f0378 100644
--- a/Graph.py
+++ b/src/Graph.py
diff --git a/Node.py b/src/Node.py
index f85dab2..f85dab2 100644
--- a/Node.py
+++ b/src/Node.py
diff --git a/builder.py b/src/builder.py
index 0bc0444..3c79d1b 100644
--- a/builder.py
+++ b/src/builder.py
@@ -9,8 +9,9 @@ def main():
clock = pygame.time.Clock()
running = True
- graph = Graph(screen, file="finalGraph.txt")
- graph.fromFile(False)
+# graph = Graph(screen, file="copy.txt")
+# graph.fromFile(False)
+ graph = Graph(screen)
isNodeUnderMouse = False
node1 = None
node2 = None
@@ -25,7 +26,7 @@ def main():
file.close()
running = False
if event.type == pygame.KEYDOWN:
- if event.key == pygame.K_SPACE:
+ if event.key == pygame.K_f:
find = input("Name of node: ")
for i in graph.nodes:
if i.text == find:
@@ -40,7 +41,7 @@ def main():
graph.drawLinks(i)
if (node1):
node2 = i
- description = input("Description of link: ")
+ description = input("Description of link between " + node1.text + " and " + node2.text + ": ")
if (description != "no"):
graph.links.append([node1, node2, 1.0, description])
node2 = None
diff --git a/finalGraph.txt b/src/finalGraph.txt
index 3105bee..3105bee 100644
--- a/finalGraph.txt
+++ b/src/finalGraph.txt
diff --git a/globals.py b/src/globals.py
index d8406e5..d8406e5 100644
--- a/globals.py
+++ b/src/globals.py
diff --git a/main.py b/src/main.py
index 9e86ae1..9e86ae1 100644
--- a/main.py
+++ b/src/main.py
diff --git a/parse.py b/src/parse.py
index e92743f..e92743f 100644
--- a/parse.py
+++ b/src/parse.py