Skip to content

Commit

Permalink
Selection clearing should account for toggling.
Browse files Browse the repository at this point in the history
  • Loading branch information
arvind committed Apr 5, 2019
1 parent 519a2b6 commit 6b81dd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/compile/selection/transforms/clear.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Update} from 'vega';
import {TUPLE} from '..';
import {varName} from '../../../util';
import inputBindings from './inputs';
import toggle, {TOGGLE} from './toggle';
import {TransformCompiler} from './transforms';

const clear: TransformCompiler = {
Expand Down Expand Up @@ -41,8 +42,13 @@ const clear: TransformCompiler = {
}
});
} else {
const tIdx = signals.findIndex(n => n.name === selCmpt.name + TUPLE);
let tIdx = signals.findIndex(n => n.name === selCmpt.name + TUPLE);
addClear(tIdx, 'null');

if (toggle.has(selCmpt)) {
tIdx = signals.findIndex(n => n.name === selCmpt.name + TOGGLE);
addClear(tIdx, 'false');
}
}

return signals;
Expand Down
2 changes: 1 addition & 1 deletion src/compile/selection/transforms/toggle.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {TUPLE, unitName} from '..';
import {TransformCompiler} from './transforms';

const TOGGLE = '_toggle';
export const TOGGLE = '_toggle';

const toggle: TransformCompiler = {
has: selCmpt => {
Expand Down

0 comments on commit 6b81dd2

Please sign in to comment.