Skip to content

Add ability to call interactive on bound functions#720

Merged
philippjfr merged 10 commits into
masterfrom
interactive_bind
Apr 8, 2022
Merged

Add ability to call interactive on bound functions#720
philippjfr merged 10 commits into
masterfrom
interactive_bind

Conversation

@philippjfr
Copy link
Copy Markdown
Member

@philippjfr philippjfr commented Mar 23, 2022

Implements functionality requested in #673

from bokeh import sampledata

ticker = pn.widgets.Select(options=['AAPL', 'IBM', 'GOOG', 'MSFT'], name='Ticker')

def stock_df(ticker):
    df = pd.DataFrame(getattr(sampledata.stocks, ticker))
    df['date'] = pd.to_datetime(df.date)
    return df

stock_dfi = hvplot.bind(stock_df, ticker).interactive(width=600)

stock_dfi.head(10)

interactive_df_select

  • Add tests
  • Automatically detect whether to use DataFrameInteractive or XArrayInteractive object

Copy link
Copy Markdown
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for doing this.

Comment thread examples/user_guide/Interactive.ipynb Outdated
Comment thread hvplot/interactive.py Outdated
@MarcSkovMadsen
Copy link
Copy Markdown
Collaborator

Love this

@philippjfr
Copy link
Copy Markdown
Member Author

@maximlt Please review.

Copy link
Copy Markdown
Member

@maximlt maximlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say there is one outstanding issue to fix, my other comments or suggestions are somewhat minor.

Comment thread examples/user_guide/Interactive.ipynb
Comment thread examples/user_guide/Interactive.ipynb
Comment thread examples/user_guide/Interactive.ipynb
Comment thread hvplot/__init__.py
Comment thread examples/user_guide/Interactive.ipynb
Comment thread hvplot/interactive.py
Comment thread hvplot/tests/testinteractive.py
@philippjfr
Copy link
Copy Markdown
Member Author

Sorry for polluting this PR but I pushed some other changes:

  • Accessor resolution now implemented consistently via one codepath
  • Accessors now always return a new interactive object, previously it would act by changing the object inplace resulting in a lot of oddness when you chained that object
  • Fixed docstring generation for methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants