Skip to content

Commit eb24646

Browse files
committed
strip apps/examples/basic_hello_world.py down to essentials
1 parent e18214e commit eb24646

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

crystal_toolkit/apps/examples/basic_hello_structure_interactive.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# as above
21
import dash
32
from dash import html
43

@@ -9,9 +8,8 @@
98

109
import crystal_toolkit.components as ctc
1110

12-
app = dash.Dash(
13-
prevent_initial_callbacks=True, # don't run callbacks on page load
14-
)
11+
# don't run callbacks on page load
12+
app = dash.Dash(prevent_initial_callbacks=True)
1513

1614
# now we give a list of structures to pick from
1715
structures = [
@@ -41,6 +39,5 @@ def update_structure(n_clicks):
4139
return structures[n_clicks % 2]
4240

4341

44-
# as above
4542
if __name__ == "__main__":
4643
app.run_server(debug=True, port=8050)

crystal_toolkit/apps/examples/basic_hello_world.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
import dash
22
from dash import html
33

4-
# standard Crystal Toolkit import
5-
import crystal_toolkit.components as ctc
6-
74
# create Dash app as normal
85
app = dash.Dash()
96

107
# create your layout
11-
my_layout = html.Div(["Hello scientist!"])
12-
13-
# tell Crystal Toolkit about the app and layout we want to display
14-
ctc.register_crystal_toolkit(app=app, layout=my_layout, cache=None)
8+
app.layout = html.Span(["Hello scientist!"])
159

1610
# allow app to be run using "python app.py"
1711
# in production, deploy behind gunicorn or similar

0 commit comments

Comments
 (0)