File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ PeriodicContext is a top-level that provides a model for the periodic table that
26
26
PeriodicFilter allows you to use filter some elements on table, by groups/periods/properties.
27
27
It updates the PeriodicContext, which in turn is mirrored on the table.
28
28
```
29
- //TODO
29
+ //TODO example file
30
30
```
31
31
32
32
#3D Scene
@@ -52,7 +52,7 @@ The JSON of the object will be passed as an argument
52
52
53
53
## CameraContext
54
54
55
- Camera context allows you to wire the camera of multiple SimpleScenes together.
55
+ Camera context allows you to wire the camera of multiple SimpleScenes together. See ` scene_usage.py `
56
56
57
57
```
58
58
dash_mp_components.CameraContext(children=[
@@ -87,12 +87,15 @@ dash_mp_components.CameraContext(children=[
87
87
88
88
## SearchGrid
89
89
90
- This is the whole search interface, wrapped in a React component. Everything happens in the frontend.
90
+ This is the whole search interface, wrapped in a React component. From a dash point of view, this
91
+ component is opaque. Everything happens in the frontend.
91
92
92
- ## MatSearchGrid / MatPrintViewContext / MAtMaterialsTable
93
+ ## MatSearchGrid / MatPrintViewContext / MatMaterialsTable
93
94
94
95
This is the same interface. The search funnel and the result table are decoupled. The REST call
95
- happens in dash. See usage.py for more details
96
+ happens in dash. See ` usage.py ` . The whole search is implemented there
97
+
98
+ See ` search_usage.py ` for a very simple example of a card
96
99
97
100
```
98
101
dash_mp_components.MatPrintViewContext(children=[
Original file line number Diff line number Diff line change 7
7
import functools
8
8
from dash .exceptions import PreventUpdate
9
9
from pymatgen import MPRester
10
+ import os
11
+
12
+ try :
13
+ os .environ ["MP_API_KEY" ]
14
+ except KeyError :
15
+ print ("Please set the environment variable MP_API_KEY" )
16
+ sys .exit (1 )
10
17
11
18
app = dash .Dash (__name__ )
12
19
@@ -99,7 +106,7 @@ def display_output2(c):
99
106
]
100
107
101
108
# This should be setted as an env variable instead
102
- with MPRester ("fJcpJy6hRNF3DzBo" ) as m :
109
+ with MPRester (os . environ [ "MP_API_KEY" ] ) as m :
103
110
q = m .query (criteria = query , properties = properties )
104
111
105
112
#print('RESULT', len(q))
You can’t perform that action at this time.
0 commit comments