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

descending order with TableColumn still ascending #6115

Closed
Pierretherenard opened this Issue Apr 9, 2017 · 9 comments

Comments

Projects
None yet
2 participants
@Pierretherenard

Pierretherenard commented Apr 9, 2017

Default_sort is ascending, I am using descending but either this is not working or I am using the wrong kind of marker for default_sort

    from bokeh.layouts import row
    from bokeh.models import ColumnDataSource, WidgetBox, HoverTool
    from bokeh.models.widgets import  DataTable, TableColumn

    xu = [1,2,3]
    ttnwwrd = [90, 78, 150]
    dte = [100,200,300]
    #data = {'id':[1,2,3],'ttnwwrd':[3,4,6],}

    sourcet5 = ColumnDataSource(data=dict(x=xu,top=ttnwwrd,date=dte))
    p5 = figure(plot_width=500, plot_height=650, title="GJT Unique",
        tools = "pan,wheel_zoom,box_zoom,reset,hover,previewsave") #, x_axis_type = "datetime")
    # x = "x",
    glyph = VBar(x="x", top="top", bottom=-1, width=.5, fill_color="#b3de69")
    p5.add_glyph(sourcet5, glyph)
    people = ['un', 'deux','trois']
    sourcedt1 = ColumnDataSource(data=dict(people=people))

    columns1 = [
        TableColumn(field="people", title="People",  default_sort="descending"),

    ]
    dttbl1 = DataTable(source=sourcedt1, columns=columns1, width=220, height=130)
    wdgtdt1 = WidgetBox(dttbl1)
    hover = p5.select(dict(type=HoverTool))
    hover.tooltips = [("New words", "@top"),('date',' @date')]
    l5 = row(p5,wdgtdt1)
    show(l5)

I see:
screen shot 2017-04-09 at 9 53 17 am
but I should see:
screen shot 2017-04-09 at 9 54 47 am

Thank you
Pierre

@bryevdv

This comment has been minimized.

Member

bryevdv commented Apr 11, 2017

Can reproduce. Not sure what the issue is since the plumbing appears to all be in order. Perhaps this is a bug in Slick Grid itself.

@bryevdv

This comment has been minimized.

Member

bryevdv commented Apr 30, 2017

This should be fixed in #6180 @Pierretherenard if you have the ability to test the PR yourself it would be helpful.

@Pierretherenard

This comment has been minimized.

Pierretherenard commented May 1, 2017

If you have time to point me in the right direction i will do it.

@bryevdv

This comment has been minimized.

Member

bryevdv commented May 1, 2017

@Pierretherenard Sure, there are some detailed instructions here

http://bokeh.pydata.org/en/latest/docs/dev_guide/setup.html#building-bokehjs

But the TLDR version is:

  • Install npm (however is most convenient for your platform)
  • clone the bokeh/bokeh repo
  • run python setup.py install --build-js

Then when you run your examples make sure to use the BokehJS you just built by asking for inline resources with the BOKEH_RESOURCES environment variable, e.g. on *nix:

BOKEH_RESOURCES=inline python myscript.py
@Pierretherenard

This comment has been minimized.

Pierretherenard commented May 3, 2017

Will this disturb the Bokeh project that I am running now? I might not be ready in time for this one. It will definitively be tested after release since it is included in my project. I know you will be happy to have it tested before. I will search how to do step 2. The clone one.

@bryevdv

This comment has been minimized.

Member

bryevdv commented May 3, 2017

@Pierretherenard I would suggest testing in a completely different environment (a conda environment or pip virtualenv) away from any existing "production" environments. I'm fairly certain the PR resolves the issue, so we will probably merge it in the next few days. If you don't have the ability to test before then, I understand.

@Pierretherenard

This comment has been minimized.

Pierretherenard commented Jun 14, 2017

I just installed 0.12.6. Was the resolution part of the release? This is not descending. Same test.
thank you

@bryevdv

This comment has been minimized.

Member

bryevdv commented Jun 14, 2017

@Pierretherenard I think I might have misunderstood this issue. There was an error that actually caused columns to not sort correctly together in some cases, and I thought this was what you were referring to. (and that was what was fixed) I'm afraid you have misunderstood to purpose of default_sort (we probably need to make the docs clearer) Here is what the underlying slick grid library has to say:

screen shot 2017-06-14 at 15 15 46

As you can see, this parameter (which corresponds to Bokeh's default_sort) only controls what the sort order should be when a column header is first clicked. Before that, the data is presented in exactly the order that you supply it. So if you want to have it display differently initially, I think you will have to sort it yourself to that order in the CDS. The underlying slick grid library does not offer any other capability in this regard.

@Pierretherenard

This comment has been minimized.

Pierretherenard commented Jun 14, 2017

Cool. Thank you for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment