diff --git a/doc/how_to/custom_components/examples/table_viewer.md b/doc/how_to/custom_components/examples/table_viewer.md index ddc43b3c07..35c5d27754 100644 --- a/doc/how_to/custom_components/examples/table_viewer.md +++ b/doc/how_to/custom_components/examples/table_viewer.md @@ -17,7 +17,7 @@ This example demonstrates Panel's reactive programming paradigm using the Param ```{pyodide} class ReactiveTables(Viewer): - dataset = param.ObjectSelector(default='iris', objects=['iris', 'autompg', 'population']) + dataset = param.Selector(default='iris', objects=['iris', 'autompg', 'population']) rows = param.Integer(default=10, bounds=(0, 19)) diff --git a/doc/how_to/param/dependencies.md b/doc/how_to/param/dependencies.md index e5e2da966d..c46b4a1d79 100644 --- a/doc/how_to/param/dependencies.md +++ b/doc/how_to/param/dependencies.md @@ -55,9 +55,9 @@ We also define a ``view`` method that returns an HTML iframe displaying the coun ```{pyodide} class GoogleMapViewer(param.Parameterized): - continent = param.ObjectSelector(default='Asia', objects=['Africa', 'Asia', 'Europe']) + continent = param.Selector(default='Asia', objects=['Africa', 'Asia', 'Europe']) - country = param.ObjectSelector(default='China', objects=['China', 'Thailand', 'Japan']) + country = param.Selector(default='China', objects=['China', 'Thailand', 'Japan']) _countries = {'Africa': ['Ghana', 'Togo', 'South Africa', 'Tanzania'], 'Asia' : ['China', 'Thailand', 'Japan'], diff --git a/doc/how_to/param/examples/subobjects.md b/doc/how_to/param/examples/subobjects.md index 3ba4f0c983..e96faf1f73 100644 --- a/doc/how_to/param/examples/subobjects.md +++ b/doc/how_to/param/examples/subobjects.md @@ -82,7 +82,7 @@ Having defined our basic domain model (of shapes in this case), we can now make ```{pyodide} class ShapeViewer(param.Parameterized): - shape = param.ObjectSelector(default=shapes[0], objects=shapes) + shape = param.Selector(default=shapes[0], objects=shapes) @param.depends('shape', 'shape.param') def view(self): diff --git a/doc/how_to/param/subobjects.md b/doc/how_to/param/subobjects.md index 47b6f06afb..e98ffdcf80 100644 --- a/doc/how_to/param/subobjects.md +++ b/doc/how_to/param/subobjects.md @@ -69,7 +69,7 @@ shapes = [NGon(), Circle()] class ShapeViewer(param.Parameterized): - shape = param.ObjectSelector(default=shapes[0], objects=shapes) + shape = param.Selector(default=shapes[0], objects=shapes) @param.depends('shape') def view(self): diff --git a/doc/how_to/param/uis.md b/doc/how_to/param/uis.md index 676094e8ad..05f0b37f21 100644 --- a/doc/how_to/param/uis.md +++ b/doc/how_to/param/uis.md @@ -81,8 +81,8 @@ class Example(BaseClass): date = param.Date(default=dt.datetime(2017, 1, 1), bounds=(dt.datetime(2017, 1, 1), dt.datetime(2017, 2, 1))) dataframe = param.DataFrame(default=pd.DataFrame({'A': [1, 2, 3]})) - select_string = param.ObjectSelector(default="yellow", objects=["red", "yellow", "green"]) - select_fn = param.ObjectSelector(default=list,objects=[list, set, dict]) + select_string = param.Selector(default="yellow", objects=["red", "yellow", "green"]) + select_fn = param.Selector(default=list,objects=[list, set, dict]) int_list = param.ListSelector(default=[3, 5], objects=[1, 3, 5, 7, 9], precedence=0.5) single_file = param.FileSelector(path='../../*/*.py*', precedence=0.5) multiple_files = param.MultiFileSelector(path='../../*/*.py?', precedence=0.5) diff --git a/panel/chat/feed.py b/panel/chat/feed.py index a0924f46e7..da77313ef4 100644 --- a/panel/chat/feed.py +++ b/panel/chat/feed.py @@ -99,7 +99,7 @@ class ChatFeed(ListPanel): the previous message value `contents`, the previous `user` name, and the component `instance`.""") - callback_exception = param.ObjectSelector( + callback_exception = param.Selector( default="summary", objects=["raise", "summary", "verbose", "ignore"], doc=""" How to handle exceptions raised by the callback. If "raise", the exception will be raised. @@ -199,7 +199,7 @@ class ChatFeed(ListPanel): The placeholder wrapped in a ChatMessage object; primarily to prevent recursion error in _update_placeholder.""") - _callback_state = param.ObjectSelector(objects=list(CallbackState), doc=""" + _callback_state = param.Selector(objects=list(CallbackState), doc=""" The current state of the callback.""") _prompt_trigger = param.Event(doc="Triggers the prompt input.") diff --git a/panel/chat/input.py b/panel/chat/input.py index 78f995234b..602941613c 100644 --- a/panel/chat/input.py +++ b/panel/chat/input.py @@ -63,7 +63,7 @@ class ChatAreaInput(_PnTextAreaInput): of rows the input area can grow.""", ) - resizable = param.ObjectSelector( + resizable = param.Selector( default="height", objects=["both", "width", "height", False], doc=""" diff --git a/panel/chat/step.py b/panel/chat/step.py index a7384f13c2..6b93ae4f6a 100644 --- a/panel/chat/step.py +++ b/panel/chat/step.py @@ -43,7 +43,7 @@ class ChatStep(Card): collapsed_on_success = param.Boolean(default=True, doc=""" Whether to collapse the card on completion.""") - context_exception = param.ObjectSelector( + context_exception = param.Selector( default="raise", objects=["raise", "summary", "verbose", "ignore"], doc=""" How to handle exceptions raised upon exiting the context manager. If "raise", the exception will be raised. diff --git a/panel/config.py b/panel/config.py index 4085177094..6c786e76a5 100644 --- a/panel/config.py +++ b/panel/config.py @@ -203,12 +203,12 @@ class _config(_base_config): information about user sessions. A value of -1 indicates an unlimited history.""") - sizing_mode = param.ObjectSelector(default=None, objects=[ + sizing_mode = param.Selector(default=None, objects=[ 'fixed', 'stretch_width', 'stretch_height', 'stretch_both', 'scale_width', 'scale_height', 'scale_both', None], doc=""" Specify the default sizing mode behavior of panels.""") - template = param.ObjectSelector(default=None, doc=""" + template = param.Selector(default=None, doc=""" The default template to render served applications into.""") throttled = param.Boolean(default=False, doc=""" @@ -222,12 +222,12 @@ class _config(_base_config): default='DEBUG', objects=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], doc="Log level of the Admin Panel logger") - _comms = param.ObjectSelector( + _comms = param.Selector( default='default', objects=['default', 'ipywidgets', 'vscode', 'colab'], doc=""" Whether to render output in Jupyter with the default Jupyter extension or use the jupyter_bokeh ipywidget model.""") - _console_output = param.ObjectSelector(default='accumulate', allow_None=True, + _console_output = param.Selector(default='accumulate', allow_None=True, objects=['accumulate', 'replace', 'disable', False], doc=""" How to log errors and stdout output triggered by callbacks @@ -271,7 +271,7 @@ class _config(_base_config): or filepath containing JSON to use with the basic auth provider.""") - _oauth_provider = param.ObjectSelector( + _oauth_provider = param.Selector( default=None, allow_None=True, objects=[], doc=""" Select between a list of authentication providers.""") @@ -310,7 +310,7 @@ class _config(_base_config): Whether to inline JS and CSS resources. If disabled, resources are loaded from CDN if one is available.""") - _theme = param.ObjectSelector(default=None, objects=['default', 'dark'], allow_None=True, doc=""" + _theme = param.Selector(default=None, objects=['default', 'dark'], allow_None=True, doc=""" The theme to apply to components.""") # Global parameters that are shared across all sessions diff --git a/panel/layout/base.py b/panel/layout/base.py index 0c86d1bbab..63f6c96723 100644 --- a/panel/layout/base.py +++ b/panel/layout/base.py @@ -848,7 +848,7 @@ class NamedListPanel(NamedListLike, Panel): active = param.Integer(default=0, bounds=(0, None), doc=""" Index of the currently displayed objects.""") - scroll = param.ObjectSelector( + scroll = param.Selector( default=False, objects=[False, True, "both-auto", "y-auto", "x-auto", "both", "x", "y"], doc="""Whether to add scrollbars if the content overflows the size diff --git a/panel/layout/grid.py b/panel/layout/grid.py index 2039786be1..0c1e9675e1 100644 --- a/panel/layout/grid.py +++ b/panel/layout/grid.py @@ -260,7 +260,7 @@ class GridSpec(Panel): objects = ChildDict(default={}, doc=""" The dictionary of child objects that make up the grid.""") - mode = param.ObjectSelector(default='warn', objects=['warn', 'error', 'override'], doc=""" + mode = param.Selector(default='warn', objects=['warn', 'error', 'override'], doc=""" Whether to warn, error or simply override on overlapping assignment.""") ncols = param.Integer(default=None, bounds=(0, None), doc=""" diff --git a/panel/layout/spacer.py b/panel/layout/spacer.py index 4be5c40ade..a4a0051c2e 100644 --- a/panel/layout/spacer.py +++ b/panel/layout/spacer.py @@ -101,7 +101,7 @@ class Divider(Reactive): >>> ) """ - width_policy = param.ObjectSelector(default="fit", readonly=True) + width_policy = param.Selector(default="fit", readonly=True) _bokeh_model = BkDiv diff --git a/panel/layout/tabs.py b/panel/layout/tabs.py index 0dc43f37e3..e4a795d0f6 100644 --- a/panel/layout/tabs.py +++ b/panel/layout/tabs.py @@ -43,7 +43,7 @@ class Tabs(NamedListPanel): dynamic = param.Boolean(default=False, doc=""" Dynamically populate only the active tab.""") - tabs_location = param.ObjectSelector( + tabs_location = param.Selector( default='above', objects=['above', 'below', 'left', 'right'], doc=""" The location of the tabs relative to the tab contents.""") diff --git a/panel/pane/alert.py b/panel/pane/alert.py index fb12e04990..b2d390bf0d 100644 --- a/panel/pane/alert.py +++ b/panel/pane/alert.py @@ -30,7 +30,7 @@ class Alert(Markdown): >>> Alert('Some important message', alert_type='warning') """ - alert_type = param.ObjectSelector(default="primary", objects=ALERT_TYPES) + alert_type = param.Selector(default="primary", objects=ALERT_TYPES) priority: ClassVar[float | bool | None] = 0 diff --git a/panel/pane/echarts.py b/panel/pane/echarts.py index 7a2d4384d5..22fd8d9ba1 100644 --- a/panel/pane/echarts.py +++ b/panel/pane/echarts.py @@ -44,10 +44,10 @@ class ECharts(ModelPane): the `objects` with a value containing a smaller number of series. """) - renderer = param.ObjectSelector(default="canvas", objects=["canvas", "svg"], doc=""" + renderer = param.Selector(default="canvas", objects=["canvas", "svg"], doc=""" Whether to render as HTML canvas or SVG""") - theme = param.ObjectSelector(default="default", objects=["default", "light", "dark"], doc=""" + theme = param.Selector(default="default", objects=["default", "light", "dark"], doc=""" Theme to apply to plots.""") priority: ClassVar[float | bool | None] = None diff --git a/panel/pane/equation.py b/panel/pane/equation.py index 163d4ead12..4af31999ce 100644 --- a/panel/pane/equation.py +++ b/panel/pane/equation.py @@ -42,7 +42,7 @@ class LaTeX(ModelPane): ... ) """ - renderer = param.ObjectSelector(default=None, allow_None=True, + renderer = param.Selector(default=None, allow_None=True, objects=['katex', 'mathjax'], doc=""" The JS renderer used to render the LaTeX expression. Defaults to katex.""") diff --git a/panel/pane/holoviews.py b/panel/pane/holoviews.py index f157072775..827d45eff8 100644 --- a/panel/pane/holoviews.py +++ b/panel/pane/holoviews.py @@ -58,7 +58,7 @@ class HoloViews(Pane): >>> HoloViews(some_holoviews_object) """ - backend = param.ObjectSelector( + backend = param.Selector( default=None, objects=['bokeh', 'matplotlib', 'plotly'], doc=""" The HoloViews backend used to render the plot (if None defaults to the currently selected renderer).""") @@ -81,18 +81,18 @@ class HoloViews(Pane): allow_None=True, doc=""" Bokeh theme to apply to the HoloViews plot.""") - widget_location = param.ObjectSelector(default='right_top', objects=[ + widget_location = param.Selector(default='right_top', objects=[ 'left', 'bottom', 'right', 'top', 'top_left', 'top_right', 'bottom_left', 'bottom_right', 'left_top', 'left_bottom', 'right_top', 'right_bottom'], doc=""" The layout of the plot and the widgets. The value refers to the position of the widgets relative to the plot.""") - widget_layout = param.ObjectSelector( + widget_layout = param.Selector( objects=[WidgetBox, Row, Column], constant=True, default=WidgetBox, doc=""" The layout object to display the widgets in.""") - widget_type = param.ObjectSelector(default='individual', + widget_type = param.Selector(default='individual', objects=['individual', 'scrubber'], doc=""") Whether to generate individual widgets for each dimension or on global scrubber.""") diff --git a/panel/pane/ipywidget.py b/panel/pane/ipywidget.py index a8a9c522f5..a4ca2b08ae 100644 --- a/panel/pane/ipywidget.py +++ b/panel/pane/ipywidget.py @@ -84,7 +84,7 @@ def _get_model( class IPyLeaflet(IPyWidget): - sizing_mode = param.ObjectSelector(default='stretch_width', objects=[ + sizing_mode = param.Selector(default='stretch_width', objects=[ 'fixed', 'stretch_width', 'stretch_height', 'stretch_both', 'scale_width', 'scale_height', 'scale_both', None]) diff --git a/panel/pane/markup.py b/panel/pane/markup.py index 583903a932..30a1b9c7be 100644 --- a/panel/pane/markup.py +++ b/panel/pane/markup.py @@ -168,7 +168,7 @@ class DataFrame(HTML): index_names = param.Boolean(default=True, doc=""" Prints the names of the indexes.""") - justify = param.ObjectSelector(default=None, allow_None=True, objects=[ + justify = param.Selector(default=None, allow_None=True, objects=[ 'left', 'right', 'center', 'justify', 'justify-all', 'start', 'end', 'inherit', 'match-parent', 'initial', 'unset'], doc=""" How to justify the column labels.""") @@ -505,7 +505,7 @@ class JSON(HTMLBasePane): hover_preview = param.Boolean(default=False, doc=""" Whether to display a hover preview for collapsed nodes.""") - theme = param.ObjectSelector(default="dark", objects=["light", "dark"], doc=""" + theme = param.Selector(default="dark", objects=["light", "dark"], doc=""" Whether the JSON tree view is expanded by default.""") priority: ClassVar[float | bool | None] = None diff --git a/panel/pane/perspective.py b/panel/pane/perspective.py index aceb0cc67d..476a9e3904 100644 --- a/panel/pane/perspective.py +++ b/panel/pane/perspective.py @@ -305,7 +305,7 @@ class Perspective(ModelPane, ReactiveData): sort = param.List(default=None, doc=""" How to sort. For example[["x","desc"]]""") - plugin = param.ObjectSelector(default=Plugin.GRID.value, objects=Plugin.options(), doc=""" + plugin = param.Selector(default=Plugin.GRID.value, objects=Plugin.options(), doc=""" The name of a plugin to display the data. For example hypergrid or d3_xy_scatter.""") plugin_config = param.Dict(default={}, nested_refs=True, doc=""" @@ -314,7 +314,7 @@ class Perspective(ModelPane, ReactiveData): settings = param.Boolean(default=True, doc=""" Whether to show the settings menu.""") - theme = param.ObjectSelector(default='pro', objects=THEMES, doc=""" + theme = param.Selector(default='pro', objects=THEMES, doc=""" The style of the PerspectiveViewer. For example pro-dark""") title = param.String(default=None, doc=""" diff --git a/panel/pane/plot.py b/panel/pane/plot.py index 0ede8f7dcb..8b83769eb7 100644 --- a/panel/pane/plot.py +++ b/panel/pane/plot.py @@ -443,7 +443,7 @@ class Folium(HTML): The Folium pane wraps Folium map components. """ - sizing_mode = param.ObjectSelector(default='stretch_width', objects=[ + sizing_mode = param.Selector(default='stretch_width', objects=[ 'fixed', 'stretch_width', 'stretch_height', 'stretch_both', 'scale_width', 'scale_height', 'scale_both', None]) diff --git a/panel/pane/vega.py b/panel/pane/vega.py index 59ef47d57c..3ad207eeba 100644 --- a/panel/pane/vega.py +++ b/panel/pane/vega.py @@ -160,7 +160,7 @@ class Vega(ModelPane): show_actions = param.Boolean(default=False, doc=""" Whether to show Vega actions.""") - theme = param.ObjectSelector(default=None, allow_None=True, objects=[ + theme = param.Selector(default=None, allow_None=True, objects=[ 'excel', 'ggplot2', 'quartz', 'vox', 'fivethirtyeight', 'dark', 'latimes', 'urbaninstitute', 'googlecharts']) diff --git a/panel/template/base.py b/panel/template/base.py index 10c9f54d67..a47161dc5e 100644 --- a/panel/template/base.py +++ b/panel/template/base.py @@ -671,7 +671,7 @@ class BasicTemplate(BaseTemplate): Specifies the base URL for all relative URLs in a page. Default is '', i.e. not the domain.""") - base_target = param.ObjectSelector(default="_self", + base_target = param.Selector(default="_self", objects=["_blank", "_self", "_parent", "_top"], doc=""" Specifies the base Target for all relative URLs in a page.""") diff --git a/panel/template/react/__init__.py b/panel/template/react/__init__.py index 5971ac9250..b0378150d9 100644 --- a/panel/template/react/__init__.py +++ b/panel/template/react/__init__.py @@ -19,7 +19,7 @@ class ReactTemplate(BasicTemplate): ReactTemplate is built on top of React Grid Layout web components. """ - compact = param.ObjectSelector(default=None, objects=[None, 'vertical', 'horizontal', 'both']) + compact = param.Selector(default=None, objects=[None, 'vertical', 'horizontal', 'both']) cols = param.Dict(default={'lg': 12, 'md': 10, 'sm': 6, 'xs': 4, 'xxs': 2}) diff --git a/panel/tests/layout/test_base.py b/panel/tests/layout/test_base.py index 422cbce9fc..20097b282b 100644 --- a/panel/tests/layout/test_base.py +++ b/panel/tests/layout/test_base.py @@ -494,7 +494,7 @@ def test_widgetbox(document, comm): def test_layout_with_param_setitem(document, comm): import param class TestClass(param.Parameterized): - select = param.ObjectSelector(default=0, objects=[0,1]) + select = param.Selector(default=0, objects=[0,1]) def __init__(self, **params): super().__init__(**params) diff --git a/panel/tests/test_param.py b/panel/tests/test_param.py index 02abc8503c..18dfb99b91 100644 --- a/panel/tests/test_param.py +++ b/panel/tests/test_param.py @@ -314,7 +314,7 @@ class Test(param.Parameterized): def test_object_selector_param(document, comm): class Test(param.Parameterized): - a = param.ObjectSelector(default='b', objects=[1, 'b', 'c']) + a = param.Selector(default='b', objects=[1, 'b', 'c']) test = Test() test_pane = Param(test) @@ -420,7 +420,7 @@ class Test(param.Parameterized): def test_object_selector_param_overrides(document, comm): class Test(param.Parameterized): - a = param.ObjectSelector(default='b', objects=[1, 'b', 'c']) + a = param.Selector(default='b', objects=[1, 'b', 'c']) test = Test() test_pane = Param(test, widgets={'a': {'options': ['b', 'c'], 'value': 'c'}}) @@ -953,7 +953,7 @@ class Test(param.Parameterized): def test_switch_param_subobject(document, comm): class Test(param.Parameterized): - a = param.ObjectSelector() + a = param.Selector() o1 = Test(name='Subobject 1') o2 = Test(name='Subobject 2') diff --git a/panel/viewable.py b/panel/viewable.py index 7fc48d8e7e..65fd6651d6 100644 --- a/panel/viewable.py +++ b/panel/viewable.py @@ -86,7 +86,7 @@ class Layoutable(param.Parameterized): css_classes = param.List(default=[], nested_refs=True, doc=""" CSS classes to apply to the layout.""") - design = param.ObjectSelector(default=None, objects=[], doc=""" + design = param.Selector(default=None, objects=[], doc=""" The design system to use to style components.""") height = param.Integer(default=None, bounds=(0, None), doc=""" @@ -127,7 +127,7 @@ class Layoutable(param.Parameterized): The width of the component (in pixels). This can be either fixed or preferred width, depending on width sizing policy.""") - width_policy = param.ObjectSelector( + width_policy = param.Selector( default="auto", objects=['auto', 'fixed', 'fit', 'min', 'max'], doc=""" Describes how the component should maintain its width. @@ -159,7 +159,7 @@ class Layoutable(param.Parameterized): management and other factors. """) - height_policy = param.ObjectSelector( + height_policy = param.Selector( default="auto", objects=['auto', 'fixed', 'fit', 'min', 'max'], doc=""" Describes how the component should maintain its height. @@ -191,7 +191,7 @@ class Layoutable(param.Parameterized): management and other factors. """) - sizing_mode = param.ObjectSelector(default=None, objects=[ + sizing_mode = param.Selector(default=None, objects=[ 'fixed', 'stretch_width', 'stretch_height', 'stretch_both', 'scale_width', 'scale_height', 'scale_both', None], doc=""" How the component should size itself. diff --git a/panel/widgets/button.py b/panel/widgets/button.py index 83b08835d7..344b3841f7 100644 --- a/panel/widgets/button.py +++ b/panel/widgets/button.py @@ -33,12 +33,12 @@ class _ButtonBase(Widget): - button_type = param.ObjectSelector(default='default', objects=BUTTON_TYPES, doc=""" + button_type = param.Selector(default='default', objects=BUTTON_TYPES, doc=""" A button theme; should be one of 'default' (white), 'primary' (blue), 'success' (green), 'info' (yellow), 'light' (light), or 'danger' (red).""") - button_style = param.ObjectSelector(default='solid', objects=BUTTON_STYLES, doc=""" + button_style = param.Selector(default='solid', objects=BUTTON_STYLES, doc=""" A button style to switch between 'solid', 'outline'.""") _rename: ClassVar[Mapping[str, str | None]] = {'name': 'label', 'button_style': None} diff --git a/panel/widgets/codeeditor.py b/panel/widgets/codeeditor.py index 8e766afd85..7549ad2ce7 100644 --- a/panel/widgets/codeeditor.py +++ b/panel/widgets/codeeditor.py @@ -49,7 +49,7 @@ class CodeEditor(Widget): readonly = param.Boolean(default=False, doc=""" Define if editor content can be modified. Alias for disabled.""") - theme = param.ObjectSelector(default="chrome", objects=list(ace_themes), + theme = param.Selector(default="chrome", objects=list(ace_themes), doc="Theme of the editor") value = param.String(default="", doc=""" diff --git a/panel/widgets/indicators.py b/panel/widgets/indicators.py index 56f1c87061..65c434565a 100644 --- a/panel/widgets/indicators.py +++ b/panel/widgets/indicators.py @@ -66,7 +66,7 @@ class Indicator(Widget): Indicator is a baseclass for widgets which indicate some state. """ - sizing_mode = param.ObjectSelector(default='fixed', objects=[ + sizing_mode = param.Selector(default='fixed', objects=[ 'fixed', 'stretch_width', 'stretch_height', 'stretch_both', 'scale_width', 'scale_height', 'scale_both', None]) @@ -158,7 +158,7 @@ class BooleanStatus(BooleanIndicator): >>> BooleanStatus(value=True, color='primary', width=100, height=100) """ - color = param.ObjectSelector(default='dark', objects=[ + color = param.Selector(default='dark', objects=[ 'primary', 'secondary', 'success', 'info', 'danger', 'warning', 'light', 'dark'], doc=""" The color of the circle, one of 'primary', 'secondary', 'success', 'info', 'danger', 'warning', 'light', 'dark'""") @@ -203,9 +203,9 @@ class LoadingSpinner(BooleanIndicator): >>> LoadingSpinner(value=True, color='primary', bgcolor='light', width=100, height=100) """ - bgcolor = param.ObjectSelector(default='light', objects=['dark', 'light']) + bgcolor = param.Selector(default='light', objects=['dark', 'light']) - color = param.ObjectSelector(default='dark', objects=[ + color = param.Selector(default='dark', objects=[ 'primary', 'secondary', 'success', 'info', 'danger', 'warning', 'light', 'dark']) @@ -284,13 +284,13 @@ class Progress(ValueIndicator): If no value is set the active property toggles animation of the progress bar on and off.""") - bar_color = param.ObjectSelector(default='success', objects=[ + bar_color = param.Selector(default='success', objects=[ 'primary', 'secondary', 'success', 'info', 'danger', 'warning', 'light', 'dark']) max = param.Integer(default=100, doc="The maximum value of the progress bar.") - sizing_mode = param.ObjectSelector(default=None, objects=[ + sizing_mode = param.Selector(default=None, objects=[ 'fixed', 'stretch_width', 'stretch_height', 'stretch_both', 'scale_width', 'scale_height', 'scale_both', None]) @@ -1120,7 +1120,7 @@ class Trend(SyncableData, Indicator): data = param.Parameter(doc=""" The plot data declared as a dictionary of arrays or a DataFrame.""") - layout = param.ObjectSelector(default="column", objects=["column", "row"]) + layout = param.Selector(default="column", objects=["column", "row"]) plot_x = param.String(default="x", doc=""" The name of the key in the plot_data to use on the x-axis.""") @@ -1131,7 +1131,7 @@ class Trend(SyncableData, Indicator): plot_color = param.String(default=BLUE, doc=""" The color to use in the plot.""") - plot_type = param.ObjectSelector(default="bar", objects=["line", "step", "area", "bar"], doc=""" + plot_type = param.Selector(default="bar", objects=["line", "step", "area", "bar"], doc=""" The plot type to render the plot data as.""") pos_color = param.String(GREEN, doc=""" @@ -1140,7 +1140,7 @@ class Trend(SyncableData, Indicator): neg_color = param.String(RED, doc=""" The color used to indicate a negative change.""") - sizing_mode = param.ObjectSelector(default=None, objects=[ + sizing_mode = param.Selector(default=None, objects=[ 'fixed', 'stretch_width', 'stretch_height', 'stretch_both', 'scale_width', 'scale_height', 'scale_both', None]) diff --git a/panel/widgets/input.py b/panel/widgets/input.py index bcf884579a..b5337e977f 100644 --- a/panel/widgets/input.py +++ b/panel/widgets/input.py @@ -171,7 +171,7 @@ class TextAreaInput(_TextInputBase): rows = param.Integer(default=2, doc=""" Number of rows in the text input field.""") - resizable = param.ObjectSelector( + resizable = param.Selector( objects=["both", "width", "height", False], doc=""" Whether the layout is interactively resizable, and if so in which dimensions: `width`, `height`, or `both`. @@ -1141,7 +1141,7 @@ class LiteralInput(Widget): placeholder = param.String(default='', doc=""" Placeholder for empty input field.""") - serializer = param.ObjectSelector(default='ast', objects=['ast', 'json'], doc=""" + serializer = param.Selector(default='ast', objects=['ast', 'json'], doc=""" The serialization (and deserialization) method to use. 'ast' uses ast.literal_eval and 'json' uses json.loads and json.dumps. """) diff --git a/panel/widgets/misc.py b/panel/widgets/misc.py index 027ac2340e..aea99669a9 100644 --- a/panel/widgets/misc.py +++ b/panel/widgets/misc.py @@ -39,7 +39,7 @@ class VideoStream(Widget): >>> VideoStream(name='Video Stream', timeout=100) """ - format = param.ObjectSelector(default='png', objects=['png', 'jpeg'], + format = param.Selector(default='png', objects=['png', 'jpeg'], doc=""" The file format as which the video is returned.""") @@ -86,12 +86,12 @@ class FileDownload(IconMixin): Whether to download on the initial click or allow for right-click save as.""") - button_type = param.ObjectSelector(default='default', objects=BUTTON_TYPES, doc=""" + button_type = param.Selector(default='default', objects=BUTTON_TYPES, doc=""" A button theme; should be one of 'default' (white), 'primary' (blue), 'success' (green), 'info' (yellow), 'light' (light), or 'danger' (red).""") - button_style = param.ObjectSelector(default='solid', objects=BUTTON_STYLES, doc=""" + button_style = param.Selector(default='solid', objects=BUTTON_STYLES, doc=""" A button style to switch between 'solid', 'outline'.""") callback = param.Callable(default=None, allow_refs=False, doc=""" diff --git a/panel/widgets/player.py b/panel/widgets/player.py index 93d94b656a..7f320125c6 100644 --- a/panel/widgets/player.py +++ b/panel/widgets/player.py @@ -30,7 +30,7 @@ class PlayerBase(Widget): Interval between updates, in milliseconds. Default is 500, i.e. two updates per second.""") - loop_policy = param.ObjectSelector( + loop_policy = param.Selector( default='once', objects=['once', 'loop', 'reflect'], doc=""" Policy used when player hits last frame""") @@ -49,7 +49,7 @@ class PlayerBase(Widget): height = param.Integer(default=80) - value_align = param.ObjectSelector( + value_align = param.Selector( objects=["start", "center", "end"], doc=""" Location to display the value of the slider ("start", "center", "end")""") diff --git a/panel/widgets/slider.py b/panel/widgets/slider.py index 2fa58541c4..305ad5f0fa 100644 --- a/panel/widgets/slider.py +++ b/panel/widgets/slider.py @@ -49,7 +49,7 @@ class _SliderBase(Widget): bar_color = param.Color(default="#e6e6e6", doc="""""") - direction = param.ObjectSelector(default='ltr', objects=['ltr', 'rtl'], doc=""" + direction = param.Selector(default='ltr', objects=['ltr', 'rtl'], doc=""" Whether the slider should go from left-to-right ('ltr') or right-to-left ('rtl').""") @@ -57,7 +57,7 @@ class _SliderBase(Widget): The name of the widget. Also used as the label of the widget. If not set, the widget has no label.""") - orientation = param.ObjectSelector(default='horizontal', objects=['horizontal', 'vertical'], + orientation = param.Selector(default='horizontal', objects=['horizontal', 'vertical'], doc=""" Whether the slider should be oriented horizontally or vertically.""") diff --git a/panel/widgets/speech_to_text.py b/panel/widgets/speech_to_text.py index 93274af00f..0bede0a8d3 100644 --- a/panel/widgets/speech_to_text.py +++ b/panel/widgets/speech_to_text.py @@ -318,7 +318,7 @@ class SpeechToText(Widget): incoming audio, and attempts to return a RecognitionResult using the audio captured so far.""") - lang = param.ObjectSelector(default="", objects=[""] + LANGUAGE_CODES, + lang = param.Selector(default="", objects=[""] + LANGUAGE_CODES, allow_None=True, label="Language", doc=""" The language of the current SpeechRecognition in BCP 47 format. For example 'en-US'. If not specified, this defaults @@ -353,7 +353,7 @@ class SpeechToText(Widget): button_hide = param.Boolean(default=False, label="Hide the Button", doc=""" If True no button is shown. If False a toggle Start/ Stop button is shown.""") - button_type = param.ObjectSelector(default="light", objects=BUTTON_TYPES, doc=""" + button_type = param.Selector(default="light", objects=BUTTON_TYPES, doc=""" The button styling.""") button_not_started = param.String(label="Button Text when not started", doc=""" diff --git a/panel/widgets/tables.py b/panel/widgets/tables.py index 6feb6d61e5..9663346b11 100644 --- a/panel/widgets/tables.py +++ b/panel/widgets/tables.py @@ -934,7 +934,7 @@ class DataFrame(BaseTable): auto_edit = param.Boolean(default=False, doc=""" Whether clicking on a table cell automatically starts edit mode.""") - autosize_mode = param.ObjectSelector(default='force_fit', objects=[ + autosize_mode = param.Selector(default='force_fit', objects=[ "none", "fit_columns", "fit_viewport", "force_fit"], doc=""" Determines the column autosizing mode, as one of the following options: @@ -1144,14 +1144,14 @@ class Tabulator(BaseTable): hidden_columns = param.List(default=[], nested_refs=True, doc=""" List of columns to hide.""") - layout = param.ObjectSelector(default='fit_data_table', objects=[ + layout = param.Selector(default='fit_data_table', objects=[ 'fit_data', 'fit_data_fill', 'fit_data_stretch', 'fit_data_table', 'fit_columns']) initial_page_size = param.Integer(default=20, bounds=(1, None), doc=""" Initial page size if page_size is None and therefore automatically set.""") - pagination = param.ObjectSelector(default=None, allow_None=True, + pagination = param.Selector(default=None, allow_None=True, objects=['local', 'remote']) page = param.Integer(default=1, doc=""" @@ -1199,7 +1199,7 @@ class Tabulator(BaseTable): Can either be specified as a simple boolean toggling the behavior on and off or as a dictionary specifying the option per column.""") - theme = param.ObjectSelector( + theme = param.Selector( default="simple", objects=[ 'default', 'site', 'simple', 'midnight', 'modern', 'bootstrap', 'bootstrap4', 'materialize', 'bulma', 'semantic-ui', 'fast', diff --git a/panel/widgets/text_to_speech.py b/panel/widgets/text_to_speech.py index 236b2bed11..de84d43df3 100644 --- a/panel/widgets/text_to_speech.py +++ b/panel/widgets/text_to_speech.py @@ -90,7 +90,7 @@ class Utterance(param.Parameterized): spoken. The text may be provided as plain text, or a well-formed SSML document.""") - lang = param.ObjectSelector(default="", doc=""" + lang = param.Selector(default="", doc=""" The language of the utterance.""") pitch = param.Number(default=1.0, bounds=(0.0, 2.0), doc=""" @@ -101,7 +101,7 @@ class Utterance(param.Parameterized): The speed at which the utterance will be spoken at expressed as a number between 0.1 and 10.""" ) - voice = param.ObjectSelector(doc=""" + voice = param.Selector(doc=""" The voice that will be used to speak the utterance.""") volume = param.Number(default=1.0, bounds=(0.0, 1.0), doc=""" The