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

Add support for finalize_hooks to bokeh backend #1040

Merged
merged 1 commit into from
Jan 9, 2017

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Jan 9, 2017

We've had finalize_hooks to apply customizations of plots that are currently not directly supported by holoviews in the matplotlib backend for a long time now. This PR adds support for finalize_hooks to bokeh as well.

Here is a simple example that can be used as a workaround for #1039:

def apply_dt_formatter(plot, element):
    plot.handles['xaxis'].formatter = bokeh.models.DatetimeTickFormatter()

drange = pd.date_range(start="2014-01-01", end="2016-01-01")
vals = drange.values.astype('int64')/10**6
hv.Curve((vals, np.arange(len(vals))))(plot=dict(finalize_hooks=[apply_dt_formatter]))

bokeh_plot 28

@philippjfr
Copy link
Member Author

hooks aren't called quite in the right place, will fix shortly.

@philippjfr philippjfr assigned philippjfr and unassigned philippjfr Jan 9, 2017
@philippjfr philippjfr added this to the v1.7.0 milestone Jan 9, 2017
@philippjfr
Copy link
Member Author

Had to rebase to get the HeatMap changes. Ready to merge once it's passing.

@jlstevens
Copy link
Contributor

Tests have passed. Merging.

@jlstevens jlstevens merged commit 6bd8ae4 into master Jan 9, 2017
@philippjfr philippjfr deleted the bokeh_finalize_hooks branch January 27, 2017 02:53
@thoth291
Copy link
Contributor

Doesn't work for my Linux installation (hv - 1.9.2).
image

@philippjfr
Copy link
Member Author

Your call back references bokeh but you haven't imported it.

@thoth291
Copy link
Contributor

🤥 OMG! I guess I should stop working on weekends... Sorry for the bothering.... Thanks for your help!!!

@philippjfr
Copy link
Member Author

No worries, I know the feeling 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants