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

Projects
None yet
3 participants
@philippjfr
Member

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

This comment has been minimized.

Member

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

This comment has been minimized.

Member

philippjfr commented Jan 9, 2017

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

@jlstevens

This comment has been minimized.

Member

jlstevens commented Jan 9, 2017

Tests have passed. Merging.

@jlstevens jlstevens merged commit 6bd8ae4 into master Jan 9, 2017

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.01%) to 76.865%
Details
s3-reference-data-cache Test data is cached.
Details

@philippjfr philippjfr deleted the bokeh_finalize_hooks branch Jan 27, 2017

@thoth291

This comment has been minimized.

Contributor

thoth291 commented Jan 28, 2018

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

@philippjfr

This comment has been minimized.

Member

philippjfr commented Jan 28, 2018

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

@thoth291

This comment has been minimized.

Contributor

thoth291 commented Jan 29, 2018

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

@philippjfr

This comment has been minimized.

Member

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