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
Merged

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

@philippjfr philippjfr commented Jan 9, 2017

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 philippjfr force-pushed the bokeh_finalize_hooks branch from 9775805 to f22a349 Jan 9, 2017
@philippjfr philippjfr force-pushed the bokeh_finalize_hooks branch from f22a349 to af87db7 Jan 9, 2017
@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented Jan 9, 2017

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

@jlstevens
Copy link
Contributor

@jlstevens jlstevens commented Jan 9, 2017

Tests have passed. Merging.

@jlstevens jlstevens merged commit 6bd8ae4 into master Jan 9, 2017
4 checks passed
@philippjfr philippjfr deleted the bokeh_finalize_hooks branch Jan 27, 2017
@thoth291
Copy link
Contributor

@thoth291 thoth291 commented Jan 28, 2018

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

@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented Jan 28, 2018

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

@thoth291
Copy link
Contributor

@thoth291 thoth291 commented Jan 29, 2018

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

@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented Jan 29, 2018

No worries, I know the feeling 😃

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

Successfully merging this pull request may close these issues.

None yet

3 participants