Use this app to generate interactive visualizations like these for atomic structures and their properties.
- interactive scatter plots via bokeh server
- interactive structure visualization via jsmol
- simple input: provide CIF/XYZ files with structures and CSV file with their properties
- simple deployment on materialscloud.org through Docker containers
- driven by database backend:
git clone https://github.com/materialscloud-org/structure-property-visualizer.git
cd structure-property-visualizer
pip install -e . # install python dependencies
./prepare.sh # download test data (run only once)
export PYTHONPATH="${PYTHONPATH}:/path/to/structure-property-visualizer" # export pythonpath
bokeh serve --show figure detail select-figure # run app
- a set of structures in
data/structures
- Allowed file extensions:
cif
,xyz
- Allowed file extensions:
- a CSV file
data/properties.csv
with their properties- has a column
name
whose value<name>
links each row to a file instructures/<name>.<extension>
.
- has a column
- adapt
import_db.py
accordingly and run it to create the database
The plots can be configured using a few YAML files in figure/static
:
columns.yml
: defines metadata for columns of CSV filefilters.yml
: defines filters available in plotpresets.yml
: defines presets for axis + filter settings
Instead of querying an sqlite database, you can also query an AiiDA database. In order to keep the docker image size manageable, it is best to keep the AiiDA profile outside the image and to
- communicate the docker container how to connect to the AiiDA database
- mount the AiiDA file repository inside the docker container
For the first step you already find a couple of (commented) variables in the Dockerfile
, as well a python function figure.aiida.load_profile
to load an AiiDA profile environment from these variables.
For the second step, modify the docker-compose.yml
to mount the AiiDA file repository instead of the data/
directory.
pip install -e .
./prepare.sh
docker-compose build
docker-compose up
# open http://localhost:3245/select-figure