dzs commited on
Commit
54ab346
·
1 Parent(s): e743fc5

removed calculate on initial load

Browse files
Files changed (2) hide show
  1. main.py +1 -1
  2. main_layout.py +24 -0
main.py CHANGED
@@ -105,8 +105,8 @@ def toggle_condition2_inputs(mode):
105
  State("c2_temp", "value"),
106
  State("c2_time", "value"),
107
  State("c2_iterations", "value"),
108
- #prevent_initial_call=True,
109
  State("samples", "value"),
 
110
  )
111
 
112
  def update_chart(n_clicks,
 
105
  State("c2_temp", "value"),
106
  State("c2_time", "value"),
107
  State("c2_iterations", "value"),
 
108
  State("samples", "value"),
109
+ prevent_initial_call=True,
110
  )
111
 
112
  def update_chart(n_clicks,
main_layout.py CHANGED
@@ -1,8 +1,31 @@
1
  from dash import html, dcc
2
  import dash_bootstrap_components as dbc
3
  from data.functions import *
 
4
 
5
  def build_main_layout() -> html.Div:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  return html.Div(
7
  style={
8
  "fontFamily": "Arial, Helvetica, sans-serif",
@@ -464,6 +487,7 @@ def build_main_layout() -> html.Div:
464
  ),
465
  children=dcc.Graph(
466
  id="mm0_chart",
 
467
  config={"displayModeBar": False},
468
  # Graph fills the 600x800 parent
469
  style={
 
1
  from dash import html, dcc
2
  import dash_bootstrap_components as dbc
3
  from data.functions import *
4
+ from figure import build_figure
5
 
6
  def build_main_layout() -> html.Div:
7
+ n = len(soluteData)
8
+ df0 = pd.DataFrame({
9
+ "CASRN": soluteData["CASRN"].to_numpy(),
10
+ "Condition 1": np.zeros(n),
11
+ "Cond1_err_plus": np.zeros(n),
12
+ "Cond1_err_minus": np.zeros(n),
13
+ "Condition 2": np.zeros(n),
14
+ "Cond2_err_plus": np.zeros(n),
15
+ "Cond2_err_minus": np.zeros(n),
16
+ })
17
+ placeholder_fig = build_figure(df0)
18
+ placeholder_fig.update_yaxes(range=[-2, 0])
19
+ placeholder_fig.add_annotation(
20
+ text="Click 'Calculate' to run model",
21
+ xref="paper",
22
+ yref="paper",
23
+ x=0.5,
24
+ y=0.5,
25
+ showarrow=False,
26
+ font=dict(size=22, color="gray"),
27
+ align="center",
28
+ )
29
  return html.Div(
30
  style={
31
  "fontFamily": "Arial, Helvetica, sans-serif",
 
487
  ),
488
  children=dcc.Graph(
489
  id="mm0_chart",
490
+ figure=placeholder_fig,
491
  config={"displayModeBar": False},
492
  # Graph fills the 600x800 parent
493
  style={