|
8 | 8 | from dash.exceptions import PreventUpdate
|
9 | 9 | from pymatgen import MPRester
|
10 | 10 |
|
11 |
| -# |
12 |
| - |
13 | 11 | app = dash.Dash(__name__)
|
14 | 12 |
|
15 | 13 | app.layout = html.Div(children=[
|
16 |
| - # dash_mp_components.Search( |
17 |
| - # id='test3', allDefinitions=grid, initCards=['has_properties']), |
18 |
| - # dash_mp_components.SearchGrid(id='test'), |
19 |
| - # dash_mp_components.MatSidebar(id='bar', layout='horizontal'), |
20 | 14 | dash_mp_components.MatPrintViewContext(children=[
|
21 | 15 | dash_mp_components.MatSearchGrid(id='search-table'),
|
22 | 16 | dcc.Loading(
|
23 | 17 | [dash_mp_components.MatMaterialsTable(id='mat-result-table')]),
|
24 | 18 | ])
|
25 | 19 | ])
|
26 | 20 |
|
| 21 | +# make a dedicated example |
| 22 | +# dash_mp_components.Search( |
| 23 | +# id='test3', allDefinitions=grid, initCards=['has_properties']), |
| 24 | +# dash_mp_components.SearchGrid(id='test'), |
| 25 | +# dash_mp_components.MatSidebar(id='bar', layout='horizontal'), |
| 26 | + |
27 | 27 |
|
28 | 28 | @app.callback(
|
29 | 29 | Output(component_id='mat-result-table', component_property='data'),
|
@@ -112,50 +112,6 @@ def display_output2(c):
|
112 | 112 | return q
|
113 | 113 |
|
114 | 114 |
|
115 |
| -# @app.callback([Output(component_id='p2', component_property='children')], |
116 |
| -# [Input(component_id='bar', component_property='appId')]) |
117 |
| -# def display_output2(value): |
118 |
| -# print(value) |
119 |
| -# if value is None: |
120 |
| -# return [''] |
121 |
| -# return [value] |
122 |
| - |
123 |
| -# |
124 |
| -# @app.callback([Output(component_id='p', component_property='children')], |
125 |
| -# [Input(component_id='context', component_property='state')]) |
126 |
| -# def display_output2(value): |
127 |
| -# print(value) |
128 |
| -# if value is None: |
129 |
| -# return [''] |
130 |
| -# return [value['enabledElements']] |
131 |
| -# |
132 |
| -# |
133 |
| -# @app.callback([ |
134 |
| -# Output(component_id='context', component_property='disabledElements'), |
135 |
| -# Output(component_id='context', component_property='enabledElements') |
136 |
| -# ], [Input('RR', 'value')]) |
137 |
| -# def display_output(value): |
138 |
| -# return [], [value] |
139 |
| -# |
140 |
| -# |
141 |
| -# @app.callback( |
142 |
| -# Output(component_id='context', component_property='forceTableLayout'), |
143 |
| -# [Input('RR', 'value')]) |
144 |
| -# def display_output(value): |
145 |
| -# if value == 'K': |
146 |
| -# return 'small' |
147 |
| -# if value == 'Cl': |
148 |
| -# return 'compact' |
149 |
| -# if value == 'Na': |
150 |
| -# return 'spaced' |
151 |
| - |
152 |
| -# |
153 |
| -# @app.callback( |
154 |
| -# Output(component_id='selected-object', component_property='children'), |
155 |
| -# [Input('3d-2', 'selectedObject')]) |
156 |
| -# def display_selectedObject(value): |
157 |
| -# return f'Type {value} color {value}' |
158 |
| - |
159 | 115 | # use True to load a dev build of react
|
160 | 116 | if __name__ == '__main__':
|
161 | 117 | app.run_server(debug=True)
|
0 commit comments