Writing a Webviz application, built on top of dash, gives a lot of flexibility. However, it also requires Python knowledge from the person setting it up.
This utility reduces the skills necessary to configure a Webviz application.
The workflow can be summarized as this:
- The user provides a configuration file following the yaml standard.
- This utility reads the configuration file and automatically writes the corresponding Webviz Dash code.
- The created application can either be viewed locally, or deployed to a cloud provider. Both out of the box.
Creating custom, specialized elements is possible. See the contribution guide for more details.
The yaml configuration file can either be manually created, or it could be auto-generated by some other tool.
Example configuration file and information about the standard containers can be seen in the documentation.
As dash
is using Python3-only functionality, you should use a Python3 (virtual)
environment before installation. One way of doing this is
PATH_TO_VENV='./my_new_venv'
python3 -m virtualenv $PATH_TO_VENV
source $PATH_TO_VENV/bin/activate
The simplest way of installing webviz-config
is to run
pip install webviz-config
If you want to download the latest source code and install it manually you can run
git clone git@github.com:equinor/webviz-config.git
cd webviz-config
pip install .
To run tests it is necessary to first install selenium chrome driver. Then install dev requirements and run pytest:
pip install .[tests]
pytest tests
Linting can be checked by:
pycodestyle webviz_config tests
End-user documentation (i.e. YAML configuration file) be created after installation by
pip install .[tests]
cd ./docs
python3 build_docs.py
Officially updated built end-user documentation (i.e. information to the person setting up the configuration file) is hosted here on github.
After installation, there is a console script named webviz
available
in $PATH_TO_VENV/bin
. You can test the installation by using the provided test
configuration file,
webviz build ./examples/basic_example.yaml
Without any additional arguments, this will
- create a temporary folder
- write the Webviz Dash application code to that folder
- start the server
- when stopping the server (press CTRL+C at any time), the temporary folder is deleted
The optional arguments can be seen when running
webviz --help
For example will
webviz build ./examples/basic_example.yaml --portable /scratch/my_field/my_webviz
create a portable instance and store it in the provided folder.
A recent feature in dash is hot reload. When the Dash Python code file is saved, the content seen in the web browser is automatically reloaded (no need for server restart). This feature is passed on to Webviz configuration utility, meaning that if the user runs
webviz build ./examples/basic_example.yaml
and then modifies ./examples/basic_example.yaml
while the Webviz application is
still running, a hot reload will occur.
By default webviz-config
uses https
and runs on localhost
.
In order to create your personal https
certificate, run
webviz certificate
Certificate installation guidelines will be given when running the command.
If you are interested in creating new containers which can be configured through the configuration file, take a look at the contribution guide.
This is a tool under heavy development. The current configuration file layout will therefore also see large changes.