-
Notifications
You must be signed in to change notification settings - Fork 796
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
BUG: composing multiple selections #1707
Conversation
I think |
Actually, it looks like those compound operands are not fully implemented currently. |
Relevant issue is #695 |
I think I got the compound operators working: class Foo(object):
def __init__(self, name):
self.name = name
def __invert__(self):
return Foo({'not': self.name})
def __repr__(self):
return str(self.name)
def __or__(self, other):
return Foo({'or': [self.name, other]})
def __and__(self, other):
return Foo({'and': [self.name, other]})
x = Foo('s1')
y = Foo('s2')
z = Foo('s3') x | ~y
~x | y
~x | ~y
~(x & y)
~z | x & ~y
|
Yeah, that's how to implement them. The challenge is that the relevant classes are auto-generated, so we'll need to create wrappers in order to define the operators correctly. And there are a lot of relevant classes. |
I've changed the operators ( I add some tests to verify, but (!) also had to change some tests to make all tests pass. Please have a look. |
ENH: Recommit removed commits #1707
This PR has still some issues, but it adds some documentation + inline example to compose multiple selections as discussed in #1704.
I tried to emulate the Vega-Lite example from here, but preferred to hold the ctrl-key or shift-key to separately initiate the selections.
I don't know how to make the following Vega-Lite example with bitwise operators work in Altair:
I tried some (eg.
~alex & ~morgan
and~[alex & morgan]
), but got none working.