瀏覽代碼

Docs

master
Pete Shadbolt 7 年之前
父節點
當前提交
72d6e82d4d
共有 1 個文件被更改,包括 8 次插入8 次删除
  1. +8
    -8
      templates/doc.md

+ 8
- 8
templates/doc.md 查看文件

@@ -15,25 +15,25 @@ Arbitrary 3D structures can be constructed by rotating the grid.
The URL contains a unique ID such as `oranges-arkansas-mexico-fish`. You can share this URL with other people to share your screen and edit collaboratively.

## 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/).
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/). You can install it like this:

:::bash
pip install abp


## API

Here's a complete example of sending a state from Python to the server:

:::python
import requests, json, abp
import abp
# Make a new graph and position the nodes
# Make a new graph and automatically position the nodes
g = abp.NXGraphState(range(10))
g.layout()
# Serialize
data = json.dumps(test_graph().to_json())
# Post to the server
URL = "https://abv.peteshadbolt.co.uk/oranges-arkansas-mexico-fish"
requests.post("{}/graph".format(URL), data=data)
g.push()

### Endpoints



Loading…
取消
儲存