From d5aad87c6be23f3e494702d912823c2652e543c9 Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Wed, 14 Feb 2024 12:27:15 -0500 Subject: [PATCH] Raise error on single input to MultiRangeSlider (#367) Ref https://github.com/developmentseed/lonboard/issues/363#issuecomment-1943616456 --- lonboard/controls.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lonboard/controls.py b/lonboard/controls.py index ab760118..bec97922 100644 --- a/lonboard/controls.py +++ b/lonboard/controls.py @@ -64,6 +64,13 @@ class MultiRangeSlider(VBox): value = TypedTuple(trait=TypedTuple(trait=traitlets.Float())).tag(sync=True) def __init__(self, children: Sequence[FloatRangeSlider], **kwargs): + if len(children) == 1: + raise ValueError( + "Expected more than one slider. " + "For filtering data from a single column, " + "use a FloatRangeSlider directly." + ) + # We manage a list of lists to match what deck.gl expects for the # DataFilterExtension def callback(change, *, i: int):