Vega-lite: Selections break when field names are channel names

Created on 14 May 2019  路  9Comments  路  Source: vega/vega-lite

Howdy all

I'm trying to use altair to make an interactive display. When I make the static image on a subset of the data, it works fine.

image

When I try to add in the brush, things get wonky and it doesn't even let me use a brush!

image

An example from the altair site works fine though, including the brush.

image

@domoritz suggested I should post the issue and the vega here. I've attached the json file (which is named txt so that GitHub will support it.

I am using altair v3.0.1, vega v2.1.0, jupyter notebook version 5.7.8, Python 3.6

vega.txt

Bug

All 9 comments

A minimal reproduction in the vega editor is here.

(first reported in https://github.com/altair-viz/altair/issues/1503)

Even more minimal example is here.

Ahh, so the problem is that we are generating signals that seem to be colling between x and y channels and fields.

If I change the names from x and y to xcoord and ycoord, it works.

@arvind I'm thinking of renaming the signals we usually create for x and y and adding a _brush to the name in index.ts. Where do I need to then change things to generate the right signals?

Of note: this works correctly in altair 2.4.1, but not in altair 3.0.1 (see my issue on the altair repository)

Thanks for reporting this, @jmschrei and @hannahburkhardt. The selection code already takes care of renaming conflicting signal names when channel and field names collide, so the fix @domoritz suggests shouldn't be necessary. Instead, it looks like the brush marks generated by interval.ts are still hardcoded to use signal names of the format ${name}_x or ${name}_y rather than reading off their values from selCmpt.project. I should be able to fix this first thing tomorrow.

Should be fixed with #4960.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

infai-feineis picture infai-feineis  路  3Comments

kanitw picture kanitw  路  3Comments

mcnuttandrew picture mcnuttandrew  路  3Comments

swanderz picture swanderz  路  4Comments

ijlyttle picture ijlyttle  路  4Comments