Skip to content

Commit 2313e22

Browse files
committed
Added usage doc
1 parent 7a7c28b commit 2313e22

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

dashipy/README.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,53 @@
11
# dashi
22

3-
Dashi is a demo for server-configured panels using Plotly + Tornado.
3+
Dashi is a framework for server-configured panels.
44

5-
### Run server
5+
## Run demo server
66

77
``` bash
88
mamba env create
99
conda activate dashi
1010
python -m dashipy.server
1111
```
12+
13+
## How to use the framework
14+
15+
### 1. Implement the possible contributions
16+
17+
Implement the application-specific contributions that users
18+
can add to their extensions.
19+
20+
As an example, see [`panel.py` of the demo](dashipy/demo/contribs/panel.py).
21+
22+
### 2. Define the contributions points
23+
24+
Define the possible contribution points in your application.
25+
26+
As an example, see [`server.py` of the demo](dashipy/demo/server.py):
27+
28+
```python
29+
from dashipy import Extension
30+
from dashipy.demo.contribs import Panel
31+
32+
Extension.add_contrib_point("panels", Panel)
33+
```
34+
35+
### 3. Load the extensions
36+
37+
Load the extensions that augment your application.
38+
39+
As an example, see [`server.py` of the demo](dashipy/demo/server.py):
40+
41+
```python
42+
from dashipy import ExtensionContext
43+
44+
ext_ctx = ExtensionContext.load(app_ctx, extension_refs)
45+
```
46+
47+
### 4. Publish the extensions
48+
49+
Implement the Dashi API in your application-specific webserver using
50+
the controller implementations in `dashipy.controllers`.
51+
52+
As an example, see [`server.py` of the demo](dashipy/demo/server.py).
53+

0 commit comments

Comments
 (0)