Use 'panel.side in' not panel.side?
@@ -88,7 +88,7 @@ export class LegendView extends AnnotationView
y = (v_range.end + v_range.start)/2 + legend_height/2
else if isArray(location) and location.length == 2
[x, y] = location # left, bottom wrt panel
- if panel.side?
+ if panel.side in ["left", "right", "above", "below"]
x += h_range.start
y += v_range.end
else
