This repository contains examples of how to build application functionalities in the NOVA framework.
- Creating a form for a Pydantic model
Validation
- Using Pydantic to add options to a form field
Computed Fields
- Create a JSON editor for a Pydantic model
Monaco EditorValidation
- Conditionally rendering elements
Conditions
- Conditionally disabling elements
Conditions
- Disabling an element when the user interface has errors
ConditionsValidation
- Creating a dialog
Modals
- Creating a navigation drawer
Modals
- Changing Pydantic rules based on user input
Validation
- Complex Pydantic rules
Computed FieldsValidation
- Selecting datafiles from the server
Remote Data
- Downloading files to the user's computer
Remote Data
- Running a Galaxy tool
GalaxyAsynchronous
- Running a Galaxy workflow
GalaxyAsynchronous
- Working with Plotly
VisualizationPlotting
- Working with Matplotlib
VisualizationPlotting
- Working with VTK
VisualizationAdvanced Graphics
- Synchronizing changes between tabs
Events
We also provide examples that take advantage of ORNL resources:
- Selecting datafiles from the Analysis Cluster
Remote Data
- Selecting datafiles from ONCat
Remote DataONCat
If you want to run the examples, then you will need to install Pixi. Once done, run the following to run an example.
pixi install
pixi run python -m examples.{example_folder}This repo includes an automated test to ensure that each example runs:
pixi run pytestYou can set the environment variable INCLUDE_ORNL_TESTS=1 if you want to test the examples that rely on specific ORNL resources. Note that you will need to run them from a location that has access to these resources.
We use the MVVM framework for NOVA applications. With this in mind, each example is broken down into the following sections:
- view - Sets up a Trame GUI for the example.
- model - Sets up a Pydantic model and any business logic needed by the application.
- view_model - Sets up a view model that binds the model and view.
- main.py - Entrypoint for the Trame GUI.