You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-51Lines changed: 11 additions & 51 deletions
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,13 @@ This project is to visualize the graph network corresponding to a gremlin query.
6
6
### Quick start guide
7
7
8
8
Below is a quick start guide to start JanusGraph, load the testing graph, and start visualization to show the graph.
9
-
Notice, this guide uses Docker image, but it's possible to start JanusGraph and visualization tool without (see `Setting Up JanusGraph Visualizer` section below).
10
-
11
-
1. Start JanusGraph on your host machine: `docker run --name janusgraph-default -p 8182:8182 --network=host janusgraph/janusgraph:latest`
12
-
2. Open second terminal and start gremlin console: `docker run --rm --network=host -e GREMLIN_REMOTE_HOSTS=localhost -it janusgraph/janusgraph:latest ./bin/gremlin.sh`
13
-
3. Connect to JanusGraph Server from your running Gremlin Console: `:remote connect tinkerpop.server conf/remote.yaml`
14
-
4. Instruct Gremlin Console to send all requests to the connected remote server: `:remote console`
15
-
5. Load JanusGraph testing graph via Gremlin Console: `GraphOfTheGodsFactory.load(graph)`
16
-
6. Exit Gremlin Console because it's no longer needed: `:exit`
8. Open your browser and enter address `http://localhost:3001/`
19
-
9. Click `EXECUTE` button. You should see the same graph as the one specified on the image above.
9
+
Notice, this guide uses Docker compose, but it's possible to start JanusGraph and visualization tool without (see `Setting Up JanusGraph Visualizer` section below).
10
+
11
+
1. Start the docker services using `docker compose up` for the starting the Janusgraph service, loading the test data and starting the visualization service.
12
+
2. (Optional) If you want to specially build the visualizer from the source code, use `docker compose up --build`.
13
+
3. Open your browser and enter address `http://localhost:3001/`
14
+
4. Click `EXECUTE` button. You should see the same graph as the one specified on the image above.
15
+
5. The Docker containers can be stopped by calling `docker compose down`.
20
16
21
17
### Setting Up JanusGraph Visualizer
22
18
To setup JanusGraph visualizer, you need to have `node.js` and `npm` installed in your system.
@@ -40,55 +36,19 @@ http://localhost:3000
40
36
41
37
Note - Frontend starts on port 3000 and simple Node.js server also starts on port 3001. If you need to change the ports, configure in `package.json`, `proxy-server.js`, `src/constants`
42
38
43
-
#### Setting up with Docker
44
-
45
-
You can build a Docker image of the JanusGraph visualizer with the included `Dockerfile`.
46
-
This will use the current version of the `main` branch of the source GitHub repository.
47
-
The Docker image can be built by calling the `docker build -f full.Dockerfile` command, for example:
If you had already built node project on your host then you can create a Docker image faster by using `Dockerfile` instead of `full.Dockerfile`:
54
-
55
-
```sh
56
-
docker build --tag=janusgraph-visualizer:latest .
57
-
```
58
-
59
-
The image can also be downloaded from Docker hub: [`janusgraph/janusgraph-visualizer:latest`](https://hub.docker.com/r/janusgraph/janusgraph-visualizer).
The Docker image can then be run by calling `docker run` and exposing the necessary ports for communication. See [Docker's documentation](https://docs.docker.com/engine/reference/commandline/run/) for more options on how to run the image.
Note that `--network=host` is not needed if you don't run your gremlin server in the host machine.
74
-
75
-
* Open the browser and navigate to
76
-
```sh
77
-
http://localhost:3001
78
-
```
79
-
80
-
The Docker container can be stopped by calling `docker stop janusgraph-visualizer`.
39
+
See [docs/docker-build.md](docs/docker-build.md) to learn how to build the project directly using Docker images.
81
40
82
41
### Supported Environment Variables
83
42
84
-
*`GREMLIN_HOST` - sets gremlin server hostname for connection. Default is `localhost`.
43
+
*`GREMLIN_HOST` - sets gremlin server hostname for connection. Default is `janusgraph` if started via `docker compose up` (`docker-compose.yml` receives this value from `.env` file) or `localhost` if started directly via `docker run`.
85
44
*`GREMLIN_PORT` - sets gremlin server port for connection. Default is `8182`.
86
45
*`GREMLIN_TRAVERSAL_SOURCE` - sets default graph traversal source name to be used for queries. Default is `g`.
87
46
*`GREMLIN_DEFAULT_QUERY` - sets default query to show in visualizer. Default is `g.V()`.
88
47
48
+
You can change these values in the .env file.
49
+
89
50
### Usage
90
51
* Start JanusGraph-Visualizer as mentioned above
91
-
* Start or tunnel a gremlin server
92
52
* Specify the host and port of the gremlin server
93
53
* Write a gremlin query to retrieve a set of nodes (eg. `g.V()`)
If you had already built node project on your host then you can create a Docker image faster by using `Dockerfile` instead of `full.Dockerfile`:
12
+
13
+
```sh
14
+
docker build --tag=janusgraph-visualizer:latest .
15
+
```
16
+
17
+
The image can also be downloaded from Docker hub: [`janusgraph/janusgraph-visualizer:latest`](https://hub.docker.com/r/janusgraph/janusgraph-visualizer).
The Docker image can then be run by calling `docker run` and exposing the necessary ports for communication. See [Docker's documentation](https://docs.docker.com/engine/reference/commandline/run/) for more options on how to run the image.
0 commit comments