Skip to content

Commit

Permalink
fix: hardwire SELECTION_ID as the only valid field for regions
Browse files Browse the repository at this point in the history
  • Loading branch information
arvind committed Jul 6, 2023
1 parent b9d5cdc commit 070f2f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/compile/selection/region.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ import {SelectionCompiler, TUPLE, unitName} from '.';
import {warn} from '../../log';
import {BRUSH} from './interval';
import scales from './scales';
import {SELECTION_ID} from '../../selection';
export const SCREEN_PATH = '_screen_path';

const region: SelectionCompiler<'region'> = {
defined: selCmpt => selCmpt.type === 'region',

parse: (model, selCmpt, selDef) => {
// Region selections are only valid over the SELECTION_ID field.
// As a result, we don't expose "fields" as a valid property of the interface
// and instead hardwire it here during parsing.
selDef.select = {type: 'region', fields: [SELECTION_ID]} as any;
},

signals: (model, selCmpt, signals) => {
const name = selCmpt.name;
const signalsToAdd: Signal[] = [];
Expand Down

0 comments on commit 070f2f5

Please sign in to comment.