MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / slider

Function slider

pywebio/input.py:655–675  ·  view source on GitHub ↗

r"""Range input. :param int/float value: The initial value of the slider. :param int/float min_value: The minimum permitted value. :param int/float max_value: The maximum permitted value. :param int step: The stepping interval. Only available when ``value``, ``min_value`` and

(label: str = '', *, name: str = None, value: Union[int, float] = 0, min_value: Union[int, float] = 0,
           max_value: Union[int, float] = 100, step: int = 1, validate: Callable[[Any], Optional[str]] = None,
           onchange: Callable[[Any], None] = None, required: bool = None, help_text: str = None, **other_html_attrs)

Source from the content-addressed store, hash-verified

653
654
655def slider(label: str = '', *, name: str = None, value: Union[int, float] = 0, min_value: Union[int, float] = 0,
656 max_value: Union[int, float] = 100, step: int = 1, validate: Callable[[Any], Optional[str]] = None,
657 onchange: Callable[[Any], None] = None, required: bool = None, help_text: str = None, **other_html_attrs):
658 r"""Range input.
659
660 :param int/float value: The initial value of the slider.
661 :param int/float min_value: The minimum permitted value.
662 :param int/float max_value: The maximum permitted value.
663 :param int step: The stepping interval.
664 Only available when ``value``, ``min_value`` and ``max_value`` are all integer.
665 :param - label, name, validate, onchange, required, help_text, other_html_attrs: Those arguments have the same meaning as for `input()`
666 :return int/float: If one of ``value``, ``min_value`` and ``max_value`` is float,
667 the return value is a float, otherwise an int is returned.
668 """
669 item_spec, valid_func, onchange_func = _parse_args(locals())
670 item_spec['type'] = 'slider'
671 item_spec['float'] = any(isinstance(i, float) for i in (value, min_value, max_value))
672 if item_spec['float']:
673 item_spec['step'] = 'any'
674
675 return single_input(item_spec, valid_func, lambda d: d, onchange_func)
676
677
678def input_group(label: str = '', inputs: List = None, validate: Callable[[Dict], Optional[Tuple[str, str]]] = None,

Callers 1

put_sliderFunction · 0.90

Calls 2

_parse_argsFunction · 0.85
single_inputFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…