Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explorer: change default plot type from line to scatter #1228

Merged
merged 1 commit into from
Dec 21, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/getting_started/explorer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"metadata": {},
"outputs": [],
"source": [
"explorer = df.hvplot.explorer(x='bill_length_mm', y='bill_depth_mm', kind='scatter', by=['species'])\n",
"explorer = df.hvplot.explorer(x='bill_length_mm', y='bill_depth_mm', by=['species'])\n",
"explorer"
]
},
Expand Down
2 changes: 1 addition & 1 deletion examples/user_guide/Explorer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"metadata": {},
"outputs": [],
"source": [
"hvexplorer.param.update(kind='scatter', x='bill_length_mm', y_multi=['bill_depth_mm'], by=['species'])\n",
"hvexplorer.param.update(x='bill_length_mm', y_multi=['bill_depth_mm'], by=['species'])\n",
"hvexplorer.labels.title = 'Penguins Scatter'"
]
},
Expand Down
22 changes: 11 additions & 11 deletions hvplot/tests/testui.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_explorer_basic():
explorer = hvplot.explorer(df)

assert isinstance(explorer, hvDataFrameExplorer)
assert explorer.kind == "line"
assert explorer.kind == "scatter"
assert explorer.x == "index"
assert explorer.y == "species"

Expand Down Expand Up @@ -213,25 +213,25 @@ def test_explorer_live_update_init():

def test_explorer_live_update_after_init():
explorer = hvplot.explorer(df)
assert explorer._hv_pane.object.type is hv.Curve
explorer.kind = 'scatter'
assert explorer._hv_pane.object.type is hv.Scatter
explorer.kind = 'line'
assert explorer._hv_pane.object.type is hv.Curve

explorer.statusbar.live_update = False
explorer.kind = 'line'
assert explorer._hv_pane.object.type is hv.Scatter
assert 'line' not in explorer.code
explorer.kind = 'scatter'
assert explorer._hv_pane.object.type is hv.Curve
assert 'scatter' not in explorer.code

explorer.statusbar.live_update = True
assert explorer._hv_pane.object.type is hv.Curve
assert 'line' in explorer.code
assert explorer._hv_pane.object.type is hv.Scatter
assert 'scatter' in explorer.code


def test_explorer_method_dataframe():
explorer = df.hvplot.explorer()

assert isinstance(explorer, hvDataFrameExplorer)
assert explorer.kind == 'line'
assert explorer.kind == 'scatter'
assert explorer.x == 'index'
assert explorer.y == 'species'

Expand All @@ -258,7 +258,7 @@ def test_explorer_method_as_kind():
explorer = df.hvplot(kind="explorer")

assert isinstance(explorer, hvDataFrameExplorer)
assert explorer.kind == 'line'
assert explorer.kind == 'scatter'
assert explorer.x == 'index'
assert explorer.y == 'species'

Expand All @@ -267,7 +267,7 @@ def test_explorer_method_propagates_kwargs():
explorer = df.hvplot.explorer(title="Dummy title", x="bill_length_mm")

assert isinstance(explorer, hvDataFrameExplorer)
assert explorer.kind == 'line'
assert explorer.kind == 'scatter'
assert explorer.x == 'bill_length_mm'
assert explorer.y == 'species'
assert explorer.labels.title == 'Dummy title'
Expand Down
2 changes: 1 addition & 1 deletion hvplot/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ class hvDataFrameExplorer(hvPlotExplorer):

z = param.Selector()

kind = param.Selector(default='line', objects=KINDS['all'])
kind = param.Selector(default='scatter', objects=KINDS['all'])

@property
def _var_name(self):
Expand Down