question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Changing CDSView filters' attributes does not trigger rendering

See original GitHub issue

Bokeh 0.12.11

from bokeh.io import curdoc
from bokeh.layouts import column
from bokeh.models import CDSView, IndexFilter, ColumnDataSource, Button
from bokeh.plotting import figure

ds = ColumnDataSource(dict(x=[1, 2, 3], y=[1, 2, 3]))
f = IndexFilter(indices=list(range(len(ds.data['x']))))
v = CDSView(source=ds, filters=[f])

fig = figure()
fig.x(x='x', y='y', source=ds, view=v)

b = Button(label='Change indices')


def change_indices():
    if f.indices:
        f.indices = f.indices[:-1]


b.on_click(change_indices)

curdoc().add_root(column(fig, b))

Clicking on the button results in ModelChanged messages being sent out, but the plot itself does not change. The root cause is that all filter models do not connect any signals - effectively, they’re just passive containers.

As of now, a workaround would be to re-set filters property of the CDSView instance.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
birdsarahcommented, Apr 5, 2018

I just ran into this too when trying to update an IndexFilter. Was extremely confusing.

1reaction
bryevdvcommented, Dec 5, 2017

agree this is an issue of missing plumbing, which might be simple to add

cc @clairetang6

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing CDSView filters' attributes does not trigger rendering
Changing CDSView filters' attributes does not trigger rendering. ... The root cause is that all filter models do not connect any signals ......
Read more >
In Bokeh Server, CDSView Is Updating But Glyph Does Not
I expected the glyph that uses this view to change as well, ... Changing CDSView filters' attributes does not trigger rendering · Issue ......
Read more >
python 3.x - Creating GlyphRenderers for modifying the legend
I want to create a bokeh application that can filter points based on some attribute. Here is a very simple code example for...
Read more >
bokeh Changelog - pyup.io
11413 [component: bokehjs] Changing tile provider does not remove attribution - 11437 [component: bokehjs] [BUG] HoverTool ignores IndexFilter in CDSView
Read more >
SAP - ABAP RESTful Application Programming Model
CDS Views with parameters do not work properly in Fiori Elements UI services. The filter value is not sent to the backend.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found