@@ -32,7 +32,11 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
32
32
# GUI setup
33
33
# -----------------------------------------------------------------------------
34
34
35
- app = dash .Dash (__name__ , external_stylesheets = [dbc .themes .BOOTSTRAP ], suppress_callback_exceptions = True )
35
+ app = dash .Dash (
36
+ __name__ ,
37
+ external_stylesheets = [dbc .themes .BOOTSTRAP ],
38
+ suppress_callback_exceptions = True ,
39
+ )
36
40
server = app .server
37
41
38
42
# -----------------------------------------------------------------------------
@@ -53,7 +57,7 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
53
57
colorDataRange = [0 , 100 ],
54
58
actor = {"visibility" : 1 },
55
59
mapper = {"scalarVisibility" : False },
56
- children = [dash_vtk .Mesh (id = f"{ part_name } -mesh" , state = mesh , )],
60
+ children = [dash_vtk .Mesh (id = f"{ part_name } -mesh" , state = mesh )],
57
61
# children=[dash_vtk.Mesh(id=f"{part_name}-mesh")],
58
62
)
59
63
vehicle_vtk .append (child )
@@ -74,7 +78,7 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
74
78
id = f"{ surf_name } -rep" ,
75
79
property = {"color" : [1 , 0 , 0 ]},
76
80
actor = {"visibility" : 0 },
77
- children = [dash_vtk .Mesh (id = f"{ surf_name } -mesh" , state = mesh , )],
81
+ children = [dash_vtk .Mesh (id = f"{ surf_name } -mesh" , state = mesh )],
78
82
# children=[dash_vtk.Mesh(id=f"{surf_name}-mesh")],
79
83
)
80
84
@@ -111,7 +115,7 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
111
115
],
112
116
labelStyle = {"display" : "block" },
113
117
value = ["body" , "drive-train" , "front-wing" , "rear-wing" ],
114
- ),
118
+ )
115
119
]
116
120
),
117
121
]
@@ -130,7 +134,7 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
130
134
{"label" : "p" , "value" : "p" },
131
135
],
132
136
value = "solid" ,
133
- ),
137
+ )
134
138
]
135
139
),
136
140
]
@@ -146,7 +150,7 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
146
150
options = [{"label" : " Cp" , "value" : "cp" }],
147
151
labelStyle = {"display" : "block" },
148
152
value = [],
149
- ),
153
+ )
150
154
]
151
155
),
152
156
]
@@ -172,14 +176,16 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
172
176
dbc .Spinner (
173
177
html .Div (
174
178
id = "vtk-view-container" ,
175
- style = {"height" : "calc(100vh - 230px)" , "width" : "100%" }
179
+ style = {
180
+ "height" : "calc(100vh - 230px)" ,
181
+ "width" : "100%" ,
182
+ },
176
183
),
177
- color = ' light'
184
+ color = " light" ,
178
185
),
179
- style = {' background-color' : ' #334c66' }
186
+ style = {" background-color" : " #334c66" },
180
187
)
181
188
],
182
-
183
189
),
184
190
],
185
191
style = {"margin-top" : "15px" , "height" : "calc(100vh - 230px)" },
@@ -191,25 +197,16 @@ def _load_vtp(filepath, fieldname=None, point_arrays=[], cell_arrays=[]):
191
197
# This Handle controls
192
198
# -----------------------------------------------------------------------------
193
199
194
- COLOR_RANGES = {
195
- "solid" : [0 , 1 ],
196
- "U" : [0 , 100 ],
197
- "p" : [- 4464 , 1700 ],
198
- }
199
-
200
+ COLOR_RANGES = {"solid" : [0 , 1 ], "U" : [0 , 100 ], "p" : [- 4464 , 1700 ]}
200
201
201
202
202
- @app .callback (
203
- Output ('vtk-view-container' , 'children' ),
204
- [Input ('geometry' , 'value' )]
205
- )
203
+ @app .callback (Output ("vtk-view-container" , "children" ), [Input ("geometry" , "value" )])
206
204
def initial_loading (geometry ):
207
205
triggered = dash .callback_context .triggered
208
206
if triggered :
209
207
return dash .no_update
210
-
211
- return dash_vtk .View (id = "vtk-view" , children = vehicle_vtk + isosurfs_vtk )
212
208
209
+ return dash_vtk .View (id = "vtk-view" , children = vehicle_vtk + isosurfs_vtk )
213
210
214
211
215
212
@app .callback (
@@ -223,7 +220,7 @@ def initial_loading(geometry):
223
220
Input ("isosurfaces" , "value" ),
224
221
Input ("surfcolor" , "value" ),
225
222
],
226
- prevent_initial_call = True
223
+ prevent_initial_call = True ,
227
224
)
228
225
def update_scene (geometry , isosurfaces , surfcolor ):
229
226
triggered = dash .callback_context .triggered
0 commit comments