Skip to content

Commit b56f413

Browse files
committed
set Dash(assets_folder=SETTINGS.ASSETS_PATH) in all example apps
1 parent 66db562 commit b56f413

7 files changed

+15
-7
lines changed

crystal_toolkit/apps/examples/basic_hello_structure.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
from pymatgen.core.structure import Structure
66

77
import crystal_toolkit.components as ctc
8+
from crystal_toolkit.settings import SETTINGS
89

9-
app = dash.Dash()
10+
app = dash.Dash(assets_folder=SETTINGS.ASSETS_PATH)
1011

1112
# create our crystal structure using pymatgen
1213
structure = Structure(Lattice.cubic(4.2), ["Na", "K"], [[0, 0, 0], [0.5, 0.5, 0.5]])

crystal_toolkit/apps/examples/basic_hello_world.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import dash
22
from dash import html
33

4+
from crystal_toolkit.settings import SETTINGS
5+
46
# create Dash app as normal
5-
app = dash.Dash()
7+
app = dash.Dash(assets_folder=SETTINGS.ASSETS_PATH)
68

79
# create your layout
810
app.layout = html.Span(["Hello scientist!"])

crystal_toolkit/apps/examples/phase_diagram.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
from pymatgen.ext.matproj import MPRester
55

66
import crystal_toolkit.components as ctc
7+
from crystal_toolkit.settings import SETTINGS
78

8-
app = dash.Dash()
9+
app = dash.Dash(assets_folder=SETTINGS.ASSETS_PATH)
910

1011
# If callbacks created dynamically they cannot be statically checked at app startup.
1112
# For this simple example this is not a problem, but if creating a complicated,

crystal_toolkit/apps/examples/structure_magnetic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
from pymatgen.core.structure import Structure
55

66
import crystal_toolkit.components as ctc
7+
from crystal_toolkit.settings import SETTINGS
78

8-
app = dash.Dash()
9+
app = dash.Dash(assets_folder=SETTINGS.ASSETS_PATH)
910

1011
# create the Structure object
1112
structure = Structure(

crystal_toolkit/apps/examples/transformations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
from pymatgen.ext.matproj import MPRester
88

99
import crystal_toolkit.components as ctc
10+
from crystal_toolkit.settings import SETTINGS
1011

11-
app = dash.Dash()
12+
app = dash.Dash(assets_folder=SETTINGS.ASSETS_PATH)
1213

1314
# create the Structure object
1415
structure = Structure(Lattice.cubic(4.2), ["Na", "K"], [[0, 0, 0], [0.5, 0.5, 0.5]])

crystal_toolkit/apps/examples/transformations_minimal.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
from pymatgen.ext.matproj import MPRester
88

99
import crystal_toolkit.components as ctc
10+
from crystal_toolkit.settings import SETTINGS
1011

11-
app = dash.Dash()
12+
app = dash.Dash(assets_folder=SETTINGS.ASSETS_PATH)
1213

1314
# create the Structure object
1415
structure = Structure(Lattice.cubic(4.2), ["Na", "K"], [[0, 0, 0], [0.5, 0.5, 0.5]])

crystal_toolkit/apps/examples/write_structure_screenshot_to_file.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
1212

1313
import crystal_toolkit.components as ctc
14+
from crystal_toolkit.settings import SETTINGS
1415

1516
SCREENSHOT_PATH = Path.home() / "screenshots"
1617

17-
app = dash.Dash()
18+
app = dash.Dash(assets_folder=SETTINGS.ASSETS_PATH)
1819
server = app.server
1920

2021
structure_component = ctc.StructureMoleculeComponent(

0 commit comments

Comments
 (0)