@@ -8,15 +8,90 @@ the start banner for the plugin. From here each page defined within the applicat
88described by a jupyter notebook (\* .ipynb) file which may call components from the
99core python package.
1010
11- Model-View-Controller Paradigm
11+
12+ Core Requirements
13+ -----------------
14+
15+ Project Meta-Data
16+ ~~~~~~~~~~~~~~~~~
17+
18+ AiiDAlab uses the python style ``setup.cfg `` configuration file to define project meta-data which
19+ it parses and associates with the plugin inside the AiiDAlab interface. This file must be
20+ present within the plugins root directory or within a special ``.aiidalab `` directory under the
21+ project root. Within it all the required meta-data can be specified such as project name, description,
22+ version number etc. More detail on the available and required meta-data inputs can be found
23+ `here <https://aiidalab.readthedocs.io/en/latest/app_development/publish.html >`_ .
24+
25+ Start Banner
26+ ~~~~~~~~~~~~
27+
28+ To be displayed in the core AiiDAlab home interface a plugin must contain a start banner, which can
29+ either be defined in a python file (``start.py ``) or a markdown file (``start.md ``). This is the main
30+ interface from the AiiDAlab home page to your developed plugin so should contain any relevant logos
31+ and navigation buttons for the plugin. The example presented alongside this documentation in the
32+ `github repo <https://github.com/stfc/alc-ux >`_ defines a python based approach with an embedded
33+ HTML element which provides the application logo as a navigation button alongside a selection
34+ of navigation buttons below the logo which all navigate to different components of the underlying
35+ AiiDAlab plugin.
36+
37+
38+ Main Application
39+ ~~~~~~~~~~~~~~~~
40+
41+ The main AiiDAlab plugin application will be written in jupyter notebook files ``.ipynb `` which
42+ can either be self contained or for more complex UI project will reference an underlying python
43+ library associated with the plugin. For the `example plugin <https://github.com/stfc/alc-ux >`_
44+ provided the main application page is defined in ``main.ipynb `` and refers to the ``aiidalab_alc ``
45+ python library which contains all the required UI elements and how they interact with each other
46+ and the user. This library is defined in ``src/aiidalab-alc/ `` and has various components that
47+ each contribute to different aspects of the AiiDAlab plugins UI.
48+
49+
50+ Making Your App Discoverable
51+ ----------------------------
52+
53+ When installing new plugins via the AiiDAlab plugin manager interface, plugins will be installed
54+ and configured into the correct directories to be picked up by the AiiDAlab home page. However,
55+ when developing plugins it is often required to manually manipulate these directories to make
56+ sure your in-development application can be found and displayed by AiiDAlab. By default AiiDAlab
57+ will create an ``apps `` directory within the home space of the container running the jupyter server
58+ instance. This is where all AiiDAlab plugin apps reside and where the home app looks to determine
59+ which plugins are available. The process for AiiDAlab to install an application typically follows
60+ as first checkout a specific release version of the plugin's code from its online host e.g. GitHub
61+ into the ``apps `` folder. Following this it will run a pip install within the root source directory
62+ of the plugin if required to install the required backend python UI package.
63+
64+
65+ General Plugin Design Concepts
1266------------------------------
1367
68+ Model-View-Controller Paradigm
69+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70+
1471It is recommended that an AiiDAlab plugin follows the widely recognised Model-View-Controller
1572design paradigm for UI development.
1673The core UI package will use ``IPywidgets `` (or aiidalab's own pre-configured widgets) to display
17- the various UI components that a user will interact with. This defines the * view * for the application.
18- The data that is being handled should exist seperate to any visual components that are part
19- of the applications *view * layer. They are handled by the ``traitlets `` python packages and can
20- be dynamically linked to user inputs through the *view * layer but should exist indendantly, thus
74+ the various UI components that a user will interact with (described later) . This defines the
75+ * view * for the application. The data that is being handled should exist seperate to any visual
76+ components that are part of the applications *view * layer. They are handled by the ``traitlets ``
77+ python packages and can be dynamically linked to user inputs through the *view * layer but should exist indendantly, thus
2178defining the *model * layer. The controller layer is an optional additional layer that defines user
22- controll over that application that doesn't directly interact with any of the stored data.
79+ controll over that application that doesn't directly interact with any of the stored data.
80+
81+
82+ Widgets
83+ ~~~~~~~
84+
85+ Jupyter notebook based GUI's rely on components called widgets, often (but not exclusively) provided
86+ by a library called `IPywidgets <https://ipywidgets.readthedocs.io/en/stable/ >`_\. These form the core
87+ UI elements that can be used as building blocks to create your application. They provide widgets for
88+ formatting such as vertical/horizontal layout boxes, as well as different forms of input/output or
89+ interaction interfaces, such as text display/input boxes, drop down lists or buttons. These can be
90+ combined to build a complex GUI application.
91+
92+ In addition to the core widgets provided by IPywidgets, AiiDAlab provides several of its own widgets
93+ specifically tailored for interacting with AiiDA components such as data structures and the database
94+ itself. These are provided in the *aiidalab-widgets-base * python package and are documented
95+ `here <https://aiidalab-widgets-base.readthedocs.io/en/latest/ >`_\.
96+
97+
0 commit comments