Commit 5886ef4d authored by Marius Isken's avatar Marius Isken
Browse files

using on_session_created

parent 25624374
......@@ -203,7 +203,29 @@ class BaraddurBokehHandler(BokehHandler):
self.model = config.model
self.nmodels = 0
self.source = ColumnDataSource()
def on_session_created(self, doc):
doc.source = ColumnDataSource()
doc.model = self.model
doc.nmodels = 0
def update_source(self, func):
new_nmodels, new_data = func(
skip_nmodels=self.nmodels,
keys=self.source.data.keys())
self.source.stream(new_data)
self.nmodels += new_nmodels
@gen.coroutine
def update_models(self):
return self.update_source(self.model.get_models)
@gen.coroutine
def update_misfits(self):
return self.update_source(self.model.get_misfits)
doc.update_source = update_source
doc.update_models = update_models
doc.update_misfits = update_misfits
def update_source(self, func):
new_nmodels, new_data = func(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment