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

Fixed handling of ColumnDataSource array shapes for bokeh 2.1 #1428

Merged
merged 2 commits into from Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions panel/models/deckgl.ts
Expand Up @@ -93,14 +93,15 @@ export class DeckGLPlotView extends PanelHTMLBoxView {
}
const data: any = []
const columns = cds.columns()
for (let i = 0; i < cds.data[columns[0]].length; i++) {
for (let i = 0; i < cds.get_length(); i++) {
const item: any = {}
for (const column of columns) {
const shape = cds._shapes[column]
if ((shape !== undefined) && (shape.length > 1) && (typeof shape[0] == "number"))
item[column] = cds.data[column].slice(i*shape[1], i*shape[1]+shape[1])
let array = cds.get_array(column);
const shape = array[0].shape == null ? null : array[0].shape;
if ((shape != null) && (shape.length > 1) && (typeof shape[0] == "number"))
item[column] = array.slice(i*shape[1], i*shape[1]+shape[1])
else
item[column] = cds.data[column][i]
item[column] = array[i]
}
data.push(item)
}
Expand Down
8 changes: 4 additions & 4 deletions panel/models/plotly.ts
Expand Up @@ -231,19 +231,19 @@ export class PlotlyPlotView extends PanelHTMLBoxView {
const trace = clone(this.model.data[index]);
const cds = this.model.data_sources[index];
for (const column of cds.columns()) {
const shape: number[] = cds._shapes[column][0];
let array = cds.get_array(column)[0];
if (shape.length > 1) {
if (array.shape != null && array.shape.length > 1) {
const arrays = [];
const shape = array.shape;
for (let s = 0; s < shape[0]; s++) {
arrays.push(array.slice(s*shape[1], (s+1)*shape[1]));
}
array = arrays;
}
let prop_path = column.split(".");
let prop = prop_path[prop_path.length - 1];
var prop_parent = trace;
for(let k of prop_path.slice(0, -1)) {
let prop_parent = trace;
for (let k of prop_path.slice(0, -1)) {
prop_parent = (prop_parent[k] as any)
}

Expand Down