Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/gallery/interactivity/app_bind.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"df = hvplot.sampledata.penguins(\"pandas\").dropna()\n",
"\n",
"species_widget = pn.widgets.Select(\n",
" name='Species',\n",
" label='Species',\n",
" options=list(df['species'].unique()),\n",
" width=200,\n",
")\n",
"\n",
"mass_widget = pn.widgets.IntSlider(\n",
" name='Min Body Mass (g)',\n",
" label='Min Body Mass (g)',\n",
" start=int(df['body_mass_g'].min()),\n",
" end=int(df['body_mass_g'].max()),\n",
" step=100,\n",
Expand Down
4 changes: 2 additions & 2 deletions doc/gallery/interactivity/app_rx.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"df = pd.DataFrame({'x': x})\n",
"\n",
"amp_slider = pn.widgets.FloatSlider(\n",
" name='Amplitude', start=-5.0, end=5.0,\n",
" label='Amplitude', start=-5.0, end=5.0,\n",
" step=0.1, value=1.0, width=200,\n",
")\n",
"freq_slider = pn.widgets.FloatSlider(\n",
" name='Frequency', start=0.1, end=5.1,\n",
" label='Frequency', start=0.1, end=5.1,\n",
" step=0.1, value=1.0, width=200,\n",
")\n",
"\n",
Expand Down
10 changes: 5 additions & 5 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ import hvplot.pandas
import panel as pn
from bokeh.sampledata.penguins import data as df

w_sex = pn.widgets.MultiSelect(name='Sex', value=['MALE'], options=['MALE', 'FEMALE'])
w_body_mass = pn.widgets.FloatSlider(name='Min body mass', start=2700, end=6300, step=50)
w_sex = pn.widgets.MultiSelect(label='Sex', value=['MALE'], options=['MALE', 'FEMALE'])
w_body_mass = pn.widgets.FloatSlider(label='Min body mass', start=2700, end=6300, step=50)

dfi = df.interactive(loc='left')
dfi.loc[(dfi['sex'].isin(w_sex)) & (dfi['body_mass_g'] > w_body_mass)]['bill_length_mm'].describe()
Expand All @@ -352,7 +352,7 @@ import hvplot.xarray
import panel as pn
import xarray as xr

w_time = pn.widgets.IntSlider(name='time', start=0, end=10)
w_time = pn.widgets.IntSlider(label='time', start=0, end=10)

da = xr.tutorial.open_dataset('air_temperature').air
da.interactive.isel(time=w_time).mean().item() - da.mean().item()
Expand All @@ -375,8 +375,8 @@ import panel as pn
import xarray as xr

da = xr.tutorial.open_dataset('air_temperature').air
w_quantile = pn.widgets.FloatSlider(name='quantile', start=0, end=1)
w_time = pn.widgets.IntSlider(name='time', start=0, end=10)
w_quantile = pn.widgets.FloatSlider(label='quantile', start=0, end=1)
w_time = pn.widgets.IntSlider(label='time', start=0, end=10)

da.interactive(loc='left') \
.isel(time=w_time) \
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorials/getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,8 @@
"source": [
"import panel as pn\n",
"\n",
"w_latitude = pn.widgets.DiscreteSlider(name='Latitude', options=list(air.lat.values))\n",
"w_rolling_window = pn.widgets.RadioButtonGroup(name='Rolling window', options=['1D', '7D', '30D'])"
"w_latitude = pn.widgets.DiscreteSlider(label='Latitude', options=list(air.lat.values))\n",
"w_rolling_window = pn.widgets.RadioButtonGroup(label='Rolling window', options=['1D', '7D', '30D'])"
]
},
{
Expand Down
18 changes: 9 additions & 9 deletions doc/user_guide/Interactive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"metadata": {},
"outputs": [],
"source": [
"slider = pnw.IntSlider(name='time', start=0, end=10)\n",
"slider = pnw.IntSlider(label='time', start=0, end=10)\n",
"\n",
"ds.air.interactive(width=800).isel(time=slider)"
]
Expand Down Expand Up @@ -149,7 +149,7 @@
"source": [
"from bokeh import sampledata\n",
"\n",
"ticker = pn.widgets.Select(options=['AAPL', 'IBM', 'GOOG', 'MSFT'], name='Ticker')\n",
"ticker = pn.widgets.Select(options=['AAPL', 'IBM', 'GOOG', 'MSFT'], label='Ticker')\n",
"\n",
"def stock_df(ticker):\n",
" df = pd.DataFrame(getattr(sampledata.stocks, ticker))\n",
Expand All @@ -176,7 +176,7 @@
"metadata": {},
"outputs": [],
"source": [
"ticker = pn.widgets.Select(options=['AAPL', 'IBM', 'GOOG', 'MSFT'], name='Ticker')\n",
"ticker = pn.widgets.Select(options=['AAPL', 'IBM', 'GOOG', 'MSFT'], label='Ticker')\n",
"\n",
"def stock_df(ticker):\n",
" df = pd.DataFrame(getattr(sampledata.stocks, ticker))\n",
Expand Down Expand Up @@ -261,7 +261,7 @@
"metadata": {},
"outputs": [],
"source": [
"time = pnw.Player(name='time', start=0, end=10, loop_policy='loop', interval=100)\n",
"time = pnw.Player(label='time', start=0, end=10, loop_policy='loop', interval=100)\n",
"\n",
"ds.air.interactive(loc='bottom').isel(time=time).plot()"
]
Expand All @@ -286,7 +286,7 @@
"metadata": {},
"outputs": [],
"source": [
"slider = pnw.FloatSlider(name='quantile', start=0, end=1)\n",
"slider = pnw.FloatSlider(label='quantile', start=0, end=1)\n",
"\n",
"ds.air.interactive.quantile(slider, dim='time').hvplot(data_aspect=1)"
]
Expand All @@ -304,7 +304,7 @@
"metadata": {},
"outputs": [],
"source": [
"q = pnw.FloatSlider(name='quantile', start=0, end=1)\n",
"q = pnw.FloatSlider(label='quantile', start=0, end=1)\n",
"\n",
"(ds.air.interactive(loc='left')\n",
" .sel(time=pnw.DiscreteSlider)\n",
Expand Down Expand Up @@ -371,7 +371,7 @@
"metadata": {},
"outputs": [],
"source": [
"slider = pnw.IntSlider(name='time', start=0, end=10)\n",
"slider = pnw.IntSlider(label='time', start=0, end=10)\n",
"baseline = ds.air.mean().item()\n",
"baseline"
]
Expand All @@ -398,8 +398,8 @@
"metadata": {},
"outputs": [],
"source": [
"slider = pnw.IntSlider(name='time', start=0, end=10)\n",
"offset = pnw.IntSlider(name='offset', start=0, end=500)\n",
"slider = pnw.IntSlider(label='time', start=0, end=10)\n",
"offset = pnw.IntSlider(label='offset', start=0, end=500)\n",
"\n",
"ds.air.interactive.isel(time=slider).mean().item() + offset"
]
Expand Down
14 changes: 7 additions & 7 deletions doc/user_guide/Widgets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@
"metadata": {},
"outputs": [],
"source": [
"x = pn.widgets.Select(name='x', options=['sepal_width', 'petal_width'])\n",
"y = pn.widgets.Select(name='y', options=['sepal_length', 'petal_length'])\n",
"kind = pn.widgets.Select(name='kind', value='scatter', options=['bivariate', 'scatter'])\n",
"x = pn.widgets.Select(label='x', options=['sepal_width', 'petal_width'])\n",
"y = pn.widgets.Select(label='y', options=['sepal_length', 'petal_length'])\n",
"kind = pn.widgets.Select(label='kind', value='scatter', options=['bivariate', 'scatter'])\n",
"\n",
"plot = flowers.hvplot(x=x, y=y, kind=kind, colorbar=False, width=600)\n",
"pn.Row(pn.WidgetBox(x, y, kind), plot)"
Expand All @@ -126,10 +126,10 @@
"metadata": {},
"outputs": [],
"source": [
"x = pn.widgets.Select(name='x', options=['sepal_width', 'petal_width'])\n",
"y = pn.widgets.Select(name='y', options=['sepal_length', 'petal_length'])\n",
"kind = pn.widgets.Select(name='kind', value='scatter', options=['bivariate', 'scatter'])\n",
"by_species = pn.widgets.Checkbox(name='By species')\n",
"x = pn.widgets.Select(label='x', options=['sepal_width', 'petal_width'])\n",
"y = pn.widgets.Select(label='y', options=['sepal_length', 'petal_length'])\n",
"kind = pn.widgets.Select(label='kind', value='scatter', options=['bivariate', 'scatter'])\n",
"by_species = pn.widgets.Checkbox(label='By species')\n",
"color = pn.widgets.ColorPicker(value='#ff0000')\n",
"\n",
"@pn.depends(by_species, color)\n",
Expand Down
4 changes: 2 additions & 2 deletions hvplot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ def bind(function, *args, **kwargs):
>>> import hvplot
>>> import panel as pn

>>> alpha = pn.widgets.FloatSlider(value=0.5, start=0, end=1.0, step=0.1, name="Alpha")
>>> top = pn.widgets.RadioButtonGroup(value=10, options=[5, 10, 25], name="Top")
>>> alpha = pn.widgets.FloatSlider(value=0.5, start=0, end=1.0, step=0.1, label="Alpha")
>>> top = pn.widgets.RadioButtonGroup(value=10, options=[5, 10, 25], label="Top")
>>> interactive_table = (
... hvplot
... .bind(algorithm, alpha=alpha)
Expand Down
4 changes: 2 additions & 2 deletions hvplot/tests/testinteractive.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ def test_interactive_pandas_dataframe_hvplot_accessor_dmap_kind_widget(df):
def test_interactive_with_bound_function_calls():
df = pd.DataFrame({'species': [1, 1, 1, 2, 2, 2], 'sex': 3 * ['MALE', 'FEMALE']})

w_species = pn.widgets.Select(name='Species', options=[1, 2])
w_sex = pn.widgets.MultiSelect(name='Sex', value=['MALE'], options=['MALE', 'FEMALE'])
w_species = pn.widgets.Select(label='Species', options=[1, 2])
w_sex = pn.widgets.MultiSelect(label='Sex', value=['MALE'], options=['MALE', 'FEMALE'])

def load_data(species, watch=True):
if watch:
Expand Down
12 changes: 6 additions & 6 deletions hvplot/tests/testpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def setUp(self):
self.cols = list(self.flowers.columns[:-1])

def test_using_explicit_widgets_works(self):
x = pn.widgets.Select(name='x', value='sepal_length', options=self.cols)
y = pn.widgets.Select(name='y', value='sepal_width', options=self.cols)
kind = pn.widgets.Select(name='kind', value='scatter', options=['bivariate', 'scatter'])
by_species = pn.widgets.Checkbox(name='By species')
x = pn.widgets.Select(label='x', value='sepal_length', options=self.cols)
y = pn.widgets.Select(label='y', value='sepal_width', options=self.cols)
kind = pn.widgets.Select(label='kind', value='scatter', options=['bivariate', 'scatter'])
by_species = pn.widgets.Checkbox(label='By species')
color = pn.widgets.ColorPicker(value='#ff0000')

@pn.depends(by_species.param.value, color.param.value)
Expand All @@ -53,8 +53,8 @@ def test_casting_widgets_to_different_classes(self):
assert len(look_for_class(pane, pn.widgets.DiscreteSlider)) == 1

def test_using_explicit_widgets_with_groupby_does_not_raise_error(self):
x = pn.widgets.Select(name='x', value='sepal_length', options=self.cols)
y = pn.widgets.Select(name='y', value='sepal_width', options=self.cols)
x = pn.widgets.Select(label='x', value='sepal_length', options=self.cols)
y = pn.widgets.Select(label='y', value='sepal_width', options=self.cols)

pane = self.flowers.hvplot(x, y, groupby='species')
assert isinstance(pane, pn.param.ParamFunction)
12 changes: 6 additions & 6 deletions hvplot/tests/testutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ def test_dynamic_and_static(self):

x = 'sepal_width'
y = pn.widgets.Select(
name='y', value='sepal_length', options=['sepal_length', 'petal_length']
label='y', value='sepal_length', options=['sepal_length', 'petal_length']
)
kind = pn.widgets.Select(name='kind', value='scatter', options=['bivariate', 'scatter'])
kind = pn.widgets.Select(label='kind', value='scatter', options=['bivariate', 'scatter'])

dynamic, arg_deps, _arg_names = process_dynamic_args(x, y, kind)
assert 'x' not in dynamic
Expand All @@ -230,7 +230,7 @@ def test_fn_kwds(self):
x = 'sepal_length'
y = 'sepal_width'
kind = 'scatter'
by_species = pn.widgets.Checkbox(name='By species')
by_species = pn.widgets.Checkbox(label='By species')
color = pn.widgets.ColorPicker(value='#ff0000')

@pn.depends(by_species.param.value, color.param.value)
Expand All @@ -255,7 +255,7 @@ def test_check_crs():
@pytest.mark.parametrize(
'input',
[
'+init=epsg:26911',
'epsg:26911',
'PlateCarree',
'epsg:6933',
6933,
Expand Down Expand Up @@ -290,7 +290,7 @@ def test_process_crs_pyproj_proj():
4326,
'epsg:4326',
'EPSG: 4326',
'+init=epsg:4326',
'epsg:4326',
# Created with pyproj.CRS("EPSG:4326").to_wkt()
'GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]]', # noqa: E501
],
Expand All @@ -310,7 +310,7 @@ def test_process_crs_platecarree(input):
3857,
'epsg:3857',
'EPSG: 3857',
'+init=epsg:3857',
'epsg:3857',
'PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]]', # noqa: E501
# Created with pyproj.CRS("EPSG:3857").to_wkt()
'PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]', # noqa: E501
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ examples = [
"ipywidgets",
"networkx >=2.6.3",
"matplotlib",
"netcdf4",
"notebook >=5.4",
"numba >=0.51.0",
"pillow >=8.2.0",
Expand Down
Loading