11# chartlets
22
3- ` chartlets ` is a Python framework for server-configured web-UI contributions.
3+ Chartlets is a software framework that allows websites developed with
4+ React to be extended by server-side widgets programmed in Python or other
5+ programming languages.
6+
7+ This is the Python backend library of the framework.
8+
9+ For details refer to the [ documentation] ( https://bcdev.github.io/chartlets/ ) .
410
511## Run demo server
612
@@ -9,62 +15,3 @@ mamba env create
915conda activate chartlets
1016python -m chartlets.demo.server
1117```
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] ( chartlets/demo/contribs/panel.py ) :
21-
22- ``` python
23- from chartlets import Contribution
24-
25-
26- class Panel (Contribution ):
27- """ Panel contribution"""
28-
29- def __init__ (self , name : str , title : str | None = None ):
30- super ().__init__ (name, title = title)
31- ```
32-
33- ### 2. Define the contributions points
34-
35- Define the possible contribution points in your application.
36-
37- As an example, see [ ` server.py ` of the demo] ( chartlets/demo/server.py ) :
38-
39- ``` python
40- from chartlets import Extension
41- from chartlets.demo.contribs import Panel
42-
43- Extension.add_contrib_point(" panels" , Panel)
44- ```
45-
46- ### 3. Load the extensions
47-
48- Load the extensions that augment your application.
49-
50- As an example, see [ ` server.py ` of the demo] ( chartlets/demo/server.py ) :
51-
52- ``` python
53- from chartlets import ExtensionContext
54-
55- ext_ctx = ExtensionContext.load(app_ctx, extension_refs)
56- ```
57-
58- ### 4. Publish the extensions
59-
60- Implement the Chartlets API in your application-specific webserver using
61- the controller implementations in ` chartlets.controllers ` .
62-
63- As an example, see [ ` server.py ` of the demo] ( chartlets/demo/server.py ) .
64-
65- ### 5. Consume the extensions
66-
67- Use JavaScript package ` chartlets ` in your frontend to implement the
68- contribution lifecycle in your React application.
69-
70- As an example, see [ the demo application] ( ../chartlets/src/demo ) .
0 commit comments