@@ -104,6 +104,8 @@ def _get_local_order_parameters(structure_graph, n):
104
104
105
105
106
106
class LocalEnvironmentPanel (PanelComponent ):
107
+ """A panel to analyze the local chemical environments in a crystal."""
108
+
107
109
def __init__ (self , * args , ** kwargs ) -> None :
108
110
super ().__init__ (* args , ** kwargs )
109
111
self .create_store ("graph" )
@@ -114,17 +116,21 @@ def __init__(self, *args, **kwargs) -> None:
114
116
115
117
@property
116
118
def title (self ) -> str :
119
+ """Title of the panel."""
117
120
return "Local Environments"
118
121
119
122
@property
120
123
def description (self ) -> str :
124
+ """Description of the panel."""
121
125
return "Analyze the local chemical environments in your crystal."
122
126
123
127
@property
124
128
def loading_text (self ):
129
+ """Text to display while loading."""
125
130
return "Analyzing environments"
126
131
127
132
def contents_layout (self ) -> html .Div :
133
+ """HTML layout of the panel contents."""
128
134
algorithm_choices = self .get_choice_input (
129
135
label = "Analysis method" ,
130
136
kwarg_label = "algorithm" ,
@@ -145,6 +151,7 @@ def contents_layout(self) -> html.Div:
145
151
146
152
@staticmethod
147
153
def get_graph_data (graph , display_options ):
154
+ """Get the data for the graph visualization."""
148
155
color_scheme = display_options .get ("color_scheme" , "Jmol" )
149
156
150
157
nodes = []
@@ -197,6 +204,7 @@ def get_graph_data(graph, display_options):
197
204
return {"nodes" : nodes , "edges" : edges }
198
205
199
206
def generate_callbacks (self , app , cache ):
207
+ """Generate the callbacks for the panel interactions."""
200
208
super ().generate_callbacks (app , cache )
201
209
202
210
@app .callback (
0 commit comments