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

Ellipse and datetime axis #8375

Closed
Pierretherenard opened this issue Oct 28, 2018 · 1 comment
Closed

Ellipse and datetime axis #8375

Pierretherenard opened this issue Oct 28, 2018 · 1 comment

Comments

@Pierretherenard
Copy link

@Pierretherenard Pierretherenard commented Oct 28, 2018

READ AND FOLLOW THESE INSTRUCTIONS CAREFULLY

ISSUES THAT DO NOT CONTAIN NECESSARY INFORMATION MAY BE CLOSED, IMMEDIATELY

The issue tracker is NOT the place for general support. For questions and
technical assistance, come ask the Bokeh mailing list or join the chat on Gitter. For feature requests, please provide a detailed description or proposal of the new capability or behavior.

For defects or deficiencies, please provide ALL OF THE FOLLOWING:

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

bokeh 1.0
python 3.5
Safari or firefox
macOS High Sierra

Description of expected behavior and the observed behavior

expected: display plots just like in 0.13
observed: Do not display plots AFTER ellipse with datetime
p3.ellipse(x=[xm[0]], y=[2], width=[150000000], height=0.3,color="#CAB2D6", legend='Datetime')
The width of the ellipse is equal to this big number to show the ellipse curve with datetime. May be there is another way and may this will remove the issue. I don't know.

This line of code above was working with no issue with 0.13. But with 1.0 It removed every displays after. On the graph I have no title and no tools displaying as you can see under the tab "ellipse with datetime". If p3, the code with the issue is showed last in the tab index then it does not create any problem for the previous tabs.
This issue does not happen with circle. I am not sure that another glyphs will create the same issue with datetime.

I added the other tabs with code to show how this ellipse code is creating issue on its own display and every other displays after.

ellipse
ellipse datetime
last
no show

Complete, minimal, self-contained example code that reproduces the issue

# code goes here between backticks
    def test_issue(self):
        from bokeh.io import show
        from bokeh.layouts import column
        from bokeh.models import ColumnDataSource, RangeTool, Span, BoxAnnotation
        from bokeh.plotting import figure

        x = [1,2,3,4,5,6,7,8]
        xd = ['01-jan-18','02-jan-18','03-jan-18','04-jan-18','05-jan-18','06-jan-18','07-jan-18','08-jan-18']
        xm = [dt.datetime.strptime(d, '%d-%b-%y').date() for d in xd]
        wdth = [0.5 for x in range(0,8)]
        top = [8,7,6,5,4,3,2,1]
        # x_range = Range1d(3, 8),
        sourceRT5 = ColumnDataSource(data=dict(x=x, width=wdth, top=top))
        p = figure(plot_height=300, plot_width=800, x_range=(3,8), title='Test',
                   tools="wheel_zoom,box_zoom,reset,hover,previewsave,help",
                   toolbar_location="above")

        p.vbar('x', 'width', 'top', bottom=0, line_color='dodgerblue',
               fill_color="dodgerblue", legend='New Words',
                source=sourceRT5)
        p.min_border_left = 0

        p1 = figure(plot_width=300, plot_height=300)

        p1.scatter([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=20, color="navy", alpha=0.5, legend='Legend')
        p1.legend.location = "center_right"
        p1.yaxis.major_label_text_color = "brown"
        high_box = BoxAnnotation(bottom=6, fill_alpha=0.1, fill_color='green')
        low_box = BoxAnnotation(top=3, fill_alpha=0.3, fill_color='skyblue')
        p1.add_layout(high_box)
        p1.add_layout(low_box)
        gnbwrd = Label(x=2, y=3, x_units='screen', y_units='screen',
                       text=" words", render_mode='css',
                       border_line_color='white', border_line_alpha=1.0,
                       background_fill_color='white', text_font_size='30pt', background_fill_alpha=0.5)
        p1.add_layout(gnbwrd)


        hline = Span(location=2, dimension='width', line_color='blue', line_width=2, line_alpha=0.1)
        p.add_layout(hline)

        p.title.text_color = "blue"
        p.title.text_font = "times"
        p.yaxis.axis_label = 'Price'

        select = figure(plot_height=50, plot_width=800, y_range=(0,10),
                          y_axis_type=None, x_axis_type=None,
                        tools="", toolbar_location=None)

        range_rool = RangeTool(x_range= p.x_range)
        range_rool.overlay.fill_color = "#ccff5e"
        range_rool.overlay.fill_alpha = 0.4

        select.vbar('x', 'width', 'top', source=sourceRT5)
        select.ygrid.grid_line_color = None
        select.add_tools(range_rool)
        select.toolbar.active_multi = range_rool

        divtest = Div(text="""There should be a plot above.""", width=100)

        l1 = column(p,select,divtest)
        tab1 = Panel(child=l1, title='Last plot')
        l2 = column(p1)
        tab2 = Panel(child=l2, title="circles")

        # ISSUE is HERE datetime and ellipse
        p3 = figure(plot_width=900, plot_height=400,x_axis_type="datetime", title="ellipse",
                     x_range=(
            dt.datetime.strptime("30-Nov-17", '%d-%b-%y').date(), dt.datetime.strptime("01-Nov-18", '%d-%b-%y').date()),
                    tools="pan,wheel_zoom,help")
        p3.ellipse(x=[xm[0]], y=[2], width=[150000000], height=0.3,
             color="#CAB2D6", legend='Datetime')  #4820 
        p3.legend.location = "center_right"
        tab3 = Panel(child=p3, title="Ellipse axis datetime")

        p4 = figure(plot_width=400, plot_height=400)
        p4.ellipse(x=[2], y=[2], width=[0.2], height=0.3,  color="#CAB2D6")
        tab4 = Panel(child=p4, title="Ellipse axis int")

        tabindex = Tabs(tabs=[tab4,tab3,tab2,tab1])
        show(tabindex)

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

@bryevdv
Copy link
Member

@bryevdv bryevdv commented Oct 28, 2018

@Pierretherenard The issue has nothing to do with the datetime axis. There is actually a problem due to putting the ellipse in a legend (when the legend is rendered the angle is lost and the code falls over)

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

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.