Skip to content

Commit

Permalink
fix: review comments, removing new defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Lundez committed Aug 26, 2023
1 parent f270d6e commit 65902f3
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions solara/components/slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def SliderInt(
max: int = 10,
step: int = 1,
on_value: Optional[Callable[[int], None]] = None,
thumb_label: Union[bool, Literal["always"], None] = "always",
tick_labels: Union[list, Literal["end_points"], None] = "end_points",
thumb_label: Union[bool, Literal["always"]] = "always",
tick_labels: Union[List[str], Literal["end_points"], bool] = False,
disabled: bool = False,
):
"""Slider for controlling an integer value.
Expand Down Expand Up @@ -55,7 +55,9 @@ def Page():
* `step`: Step size.
* `on_value`: Callback to call when the value changes.
* `thumb_label`: Show a thumb label when sliding (True), always ("always"), or never (False).
* `tick_labels`: Show tick labels by list (list), only end_points ("end_points") or never (None).
* `tick_labels`: Show tick labels corresponding to the values (True),
custom tick labels by passing a list of strings, only end_points ("end_points"),
or no labels at all (False, the default).
* `disabled`: Whether the slider is disabled.
"""
reactive_value = solara.use_reactive(value, on_value)
Expand All @@ -76,7 +78,6 @@ def set_value_cast(value):
max=max,
step=step,
thumb_label=thumb_label,
thumb_size=24,
tick_labels=tick_labels,
dense=False,
hide_details=True,
Expand All @@ -92,8 +93,8 @@ def SliderRangeInt(
max: int = 10,
step: int = 1,
on_value: Callable[[Tuple[int, int]], None] = None,
thumb_label: Union[bool, Literal["always"], None] = "always",
tick_labels: Union[list, Literal["end_points"], None] = "end_points",
thumb_label: Union[bool, Literal["always"]] = "always",
tick_labels: Union[List[str], Literal["end_points"], bool] = False,
disabled: bool = False,
) -> reacton.core.ValueElement[ipyvuetify.RangeSlider, Tuple[int, int]]:
"""Slider for controlling a range of integer values.
Expand Down Expand Up @@ -122,7 +123,9 @@ def Page():
* `step`: Step size.
* `on_value`: Callback to call when the value changes.
* `thumb_label`: Show a thumb label when sliding (True), always ("always"), or never (False).
* `tick_labels`: Show tick labels by list (list), only end_points ("end_points") or never (None).
* `tick_labels`: Show tick labels corresponding to the values (True),
custom tick labels by passing a list of strings, only end_points ("end_points"),
or no labels at all (False, the default).
* `disabled`: Whether the slider is disabled.
"""
reactive_value = solara.use_reactive(value, on_value)
Expand All @@ -146,7 +149,6 @@ def set_value_cast(value):
max=max,
step=step,
thumb_label=thumb_label,
thumb_size=24,
tick_labels=tick_labels,
dense=False,
hide_details=True,
Expand All @@ -163,8 +165,8 @@ def SliderFloat(
max: float = 10.0,
step: float = 0.1,
on_value: Callable[[float], None] = None,
thumb_label: Union[bool, Literal["always"], None] = "always",
tick_labels: Union[list, Literal["end_points"], None] = "end_points",
thumb_label: Union[bool, Literal["always"]] = "always",
tick_labels: Union[List[str], Literal["end_points"], bool] = False,
disabled: bool = False,
):
"""Slider for controlling a float value.
Expand Down Expand Up @@ -193,7 +195,9 @@ def Page():
* `step`: The step size.
* `on_value`: Callback to call when the value changes.
* `thumb_label`: Show a thumb label when sliding (True), always ("always"), or never (False).
* `tick_labels`: Show tick labels by list (list), only end_points ("end_points") or never (None).
* `tick_labels`: Show tick labels corresponding to the values (True),
custom tick labels by passing a list of strings, only end_points ("end_points"),
or no labels at all (False, the default).
* `disabled`: Whether the slider is disabled.
"""
reactive_value = solara.use_reactive(value, on_value)
Expand All @@ -214,7 +218,6 @@ def set_value_cast(value):
max=max,
step=step,
thumb_label=thumb_label,
thumb_size=24,
tick_labels=tick_labels,
dense=False,
hide_details=True,
Expand All @@ -230,8 +233,8 @@ def SliderRangeFloat(
max: float = 10.0,
step: float = 0.1,
on_value: Callable[[Tuple[float, float]], None] = None,
thumb_label: Union[bool, Literal["always"], None] = "always",
tick_labels: Union[list, Literal["end_points"], None] = "end_points",
thumb_label: Union[bool, Literal["always"]] = "always",
tick_labels: Union[List[str], Literal["end_points"], bool] = False,
disabled: bool = False,
) -> reacton.core.ValueElement[ipyvuetify.RangeSlider, Tuple[float, float]]:
"""Slider for controlling a range of float values.
Expand Down Expand Up @@ -260,7 +263,9 @@ def Page():
* `step`: The step size.
* `on_value`: Callback to call when the value changes.
* `thumb_label`: Show a thumb label when sliding (True), always ("always"), or never (False).
* `tick_labels`: Show tick labels by list (list), only end_points ("end_points") or never (None).
* `tick_labels`: Show tick labels corresponding to the values (True),
custom tick labels by passing a list of strings, only end_points ("end_points"),
or no labels at all (False, the default).
* `disabled`: Whether the slider is disabled.
"""
reactive_value = solara.use_reactive(value, on_value)
Expand All @@ -284,7 +289,6 @@ def set_value_cast(value):
max=max,
step=step,
thumb_label=thumb_label,
thumb_size=24,
tick_labels=tick_labels,
dense=False,
hide_details=True,
Expand Down

0 comments on commit 65902f3

Please sign in to comment.