Bokeh renderer issues?

Hello,

I’m working on a dashboard where a number of the drop-down Select menus can change the plots on the dashboard.

I’m having an issue where the renderer doesn’t plot the data on the chart in order, despite me calling the sorted function in python and using a custom sort function.

As can be seen in the screenshot, the list is sorted before the CDS data is updated.

How can I fix this?

Thanks!

JayR

Hi,

Screenshots of code are never very useful. Please always provide (or link to) actual code text, and for the best chance that someone will be able to help you, please pare things down a minimal, *complete* example that reproduces the issue in question.

It's impossible to say for sure based on what you have provided, offhand I would guess that your x-axis is categorical? In which case the axis order is determined according to the value you set for the x_range categorical axis. The order of the data itself is not what matters.

Thanks,

Bryan

···

On Jul 23, 2018, at 11:56, [email protected] wrote:

Hello,

I'm working on a dashboard where a number of the drop-down Select menus can change the plots on the dashboard.

I'm having an issue where the renderer doesn't plot the data on the chart in order, despite me calling the sorted function in python and using a custom sort function.

As can be seen in the screenshot, the list is sorted before the CDS data is updated.
How can I fix this?

Thanks!
JayR

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/816708c3-3892-4417-bf30-1ba72b8bfd8a%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Thanks Bryan,

I can link to the source code (function that causes issues is line 452), but I did want to include what the command console showed. The data is sensitive (work) and this is the first time I’m running into this issue - I wouldn’t know how to reproduce it.

You’re right about the x-axis being categorical. However I have verified that both the X and Y that are sent to the CDS are sorted. This has worked for each other one of my drop-down selectables in the same project, just not for this last one. In the other instances, I’ve never needed to explicitly state the x_range.

Any additional things to consider would be welcome!

JayR

···

On Monday, July 23, 2018 at 3:02:00 PM UTC-4, Bryan Van de ven wrote:

Hi,

Screenshots of code are never very useful. Please always provide (or link to) actual code text, and for the best chance that someone will be able to help you, please pare things down a minimal, complete example that reproduces the issue in question.

It’s impossible to say for sure based on what you have provided, offhand I would guess that your x-axis is categorical? In which case the axis order is determined according to the value you set for the x_range categorical axis. The order of the data itself is not what matters.

Thanks,

Bryan

On Jul 23, 2018, at 11:56, [email protected] wrote:

Hello,

I’m working on a dashboard where a number of the drop-down Select menus can change the plots on the dashboard.

I’m having an issue where the renderer doesn’t plot the data on the chart in order, despite me calling the sorted function in python and using a custom sort function.

As can be seen in the screenshot, the list is sorted before the CDS data is updated.

How can I fix this?

Thanks!
JayR


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/816708c3-3892-4417-bf30-1ba72b8bfd8a%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi,

As I stated before, the order of the data *in the CDS* is completely irrelevant. The order of data in the CDS in *no way* affects the order of categories displayed on an axis. If it ever seemed like it has in the past, that was purely coincidence. The order of the axis labels for a categorical range is controlled *solely* by the configured FactorRange that the axis uses. There are various ways to configure categorical ranges, see e.g.

  https://bokeh.pydata.org/en/latest/docs/user_guide/categorical.html#basic

Thanks,

Bryan

···

On Jul 23, 2018, at 12:25, [email protected] wrote:

Thanks Bryan,

I can link to the source code (function that causes issues is line 452), but I did want to include what the command console showed. The data is sensitive (work) and this is the first time I'm running into this issue - I wouldn't know how to reproduce it.

You're right about the x-axis being categorical. However I have verified that both the X and Y that are sent to the CDS are sorted. This has worked for each other one of my drop-down selectables in the same project, just not for this last one. In the other instances, I've never needed to explicitly state the x_range.

Any additional things to consider would be welcome!

JayR

On Monday, July 23, 2018 at 3:02:00 PM UTC-4, Bryan Van de ven wrote:
Hi,

Screenshots of code are never very useful. Please always provide (or link to) actual code text, and for the best chance that someone will be able to help you, please pare things down a minimal, *complete* example that reproduces the issue in question.

It's impossible to say for sure based on what you have provided, offhand I would guess that your x-axis is categorical? In which case the axis order is determined according to the value you set for the x_range categorical axis. The order of the data itself is not what matters.

Thanks,

Bryan

> On Jul 23, 2018, at 11:56, jrag...@gmail.com wrote:
>
> Hello,
>
> I'm working on a dashboard where a number of the drop-down Select menus can change the plots on the dashboard.
>
> I'm having an issue where the renderer doesn't plot the data on the chart in order, despite me calling the sorted function in python and using a custom sort function.
>
>
>
>
>
> As can be seen in the screenshot, the list is sorted before the CDS data is updated.
> How can I fix this?
>
> Thanks!
> JayR
>
> --
> You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/816708c3-3892-4417-bf30-1ba72b8bfd8a%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a46672b1-d44e-48af-8448-364f554a5e43%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.