Fix up scale/range validation logic in bokehjs
@@ -49,11 +49,16 @@ export class CartesianFrame extends LayoutCanvas
for name, range of ranges
if range instanceof DataRange1d or range instanceof Range1d
- if not scale instanceof LogScale or not scale instanceof LinearScale
+ if scale not instanceof LogScale and scale not instanceof LinearScale
throw new Error("Range #{range.constructor.name} is incompatible is Scale #{scale.constructor.name}")
+ # special case because CategoricalScale is a subclass of LinearScale, should be removed in future
+ if scale instanceof CategoricalScale
+ throw new Error("Range #{range.constructor.name} is incompatible is Scale #{scale.constructor.name}")
+
if range instanceof FactorRange
- if not scale instanceof CategoricalScale
+ if scale not instanceof CategoricalScale
throw new Error("Range #{range.constructor.name} is incompatible is Scale #{scale.constructor.name}")
+
if scale instanceof LogScale and range instanceof DataRange1d
range.scale_hint = "log"
