Skip to content

Commit

Permalink
Backports for 2.2.2 (#10555)
Browse files Browse the repository at this point in the history
* pin pytest-asyncio 0.12 (#10515)

* Pin pytest 6.0* (#10554)

* Backport: Selectively update data when CDSView changes (#10521)

* Selectively update data when CDSView changes

* Add a regression test

* Backport: Mark synthetic {x,y,xs,ys} expressions as internal (#10518)

* Mark synthetic {x,y,xs,ys} expressions as internal

* Backport: Update bokehjs' dependencies (#10451)

* Update baselines to Chrome 85

* Fix (?) issues with Chrome in bokehjs tests

* Add c:\Program Files\ to windows' PATH

Co-authored-by: Mateusz Paprocki <mattpap@gmail.com>
  • Loading branch information
bryevdv and mattpap committed Oct 12, 2020
1 parent 658f80d commit cc7f077
Show file tree
Hide file tree
Showing 28 changed files with 79 additions and 21 deletions.
1 change: 1 addition & 0 deletions bokehjs/make/tasks/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function sys_path(): string {
path.push("/Applications/Google\ Chrome.app/Contents/MacOS/")
break
case "Windows_NT":
path.push("c:\\Program Files\\Google\\Chrome\\Application\\")
path.push("c:\\Program Files (x86)\\Google\\Chrome\\Application\\")
break
}
Expand Down
2 changes: 1 addition & 1 deletion bokehjs/src/lib/core/properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export abstract class Property<T = unknown> {

readonly change: Signal0<HasProps>

readonly internal: boolean
/*readonly*/ internal: boolean
readonly optional: boolean

constructor(readonly obj: HasProps,
Expand Down
23 changes: 15 additions & 8 deletions bokehjs/src/lib/models/renderers/glyph_renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ export class GlyphRendererView extends DataRendererView {
if (this.hover_glyph != null)
this.connect(this.model.data_source.inspect, () => this.request_render())
this.connect(this.model.properties.view.change, () => this.set_data())
this.connect(this.model.view.change, () => this.set_data())
this.connect(this.model.view.properties.indices.change, () => this.set_data())
this.connect(this.model.view.properties.masked.change, () => this.set_visuals())
this.connect(this.model.properties.visible.change, () => this.plot_view.update_dataranges())

const {x_ranges, y_ranges} = this.plot_view.frame
Expand Down Expand Up @@ -160,13 +161,7 @@ export class GlyphRendererView extends DataRendererView {
const {all_indices} = this

this.glyph.set_data(source, all_indices, indices)

this.glyph.set_visuals(source, all_indices)
this.decimated_glyph.set_visuals(source, all_indices)
this.selection_glyph?.set_visuals(source, all_indices)
this.nonselection_glyph?.set_visuals(source, all_indices)
this.hover_glyph?.set_visuals(source, all_indices)
this.muted_glyph?.set_visuals(source, all_indices)
this.set_visuals()

this._update_masked_indices()

Expand All @@ -184,6 +179,18 @@ export class GlyphRendererView extends DataRendererView {
}
}

set_visuals(): void {
const source = this.model.data_source
const {all_indices} = this

this.glyph.set_visuals(source, all_indices)
this.decimated_glyph.set_visuals(source, all_indices)
this.selection_glyph?.set_visuals(source, all_indices)
this.nonselection_glyph?.set_visuals(source, all_indices)
this.hover_glyph?.set_visuals(source, all_indices)
this.muted_glyph?.set_visuals(source, all_indices)
}

get has_webgl(): boolean {
return this.glyph.has_webgl
}
Expand Down
6 changes: 6 additions & 0 deletions bokehjs/src/lib/models/renderers/graph_renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ export class GraphRendererView extends DataRendererView {

const {edge_renderer, node_renderer} = this.model

edge_renderer.glyph.properties.xs.internal = true
edge_renderer.glyph.properties.ys.internal = true

node_renderer.glyph.properties.x.internal = true
node_renderer.glyph.properties.y.internal = true

edge_renderer.glyph.xs = {expr: xs_expr}
edge_renderer.glyph.ys = {expr: ys_expr}

Expand Down
5 changes: 1 addition & 4 deletions bokehjs/src/lib/models/sources/cds_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ export class CDSView extends Model {
connect_signals(): void {
super.connect_signals()

this.connect(this.properties.filters.change, () => {
this.compute_indices()
this.change.emit()
})
this.connect(this.properties.filters.change, () => this.compute_indices())

const connect_listeners = () => {
const fn = () => this.compute_indices()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Plot bbox=[0, 0, 200, 200]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bokehjs/test/baselines/linux/Widgets__should_allow_Slider.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bokehjs/test/baselines/macos/Widgets__should_allow_DateSlider.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bokehjs/test/baselines/macos/Widgets__should_allow_Slider.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bokehjs/test/baselines/windows/Widgets__should_allow_Slider.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion bokehjs/test/devtools/devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ async function run_tests(): Promise<boolean> {
await Network.enable()
await Network.setCacheDisabled({cacheDisabled: true})

await Runtime.enable()
await Page.enable()
await Page.navigate({url: "about:blank"})

await Runtime.enable()
await Log.enable()

async function override_metrics(dpr: number = 1): Promise<void> {
Expand Down
44 changes: 44 additions & 0 deletions bokehjs/test/integration/regressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import {
Range1d, DataRange1d, FactorRange,
ColumnDataSource, CDSView, BooleanFilter, Selection,
LinearAxis, CategoricalAxis,
GlyphRenderer,
Circle, Quad,
Plot,
} from "@bokehjs/models"

import {Factor} from "@bokehjs/models/ranges/factor_range"
Expand Down Expand Up @@ -356,4 +359,45 @@ describe("Bug", () => {
await display(row([p0, p1]), [450, 250])
})
})

describe("in issue holoviews#4589", () => {
it("disallows rendering two glyphs sharing a source and view", async () => {
const source = new ColumnDataSource({
data: {
x: [0],
y: [0],
left: [1],
right: [2],
bottom: [1],
top: [2],
},
})

const view = new CDSView({source})

const circle_renderer = new GlyphRenderer({
data_source: source,
glyph: new Circle(),
view,
})

const quad_renderer = new GlyphRenderer({
data_source: source,
glyph: new Quad(),
view,
})

const x_range = new Range1d({start: -1, end: 3})
const y_range = new Range1d({start: -1, end: 3})

const p = new Plot({
width: 200, height: 200,
x_range, y_range,
title: null, toolbar_location: null,
renderers: [circle_renderer, quad_renderer],
})

await display(p, [250, 250])
})
})
})
4 changes: 2 additions & 2 deletions ci/environment-test-3.6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ dependencies:
- psutil
- pydot
- pygments
- pytest >=6.0.0
- pytest-asyncio >=0.12.0
- pytest 6.0*
- pytest-asyncio=0.12.0
- pytest-cov >=1.8.1
- pytest-html
- pytest-xdist
Expand Down
4 changes: 2 additions & 2 deletions ci/environment-test-3.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ dependencies:
- psutil
- pydot
- pygments
- pytest >=6.0.0
- pytest-asyncio >=0.12.0
- pytest 6.0*
- pytest-asyncio=0.12.0
- pytest-cov >=1.8.1
- pytest-html
- pytest-xdist
Expand Down
4 changes: 2 additions & 2 deletions ci/environment-test-3.8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ dependencies:
- psutil
- pydot
- pygments
- pytest >=6.0.0
- pytest-asyncio >=0.12.0
- pytest 6.0*
- pytest-asyncio=0.12.0
- pytest-cov >=1.8.1
- pytest-html
- pytest-xdist
Expand Down
Empty file added ci/examples.log
Empty file.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dependencies:
- pandas
- psutil
- pydot
- pytest >=6.0.0
- pytest 6.0*
- pytest-asyncio >=0.12.0
- pytest-cov >=1.8.1
- pytest-html
Expand Down

0 comments on commit cc7f077

Please sign in to comment.