|
1 |
| -# standard Dash imports |
2 | 1 | import dash
|
3 |
| -from dash import html |
4 |
| -from dash import dcc |
| 2 | + |
| 3 | +# create our crystal structure using pymatgen |
| 4 | +from pymatgen.core.lattice import Lattice |
| 5 | +from pymatgen.core.structure import Structure |
5 | 6 |
|
6 | 7 | # standard Crystal Toolkit import
|
7 | 8 | import crystal_toolkit.components as ctc
|
| 9 | +from crystal_toolkit.helpers.layouts import H1, Container |
8 | 10 | from crystal_toolkit.settings import SETTINGS
|
9 |
| -from crystal_toolkit.helpers.layouts import H1, H2, Container |
10 |
| - |
11 |
| -# import for this example |
12 |
| -from pymatgen.core.structure import Structure |
13 |
| -from pymatgen.core.lattice import Lattice |
14 |
| -from pymatgen.ext.matproj import MPRester |
15 |
| -from pymatgen.analysis.phase_diagram import PhaseDiagram |
16 |
| -from pymatgen.analysis.diffraction.xrd import XRDCalculator |
17 | 11 |
|
18 | 12 | # create Dash app as normal
|
19 | 13 | app = dash.Dash(assets_folder=SETTINGS.ASSETS_PATH)
|
20 | 14 |
|
21 |
| -# create our crystal structure using pymatgen |
22 |
| -from pymatgen.core.structure import Structure |
23 |
| -from pymatgen.core.lattice import Lattice |
24 |
| - |
25 | 15 | structure = Structure(Lattice.cubic(4.2), ["Na", "K"], [[0, 0, 0], [0.5, 0.5, 0.5]])
|
26 | 16 |
|
27 | 17 | xrd_component = ctc.XRayDiffractionComponent()
|
28 | 18 |
|
29 | 19 | # example layout to demonstrate capabilities of component
|
30 | 20 | my_layout = Container(
|
31 |
| - [H1("XRDComponent Example (Empty, No Structure Defined)"), xrd_component.layout(),] |
| 21 | + [H1("XRDComponent Example (Empty, No Structure Defined)"), xrd_component.layout()] |
32 | 22 | )
|
33 | 23 |
|
34 | 24 | # as explained in "preamble" section in documentation
|
|
0 commit comments