@@ -148,40 +148,38 @@ class NucDivPlot(View):
148
148
@param.depends (" window_size" )
149
149
def __panel__ (self ):
150
150
windows = make_windows(self .window_size, self .datastore.tsm.ts.sequence_length)
151
- data = pd.DataFrame(self .datastore.tsm.ts.diversity(windows = windows))
151
+ data = pd.DataFrame(self .datastore.tsm.ts.diversity(windows = windows))
152
152
data.columns = [" pi" ]
153
153
return pn.panel(data.hvplot.line(y = " pi" ))
154
154
155
155
def sidebar (self ):
156
156
return pn.Card(
157
- self .param.window_size,
158
- collapsed = True ,
159
- title = " Nucleotide diversity plotting options" ,
157
+ self .param.window_size,
158
+ collapsed = True ,
159
+ title = " Nucleotide diversity plotting options" ,
160
160
header_background = config.SIDEBAR_BACKGROUND ,
161
161
active_header_background = config.SIDEBAR_BACKGROUND ,
162
162
styles = config.VCARD_STYLE ,
163
163
)
164
-
165
164
```
166
165
167
166
Then we modify the ` MyAnalysisPage ` class as follows:
168
167
169
168
``` python
170
-
171
169
class MyAnalysisPage (View ):
172
170
key = " myanalysis"
173
171
title = " My Analysis"
174
- nucdiv = param.ClassSelector(class_ = NucDivPlot)
172
+ nucdiv = param.ClassSelector(class_ = NucDivPlot)
175
173
176
- def __init__ (self , ** kwargs ):
177
- super ().__init__ (** kwargs)
178
- self .nucdiv = NucDivPlot(datastore = self .datastore)
174
+ def __init__ (self , ** kwargs ):
175
+ super ().__init__ (** kwargs)
176
+ self .nucdiv = NucDivPlot(datastore = self .datastore)
179
177
180
178
def __panel__ (self ):
181
179
return pn.Column(self .nucdiv)
182
180
183
- def sidebar (self ):
184
- return pn.Column(self .nucdiv.sidebar)
181
+ def sidebar (self ):
182
+ return pn.Column(self .nucdiv.sidebar)
185
183
```
186
184
187
185
Reload the app and hopefully you will see an added plot and sidebar.
0 commit comments