allow arrow heads to contribute clipping regions #5690

Merged
merged 2 commits into from Jan 11, 2017

Projects

None yet

2 participants

@bryevdv
Member
bryevdv commented Jan 10, 2017 edited
  • issues: fixes #4667
  • tests added / passed

This test code

from bokeh.plotting import figure, output_file, show
from bokeh.models import Arrow, OpenHead, NormalHead, VeeHead

output_file("foo.html")

p = figure(plot_width=600, plot_height=600, x_range=(-0.1,1.1), y_range=(-1,6))

p.add_layout(Arrow(start=VeeHead(line_width=1, fill_color="white"), x_start=0, y_start=2, x_end=1, y_end=5, line_width=10))
p.add_layout(Arrow(start=NormalHead(line_width=1, fill_color="white"), x_start=0, y_start=0, x_end=1, y_end=0, line_width=10))
p.add_layout(Arrow(start=OpenHead(line_width=1), x_start=0, y_start=1, x_end=1, y_end=2, line_width=10))

show(p)

generates

screen shot 2017-01-09 at 7 36 41 pm

@bryevdv bryevdv added the status: WIP label Jan 10, 2017
@bryevdv
Member
bryevdv commented Jan 10, 2017

@canavandl is there an existing arrows selenium image test we could update with some wide arrows too?

@canavandl
Contributor

There seems to be a faint line orthogonal to the arrow head on the examples with wide arrow bodies. I don't know if that's easily resolvable or not though.

screen shot 2017-01-11 at 11 35 25 am

@bryevdv
Member
bryevdv commented Jan 11, 2017

@canavandl I think extending the clip region one or two pixels would immediately solve that, let me try

@bryevdv
Member
bryevdv commented Jan 11, 2017

@canavandl that seems to work great, I am going to force push an update, here is the code that was added to the test:

    # test arrow body clipping
    plot.add_layout(Arrow(start=VeeHead(line_width=1, fill_color="white"), x_start=6, y_start=4, x_end=8, y_end=5, line_width=10))
    plot.add_layout(Arrow(start=NormalHead(line_width=1, fill_color="white"), x_start=6, y_start=3, x_end=8, y_end=4, line_width=10))
    plot.add_layout(Arrow(start=OpenHead(line_width=1), x_start=6, y_start=2, x_end=8, y_end=3, line_width=10))
@bryevdv
Member
bryevdv commented Jan 11, 2017

Test updated, will merge when green

@bryevdv bryevdv merged commit 18b867c into master Jan 11, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bryevdv bryevdv deleted the bryanv/4667_fat_arrows branch Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment