From b9accbc7ac7362ed8b3ab47fc26d880e29de84b9 Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Mon, 16 Oct 2017 23:12:49 -0700 Subject: [PATCH] Now working with sessions --- templates/doc.md | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/templates/doc.md b/templates/doc.md index 2a5add2..ffcbadc 100644 --- a/templates/doc.md +++ b/templates/doc.md @@ -8,21 +8,39 @@ This server does a few things: - Displays a 3D representation of the state - Randomly updates the state every five seconds -## Endpoints +## Using the interface +Sessions are identified by a UUID such as `oranges-arkansas-mexico-fish`. You can share this URL with other people to share your screen and edit collaboratively. -- `/`: Displays the state using Three.js -- `graph/`: +- Click on the grid to make a new node +- Ctrl-click a node to act a Hadamard gate +- Select a node, then shift-click another node to act a CZ gate +- Press space to rotate the grid + +## Python package +The underlying graph state simulator is based on Anders' and Briegel's method. Full docs for the Python package are [here](https://peteshadbolt.co.uk/static/abp/). + + +## API + +We expose an API so that you can programmatically read and write states to/from the server and simulate mouse clicks. + +### Endpoints + +- `/`: Displays the state using Three.js +- `//graph`: - `GET` returns JSON representing the state - `POST` accepts JSON in the same format and overwrites the state in memory +- `//edit`: + - `POST` accepts edit commands such as `cz`, `add_node` etc. - `doc/`: Shows this page -## Data format +### Data format -If you do an HTTPS GET against `/graph`, you will receive some JSON. +If you do an HTTPS GET against `//graph`, you will receive some JSON. :::bash - $ curl https://abv.peteshadbolt.co.uk/graph + $ curl https://abv.peteshadbolt.co.uk//graph outputs @@ -56,7 +74,3 @@ Here's an example of a graph `(A-B C)`: 1: {'position': {'x': 1, 'y': 0, 'z': 0}, 'vop': 0}, 2: {'position': {'x': 2, 'y': 0, 'z': 0}, 'vop': 10}}} -## ABP - -The underlying graph library is based on Anders' and Briegel's method. Full docs for the Python library are [here](https://peteshadbolt.co.uk/static/abp/). -