1
1
import dash
2
- import dash_html_components as html
3
2
import numpy as np
4
3
from pymatgen .io .vasp import Chgcar
5
4
from skimage import measure
6
5
7
6
import crystal_toolkit .components as ctc
7
+ import crystal_toolkit .core .scene as cts
8
8
9
9
app = dash .Dash (__name__ )
10
10
@@ -39,11 +39,11 @@ def get_mesh(chgcar, data_tag="total", isolvl=2.0, step_size=3):
39
39
pos = [vert for triangle in vertices [faces ].tolist () for vert in triangle ]
40
40
41
41
add_comp = [
42
- ctc .Scene (
42
+ cts .Scene (
43
43
"test" ,
44
44
contents = [
45
- ctc .Surface (positions = pos ),
46
- ctc .Arrows (positionPairs = [[[0 , 0 , 0 ], [1 , 1 , 1 ]]]),
45
+ cts .Surface (positions = pos ),
46
+ cts .Arrows (positionPairs = [[[0 , 0 , 0 ], [1 , 1 , 1 ]]]),
47
47
],
48
48
)
49
49
]
@@ -57,9 +57,10 @@ def get_mesh(chgcar, data_tag="total", isolvl=2.0, step_size=3):
57
57
58
58
# for a custom-sized component, use `struct_component.struct_layout` and put
59
59
# it inside a Div of the required size
60
- app .layout = html .Div (
60
+ app .layout = dash . html .Div (
61
61
[
62
- ctc .MPComponent .all_app_stores (), # not required in this minimal example, but usually necessary for interactivity
62
+ # not required in this minimal example but usually necessary for interactivity
63
+ ctc .MPComponent .all_app_stores (),
63
64
struct_component .standard_layout ,
64
65
]
65
66
)
0 commit comments