Skip to content

Commit

Permalink
Raise error on single input to MultiRangeSlider (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron authored Feb 14, 2024
1 parent ce77af4 commit d5aad87
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lonboard/controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit d5aad87

Please sign in to comment.