File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
crystal_toolkit/apps/examples Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ #%%
2+ from __future__ import annotations
3+
4+ import dash
5+ from dash import html
6+ from pymatgen .core import Lattice , Structure
7+
8+ import crystal_toolkit
9+ import crystal_toolkit .components as ctc
10+ from crystal_toolkit .settings import SETTINGS
11+ from dash_mp_components import CrystalToolkitScene
12+ from pymatgen .io .vasp import Chgcar
13+
14+
15+ app = dash .Dash (assets_folder = SETTINGS .ASSETS_PATH )
16+
17+ chgcar = Chgcar .from_file ("../../../tests/test_files/chgcar.vasp" )
18+ scene = chgcar .get_scene (isolvl = 0.0001 )
19+
20+ layout = html .Div (
21+ [CrystalToolkitScene (data = scene .to_json ())],
22+ style = {"width" : "100px" , "height" : "100px" },
23+ )
24+ #%%
25+ # as explained in "preamble" section in documentation
26+ ctc .register_crystal_toolkit (app = app , layout = layout )
27+
28+ if __name__ == "__main__" :
29+ app .run (debug = True , port = 8050 )
You can’t perform that action at this time.
0 commit comments