observablehq / feedback

Customer submitted bugs and feature requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regression of behaviour of signals/viewof for layered vega-lite with multiple signals

RobinL opened this issue · comments

The following schema has two signals, one on each layer:

schema $schema: "https://vega.github.io/schema/vega-lite/v5.json", vconcat: [ { params: [ { name: "brush1", select: { type: "interval", encodings: ["x"] } } ], data: { values: [ { x: 1, y: 3 }, { x: 2, y: 2 }, { x: 3, y: 4 } ] }, mark: "line", encoding: { x: { field: "x", type: "ordinal" }, y: { field: "y", type: "quantitative" } } }, { selection: { gam_concat_signal: { type: "single", encodings: ["x"] } }, data: { values: [ { x: 1, y: 2 }, { x: 2, y: 4 }, { x: 3, y: 3 } ] }, mark: "bar", encoding: { x: { field: "x", type: "ordinal" }, y: { field: "y", type: "quantitative" } } } ] };

Open the Chart in the Vega Editor

In the vega editor, both signals display correctly in the signal viewer.

If I use Generators.observe to observe the signals, then historically in observablehq, both signals could be successfully observed.

However, some of my notebooks recently broke. With no changes to the code, only the brush1 signal now is observable.

The fix is using specific vega/vega-lite versions:

embedWithSpecificVersions = require.alias({
  vega: "vega@5.21.0",
  "vega-lite": "vega-lite@5.2.0"
})("vega-embed@6")

Working version notebook

Non-working version notebook

Apologies - I struggle to understand where I should raise this issue because it's unclear whether it's a vega issue (but the signals are viewable in the vega lite editor), a vega embed issue (something to do with viewof) or an observable runtime issue. Grateful for any advice.