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.

Behavior of CDSView used with Line glyphs needs to be documented

See original GitHub issue

Originally posted on the mailing list (https://groups.google.com/a/continuum.io/forum/#!msg/bokeh/GR_qCar2-nA/P6ZLnvA0AQAJ) where it was suggested that I wait for the next dev build, and if this was not resolved to report it as a bug here. I’m a little late, but the issue still exists as of yesterday’s 0.12.10 release.

I’m working in Anaconda 5/Python 3.6.2 on a Windows 10 system with Bokeh 0.12.10, looking at things in Firefox 55.0.3, 64-bit everything.

Example code for a thing that produces the expected line from points (1,1) to (3,3):

from bokeh import plotting,models

data = {'x_vals':[1,2,3,4],
        'y_vals':[1,2,3,4],
        'group':['a','b','a','c']}

data_source = models.ColumnDataSource(data=data)
current_view = models.CDSView(source=data_source, filters=[models.
IndexFilter([2,0])])
plotting.output_file("test.html")

plot = plotting.figure(plot_width=400, plot_height=400)
plot.line(x='x_vals',y='y_vals',source=data_source,view=current_view)
plotting.show(plot)

bokeh_success

If I change the order of the list I’m feeding to IndexFilter it instead produces a plot with no line:

from bokeh import plotting,models

data = {'x_vals':[1,2,3,4],
        'y_vals':[1,2,3,4],
        'group':['a','b','a','c']}

data_source = models.ColumnDataSource(data=data)
current_view = models.CDSView(source=data_source, filters=[models.
IndexFilter([0,2])])
plotting.output_file("test.html")

plot = plotting.figure(plot_width=400, plot_height=400)
plot.line(x='x_vals',y='y_vals',source=data_source,view=current_view)
plotting.show(plot)

bokeh_empty

Attempting to use GroupFilter to select points (1,1) and (3,3) also produces an empty plot:

from bokeh import plotting,models

data = {'x_vals':[1,2,3,4],
        'y_vals':[1,2,3,4],
        'group':['a','b','a','c']}

data_source = models.ColumnDataSource(data=data)
current_view = models.CDSView(source=data_source, filters=[models.
GroupFilter(column_name='group',group='a')])
plotting.output_file("test.html")

plot = plotting.figure(plot_width=400, plot_height=400)
plot.line(x='x_vals',y='y_vals',source=data_source,view=current_view)
plotting.show(plot)

bokeh_empty

I would expect all three bits of code to produce identical plots, with a line from (1,1) to (3,3).

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
jasonsrosscommented, May 17, 2019

Bumping this because I don’t see why we cannot have it both ways and it seems intuitive to have the filtered data all connect lines between them. In my case I’m plotting each filtered view on a different figure in a grid so all the disconnections look silly. I don’t see why I would want to use multiple data sources for these plots when I could just update the one datasource and have it cascade to all plots when needed.

4reactions
iPellecommented, May 5, 2019

So I have a similar problem to kkuntze1, but I would really need the first policy described by @clairetang6 to work.

“One policy would be what @kkuntze1 describes with the line being drawn connecting the points that remain after filtering”

Since I do need line-chart, and I would like to only have one datascource with all data, continously updating with datapoints from a streaming source. And display sub-plots for different filters. Using CDS-views. Right now I can only get this to work with scatter plots.

Is the preferred way of doing that to have multiple datasources as it is implemented right now, or is there a way of solving this with CDSview and line-plots?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ABAP CDS - ANNOTATE VIEW - SAP Help Portal
Defines a CDS metadata extension in (MDE for short) for a CDS view in separate DDLX short code. The CDS metadata extension add...
Read more >
Providing data — Bokeh 2.4.0 Documentation
This section describes the various ways to provide data to Bokeh, from passing data values directly to creating a ColumnDataSource (CDS) and filtering...
Read more >
Create An Analytical Model Based On ABAP CDS Views
The answer is Yes and in this article, I try to clarify these different concepts with a good example of how you should...
Read more >
Choose Your Preferred Tools - SAP Capire
To use cds from your command line install @sap/cds-dk globally: ... You have installed Eclipse, Spring Tools, and our Eclipse plugin, see Add...
Read more >
CDS view core annotations - - SAP ABAP
The enumeration symbols are interpreted as follows: OBJECT subsumes TYPE, ENTITY, VIEW; TYPE subsumes SIMPLE_TYPE, STRUCT_TYPE. If an annotation is not ...
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