Expose metrics to JS (#4654)
This commit is contained in:
parent
1ef856e57a
commit
ab7ba20009
|
|
@ -22,6 +22,10 @@ export default function sandboxedEval(code, context, opts) {
|
|||
Object.keys(sandboxContext).forEach(function (key) {
|
||||
sandbox[key] = sandboxContext[key];
|
||||
});
|
||||
vm.runInNewContext(codeToEval, sandbox, opts);
|
||||
return sandbox[resultKey];
|
||||
try {
|
||||
vm.runInNewContext(codeToEval, sandbox, opts);
|
||||
return sandbox[resultKey];
|
||||
} catch (error) {
|
||||
return () => error;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2048,6 +2048,7 @@ class DeckScatterViz(BaseDeckGLViz):
|
|||
|
||||
def get_properties(self, d):
|
||||
return {
|
||||
'metric': d.get(self.metric),
|
||||
'radius': self.fixed_value if self.fixed_value else d.get(self.metric),
|
||||
'cat_color': d.get(self.dim) if self.dim else None,
|
||||
'position': d.get('spatial'),
|
||||
|
|
|
|||
Loading…
Reference in New Issue