-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#%% | ||
from __future__ import annotations | ||
|
||
import dash | ||
from dash import html | ||
from pymatgen.core import Lattice, Structure | ||
|
||
import crystal_toolkit | ||
import crystal_toolkit.components as ctc | ||
from crystal_toolkit.settings import SETTINGS | ||
from dash_mp_components import CrystalToolkitScene | ||
from pymatgen.io.vasp import Chgcar | ||
|
||
|
||
app = dash.Dash(assets_folder=SETTINGS.ASSETS_PATH) | ||
|
||
chgcar = Chgcar.from_file("../../../tests/test_files/chgcar.vasp") | ||
scene = chgcar.get_scene(isolvl=0.0001) | ||
|
||
layout = html.Div( | ||
[CrystalToolkitScene(data=scene.to_json())], | ||
style={"width": "100px", "height": "100px"}, | ||
) | ||
#%% | ||
# as explained in "preamble" section in documentation | ||
ctc.register_crystal_toolkit(app=app, layout=layout) | ||
|
||
if __name__ == "__main__": | ||
app.run(debug=True, port=8050) |