panel.layout.swipe module#
The Swipe layout enables you to quickly compare two panels
- class panel.layout.swipe.Swipe(*objects, **params)[source]#
Bases:
ListLike
,ReactiveHTML
The Swipe layout enables you to quickly compare two panels laid out on top of each other with a part of the before panel shown on one side of a slider and a part of the after panel shown on the other side.
- Attributes:
- after
- before
Methods
select
([selector])Iterates over the Viewable and any potential children in the applying the Selector.
Parameter Definitions
Parameters inherited from:
panel.viewable.Layoutable
: align, aspect_ratio, css_classes, design, height, min_width, min_height, max_width, max_height, margin, styles, stylesheets, tags, width, width_policy, height_policy, sizing_mode, visiblepanel.viewable.Viewable
: loadingobjects = List(bounds=(0, 2), default=[], item_type=<class 'panel.viewable.Viewable'>, label='Objects')
The list of child objects that make up the layout.
slider_width = Integer(bounds=(0, 25), default=5, inclusive_bounds=(True, True), label='Slider width')
The width of the slider in pixels
slider_color = Color(allow_named=True, default='black', label='Slider color')
The color of the slider
value = Integer(bounds=(0, 100), default=50, inclusive_bounds=(True, True), label='Value')
The percentage of the after panel to show.
_before = Parameter(allow_None=True, label=' before')
_after = Parameter(allow_None=True, label=' after')
- select(selector=None)[source]#
Iterates over the Viewable and any potential children in the applying the Selector.
- Parameters:
- selector: type or callable or None
The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.
- Returns:
- viewables: list(Viewable)