From da30cf47e7e78b717f455df46791c15d557838f1 Mon Sep 17 00:00:00 2001 From: Arvind Satyanarayan Date: Sun, 19 Aug 2018 22:27:51 -0400 Subject: [PATCH 01/18] Add "init" property to initialize selections w/fields or channels. --- examples/specs/interactive_query_widgets.vl.json | 1 + src/compile/selection/multi.ts | 3 ++- src/compile/selection/selection.ts | 8 ++------ src/compile/selection/transforms/inputs.ts | 7 ++++--- src/compile/selection/transforms/project.ts | 11 ++++++++--- src/selection.ts | 1 + 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/examples/specs/interactive_query_widgets.vl.json b/examples/specs/interactive_query_widgets.vl.json index 49e0f7dab8..0a76106d8e 100644 --- a/examples/specs/interactive_query_widgets.vl.json +++ b/examples/specs/interactive_query_widgets.vl.json @@ -7,6 +7,7 @@ "selection": { "CylYr": { "type": "single", "fields": ["Cylinders", "Year"], + "init": {"Cylinders": 4, "Year": 1977}, "bind": { "Cylinders": {"input": "range", "min": 3, "max": 8, "step": 1}, "Year": {"input": "range", "min": 1969, "max": 1981, "step": 1} diff --git a/src/compile/selection/multi.ts b/src/compile/selection/multi.ts index 524f787e06..c349163f59 100644 --- a/src/compile/selection/multi.ts +++ b/src/compile/selection/multi.ts @@ -6,6 +6,7 @@ import {TUPLE_FIELDS} from './transforms/project'; export function signals(model: UnitModel, selCmpt: SelectionComponent) { const name = selCmpt.name; const fieldsSg = name + TUPLE + TUPLE_FIELDS; + const init = selCmpt.init; const proj = selCmpt.project; const datum = '(item().isVoronoi ? datum.datum : datum)'; const values = proj @@ -29,7 +30,7 @@ export function signals(model: UnitModel, selCmpt: SelectionComponent) { return [ { name: name + TUPLE, - value: {}, + update: init ? `{unit: ${unitName(model)}, fields: ${fieldsSg}, values: ${JSON.stringify(selCmpt.init)}}` : '', on: [ { events: selCmpt.events, diff --git a/src/compile/selection/selection.ts b/src/compile/selection/selection.ts index cd1023e585..d8ead2a217 100644 --- a/src/compile/selection/selection.ts +++ b/src/compile/selection/selection.ts @@ -28,6 +28,7 @@ export const VL_SELECTION_RESOLVE = 'vlSelectionResolve'; export interface SelectionComponent { name: string; type: SelectionType; + init?: (number | string)[]; events: VgEventStream; // predicate?: string; bind?: 'scales' | Binding | Dict; @@ -136,12 +137,7 @@ export function assembleUnitSelectionSignals(model: UnitModel, signals: any[]) { signals.push({ name: name + MODIFY, - on: [ - { - events: {signal: name + TUPLE}, - update: `modify(${stringValue(selCmpt.name + STORE)}, ${modifyExpr})` - } - ] + update: `modify(${stringValue(selCmpt.name + STORE)}, ${modifyExpr})` }); }); diff --git a/src/compile/selection/transforms/inputs.ts b/src/compile/selection/transforms/inputs.ts index 2cfa4f46bd..b4ae884d71 100644 --- a/src/compile/selection/transforms/inputs.ts +++ b/src/compile/selection/transforms/inputs.ts @@ -13,15 +13,16 @@ const inputBindings: TransformCompiler = { const name = selCmpt.name; const proj = selCmpt.project; const bind = selCmpt.bind; + const init = selCmpt.init; const datum = nearest.has(selCmpt) ? '(item().isVoronoi ? datum.datum : datum)' : 'datum'; - for (const p of proj) { + proj.forEach((p, i) => { const sgname = varName(`${name}_${p.field}`); const hasSignal = signals.filter(s => s.name === sgname); if (!hasSignal.length) { signals.unshift({ name: sgname, - value: '', + value: init ? init[i] : null, on: [ { events: selCmpt.events, @@ -31,7 +32,7 @@ const inputBindings: TransformCompiler = { bind: bind[p.field] || bind[p.channel] || bind }); } - } + }); return signals; }, diff --git a/src/compile/selection/transforms/project.ts b/src/compile/selection/transforms/project.ts index 741175139f..696eb4a774 100644 --- a/src/compile/selection/transforms/project.ts +++ b/src/compile/selection/transforms/project.ts @@ -18,12 +18,13 @@ const project: TransformCompiler = { parse: (model, selDef, selCmpt) => { const timeUnits: Dict = {}; const f: Dict = {}; - const p = selCmpt.project || (selCmpt.project = []); + const proj = selCmpt.project || (selCmpt.project = []); + const init = selDef.init; selCmpt.fields = {}; // TODO: find a possible channel mapping for these fields. if (selDef.fields) { - p.push(...selDef.fields.map(field => ({field, type: 'E'}))); + proj.push(...selDef.fields.map(field => ({field, type: 'E'}))); } for (const channel of selDef.encodings || []) { @@ -60,7 +61,7 @@ const project: TransformCompiler = { type = 'R-RE'; } - p.push((f[field] = {field, channel, type})); + proj.push((f[field] = {field, channel, type})); } selCmpt.fields[channel] = field; @@ -69,6 +70,10 @@ const project: TransformCompiler = { } } + if (init) { + selCmpt.init = proj.map(p => init[p.channel] || init[p.field]); + } + if (keys(timeUnits).length) { selCmpt.timeUnit = new TimeUnitNode(null, timeUnits); } diff --git a/src/selection.ts b/src/selection.ts index efcae2d90b..6e7382b0a0 100644 --- a/src/selection.ts +++ b/src/selection.ts @@ -43,6 +43,7 @@ export interface BaseSelectionDef { * When set to `none`, empty selections contain no data values. */ empty?: 'all' | 'none'; + init?: {[key: string]: number | string}; } export interface SingleSelectionConfig extends BaseSelectionDef { From 491c96c31784ad8237ac8fe045c68f6d9211a4e4 Mon Sep 17 00:00:00 2001 From: Arvind Satyanarayan Date: Mon, 20 Aug 2018 10:57:03 -0400 Subject: [PATCH 02/18] Allow interval selections to be initialized. --- examples/specs/interactive_brush.vl.json | 3 +- src/compile/selection/interval.ts | 48 ++++++++++++++++-------- src/compile/selection/multi.ts | 12 ++++-- src/compile/selection/selection.ts | 2 +- src/selection.ts | 2 +- 5 files changed, 44 insertions(+), 23 deletions(-) diff --git a/examples/specs/interactive_brush.vl.json b/examples/specs/interactive_brush.vl.json index 04246ebaf6..80b3e08007 100644 --- a/examples/specs/interactive_brush.vl.json +++ b/examples/specs/interactive_brush.vl.json @@ -4,7 +4,8 @@ "data": {"url": "data/cars.json"}, "selection": { "brush": { - "type": "interval" + "type": "interval", + "init": {"x": [55, 160], "y": [13, 37]} } }, "mark": "point", diff --git a/src/compile/selection/interval.ts b/src/compile/selection/interval.ts index 6aa56e1e2c..29a8febe7b 100644 --- a/src/compile/selection/interval.ts +++ b/src/compile/selection/interval.ts @@ -39,14 +39,14 @@ const interval: SelectionCompiler = { }); } - for (const p of selCmpt.project) { + selCmpt.project.forEach((p, i) => { const channel = p.channel; if (channel !== X && channel !== Y) { warn('Interval selections only support x and y encoding channels.'); - continue; + return; } - const cs = channelSignals(model, selCmpt, channel); + const cs = channelSignals(model, selCmpt, channel, i); const dname = channelSignalName(selCmpt, channel, 'data'); const vname = channelSignalName(selCmpt, channel, 'visual'); const scaleStr = stringValue(model.scaleName(channel)); @@ -63,7 +63,7 @@ const interval: SelectionCompiler = { `(${toNum}invert(${scaleStr}, ${vname})[0] === ${toNum}${dname}[0] && ` + `${toNum}invert(${scaleStr}, ${vname})[1] === ${toNum}${dname}[1]))` }); - } + }); // Proxy scale reactions to ensure that an infinite loop doesn't occur // when an interval selection filter touches the scale. @@ -77,15 +77,20 @@ const interval: SelectionCompiler = { // Only add an interval to the store if it has valid data extents. Data extents // are set to null if pixel extents are equal to account for intervals over // ordinal/nominal domains which, when inverted, will still produce a valid datum. + const init = selCmpt.init; + const update = `unit: ${unitName(model)}, fields: ${fieldsSg}, values`; return signals.concat({ name: name + TUPLE, + ...(init + ? { + update: `{${update}: ${JSON.stringify(init)}}`, + react: false + } + : {}), on: [ { events: dataSignals.map(t => ({signal: t})), - update: - dataSignals.join(' && ') + - ` ? {unit: ${unitName(model)}, fields: ${fieldsSg}, ` + - `values: [${dataSignals.join(', ')}]} : null` + update: dataSignals.join(' && ') + ` ? {${update}: [${dataSignals}]} : null` } ] }); @@ -177,17 +182,19 @@ export default interval; /** * Returns the visual and data signals for an interval selection. */ -function channelSignals(model: UnitModel, selCmpt: SelectionComponent, channel: 'x' | 'y'): any { +function channelSignals(model: UnitModel, selCmpt: SelectionComponent, channel: 'x' | 'y', idx: number): any { const vname = channelSignalName(selCmpt, channel, 'visual'); const dname = channelSignalName(selCmpt, channel, 'data'); + const init = selCmpt.init && (selCmpt.init[idx] as number[] | string[]); const hasScales = scales.has(selCmpt); - const scaleName = model.scaleName(channel); - const scaleStr = stringValue(scaleName); + const scaleName = stringValue(model.scaleName(channel)); const scale = model.getScaleComponent(channel); const scaleType = scale ? scale.get('type') : undefined; const size = model.getSizeSignalRef(channel === X ? 'width' : 'height').signal; const coord = `${channel}(unit)`; + const scaleStr = (arr: string[]) => '[' + arr.map(s => `scale(${scaleName}, ${s})`) + ']'; + const on = events(selCmpt, (def: any[], evt: VgEventStream) => { return def.concat( {events: evt.between[0], update: `[${coord}, ${coord}]`}, // Brush Start @@ -201,9 +208,7 @@ function channelSignals(model: UnitModel, selCmpt: SelectionComponent, channel: on.push({ events: {signal: selCmpt.name + SCALE_TRIGGER}, update: - hasContinuousDomain(scaleType) && !isBinScale(scaleType) - ? `[scale(${scaleStr}, ${dname}[0]), scale(${scaleStr}, ${dname}[1])]` - : `[0, 0]` + hasContinuousDomain(scaleType) && !isBinScale(scaleType) ? scaleStr([`${dname}[0]`, `${dname}[1]`]) : `[0, 0]` }); return hasScales @@ -211,12 +216,23 @@ function channelSignals(model: UnitModel, selCmpt: SelectionComponent, channel: : [ { name: vname, - value: [], + ...(init + ? { + update: scaleStr([init[0], init[init.length - 1]].map(x => JSON.stringify(x))), + react: false + } + : {value: []}), on: on }, { name: dname, - on: [{events: {signal: vname}, update: `${vname}[0] === ${vname}[1] ? null : invert(${scaleStr}, ${vname})`}] + ...(init ? {value: init} : {}), + on: [ + { + events: {signal: vname}, + update: `${vname}[0] === ${vname}[1] ? null : invert(${scaleName}, ${vname})` + } + ] } ]; } diff --git a/src/compile/selection/multi.ts b/src/compile/selection/multi.ts index c349163f59..927eaf5141 100644 --- a/src/compile/selection/multi.ts +++ b/src/compile/selection/multi.ts @@ -27,16 +27,20 @@ export function signals(model: UnitModel, selCmpt: SelectionComponent) { // for constant null states but varying toggles (e.g., shift-click in // whitespace followed by a click in whitespace; the store should only // be cleared on the second click). + const update = `unit: ${unitName(model)}, fields: ${fieldsSg}, values`; return [ { name: name + TUPLE, - update: init ? `{unit: ${unitName(model)}, fields: ${fieldsSg}, values: ${JSON.stringify(selCmpt.init)}}` : '', + ...(init + ? { + update: `{${update}: ${JSON.stringify(init)}}`, + react: false + } + : {value: []}), on: [ { events: selCmpt.events, - update: - `datum && item().mark.marktype !== 'group' ? ` + - `{unit: ${unitName(model)}, fields: ${fieldsSg}, values: [${values}]} : null`, + update: `datum && item().mark.marktype !== 'group' ? {${update}: [${values}]} : null`, force: true } ] diff --git a/src/compile/selection/selection.ts b/src/compile/selection/selection.ts index d8ead2a217..d6b7b720e1 100644 --- a/src/compile/selection/selection.ts +++ b/src/compile/selection/selection.ts @@ -28,7 +28,7 @@ export const VL_SELECTION_RESOLVE = 'vlSelectionResolve'; export interface SelectionComponent { name: string; type: SelectionType; - init?: (number | string)[]; + init?: (number | string | number[] | string[])[]; events: VgEventStream; // predicate?: string; bind?: 'scales' | Binding | Dict; diff --git a/src/selection.ts b/src/selection.ts index 6e7382b0a0..3d19911c25 100644 --- a/src/selection.ts +++ b/src/selection.ts @@ -43,7 +43,7 @@ export interface BaseSelectionDef { * When set to `none`, empty selections contain no data values. */ empty?: 'all' | 'none'; - init?: {[key: string]: number | string}; + init?: {[key: string]: number | string | number[] | string[]}; } export interface SingleSelectionConfig extends BaseSelectionDef { From 4fd55b6a0f684ee88395802e7446fade4c06e346 Mon Sep 17 00:00:00 2001 From: Arvind Satyanarayan Date: Mon, 20 Aug 2018 11:19:17 -0400 Subject: [PATCH 03/18] Update existing tests for minor syntax changes introduced. This commit helps verify that introducing the `init` property for selections should not affect their existing compile- or run-time functionality. --- src/compile/selection/multi.ts | 2 +- src/compile/selection/transforms/inputs.ts | 2 +- test/compile/selection/inputs.test.ts | 5 ---- test/compile/selection/interval.test.ts | 29 ++++++---------------- test/compile/selection/multi.test.ts | 2 -- test/compile/selection/single.test.ts | 16 ++---------- test/compile/selection/toggle.test.ts | 14 ++--------- 7 files changed, 13 insertions(+), 57 deletions(-) diff --git a/src/compile/selection/multi.ts b/src/compile/selection/multi.ts index 927eaf5141..243b766a46 100644 --- a/src/compile/selection/multi.ts +++ b/src/compile/selection/multi.ts @@ -36,7 +36,7 @@ export function signals(model: UnitModel, selCmpt: SelectionComponent) { update: `{${update}: ${JSON.stringify(init)}}`, react: false } - : {value: []}), + : {}), on: [ { events: selCmpt.events, diff --git a/src/compile/selection/transforms/inputs.ts b/src/compile/selection/transforms/inputs.ts index b4ae884d71..e0644dde45 100644 --- a/src/compile/selection/transforms/inputs.ts +++ b/src/compile/selection/transforms/inputs.ts @@ -22,7 +22,7 @@ const inputBindings: TransformCompiler = { if (!hasSignal.length) { signals.unshift({ name: sgname, - value: init ? init[i] : null, + ...(init ? {value: init[i]} : {}), on: [ { events: selCmpt.events, diff --git a/test/compile/selection/inputs.test.ts b/test/compile/selection/inputs.test.ts index 824068b83c..d132de8561 100644 --- a/test/compile/selection/inputs.test.ts +++ b/test/compile/selection/inputs.test.ts @@ -61,7 +61,6 @@ describe('Inputs Selection Transform', () => { expect(selection.assembleTopLevelSignals(model, [])).toContainEqual({ name: 'one__vgsid_', - value: '', on: [ { events: [{source: 'scope', type: 'click'}], @@ -84,7 +83,6 @@ describe('Inputs Selection Transform', () => { expect.arrayContaining([ { name: 'two_Horsepower', - value: '', on: [ { events: [{source: 'scope', type: 'click'}], @@ -95,7 +93,6 @@ describe('Inputs Selection Transform', () => { }, { name: 'two_Cylinders', - value: '', on: [ { events: [{source: 'scope', type: 'click'}], @@ -120,7 +117,6 @@ describe('Inputs Selection Transform', () => { expect.arrayContaining([ { name: 'three_Origin', - value: '', on: [ { events: [{source: 'scope', type: 'click'}], @@ -135,7 +131,6 @@ describe('Inputs Selection Transform', () => { }, { name: 'three_Cylinders', - value: '', on: [ { events: [{source: 'scope', type: 'click'}], diff --git a/test/compile/selection/interval.test.ts b/test/compile/selection/interval.test.ts index 94ab799e63..02a5d34a24 100644 --- a/test/compile/selection/interval.test.ts +++ b/test/compile/selection/interval.test.ts @@ -63,7 +63,7 @@ describe('Interval Selections', () => { }, { events: {signal: 'one_scale_trigger'}, - update: '[scale("x", one_Horsepower[0]), scale("x", one_Horsepower[1])]' + update: '[scale("x", one_Horsepower[0]),scale("x", one_Horsepower[1])]' } ] }, @@ -115,7 +115,7 @@ describe('Interval Selections', () => { }, { events: {signal: 'thr_ee_scale_trigger'}, - update: '[scale("x", thr_ee_Horsepower[0]), scale("x", thr_ee_Horsepower[1])]' + update: '[scale("x", thr_ee_Horsepower[0]),scale("x", thr_ee_Horsepower[1])]' } ] }, @@ -150,7 +150,7 @@ describe('Interval Selections', () => { }, { events: {signal: 'thr_ee_scale_trigger'}, - update: '[scale("y", thr_ee_Miles_per_Gallon[0]), scale("y", thr_ee_Miles_per_Gallon[1])]' + update: '[scale("y", thr_ee_Miles_per_Gallon[0]),scale("y", thr_ee_Miles_per_Gallon[1])]' } ] }, @@ -202,7 +202,7 @@ describe('Interval Selections', () => { { events: [{signal: 'thr_ee_Horsepower'}, {signal: 'thr_ee_Miles_per_Gallon'}], update: - 'thr_ee_Horsepower && thr_ee_Miles_per_Gallon ? {unit: "", fields: thr_ee_tuple_fields, values: [thr_ee_Horsepower, thr_ee_Miles_per_Gallon]} : null' + 'thr_ee_Horsepower && thr_ee_Miles_per_Gallon ? {unit: "", fields: thr_ee_tuple_fields, values: [thr_ee_Horsepower,thr_ee_Miles_per_Gallon]} : null' } ] }); @@ -249,30 +249,15 @@ describe('Interval Selections', () => { expect.arrayContaining([ { name: 'one_modify', - on: [ - { - events: {signal: 'one_tuple'}, - update: `modify(\"one_store\", ${oneExpr})` - } - ] + update: `modify(\"one_store\", ${oneExpr})` }, { name: 'two_modify', - on: [ - { - events: {signal: 'two_tuple'}, - update: `modify(\"two_store\", ${twoExpr})` - } - ] + update: `modify(\"two_store\", ${twoExpr})` }, { name: 'thr_ee_modify', - on: [ - { - events: {signal: 'thr_ee_tuple'}, - update: `modify(\"thr_ee_store\", ${threeExpr})` - } - ] + update: `modify(\"thr_ee_store\", ${threeExpr})` } ]) ); diff --git a/test/compile/selection/multi.test.ts b/test/compile/selection/multi.test.ts index cdc212385d..723c2f6c1e 100644 --- a/test/compile/selection/multi.test.ts +++ b/test/compile/selection/multi.test.ts @@ -29,7 +29,6 @@ describe('Multi Selection', () => { expect(oneSg).toEqual([ { name: 'one_tuple', - value: {}, on: [ { events: selCmpts['one'].events, @@ -45,7 +44,6 @@ describe('Multi Selection', () => { expect(twoSg).toEqual([ { name: 'two_tuple', - value: {}, on: [ { events: selCmpts['two'].events, diff --git a/test/compile/selection/single.test.ts b/test/compile/selection/single.test.ts index fb43e86a0e..12876d90de 100644 --- a/test/compile/selection/single.test.ts +++ b/test/compile/selection/single.test.ts @@ -31,7 +31,6 @@ describe('Single Selection', () => { expect(oneSg).toEqual([ { name: 'one_tuple', - value: {}, on: [ { events: selCmpts['one'].events, @@ -47,7 +46,6 @@ describe('Single Selection', () => { expect(twoSg).toEqual([ { name: 'two_tuple', - value: {}, on: [ { events: selCmpts['two'].events, @@ -75,21 +73,11 @@ describe('Single Selection', () => { expect.arrayContaining([ { name: 'one_modify', - on: [ - { - events: {signal: 'one_tuple'}, - update: `modify(\"one_store\", ${oneExpr})` - } - ] + update: `modify(\"one_store\", ${oneExpr})` }, { name: 'two_modify', - on: [ - { - events: {signal: 'two_tuple'}, - update: `modify(\"two_store\", ${twoExpr})` - } - ] + update: `modify(\"two_store\", ${twoExpr})` } ]) ); diff --git a/test/compile/selection/toggle.test.ts b/test/compile/selection/toggle.test.ts index 99ca49114e..7dc72c0d1d 100644 --- a/test/compile/selection/toggle.test.ts +++ b/test/compile/selection/toggle.test.ts @@ -86,21 +86,11 @@ describe('Toggle Selection Transform', () => { expect.arrayContaining([ { name: 'one_modify', - on: [ - { - events: {signal: 'one_tuple'}, - update: `modify(\"one_store\", ${oneExpr})` - } - ] + update: `modify(\"one_store\", ${oneExpr})` }, { name: 'two_modify', - on: [ - { - events: {signal: 'two_tuple'}, - update: `modify(\"two_store\", ${twoExpr})` - } - ] + update: `modify(\"two_store\", ${twoExpr})` } ]) ); From ad1f0e7f1b7af6251d5ec6caaf4965b080e8a0ec Mon Sep 17 00:00:00 2001 From: Arvind Satyanarayan Date: Mon, 20 Aug 2018 14:19:49 -0400 Subject: [PATCH 04/18] Add compile- and run-time tests for initializing selections. --- src/compile/selection/transforms/project.ts | 7 +- src/log.ts | 2 + test-runtime/discrete.test.ts | 16 +++ test-runtime/interval.test.ts | 11 ++ test/compile/selection/interval.test.ts | 149 ++++++++++++++++++++ test/compile/selection/multi.test.ts | 53 ++++++- test/compile/selection/single.test.ts | 53 ++++++- 7 files changed, 286 insertions(+), 5 deletions(-) diff --git a/src/compile/selection/transforms/project.ts b/src/compile/selection/transforms/project.ts index 696eb4a774..c2198db888 100644 --- a/src/compile/selection/transforms/project.ts +++ b/src/compile/selection/transforms/project.ts @@ -5,6 +5,7 @@ import {SelectionDef} from '../../../selection'; import {Dict, keys} from '../../../util'; import {TimeUnitComponent, TimeUnitNode} from '../../data/timeunit'; import {ProjectSelectionComponent, SelectionComponent, TUPLE, TupleStoreType} from '../selection'; +import scales from './scales'; import {TransformCompiler} from './transforms'; export const TUPLE_FIELDS = '_fields'; @@ -71,7 +72,11 @@ const project: TransformCompiler = { } if (init) { - selCmpt.init = proj.map(p => init[p.channel] || init[p.field]); + if (scales.has(selCmpt)) { + log.warn(log.message.NO_INIT_SCALE_BINDINGS); + } else { + selCmpt.init = proj.map(p => (init[p.channel] !== undefined ? init[p.channel] : init[p.field])); + } } if (keys(timeUnits).length) { diff --git a/src/log.ts b/src/log.ts index 06fe2f08e1..e77571d4b3 100644 --- a/src/log.ts +++ b/src/log.ts @@ -119,6 +119,8 @@ export namespace message { export const SCALE_BINDINGS_CONTINUOUS = 'Scale bindings are currently only supported for scales with unbinned, continuous domains.'; + export const NO_INIT_SCALE_BINDINGS = 'Selections bound to scales cannot be separately initialized.'; + // REPEAT export function noSuchRepeatedValue(field: string) { return `Unknown repeated value "${field}".`; diff --git a/test-runtime/discrete.test.ts b/test-runtime/discrete.test.ts index 483a98fc62..8dcf76e63f 100644 --- a/test-runtime/discrete.test.ts +++ b/test-runtime/discrete.test.ts @@ -51,6 +51,22 @@ import {embedFn, hits as hitsMaster, pt, spec, testRenderFn} from './util'; test((i: number) => embed(spec('unit', i, {type, fields}))); }); + it('should initialize', () => { + embed( + spec('unit', 0, { + type, + encodings: ['x', 'color'], + init: {x: 4, color: 0} + }) + ); + const store = browser.execute('return view.data("sel_store")').value; + assert.lengthOf(store, 1); + assert.lengthOf(store[0].fields, 2); + assert.lengthOf(store[0].values, 2); + assert.deepEqual(store[0].values, [4, 0]); + testRender('init'); + }); + it('should clear out the store', () => { for (let i = 0; i < hits.qq_clear.length; i++) { embed(spec('unit', i, {type})); diff --git a/test-runtime/interval.test.ts b/test-runtime/interval.test.ts index c67a5e2e6d..e7e80db5cf 100644 --- a/test-runtime/interval.test.ts +++ b/test-runtime/interval.test.ts @@ -54,6 +54,17 @@ describe('interval selections at runtime in unit views', () => { } }); + it('should initialize', () => { + embed(spec('unit', 0, {type, init: {x: [2, 7], y: [25, 37]}})); + const store = browser.execute('return view.data("sel_store")').value; + assert.lengthOf(store, 1); + assert.lengthOf(store[0].fields, 2); + assert.lengthOf(store[0].values, 2); + assert.deepEqual(store[0].values[0], [2, 7]); + assert.deepEqual(store[0].values[1], [25, 37]); + testRender('init'); + }); + it('should clear out stored extents', () => { for (let i = 0; i < hits.drag_clear.length; i++) { embed(spec('unit', i, {type})); diff --git a/test/compile/selection/interval.test.ts b/test/compile/selection/interval.test.ts index 02a5d34a24..900c73e275 100644 --- a/test/compile/selection/interval.test.ts +++ b/test/compile/selection/interval.test.ts @@ -41,6 +41,19 @@ describe('Interval Selections', () => { strokeDashOffset: 3, strokeOpacity: 0.25 } + }, + four: { + type: 'interval', + translate: false, + zoom: false, + encodings: ['x'], + init: {x: [50, 70]} + }, + five: { + type: 'interval', + translate: false, + zoom: false, + init: {x: [50, 60], y: [23, 54]} } })); @@ -170,6 +183,115 @@ describe('Interval Selections', () => { } ]) ); + + const fourSg = interval.signals(model, selCmpts['four']); + expect(fourSg).toEqual( + expect.arrayContaining([ + { + name: 'four_x', + update: '[scale("x", 50),scale("x", 70)]', + react: false, + on: [ + { + events: parseSelector('mousedown', 'scope')[0], + update: '[x(unit), x(unit)]' + }, + { + events: parseSelector('[mousedown, window:mouseup] > window:mousemove!', 'scope')[0], + update: '[four_x[0], clamp(x(unit), 0, width)]' + }, + { + events: {signal: 'four_scale_trigger'}, + update: '[scale("x", four_Horsepower[0]),scale("x", four_Horsepower[1])]' + } + ] + }, + { + name: 'four_Horsepower', + value: [50, 70], + on: [ + { + events: {signal: 'four_x'}, + update: 'four_x[0] === four_x[1] ? null : invert("x", four_x)' + } + ] + }, + { + name: 'four_scale_trigger', + update: + '(!isArray(four_Horsepower) || (+invert("x", four_x)[0] === +four_Horsepower[0] && +invert("x", four_x)[1] === +four_Horsepower[1])) ? four_scale_trigger : {}' + } + ]) + ); + + const fiveSg = interval.signals(model, selCmpts['five']); + expect(fiveSg).toEqual( + expect.arrayContaining([ + { + name: 'five_x', + update: '[scale("x", 50),scale("x", 60)]', + react: false, + on: [ + { + events: parseSelector('mousedown', 'scope')[0], + update: '[x(unit), x(unit)]' + }, + { + events: parseSelector('[mousedown, window:mouseup] > window:mousemove!', 'scope')[0], + update: '[five_x[0], clamp(x(unit), 0, width)]' + }, + { + events: {signal: 'five_scale_trigger'}, + update: '[scale("x", five_Horsepower[0]),scale("x", five_Horsepower[1])]' + } + ] + }, + { + name: 'five_Horsepower', + value: [50, 60], + on: [ + { + events: {signal: 'five_x'}, + update: 'five_x[0] === five_x[1] ? null : invert("x", five_x)' + } + ] + }, + { + name: 'five_y', + update: '[scale("y", 23),scale("y", 54)]', + react: false, + on: [ + { + events: parseSelector('mousedown', 'scope')[0], + update: '[y(unit), y(unit)]' + }, + { + events: parseSelector('[mousedown, window:mouseup] > window:mousemove!', 'scope')[0], + update: '[five_y[0], clamp(y(unit), 0, height)]' + }, + { + events: {signal: 'five_scale_trigger'}, + update: '[scale("y", five_Miles_per_Gallon[0]),scale("y", five_Miles_per_Gallon[1])]' + } + ] + }, + { + name: 'five_Miles_per_Gallon', + value: [23, 54], + on: [ + { + events: {signal: 'five_y'}, + update: 'five_y[0] === five_y[1] ? null : invert("y", five_y)' + } + ] + }, + { + name: 'five_scale_trigger', + update: + '(!isArray(five_Horsepower) || (+invert("x", five_x)[0] === +five_Horsepower[0] && +invert("x", five_x)[1] === +five_Horsepower[1])) && (!isArray(five_Miles_per_Gallon) || (+invert("y", five_y)[0] === +five_Miles_per_Gallon[0] && +invert("y", five_y)[1] === +five_Miles_per_Gallon[1])) ? five_scale_trigger : {}' + } + ]) + ); }); it('builds trigger signals', () => { @@ -206,6 +328,33 @@ describe('Interval Selections', () => { } ] }); + + const fourSg = interval.signals(model, selCmpts['four']); + expect(fourSg).toContainEqual({ + name: 'four_tuple', + update: '{unit: "", fields: four_tuple_fields, values: [[50,70]]}', + react: false, + on: [ + { + events: [{signal: 'four_Horsepower'}], + update: 'four_Horsepower ? {unit: "", fields: four_tuple_fields, values: [four_Horsepower]} : null' + } + ] + }); + + const fiveSg = interval.signals(model, selCmpts['five']); + expect(fiveSg).toContainEqual({ + name: 'five_tuple', + update: '{unit: "", fields: five_tuple_fields, values: [[50,60],[23,54]]}', + react: false, + on: [ + { + events: [{signal: 'five_Horsepower'}, {signal: 'five_Miles_per_Gallon'}], + update: + 'five_Horsepower && five_Miles_per_Gallon ? {unit: "", fields: five_tuple_fields, values: [five_Horsepower,five_Miles_per_Gallon]} : null' + } + ] + }); }); it('namespaces signals when encoding/fields collide', () => { diff --git a/test/compile/selection/multi.test.ts b/test/compile/selection/multi.test.ts index 723c2f6c1e..6a25310e70 100644 --- a/test/compile/selection/multi.test.ts +++ b/test/compile/selection/multi.test.ts @@ -21,6 +21,16 @@ describe('Multi Selection', () => { on: 'mouseover', toggle: 'event.ctrlKey', encodings: ['y', 'color'] + }, + 'thr-ee': { + type: 'multi', + fields: ['Horsepower'], + init: {Horsepower: 50} + }, + four: { + type: 'multi', + encodings: ['x', 'color'], + init: {Horsepower: 50, color: 'Japan'} } })); @@ -55,13 +65,52 @@ describe('Multi Selection', () => { } ]); + const threeSg = multi.signals(model, selCmpts['thr_ee']); + expect(threeSg).toEqual([ + { + name: 'thr_ee_tuple', + update: '{unit: "", fields: thr_ee_tuple_fields, values: [50]}', + react: false, + on: [ + { + events: [{source: 'scope', type: 'click'}], + update: + 'datum && item().mark.marktype !== \'group\' ? {unit: "", fields: thr_ee_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)["Horsepower"]]} : null', + force: true + } + ] + } + ]); + + const fourSg = multi.signals(model, selCmpts['four']); + expect(fourSg).toEqual([ + { + name: 'four_tuple', + update: '{unit: "", fields: four_tuple_fields, values: [50,"Japan"]}', + react: false, + on: [ + { + events: [{source: 'scope', type: 'click'}], + update: + 'datum && item().mark.marktype !== \'group\' ? {unit: "", fields: four_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)["Horsepower"], (item().isVoronoi ? datum.datum : datum)["Origin"]]} : null', + force: true + } + ] + } + ]); + const signals = selection.assembleUnitSelectionSignals(model, []); - expect(signals).toEqual(expect.arrayContaining(oneSg.concat(twoSg))); + expect(signals).toEqual(expect.arrayContaining(oneSg.concat(twoSg, threeSg, fourSg))); }); it('builds unit datasets', () => { const data: any[] = []; - expect(selection.assembleUnitSelectionData(model, data)).toEqual([{name: 'one_store'}, {name: 'two_store'}]); + expect(selection.assembleUnitSelectionData(model, data)).toEqual([ + {name: 'one_store'}, + {name: 'two_store'}, + {name: 'thr_ee_store'}, + {name: 'four_store'} + ]); }); it('leaves marks alone', () => { diff --git a/test/compile/selection/single.test.ts b/test/compile/selection/single.test.ts index 12876d90de..0c87dae25c 100644 --- a/test/compile/selection/single.test.ts +++ b/test/compile/selection/single.test.ts @@ -23,6 +23,16 @@ describe('Single Selection', () => { on: 'mouseover', encodings: ['y', 'color'], resolve: 'intersect' + }, + 'thr-ee': { + type: 'single', + fields: ['Horsepower'], + init: {Horsepower: 50} + }, + four: { + type: 'single', + encodings: ['x', 'color'], + init: {x: 50, Origin: 'Japan'} } })); @@ -57,8 +67,42 @@ describe('Single Selection', () => { } ]); + const threeSg = single.signals(model, selCmpts['thr_ee']); + expect(threeSg).toEqual([ + { + name: 'thr_ee_tuple', + update: '{unit: "", fields: thr_ee_tuple_fields, values: [50]}', + react: false, + on: [ + { + events: [{source: 'scope', type: 'click'}], + update: + 'datum && item().mark.marktype !== \'group\' ? {unit: "", fields: thr_ee_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)["Horsepower"]]} : null', + force: true + } + ] + } + ]); + + const fourSg = single.signals(model, selCmpts['four']); + expect(fourSg).toEqual([ + { + name: 'four_tuple', + update: '{unit: "", fields: four_tuple_fields, values: [50,"Japan"]}', + react: false, + on: [ + { + events: [{source: 'scope', type: 'click'}], + update: + 'datum && item().mark.marktype !== \'group\' ? {unit: "", fields: four_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)["Horsepower"], (item().isVoronoi ? datum.datum : datum)["Origin"]]} : null', + force: true + } + ] + } + ]); + const signals = selection.assembleUnitSelectionSignals(model, []); - expect(signals).toEqual(expect.arrayContaining(oneSg.concat(twoSg))); + expect(signals).toEqual(expect.arrayContaining(oneSg.concat(twoSg, threeSg, fourSg))); }); it('builds modify signals', () => { @@ -106,7 +150,12 @@ describe('Single Selection', () => { it('builds unit datasets', () => { const data: any[] = []; - expect(selection.assembleUnitSelectionData(model, data)).toEqual([{name: 'one_store'}, {name: 'two_store'}]); + expect(selection.assembleUnitSelectionData(model, data)).toEqual([ + {name: 'one_store'}, + {name: 'two_store'}, + {name: 'thr_ee_store'}, + {name: 'four_store'} + ]); }); it('leaves marks alone', () => { From f99be515e5ad298a710468b2351cb5b87bb57b19 Mon Sep 17 00:00:00 2001 From: Arvind Satyanarayan Date: Wed, 17 Oct 2018 12:49:55 -0400 Subject: [PATCH 05/18] Support initializing selections with DateTime objects. --- src/compile/selection/interval.ts | 21 +++--- src/compile/selection/multi.ts | 4 +- src/compile/selection/selection.ts | 23 ++++++- src/compile/selection/transforms/inputs.ts | 5 +- src/selection.ts | 22 +++++- test/compile/selection/inputs.test.ts | 39 +++++++++++ test/compile/selection/interval.test.ts | 78 ++++++++++++++++++---- test/compile/selection/multi.test.ts | 31 ++++++++- test/compile/selection/single.test.ts | 2 +- 9 files changed, 187 insertions(+), 38 deletions(-) diff --git a/src/compile/selection/interval.ts b/src/compile/selection/interval.ts index 29a8febe7b..fd5536ed81 100644 --- a/src/compile/selection/interval.ts +++ b/src/compile/selection/interval.ts @@ -6,6 +6,7 @@ import {keys} from '../../util'; import {VgEventStream} from '../../vega.schema'; import {UnitModel} from '../unit'; import { + assembleInit, channelSignalName, positionalProjections, SelectionCompiler, @@ -83,7 +84,7 @@ const interval: SelectionCompiler = { name: name + TUPLE, ...(init ? { - update: `{${update}: ${JSON.stringify(init)}}`, + update: `{${update}: ${assembleInit(selCmpt.init)}}`, react: false } : {}), @@ -185,16 +186,15 @@ export default interval; function channelSignals(model: UnitModel, selCmpt: SelectionComponent, channel: 'x' | 'y', idx: number): any { const vname = channelSignalName(selCmpt, channel, 'visual'); const dname = channelSignalName(selCmpt, channel, 'data'); - const init = selCmpt.init && (selCmpt.init[idx] as number[] | string[]); + const init = selCmpt.init && selCmpt.init[idx]; const hasScales = scales.has(selCmpt); const scaleName = stringValue(model.scaleName(channel)); const scale = model.getScaleComponent(channel); const scaleType = scale ? scale.get('type') : undefined; + const scaled = (str: string) => `scale(${scaleName}, ${str})`; const size = model.getSizeSignalRef(channel === X ? 'width' : 'height').signal; const coord = `${channel}(unit)`; - const scaleStr = (arr: string[]) => '[' + arr.map(s => `scale(${scaleName}, ${s})`) + ']'; - const on = events(selCmpt, (def: any[], evt: VgEventStream) => { return def.concat( {events: evt.between[0], update: `[${coord}, ${coord}]`}, // Brush Start @@ -208,7 +208,9 @@ function channelSignals(model: UnitModel, selCmpt: SelectionComponent, channel: on.push({ events: {signal: selCmpt.name + SCALE_TRIGGER}, update: - hasContinuousDomain(scaleType) && !isBinScale(scaleType) ? scaleStr([`${dname}[0]`, `${dname}[1]`]) : `[0, 0]` + hasContinuousDomain(scaleType) && !isBinScale(scaleType) + ? `[${scaled(`${dname}[0]`)}, ${scaled(`${dname}[1]`)}]` + : `[0, 0]` }); return hasScales @@ -216,17 +218,12 @@ function channelSignals(model: UnitModel, selCmpt: SelectionComponent, channel: : [ { name: vname, - ...(init - ? { - update: scaleStr([init[0], init[init.length - 1]].map(x => JSON.stringify(x))), - react: false - } - : {value: []}), + ...(init ? {update: assembleInit(init, scaled), react: false} : {value: []}), on: on }, { name: dname, - ...(init ? {value: init} : {}), + ...(init ? {update: assembleInit(init)} : {}), on: [ { events: {signal: vname}, diff --git a/src/compile/selection/multi.ts b/src/compile/selection/multi.ts index 243b766a46..f7e17cdf94 100644 --- a/src/compile/selection/multi.ts +++ b/src/compile/selection/multi.ts @@ -1,6 +1,6 @@ import {accessPathWithDatum} from '../../util'; import {UnitModel} from '../unit'; -import {SelectionCompiler, SelectionComponent, TUPLE, unitName} from './selection'; +import {assembleInit, SelectionCompiler, SelectionComponent, TUPLE, unitName} from './selection'; import {TUPLE_FIELDS} from './transforms/project'; export function signals(model: UnitModel, selCmpt: SelectionComponent) { @@ -33,7 +33,7 @@ export function signals(model: UnitModel, selCmpt: SelectionComponent) { name: name + TUPLE, ...(init ? { - update: `{${update}: ${JSON.stringify(init)}}`, + update: `{${update}: ${assembleInit(selCmpt.init)}}`, react: false } : {}), diff --git a/src/compile/selection/selection.ts b/src/compile/selection/selection.ts index d6b7b720e1..bc7f7f5972 100644 --- a/src/compile/selection/selection.ts +++ b/src/compile/selection/selection.ts @@ -1,10 +1,19 @@ import {Binding, NewSignal, SignalRef} from 'vega'; import {selector as parseSelector} from 'vega-event-selector'; -import {isString, stringValue} from 'vega-util'; +import {identity, isArray, isString, stringValue} from 'vega-util'; import {Channel, ScaleChannel, SingleDefChannel, X, Y} from '../../channel'; +import {dateTimeExpr, isDateTime} from '../../datetime'; import {warn} from '../../log'; import {LogicalOperand} from '../../logical'; -import {BrushConfig, SELECTION_ID, SelectionDef, SelectionResolution, SelectionType} from '../../selection'; +import { + BrushConfig, + SELECTION_ID, + SelectionDef, + SelectionInit, + SelectionInitArray, + SelectionResolution, + SelectionType +} from '../../selection'; import {accessPathWithDatum, Dict, duplicate, keys, logicalExpr, varName} from '../../util'; import {VgData, VgEventStream} from '../../vega.schema'; import {DataFlowNode} from '../data/dataflow'; @@ -28,7 +37,7 @@ export const VL_SELECTION_RESOLVE = 'vlSelectionResolve'; export interface SelectionComponent { name: string; type: SelectionType; - init?: (number | string | number[] | string[])[]; + init?: (SelectionInit | SelectionInitArray)[]; events: VgEventStream; // predicate?: string; bind?: 'scales' | Binding | Dict; @@ -406,3 +415,11 @@ export function positionalProjections(selCmpt: SelectionComponent) { }); return {x, xi, y, yi}; } + +export function assembleInit(init: any, wrap: (str: string) => string = identity): string { + return isArray(init) + ? `[${init.map(v => assembleInit(v, wrap)).join(', ')}]` + : isDateTime(init) + ? wrap(dateTimeExpr(init)) + : wrap(JSON.stringify(init)); +} diff --git a/src/compile/selection/transforms/inputs.ts b/src/compile/selection/transforms/inputs.ts index e0644dde45..95a4bed86a 100644 --- a/src/compile/selection/transforms/inputs.ts +++ b/src/compile/selection/transforms/inputs.ts @@ -1,5 +1,5 @@ import {accessPathWithDatum, varName} from '../../../util'; -import {TUPLE} from '../selection'; +import {assembleInit, TUPLE} from '../selection'; import nearest from './nearest'; import {TUPLE_FIELDS} from './project'; import {TransformCompiler} from './transforms'; @@ -22,7 +22,7 @@ const inputBindings: TransformCompiler = { if (!hasSignal.length) { signals.unshift({ name: sgname, - ...(init ? {value: init[i]} : {}), + ...(init ? {update: assembleInit(init[i])} : {}), on: [ { events: selCmpt.events, @@ -51,6 +51,7 @@ const inputBindings: TransformCompiler = { delete signal.value; delete signal.on; + delete signal.react; return signals; } diff --git a/src/selection.ts b/src/selection.ts index 3d19911c25..123fc5fb9b 100644 --- a/src/selection.ts +++ b/src/selection.ts @@ -1,11 +1,15 @@ import {Binding} from 'vega'; import {SingleDefChannel} from './channel'; +import {DateTime} from './datetime'; import {VgEventStream} from './vega.schema'; export const SELECTION_ID = '_vgsid_'; export type SelectionType = 'single' | 'multi' | 'interval'; export type SelectionResolution = 'global' | 'union' | 'intersect'; +export type SelectionInit = boolean | number | string | DateTime; +export type SelectionInitArray = boolean[] | number[] | string[] | DateTime[]; + export interface BaseSelectionDef { /** * A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection. @@ -43,7 +47,6 @@ export interface BaseSelectionDef { * When set to `none`, empty selections contain no data values. */ empty?: 'all' | 'none'; - init?: {[key: string]: number | string | number[] | string[]}; } export interface SingleSelectionConfig extends BaseSelectionDef { @@ -64,6 +67,11 @@ export interface SingleSelectionConfig extends BaseSelectionDef { * See the [nearest transform](https://vega.github.io/vega-lite/docs/nearest.html) documentation for more information. */ nearest?: boolean; + + /** + * Initialize the selection with a mapping between field names and initial values. + */ + init?: {[key: string]: SelectionInit}; } export interface MultiSelectionConfig extends BaseSelectionDef { @@ -86,6 +94,12 @@ export interface MultiSelectionConfig extends BaseSelectionDef { * See the [nearest transform](https://vega.github.io/vega-lite/docs/nearest.html) documentation for more information. */ nearest?: boolean; + + /** + * Initialize the selection with a mapping between field names and an initial + * value (or array of values). + */ + init?: {[key: string]: SelectionInit}; } export interface BrushConfig { @@ -164,6 +178,12 @@ export interface IntervalSelectionConfig extends BaseSelectionDef { * appearance of the mark. */ mark?: BrushConfig; + + /** + * Initialize the selection with a mapping between field names and arrays of + * initial values. + */ + init?: {[key: string]: SelectionInitArray}; } export interface SingleSelection extends SingleSelectionConfig { diff --git a/test/compile/selection/inputs.test.ts b/test/compile/selection/inputs.test.ts index d132de8561..10aef382db 100644 --- a/test/compile/selection/inputs.test.ts +++ b/test/compile/selection/inputs.test.ts @@ -41,6 +41,16 @@ describe('Inputs Selection Transform', () => { six: { type: 'interval', bind: 'scales' + }, + seven: { + type: 'single', + fields: ['Year'], + bind: { + Year: {input: 'range', min: 1970, max: 1980, step: 1} + }, + init: { + Year: {year: 1970, month: 1, day: 1} + } } }); @@ -50,6 +60,7 @@ describe('Inputs Selection Transform', () => { expect(inputs.has(selCmpts['three'])).toBeTruthy(); expect(inputs.has(selCmpts['four'])).toBeFalsy(); expect(inputs.has(selCmpts['six'])).toBeFalsy(); + expect(inputs.has(selCmpts['seven'])).toBeTruthy(); }); it('adds widget binding for default projection', () => { @@ -149,4 +160,32 @@ describe('Inputs Selection Transform', () => { ]) ); }); + + it('respects initialization', () => { + model.component.selection = {seven: selCmpts['seven']}; + expect(selection.assembleUnitSelectionSignals(model, [])).toEqual( + expect.arrayContaining([ + { + name: 'seven_tuple', + update: 'seven_Year !== null ? {fields: seven_tuple_fields, values: [seven_Year]} : null' + } + ]) + ); + + expect(selection.assembleTopLevelSignals(model, [])).toEqual( + expect.arrayContaining([ + { + name: 'seven_Year', + update: 'datetime(1970, 1, 1+1, 0, 0, 0, 0)', + on: [ + { + events: [{source: 'scope', type: 'click'}], + update: 'datum && item().mark.marktype !== \'group\' ? datum["Year"] : null' + } + ], + bind: {input: 'range', min: 1970, max: 1980, step: 1} + } + ]) + ); + }); }); diff --git a/test/compile/selection/interval.test.ts b/test/compile/selection/interval.test.ts index 900c73e275..589a9e5d34 100644 --- a/test/compile/selection/interval.test.ts +++ b/test/compile/selection/interval.test.ts @@ -54,6 +54,15 @@ describe('Interval Selections', () => { translate: false, zoom: false, init: {x: [50, 60], y: [23, 54]} + }, + six: { + type: 'interval', + translate: false, + zoom: false, + encodings: ['x'], + init: { + x: [{year: 2000, month: 10, day: 5}, {year: 2001, month: 1, day: 13}] + } } })); @@ -76,7 +85,7 @@ describe('Interval Selections', () => { }, { events: {signal: 'one_scale_trigger'}, - update: '[scale("x", one_Horsepower[0]),scale("x", one_Horsepower[1])]' + update: '[scale("x", one_Horsepower[0]), scale("x", one_Horsepower[1])]' } ] }, @@ -128,7 +137,7 @@ describe('Interval Selections', () => { }, { events: {signal: 'thr_ee_scale_trigger'}, - update: '[scale("x", thr_ee_Horsepower[0]),scale("x", thr_ee_Horsepower[1])]' + update: '[scale("x", thr_ee_Horsepower[0]), scale("x", thr_ee_Horsepower[1])]' } ] }, @@ -163,7 +172,7 @@ describe('Interval Selections', () => { }, { events: {signal: 'thr_ee_scale_trigger'}, - update: '[scale("y", thr_ee_Miles_per_Gallon[0]),scale("y", thr_ee_Miles_per_Gallon[1])]' + update: '[scale("y", thr_ee_Miles_per_Gallon[0]), scale("y", thr_ee_Miles_per_Gallon[1])]' } ] }, @@ -189,7 +198,7 @@ describe('Interval Selections', () => { expect.arrayContaining([ { name: 'four_x', - update: '[scale("x", 50),scale("x", 70)]', + update: '[scale("x", 50), scale("x", 70)]', react: false, on: [ { @@ -202,13 +211,13 @@ describe('Interval Selections', () => { }, { events: {signal: 'four_scale_trigger'}, - update: '[scale("x", four_Horsepower[0]),scale("x", four_Horsepower[1])]' + update: '[scale("x", four_Horsepower[0]), scale("x", four_Horsepower[1])]' } ] }, { name: 'four_Horsepower', - value: [50, 70], + update: '[50, 70]', on: [ { events: {signal: 'four_x'}, @@ -229,7 +238,7 @@ describe('Interval Selections', () => { expect.arrayContaining([ { name: 'five_x', - update: '[scale("x", 50),scale("x", 60)]', + update: '[scale("x", 50), scale("x", 60)]', react: false, on: [ { @@ -242,13 +251,13 @@ describe('Interval Selections', () => { }, { events: {signal: 'five_scale_trigger'}, - update: '[scale("x", five_Horsepower[0]),scale("x", five_Horsepower[1])]' + update: '[scale("x", five_Horsepower[0]), scale("x", five_Horsepower[1])]' } ] }, { name: 'five_Horsepower', - value: [50, 60], + update: '[50, 60]', on: [ { events: {signal: 'five_x'}, @@ -258,7 +267,7 @@ describe('Interval Selections', () => { }, { name: 'five_y', - update: '[scale("y", 23),scale("y", 54)]', + update: '[scale("y", 23), scale("y", 54)]', react: false, on: [ { @@ -271,13 +280,13 @@ describe('Interval Selections', () => { }, { events: {signal: 'five_scale_trigger'}, - update: '[scale("y", five_Miles_per_Gallon[0]),scale("y", five_Miles_per_Gallon[1])]' + update: '[scale("y", five_Miles_per_Gallon[0]), scale("y", five_Miles_per_Gallon[1])]' } ] }, { name: 'five_Miles_per_Gallon', - value: [23, 54], + update: '[23, 54]', on: [ { events: {signal: 'five_y'}, @@ -292,6 +301,47 @@ describe('Interval Selections', () => { } ]) ); + + const sixSg = interval.signals(model, selCmpts['six']); + expect(sixSg).toEqual( + expect.arrayContaining([ + { + name: 'six_x', + update: + '[scale("x", datetime(2000, 10, 5+1, 0, 0, 0, 0)), scale("x", datetime(2001, 1, 13+1, 0, 0, 0, 0))]', + react: false, + on: [ + { + events: parseSelector('mousedown', 'scope')[0], + update: '[x(unit), x(unit)]' + }, + { + events: parseSelector('[mousedown, window:mouseup] > window:mousemove!', 'scope')[0], + update: '[six_x[0], clamp(x(unit), 0, width)]' + }, + { + events: {signal: 'six_scale_trigger'}, + update: '[scale("x", six_Horsepower[0]), scale("x", six_Horsepower[1])]' + } + ] + }, + { + name: 'six_Horsepower', + update: '[datetime(2000, 10, 5+1, 0, 0, 0, 0), datetime(2001, 1, 13+1, 0, 0, 0, 0)]', + on: [ + { + events: {signal: 'six_x'}, + update: 'six_x[0] === six_x[1] ? null : invert("x", six_x)' + } + ] + }, + { + name: 'six_scale_trigger', + update: + '(!isArray(six_Horsepower) || (+invert("x", six_x)[0] === +six_Horsepower[0] && +invert("x", six_x)[1] === +six_Horsepower[1])) ? six_scale_trigger : {}' + } + ]) + ); }); it('builds trigger signals', () => { @@ -332,7 +382,7 @@ describe('Interval Selections', () => { const fourSg = interval.signals(model, selCmpts['four']); expect(fourSg).toContainEqual({ name: 'four_tuple', - update: '{unit: "", fields: four_tuple_fields, values: [[50,70]]}', + update: '{unit: "", fields: four_tuple_fields, values: [[50, 70]]}', react: false, on: [ { @@ -345,7 +395,7 @@ describe('Interval Selections', () => { const fiveSg = interval.signals(model, selCmpts['five']); expect(fiveSg).toContainEqual({ name: 'five_tuple', - update: '{unit: "", fields: five_tuple_fields, values: [[50,60],[23,54]]}', + update: '{unit: "", fields: five_tuple_fields, values: [[50, 60], [23, 54]]}', react: false, on: [ { diff --git a/test/compile/selection/multi.test.ts b/test/compile/selection/multi.test.ts index 6a25310e70..cc7cf11c6a 100644 --- a/test/compile/selection/multi.test.ts +++ b/test/compile/selection/multi.test.ts @@ -31,6 +31,13 @@ describe('Multi Selection', () => { type: 'multi', encodings: ['x', 'color'], init: {Horsepower: 50, color: 'Japan'} + }, + five: { + type: 'multi', + fields: ['Year'], + init: { + Year: {year: 1970, month: 1, day: 1} + } } })); @@ -86,7 +93,7 @@ describe('Multi Selection', () => { expect(fourSg).toEqual([ { name: 'four_tuple', - update: '{unit: "", fields: four_tuple_fields, values: [50,"Japan"]}', + update: '{unit: "", fields: four_tuple_fields, values: [50, "Japan"]}', react: false, on: [ { @@ -99,8 +106,25 @@ describe('Multi Selection', () => { } ]); + const fiveSg = multi.signals(model, selCmpts['five']); + expect(fiveSg).toEqual([ + { + name: 'five_tuple', + update: '{unit: "", fields: five_tuple_fields, values: [datetime(1970, 1, 1+1, 0, 0, 0, 0)]}', + react: false, + on: [ + { + events: [{source: 'scope', type: 'click'}], + update: + 'datum && item().mark.marktype !== \'group\' ? {unit: "", fields: five_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)["Year"]]} : null', + force: true + } + ] + } + ]); + const signals = selection.assembleUnitSelectionSignals(model, []); - expect(signals).toEqual(expect.arrayContaining(oneSg.concat(twoSg, threeSg, fourSg))); + expect(signals).toEqual(expect.arrayContaining(oneSg.concat(twoSg, threeSg, fourSg, fiveSg))); }); it('builds unit datasets', () => { @@ -109,7 +133,8 @@ describe('Multi Selection', () => { {name: 'one_store'}, {name: 'two_store'}, {name: 'thr_ee_store'}, - {name: 'four_store'} + {name: 'four_store'}, + {name: 'five_store'} ]); }); diff --git a/test/compile/selection/single.test.ts b/test/compile/selection/single.test.ts index 0c87dae25c..8863cb52ab 100644 --- a/test/compile/selection/single.test.ts +++ b/test/compile/selection/single.test.ts @@ -88,7 +88,7 @@ describe('Single Selection', () => { expect(fourSg).toEqual([ { name: 'four_tuple', - update: '{unit: "", fields: four_tuple_fields, values: [50,"Japan"]}', + update: '{unit: "", fields: four_tuple_fields, values: [50, "Japan"]}', react: false, on: [ { From 09f1c39f32db4af308dfe7ccaf03f76206c4492e Mon Sep 17 00:00:00 2001 From: Arvind Satyanarayan Date: Wed, 17 Oct 2018 16:58:38 -0400 Subject: [PATCH 06/18] Support an array of initial values for multi-selections. --- src/compile/selection/interval.ts | 2 +- src/compile/selection/multi.ts | 27 ++++++++------ src/compile/selection/single.ts | 2 +- src/compile/selection/transforms/inputs.ts | 2 +- src/compile/selection/transforms/project.ts | 6 ++-- src/selection.ts | 7 ++-- test/compile/selection/multi.test.ts | 39 +++++++++++++++------ test/compile/selection/single.test.ts | 14 +++++--- 8 files changed, 66 insertions(+), 33 deletions(-) diff --git a/src/compile/selection/interval.ts b/src/compile/selection/interval.ts index fd5536ed81..d9892021a3 100644 --- a/src/compile/selection/interval.ts +++ b/src/compile/selection/interval.ts @@ -84,7 +84,7 @@ const interval: SelectionCompiler = { name: name + TUPLE, ...(init ? { - update: `{${update}: ${assembleInit(selCmpt.init)}}`, + update: `{${update}: ${assembleInit(init)}}`, react: false } : {}), diff --git a/src/compile/selection/multi.ts b/src/compile/selection/multi.ts index f7e17cdf94..d8f52f5f05 100644 --- a/src/compile/selection/multi.ts +++ b/src/compile/selection/multi.ts @@ -1,12 +1,12 @@ +import {stringValue} from 'vega-util'; import {accessPathWithDatum} from '../../util'; import {UnitModel} from '../unit'; -import {assembleInit, SelectionCompiler, SelectionComponent, TUPLE, unitName} from './selection'; +import {assembleInit, SelectionCompiler, SelectionComponent, STORE, TUPLE, unitName} from './selection'; import {TUPLE_FIELDS} from './transforms/project'; -export function signals(model: UnitModel, selCmpt: SelectionComponent) { +export function multiSignals(model: UnitModel, selCmpt: SelectionComponent) { const name = selCmpt.name; const fieldsSg = name + TUPLE + TUPLE_FIELDS; - const init = selCmpt.init; const proj = selCmpt.project; const datum = '(item().isVoronoi ? datum.datum : datum)'; const values = proj @@ -28,15 +28,9 @@ export function signals(model: UnitModel, selCmpt: SelectionComponent) { // whitespace followed by a click in whitespace; the store should only // be cleared on the second click). const update = `unit: ${unitName(model)}, fields: ${fieldsSg}, values`; - return [ + const signals: any[] = [ { name: name + TUPLE, - ...(init - ? { - update: `{${update}: ${assembleInit(selCmpt.init)}}`, - react: false - } - : {}), on: [ { events: selCmpt.events, @@ -46,10 +40,21 @@ export function signals(model: UnitModel, selCmpt: SelectionComponent) { ] } ]; + + if (selCmpt.init) { + const insert = selCmpt.init.map(i => `{${update}: ${assembleInit(i)}}`); + signals.push({ + name: `${name}_init`, + update: `modify(${stringValue(selCmpt.name + STORE)}, [${insert}])`, + react: false + }); + } + + return signals; } const multi: SelectionCompiler = { - signals: signals, + signals: multiSignals, modifyExpr: (model, selCmpt) => { const tpl = selCmpt.name + TUPLE; diff --git a/src/compile/selection/single.ts b/src/compile/selection/single.ts index 51885bd77e..8aea7458a7 100644 --- a/src/compile/selection/single.ts +++ b/src/compile/selection/single.ts @@ -1,4 +1,4 @@ -import {signals as multiSignals} from './multi'; +import {multiSignals} from './multi'; import {SelectionCompiler, TUPLE, unitName} from './selection'; const single: SelectionCompiler = { diff --git a/src/compile/selection/transforms/inputs.ts b/src/compile/selection/transforms/inputs.ts index 95a4bed86a..1b0c308ab4 100644 --- a/src/compile/selection/transforms/inputs.ts +++ b/src/compile/selection/transforms/inputs.ts @@ -13,7 +13,7 @@ const inputBindings: TransformCompiler = { const name = selCmpt.name; const proj = selCmpt.project; const bind = selCmpt.bind; - const init = selCmpt.init; + const init = selCmpt.init && selCmpt.init[0]; // Can only exist on single selections (one initial value). const datum = nearest.has(selCmpt) ? '(item().isVoronoi ? datum.datum : datum)' : 'datum'; proj.forEach((p, i) => { diff --git a/src/compile/selection/transforms/project.ts b/src/compile/selection/transforms/project.ts index c2198db888..f55d446145 100644 --- a/src/compile/selection/transforms/project.ts +++ b/src/compile/selection/transforms/project.ts @@ -1,3 +1,4 @@ +import {array} from 'vega-util'; import {ScaleChannel} from '../../../channel'; import * as log from '../../../log'; import {hasContinuousDomain, isBinScale} from '../../../scale'; @@ -75,7 +76,8 @@ const project: TransformCompiler = { if (scales.has(selCmpt)) { log.warn(log.message.NO_INIT_SCALE_BINDINGS); } else { - selCmpt.init = proj.map(p => (init[p.channel] !== undefined ? init[p.channel] : init[p.field])); + const parseInit = (i: any) => proj.map(p => (i[p.channel] !== undefined ? i[p.channel] : i[p.field])); + selCmpt.init = selCmpt.type === 'interval' ? parseInit(init) : array(init).map(parseInit); } } @@ -91,7 +93,7 @@ const project: TransformCompiler = { ? signals : signals.concat({ name, - update: `${JSON.stringify(selCmpt.project)}` + value: selCmpt.project }); } }; diff --git a/src/selection.ts b/src/selection.ts index 123fc5fb9b..b53c9e3320 100644 --- a/src/selection.ts +++ b/src/selection.ts @@ -9,6 +9,9 @@ export type SelectionResolution = 'global' | 'union' | 'intersect'; export type SelectionInit = boolean | number | string | DateTime; export type SelectionInitArray = boolean[] | number[] | string[] | DateTime[]; +export interface SelectionInitMapping { + [key: string]: SelectionInit; +} export interface BaseSelectionDef { /** @@ -71,7 +74,7 @@ export interface SingleSelectionConfig extends BaseSelectionDef { /** * Initialize the selection with a mapping between field names and initial values. */ - init?: {[key: string]: SelectionInit}; + init?: SelectionInitMapping; } export interface MultiSelectionConfig extends BaseSelectionDef { @@ -99,7 +102,7 @@ export interface MultiSelectionConfig extends BaseSelectionDef { * Initialize the selection with a mapping between field names and an initial * value (or array of values). */ - init?: {[key: string]: SelectionInit}; + init?: SelectionInitMapping | SelectionInitMapping[]; } export interface BrushConfig { diff --git a/test/compile/selection/multi.test.ts b/test/compile/selection/multi.test.ts index cc7cf11c6a..b6497762db 100644 --- a/test/compile/selection/multi.test.ts +++ b/test/compile/selection/multi.test.ts @@ -34,10 +34,17 @@ describe('Multi Selection', () => { }, five: { type: 'multi', - fields: ['Year'], - init: { - Year: {year: 1970, month: 1, day: 1} - } + fields: ['Year', 'Origin'], + init: [ + { + Origin: 'Japan', + Year: {year: 1970, month: 1, day: 1} + }, + { + Origin: 'USA', + Year: {year: 1980, month: 1, day: 1} + } + ] } })); @@ -76,8 +83,6 @@ describe('Multi Selection', () => { expect(threeSg).toEqual([ { name: 'thr_ee_tuple', - update: '{unit: "", fields: thr_ee_tuple_fields, values: [50]}', - react: false, on: [ { events: [{source: 'scope', type: 'click'}], @@ -86,6 +91,11 @@ describe('Multi Selection', () => { force: true } ] + }, + { + name: 'thr_ee_init', + update: 'modify("thr_ee_store", [{unit: "", fields: thr_ee_tuple_fields, values: [50]}])', + react: false } ]); @@ -93,8 +103,6 @@ describe('Multi Selection', () => { expect(fourSg).toEqual([ { name: 'four_tuple', - update: '{unit: "", fields: four_tuple_fields, values: [50, "Japan"]}', - react: false, on: [ { events: [{source: 'scope', type: 'click'}], @@ -103,6 +111,11 @@ describe('Multi Selection', () => { force: true } ] + }, + { + name: 'four_init', + update: 'modify("four_store", [{unit: "", fields: four_tuple_fields, values: [50, "Japan"]}])', + react: false } ]); @@ -110,16 +123,20 @@ describe('Multi Selection', () => { expect(fiveSg).toEqual([ { name: 'five_tuple', - update: '{unit: "", fields: five_tuple_fields, values: [datetime(1970, 1, 1+1, 0, 0, 0, 0)]}', - react: false, on: [ { events: [{source: 'scope', type: 'click'}], update: - 'datum && item().mark.marktype !== \'group\' ? {unit: "", fields: five_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)["Year"]]} : null', + 'datum && item().mark.marktype !== \'group\' ? {unit: "", fields: five_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)["Year"], (item().isVoronoi ? datum.datum : datum)["Origin"]]} : null', force: true } ] + }, + { + name: 'five_init', + update: + 'modify("five_store", [{unit: "", fields: five_tuple_fields, values: [datetime(1970, 1, 1+1, 0, 0, 0, 0), "Japan"]},{unit: "", fields: five_tuple_fields, values: [datetime(1980, 1, 1+1, 0, 0, 0, 0), "USA"]}])', + react: false } ]); diff --git a/test/compile/selection/single.test.ts b/test/compile/selection/single.test.ts index 8863cb52ab..2e3787ab6e 100644 --- a/test/compile/selection/single.test.ts +++ b/test/compile/selection/single.test.ts @@ -71,8 +71,6 @@ describe('Single Selection', () => { expect(threeSg).toEqual([ { name: 'thr_ee_tuple', - update: '{unit: "", fields: thr_ee_tuple_fields, values: [50]}', - react: false, on: [ { events: [{source: 'scope', type: 'click'}], @@ -81,6 +79,11 @@ describe('Single Selection', () => { force: true } ] + }, + { + name: 'thr_ee_init', + update: 'modify("thr_ee_store", [{unit: "", fields: thr_ee_tuple_fields, values: [50]}])', + react: false } ]); @@ -88,8 +91,6 @@ describe('Single Selection', () => { expect(fourSg).toEqual([ { name: 'four_tuple', - update: '{unit: "", fields: four_tuple_fields, values: [50, "Japan"]}', - react: false, on: [ { events: [{source: 'scope', type: 'click'}], @@ -98,6 +99,11 @@ describe('Single Selection', () => { force: true } ] + }, + { + name: 'four_init', + update: 'modify("four_store", [{unit: "", fields: four_tuple_fields, values: [50, "Japan"]}])', + react: false } ]); From 027708f11a71a90a76d6dc7d41e4c2dc474a2a58 Mon Sep 17 00:00:00 2001 From: Arvind Satyanarayan Date: Wed, 17 Oct 2018 21:47:18 -0400 Subject: [PATCH 07/18] Use new `init` signal property. --- src/compile/selection/interval.ts | 11 +++------ src/compile/selection/multi.ts | 3 +-- src/compile/selection/transforms/inputs.ts | 3 +-- test/compile/selection/inputs.test.ts | 7 +++++- test/compile/selection/interval.test.ts | 27 ++++++++-------------- test/compile/selection/multi.test.ts | 11 ++++----- test/compile/selection/single.test.ts | 6 ++--- 7 files changed, 27 insertions(+), 41 deletions(-) diff --git a/src/compile/selection/interval.ts b/src/compile/selection/interval.ts index d9892021a3..5d70b1671b 100644 --- a/src/compile/selection/interval.ts +++ b/src/compile/selection/interval.ts @@ -82,12 +82,7 @@ const interval: SelectionCompiler = { const update = `unit: ${unitName(model)}, fields: ${fieldsSg}, values`; return signals.concat({ name: name + TUPLE, - ...(init - ? { - update: `{${update}: ${assembleInit(init)}}`, - react: false - } - : {}), + ...(init ? {init: `{${update}: ${assembleInit(init)}}`} : {}), on: [ { events: dataSignals.map(t => ({signal: t})), @@ -218,12 +213,12 @@ function channelSignals(model: UnitModel, selCmpt: SelectionComponent, channel: : [ { name: vname, - ...(init ? {update: assembleInit(init, scaled), react: false} : {value: []}), + ...(init ? {init: assembleInit(init, scaled)} : {value: []}), on: on }, { name: dname, - ...(init ? {update: assembleInit(init)} : {}), + ...(init ? {init: assembleInit(init)} : {}), on: [ { events: {signal: vname}, diff --git a/src/compile/selection/multi.ts b/src/compile/selection/multi.ts index d8f52f5f05..1cbf2c5d4d 100644 --- a/src/compile/selection/multi.ts +++ b/src/compile/selection/multi.ts @@ -45,8 +45,7 @@ export function multiSignals(model: UnitModel, selCmpt: SelectionComponent) { const insert = selCmpt.init.map(i => `{${update}: ${assembleInit(i)}}`); signals.push({ name: `${name}_init`, - update: `modify(${stringValue(selCmpt.name + STORE)}, [${insert}])`, - react: false + init: `modify(${stringValue(selCmpt.name + STORE)}, [${insert}])` }); } diff --git a/src/compile/selection/transforms/inputs.ts b/src/compile/selection/transforms/inputs.ts index 1b0c308ab4..a3ccd63dcd 100644 --- a/src/compile/selection/transforms/inputs.ts +++ b/src/compile/selection/transforms/inputs.ts @@ -22,7 +22,7 @@ const inputBindings: TransformCompiler = { if (!hasSignal.length) { signals.unshift({ name: sgname, - ...(init ? {update: assembleInit(init[i])} : {}), + ...(init ? {init: assembleInit(init[i])} : {value: null}), on: [ { events: selCmpt.events, @@ -51,7 +51,6 @@ const inputBindings: TransformCompiler = { delete signal.value; delete signal.on; - delete signal.react; return signals; } diff --git a/test/compile/selection/inputs.test.ts b/test/compile/selection/inputs.test.ts index 10aef382db..78d01e0198 100644 --- a/test/compile/selection/inputs.test.ts +++ b/test/compile/selection/inputs.test.ts @@ -72,6 +72,7 @@ describe('Inputs Selection Transform', () => { expect(selection.assembleTopLevelSignals(model, [])).toContainEqual({ name: 'one__vgsid_', + value: null, on: [ { events: [{source: 'scope', type: 'click'}], @@ -94,6 +95,7 @@ describe('Inputs Selection Transform', () => { expect.arrayContaining([ { name: 'two_Horsepower', + value: null, on: [ { events: [{source: 'scope', type: 'click'}], @@ -104,6 +106,7 @@ describe('Inputs Selection Transform', () => { }, { name: 'two_Cylinders', + value: null, on: [ { events: [{source: 'scope', type: 'click'}], @@ -128,6 +131,7 @@ describe('Inputs Selection Transform', () => { expect.arrayContaining([ { name: 'three_Origin', + value: null, on: [ { events: [{source: 'scope', type: 'click'}], @@ -142,6 +146,7 @@ describe('Inputs Selection Transform', () => { }, { name: 'three_Cylinders', + value: null, on: [ { events: [{source: 'scope', type: 'click'}], @@ -176,7 +181,7 @@ describe('Inputs Selection Transform', () => { expect.arrayContaining([ { name: 'seven_Year', - update: 'datetime(1970, 1, 1+1, 0, 0, 0, 0)', + init: 'datetime(1970, 1, 1+1, 0, 0, 0, 0)', on: [ { events: [{source: 'scope', type: 'click'}], diff --git a/test/compile/selection/interval.test.ts b/test/compile/selection/interval.test.ts index 589a9e5d34..0fe8cd2a36 100644 --- a/test/compile/selection/interval.test.ts +++ b/test/compile/selection/interval.test.ts @@ -198,8 +198,7 @@ describe('Interval Selections', () => { expect.arrayContaining([ { name: 'four_x', - update: '[scale("x", 50), scale("x", 70)]', - react: false, + init: '[scale("x", 50), scale("x", 70)]', on: [ { events: parseSelector('mousedown', 'scope')[0], @@ -217,7 +216,7 @@ describe('Interval Selections', () => { }, { name: 'four_Horsepower', - update: '[50, 70]', + init: '[50, 70]', on: [ { events: {signal: 'four_x'}, @@ -238,8 +237,7 @@ describe('Interval Selections', () => { expect.arrayContaining([ { name: 'five_x', - update: '[scale("x", 50), scale("x", 60)]', - react: false, + init: '[scale("x", 50), scale("x", 60)]', on: [ { events: parseSelector('mousedown', 'scope')[0], @@ -257,7 +255,7 @@ describe('Interval Selections', () => { }, { name: 'five_Horsepower', - update: '[50, 60]', + init: '[50, 60]', on: [ { events: {signal: 'five_x'}, @@ -267,8 +265,7 @@ describe('Interval Selections', () => { }, { name: 'five_y', - update: '[scale("y", 23), scale("y", 54)]', - react: false, + init: '[scale("y", 23), scale("y", 54)]', on: [ { events: parseSelector('mousedown', 'scope')[0], @@ -286,7 +283,7 @@ describe('Interval Selections', () => { }, { name: 'five_Miles_per_Gallon', - update: '[23, 54]', + init: '[23, 54]', on: [ { events: {signal: 'five_y'}, @@ -307,9 +304,7 @@ describe('Interval Selections', () => { expect.arrayContaining([ { name: 'six_x', - update: - '[scale("x", datetime(2000, 10, 5+1, 0, 0, 0, 0)), scale("x", datetime(2001, 1, 13+1, 0, 0, 0, 0))]', - react: false, + init: '[scale("x", datetime(2000, 10, 5+1, 0, 0, 0, 0)), scale("x", datetime(2001, 1, 13+1, 0, 0, 0, 0))]', on: [ { events: parseSelector('mousedown', 'scope')[0], @@ -327,7 +322,7 @@ describe('Interval Selections', () => { }, { name: 'six_Horsepower', - update: '[datetime(2000, 10, 5+1, 0, 0, 0, 0), datetime(2001, 1, 13+1, 0, 0, 0, 0)]', + init: '[datetime(2000, 10, 5+1, 0, 0, 0, 0), datetime(2001, 1, 13+1, 0, 0, 0, 0)]', on: [ { events: {signal: 'six_x'}, @@ -382,8 +377,7 @@ describe('Interval Selections', () => { const fourSg = interval.signals(model, selCmpts['four']); expect(fourSg).toContainEqual({ name: 'four_tuple', - update: '{unit: "", fields: four_tuple_fields, values: [[50, 70]]}', - react: false, + init: '{unit: "", fields: four_tuple_fields, values: [[50, 70]]}', on: [ { events: [{signal: 'four_Horsepower'}], @@ -395,8 +389,7 @@ describe('Interval Selections', () => { const fiveSg = interval.signals(model, selCmpts['five']); expect(fiveSg).toContainEqual({ name: 'five_tuple', - update: '{unit: "", fields: five_tuple_fields, values: [[50, 60], [23, 54]]}', - react: false, + init: '{unit: "", fields: five_tuple_fields, values: [[50, 60], [23, 54]]}', on: [ { events: [{signal: 'five_Horsepower'}, {signal: 'five_Miles_per_Gallon'}], diff --git a/test/compile/selection/multi.test.ts b/test/compile/selection/multi.test.ts index b6497762db..56dcad2f07 100644 --- a/test/compile/selection/multi.test.ts +++ b/test/compile/selection/multi.test.ts @@ -94,8 +94,7 @@ describe('Multi Selection', () => { }, { name: 'thr_ee_init', - update: 'modify("thr_ee_store", [{unit: "", fields: thr_ee_tuple_fields, values: [50]}])', - react: false + init: 'modify("thr_ee_store", [{unit: "", fields: thr_ee_tuple_fields, values: [50]}])' } ]); @@ -114,8 +113,7 @@ describe('Multi Selection', () => { }, { name: 'four_init', - update: 'modify("four_store", [{unit: "", fields: four_tuple_fields, values: [50, "Japan"]}])', - react: false + init: 'modify("four_store", [{unit: "", fields: four_tuple_fields, values: [50, "Japan"]}])' } ]); @@ -134,9 +132,8 @@ describe('Multi Selection', () => { }, { name: 'five_init', - update: - 'modify("five_store", [{unit: "", fields: five_tuple_fields, values: [datetime(1970, 1, 1+1, 0, 0, 0, 0), "Japan"]},{unit: "", fields: five_tuple_fields, values: [datetime(1980, 1, 1+1, 0, 0, 0, 0), "USA"]}])', - react: false + init: + 'modify("five_store", [{unit: "", fields: five_tuple_fields, values: [datetime(1970, 1, 1+1, 0, 0, 0, 0), "Japan"]},{unit: "", fields: five_tuple_fields, values: [datetime(1980, 1, 1+1, 0, 0, 0, 0), "USA"]}])' } ]); diff --git a/test/compile/selection/single.test.ts b/test/compile/selection/single.test.ts index 2e3787ab6e..ac5a6e56e8 100644 --- a/test/compile/selection/single.test.ts +++ b/test/compile/selection/single.test.ts @@ -82,8 +82,7 @@ describe('Single Selection', () => { }, { name: 'thr_ee_init', - update: 'modify("thr_ee_store", [{unit: "", fields: thr_ee_tuple_fields, values: [50]}])', - react: false + init: 'modify("thr_ee_store", [{unit: "", fields: thr_ee_tuple_fields, values: [50]}])' } ]); @@ -102,8 +101,7 @@ describe('Single Selection', () => { }, { name: 'four_init', - update: 'modify("four_store", [{unit: "", fields: four_tuple_fields, values: [50, "Japan"]}])', - react: false + init: 'modify("four_store", [{unit: "", fields: four_tuple_fields, values: [50, "Japan"]}])' } ]); From e69ffa3691f4b5bdaf77a4127df27c4f316a09fb Mon Sep 17 00:00:00 2001 From: Arvind Satyanarayan Date: Wed, 19 Dec 2018 17:16:54 -0500 Subject: [PATCH 08/18] Bump vega-util version to pull typings fix (vega/vega-util#10). --- package.json | 2 +- yarn.lock | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4f0d110841..abde2e67e1 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ "vega-event-selector": "^2.0.0", "vega-expression": "^2.4.0", "vega-typings": "0.3.51", - "vega-util": "^1.7.0", + "vega-util": "^1.7.1", "yargs": "^12.0.5" }, "jest": { diff --git a/yarn.lock b/yarn.lock index 9306346e25..87e9f2be0d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7217,6 +7217,11 @@ vega-util@^1.7.0: resolved "https://registry.yarnpkg.com/vega-util/-/vega-util-1.7.0.tgz#0ca0512bb8dcc6541165c34663d115d0712e0cf1" integrity sha512-IlmYqW0t3UP8AJX4QuOOm5cMPKPOUa8fSTcCvNkfVOR5zvMNFKCVhoZmJSXgcbEhkfboB+ysI2aaWOeW2kKBog== +vega-util@^1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/vega-util/-/vega-util-1.7.1.tgz#0b95bbe6058895c332596c215247507caa68ab61" + integrity sha512-jdzigLdaXH0rClqkr/qHY//xvmLyxQyZL4Wxb3mew29QpITrMk/USV6v/399h29xVt1+hJuw1vpLoJqAq6WerA== + vega-view-transforms@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/vega-view-transforms/-/vega-view-transforms-2.0.3.tgz#9999f83301efbe65ed1971018f538f5aeb62a16e" From c08e280af7f9bb5c2c0055eebef3e258be526991 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Wed, 19 Dec 2018 22:22:40 +0000 Subject: [PATCH 09/18] [Travis] Update schema (build: 20082) --- build/vega-lite-schema.json | 100 ++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json index f98619a829..f9e50b41d6 100644 --- a/build/vega-lite-schema.json +++ b/build/vega-lite-schema.json @@ -5146,6 +5146,13 @@ }, "type": "array" }, + "init": { + "additionalProperties": { + "$ref": "#/definitions/SelectionInitArray" + }, + "description": "Initialize the selection with a mapping between field names and arrays of\ninitial values.", + "type": "object" + }, "mark": { "$ref": "#/definitions/BrushConfig", "description": "An interval selection also adds a rectangle mark to depict the\nextents of the interval. The `mark` property can be used to customize the\nappearance of the mark." @@ -5216,6 +5223,13 @@ }, "type": "array" }, + "init": { + "additionalProperties": { + "$ref": "#/definitions/SelectionInitArray" + }, + "description": "Initialize the selection with a mapping between field names and arrays of\ninitial values.", + "type": "object" + }, "mark": { "$ref": "#/definitions/BrushConfig", "description": "An interval selection also adds a rectangle mark to depict the\nextents of the interval. The `mark` property can be used to customize the\nappearance of the mark." @@ -6709,6 +6723,20 @@ }, "type": "array" }, + "init": { + "anyOf": [ + { + "$ref": "#/definitions/SelectionInitMapping" + }, + { + "items": { + "$ref": "#/definitions/SelectionInitMapping" + }, + "type": "array" + } + ], + "description": "Initialize the selection with a mapping between field names and an initial\nvalue (or array of values)." + }, "nearest": { "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](https://vega.github.io/vega-lite/docs/nearest.html) documentation for more information.", "type": "boolean" @@ -6765,6 +6793,20 @@ }, "type": "array" }, + "init": { + "anyOf": [ + { + "$ref": "#/definitions/SelectionInitMapping" + }, + { + "items": { + "$ref": "#/definitions/SelectionInitMapping" + }, + "type": "array" + } + ], + "description": "Initialize the selection with a mapping between field names and an initial\nvalue (or array of values)." + }, "nearest": { "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](https://vega.github.io/vega-lite/docs/nearest.html) documentation for more information.", "type": "boolean" @@ -8208,6 +8250,56 @@ } ] }, + "SelectionInit": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "$ref": "#/definitions/DateTime" + } + ] + }, + "SelectionInitArray": { + "anyOf": [ + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + } + ] + }, + "SelectionInitMapping": { + "additionalProperties": { + "$ref": "#/definitions/SelectionInit" + }, + "type": "object" + }, "SelectionPredicate": { "additionalProperties": false, "properties": { @@ -8300,6 +8392,10 @@ }, "type": "array" }, + "init": { + "$ref": "#/definitions/SelectionInitMapping", + "description": "Initialize the selection with a mapping between field names and initial values." + }, "nearest": { "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](https://vega.github.io/vega-lite/docs/nearest.html) documentation for more information.", "type": "boolean" @@ -8363,6 +8459,10 @@ }, "type": "array" }, + "init": { + "$ref": "#/definitions/SelectionInitMapping", + "description": "Initialize the selection with a mapping between field names and initial values." + }, "nearest": { "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](https://vega.github.io/vega-lite/docs/nearest.html) documentation for more information.", "type": "boolean" From dec3db2889a91ff4f1f182e5f694d0f07d94656d Mon Sep 17 00:00:00 2001 From: Travis CI Date: Wed, 19 Dec 2018 22:25:22 +0000 Subject: [PATCH 10/18] [Travis] Update examples (build: 20082) --- .../circle_bubble_health_income.vg.json | 14 +- .../compiled/concat_bar_layer_circle.vg.json | 10 +- .../compiled/interactive_area_brush.vg.json | 9 +- .../interactive_bar_select_highlight.vg.json | 20 +- examples/compiled/interactive_brush.svg | 2 +- examples/compiled/interactive_brush.vg.json | 21 +- .../compiled/interactive_concat_layer.vg.json | 10 +- .../interactive_dashboard_europe_pop.vg.json | 40 ++-- .../interactive_layered_crossfilter.vg.json | 27 +-- ...ctive_layered_crossfilter_discrete.vg.json | 30 +-- .../interactive_multi_line_label.vg.json | 10 +- .../interactive_multi_line_tooltip.vg.json | 10 +- .../interactive_overview_detail.vg.json | 9 +- .../compiled/interactive_paintbrush.vg.json | 10 +- .../interactive_paintbrush_color.vg.json | 10 +- ...teractive_paintbrush_color_nearest.vg.json | 10 +- .../interactive_paintbrush_interval.vg.json | 14 +- .../interactive_paintbrush_simple_all.vg.json | 10 +- ...interactive_paintbrush_simple_none.vg.json | 10 +- .../interactive_panzoom_splom.vg.json | 111 ++++----- ...interactive_panzoom_vconcat_shared.vg.json | 14 +- .../compiled/interactive_query_widgets.svg | 2 +- .../interactive_query_widgets.vg.json | 20 +- .../interactive_seattle_weather.vg.json | 19 +- examples/compiled/interactive_splom.vg.json | 222 +++++++----------- .../interactive_stocks_nearest_index.vg.json | 10 +- examples/compiled/isotype_grid.vg.json | 14 +- .../compiled/selection_bind_cylyr.vg.json | 16 +- .../compiled/selection_bind_origin.vg.json | 17 +- .../compiled/selection_brush_timeunit.vg.json | 9 +- .../selection_composition_and.vg.json | 28 +-- .../compiled/selection_composition_or.vg.json | 28 +-- examples/compiled/selection_concat.vg.json | 28 +-- examples/compiled/selection_filter.vg.json | 14 +- .../selection_filter_composition.vg.json | 14 +- examples/compiled/selection_insert.vg.json | 10 +- .../selection_interval_mark_style.vg.json | 28 +-- .../selection_layer_bar_month.vg.json | 9 +- .../selection_multi_condition.vg.json | 24 +- .../selection_project_binned_interval.vg.json | 9 +- .../selection_project_interval.vg.json | 17 +- .../selection_project_interval_x.vg.json | 12 +- .../selection_project_interval_x_y.vg.json | 17 +- .../selection_project_interval_y.vg.json | 12 +- .../compiled/selection_project_multi.vg.json | 13 +- .../selection_project_multi_cylinders.vg.json | 10 +- ...ion_project_multi_cylinders_origin.vg.json | 13 +- .../selection_project_multi_origin.vg.json | 13 +- .../compiled/selection_project_single.vg.json | 16 +- ...selection_project_single_cylinders.vg.json | 13 +- ...on_project_single_cylinders_origin.vg.json | 16 +- .../selection_project_single_origin.vg.json | 16 +- .../selection_resolution_global.vg.json | 111 ++++----- .../selection_resolution_intersect.vg.json | 111 ++++----- .../selection_resolution_union.vg.json | 111 ++++----- .../compiled/selection_toggle_altKey.vg.json | 10 +- .../selection_toggle_altKey_shiftKey.vg.json | 10 +- .../selection_toggle_shiftKey.vg.json | 10 +- .../selection_translate_brush_drag.vg.json | 14 +- ...lection_translate_brush_shift-drag.vg.json | 14 +- ...lection_translate_scatterplot_drag.vg.json | 14 +- ...n_translate_scatterplot_shift-drag.vg.json | 14 +- .../compiled/selection_type_interval.vg.json | 17 +- .../selection_type_interval_invert.vg.json | 17 +- .../compiled/selection_type_multi.vg.json | 13 +- .../compiled/selection_type_single.vg.json | 16 +- .../selection_type_single_dblclick.vg.json | 16 +- .../selection_zoom_brush_shift-wheel.vg.json | 14 +- .../selection_zoom_brush_wheel.vg.json | 14 +- ...ction_zoom_scatterplot_shift-wheel.vg.json | 14 +- .../selection_zoom_scatterplot_wheel.vg.json | 14 +- examples/compiled/trellis_selections.vg.json | 37 +-- examples/compiled/vconcat_flatten.vg.json | 13 +- 73 files changed, 571 insertions(+), 1123 deletions(-) diff --git a/examples/compiled/circle_bubble_health_income.vg.json b/examples/compiled/circle_bubble_health_income.vg.json index 588ff29b88..056f6c8cd7 100644 --- a/examples/compiled/circle_bubble_health_income.vg.json +++ b/examples/compiled/circle_bubble_health_income.vg.json @@ -54,13 +54,16 @@ "on": [ { "events": [{"signal": "view_income"}, {"signal": "view_health"}], - "update": "view_income && view_health ? {unit: \"\", fields: view_tuple_fields, values: [view_income, view_health]} : null" + "update": "view_income && view_health ? {unit: \"\", fields: view_tuple_fields, values: [view_income,view_health]} : null" } ] }, { "name": "view_tuple_fields", - "update": "[{\"field\":\"income\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"health\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "income", "channel": "x", "type": "R"}, + {"field": "health", "channel": "y", "type": "R"} + ] }, { "name": "view_translate_anchor", @@ -113,12 +116,7 @@ }, { "name": "view_modify", - "on": [ - { - "events": {"signal": "view_tuple"}, - "update": "modify(\"view_store\", view_tuple, true)" - } - ] + "update": "modify(\"view_store\", view_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/concat_bar_layer_circle.vg.json b/examples/compiled/concat_bar_layer_circle.vg.json index 1e4aa22f01..5ada5034fe 100644 --- a/examples/compiled/concat_bar_layer_circle.vg.json +++ b/examples/compiled/concat_bar_layer_circle.vg.json @@ -294,7 +294,6 @@ "signals": [ { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -305,16 +304,11 @@ }, { "name": "pts_tuple_fields", - "update": "[{\"field\":\"Major_Genre\",\"channel\":\"x\",\"type\":\"E\"}]" + "value": [{"field": "Major_Genre", "channel": "x", "type": "E"}] }, { "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } - ] + "update": "modify(\"pts_store\", pts_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_area_brush.vg.json b/examples/compiled/interactive_area_brush.vg.json index 05ee457cee..5c57ad1c35 100644 --- a/examples/compiled/interactive_area_brush.vg.json +++ b/examples/compiled/interactive_area_brush.vg.json @@ -132,7 +132,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"yearmonth_date\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "yearmonth_date", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -205,12 +205,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_bar_select_highlight.vg.json b/examples/compiled/interactive_bar_select_highlight.vg.json index f48500a946..3379c91534 100644 --- a/examples/compiled/interactive_bar_select_highlight.vg.json +++ b/examples/compiled/interactive_bar_select_highlight.vg.json @@ -45,7 +45,6 @@ {"name": "select", "update": "vlSelectionResolve(\"select_store\")"}, { "name": "highlight_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "mouseover"}], @@ -56,20 +55,14 @@ }, { "name": "highlight_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" + "value": [{"field": "_vgsid_", "type": "E"}] }, { "name": "highlight_modify", - "on": [ - { - "events": {"signal": "highlight_tuple"}, - "update": "modify(\"highlight_store\", highlight_tuple, true)" - } - ] + "update": "modify(\"highlight_store\", highlight_tuple, true)" }, { "name": "select_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -80,7 +73,7 @@ }, { "name": "select_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" + "value": [{"field": "_vgsid_", "type": "E"}] }, { "name": "select_toggle", @@ -94,12 +87,7 @@ }, { "name": "select_modify", - "on": [ - { - "events": {"signal": "select_tuple"}, - "update": "modify(\"select_store\", select_toggle ? null : select_tuple, select_toggle ? null : true, select_toggle ? select_tuple : null)" - } - ] + "update": "modify(\"select_store\", select_toggle ? null : select_tuple, select_toggle ? null : true, select_toggle ? select_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/interactive_brush.svg b/examples/compiled/interactive_brush.svg index 350a0349f7..835440d0c5 100644 --- a/examples/compiled/interactive_brush.svg +++ b/examples/compiled/interactive_brush.svg @@ -1 +1 @@ -34568Cylinders050100150200Horsepower01020304050Miles_per_Gallon \ No newline at end of file +34568Cylinders050100150200Horsepower01020304050Miles_per_Gallon \ No newline at end of file diff --git a/examples/compiled/interactive_brush.vg.json b/examples/compiled/interactive_brush.vg.json index 24387b45ff..c4d6bfb0d9 100644 --- a/examples/compiled/interactive_brush.vg.json +++ b/examples/compiled/interactive_brush.vg.json @@ -21,7 +21,7 @@ {"name": "brush", "update": "vlSelectionResolve(\"brush_store\")"}, { "name": "brush_x", - "value": [], + "init": "[scale(\"x\", 55), scale(\"x\", 160)]", "on": [ { "events": { @@ -67,6 +67,7 @@ }, { "name": "brush_Horsepower", + "init": "[55, 160]", "on": [ { "events": {"signal": "brush_x"}, @@ -76,7 +77,7 @@ }, { "name": "brush_y", - "value": [], + "init": "[scale(\"y\", 13), scale(\"y\", 37)]", "on": [ { "events": { @@ -122,6 +123,7 @@ }, { "name": "brush_Miles_per_Gallon", + "init": "[13, 37]", "on": [ { "events": {"signal": "brush_y"}, @@ -135,19 +137,23 @@ }, { "name": "brush_tuple", + "init": "{unit: \"\", fields: brush_tuple_fields, values: [[55, 160], [13, 37]]}", "on": [ { "events": [ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -220,12 +226,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_concat_layer.vg.json b/examples/compiled/interactive_concat_layer.vg.json index 7fb4b35d66..7c0fb31dab 100644 --- a/examples/compiled/interactive_concat_layer.vg.json +++ b/examples/compiled/interactive_concat_layer.vg.json @@ -297,7 +297,6 @@ "signals": [ { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -308,16 +307,11 @@ }, { "name": "pts_tuple_fields", - "update": "[{\"field\":\"Major_Genre\",\"channel\":\"x\",\"type\":\"E\"}]" + "value": [{"field": "Major_Genre", "channel": "x", "type": "E"}] }, { "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } - ] + "update": "modify(\"pts_store\", pts_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_dashboard_europe_pop.vg.json b/examples/compiled/interactive_dashboard_europe_pop.vg.json index 83815d508b..989491232a 100644 --- a/examples/compiled/interactive_dashboard_europe_pop.vg.json +++ b/examples/compiled/interactive_dashboard_europe_pop.vg.json @@ -410,7 +410,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Country\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [{"field": "Country", "channel": "y", "type": "E"}] }, { "name": "brush_translate_anchor", @@ -487,12 +487,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -723,7 +718,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Country\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [{"field": "Country", "channel": "y", "type": "E"}] }, { "name": "brush_translate_anchor", @@ -800,12 +795,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -1091,13 +1081,24 @@ {"signal": "brush_Population_ages_65_and_above_of_total"}, {"signal": "brush_Population_ages_15_64_of_total"} ], - "update": "brush_Population_ages_65_and_above_of_total && brush_Population_ages_15_64_of_total ? {unit: \"concat_2\", fields: brush_tuple_fields, values: [brush_Population_ages_65_and_above_of_total, brush_Population_ages_15_64_of_total]} : null" + "update": "brush_Population_ages_65_and_above_of_total && brush_Population_ages_15_64_of_total ? {unit: \"concat_2\", fields: brush_tuple_fields, values: [brush_Population_ages_65_and_above_of_total,brush_Population_ages_15_64_of_total]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Population_ages_65_and_above_of_total\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Population_ages_15_64_of_total\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + { + "field": "Population_ages_65_and_above_of_total", + "channel": "x", + "type": "R" + }, + { + "field": "Population_ages_15_64_of_total", + "channel": "y", + "type": "R" + } + ] }, { "name": "brush_translate_anchor", @@ -1174,12 +1175,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_layered_crossfilter.vg.json b/examples/compiled/interactive_layered_crossfilter.vg.json index 1c88904680..19d77b9ca6 100644 --- a/examples/compiled/interactive_layered_crossfilter.vg.json +++ b/examples/compiled/interactive_layered_crossfilter.vg.json @@ -286,7 +286,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"distance\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "distance", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -363,12 +363,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -634,7 +629,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"delay\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "delay", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -711,12 +706,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -982,7 +972,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"time\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "time", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -1059,12 +1049,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_layered_crossfilter_discrete.vg.json b/examples/compiled/interactive_layered_crossfilter_discrete.vg.json index 863897bf26..db5bcbb215 100644 --- a/examples/compiled/interactive_layered_crossfilter_discrete.vg.json +++ b/examples/compiled/interactive_layered_crossfilter_discrete.vg.json @@ -218,7 +218,6 @@ "signals": [ { "name": "brush_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -229,7 +228,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"distance\",\"channel\":\"x\",\"type\":\"R-RE\"}]" + "value": [{"field": "distance", "channel": "x", "type": "R-RE"}] }, { "name": "brush_toggle", @@ -243,12 +242,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_toggle ? null : brush_tuple, brush_toggle ? null : true, brush_toggle ? brush_tuple : null)" - } - ] + "update": "modify(\"brush_store\", brush_toggle ? null : brush_tuple, brush_toggle ? null : true, brush_toggle ? brush_tuple : null)" } ], "marks": [ @@ -363,7 +357,6 @@ "signals": [ { "name": "brush_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -374,7 +367,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"delay\",\"channel\":\"x\",\"type\":\"R-RE\"}]" + "value": [{"field": "delay", "channel": "x", "type": "R-RE"}] }, { "name": "brush_toggle", @@ -388,12 +381,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_toggle ? null : brush_tuple, brush_toggle ? null : true, brush_toggle ? brush_tuple : null)" - } - ] + "update": "modify(\"brush_store\", brush_toggle ? null : brush_tuple, brush_toggle ? null : true, brush_toggle ? brush_tuple : null)" } ], "marks": [ @@ -508,7 +496,6 @@ "signals": [ { "name": "brush_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -519,7 +506,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"time\",\"channel\":\"x\",\"type\":\"R-RE\"}]" + "value": [{"field": "time", "channel": "x", "type": "R-RE"}] }, { "name": "brush_toggle", @@ -533,12 +520,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_toggle ? null : brush_tuple, brush_toggle ? null : true, brush_toggle ? brush_tuple : null)" - } - ] + "update": "modify(\"brush_store\", brush_toggle ? null : brush_tuple, brush_toggle ? null : true, brush_toggle ? brush_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/interactive_multi_line_label.vg.json b/examples/compiled/interactive_multi_line_label.vg.json index 031c837d90..c61fd22177 100644 --- a/examples/compiled/interactive_multi_line_label.vg.json +++ b/examples/compiled/interactive_multi_line_label.vg.json @@ -31,7 +31,6 @@ {"name": "label", "update": "vlSelectionResolve(\"label_store\")"}, { "name": "label_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "mouseover"}], @@ -42,16 +41,11 @@ }, { "name": "label_tuple_fields", - "update": "[{\"field\":\"date\",\"channel\":\"x\",\"type\":\"E\"}]" + "value": [{"field": "date", "channel": "x", "type": "E"}] }, { "name": "label_modify", - "on": [ - { - "events": {"signal": "label_tuple"}, - "update": "modify(\"label_store\", label_tuple, true)" - } - ] + "update": "modify(\"label_store\", label_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_multi_line_tooltip.vg.json b/examples/compiled/interactive_multi_line_tooltip.vg.json index b86b1d7a5f..b6d9ad92c0 100644 --- a/examples/compiled/interactive_multi_line_tooltip.vg.json +++ b/examples/compiled/interactive_multi_line_tooltip.vg.json @@ -48,7 +48,6 @@ {"name": "hover", "update": "vlSelectionResolve(\"hover_store\")"}, { "name": "hover_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "mouseover"}], @@ -59,16 +58,11 @@ }, { "name": "hover_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" + "value": [{"field": "_vgsid_", "type": "E"}] }, { "name": "hover_modify", - "on": [ - { - "events": {"signal": "hover_tuple"}, - "update": "modify(\"hover_store\", hover_tuple, true)" - } - ] + "update": "modify(\"hover_store\", hover_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_overview_detail.vg.json b/examples/compiled/interactive_overview_detail.vg.json index a2c32f2a41..c980cebf62 100644 --- a/examples/compiled/interactive_overview_detail.vg.json +++ b/examples/compiled/interactive_overview_detail.vg.json @@ -193,7 +193,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"date\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "date", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -270,12 +270,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_paintbrush.vg.json b/examples/compiled/interactive_paintbrush.vg.json index 7e59109cc6..91dc10ad59 100644 --- a/examples/compiled/interactive_paintbrush.vg.json +++ b/examples/compiled/interactive_paintbrush.vg.json @@ -29,7 +29,6 @@ }, { "name": "paintbrush_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "mouseover"}], @@ -40,7 +39,7 @@ }, { "name": "paintbrush_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" + "value": [{"field": "_vgsid_", "type": "E"}] }, { "name": "paintbrush_toggle", @@ -54,12 +53,7 @@ }, { "name": "paintbrush_modify", - "on": [ - { - "events": {"signal": "paintbrush_tuple"}, - "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" - } - ] + "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/interactive_paintbrush_color.vg.json b/examples/compiled/interactive_paintbrush_color.vg.json index 87669f7191..52e499f553 100644 --- a/examples/compiled/interactive_paintbrush_color.vg.json +++ b/examples/compiled/interactive_paintbrush_color.vg.json @@ -29,7 +29,6 @@ }, { "name": "paintbrush_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "mouseover"}], @@ -40,7 +39,7 @@ }, { "name": "paintbrush_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" + "value": [{"field": "_vgsid_", "type": "E"}] }, { "name": "paintbrush_toggle", @@ -54,12 +53,7 @@ }, { "name": "paintbrush_modify", - "on": [ - { - "events": {"signal": "paintbrush_tuple"}, - "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" - } - ] + "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/interactive_paintbrush_color_nearest.vg.json b/examples/compiled/interactive_paintbrush_color_nearest.vg.json index 276a87156d..697d3a3705 100644 --- a/examples/compiled/interactive_paintbrush_color_nearest.vg.json +++ b/examples/compiled/interactive_paintbrush_color_nearest.vg.json @@ -29,7 +29,6 @@ }, { "name": "paintbrush_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "mouseover"}], @@ -40,7 +39,7 @@ }, { "name": "paintbrush_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" + "value": [{"field": "_vgsid_", "type": "E"}] }, { "name": "paintbrush_toggle", @@ -54,12 +53,7 @@ }, { "name": "paintbrush_modify", - "on": [ - { - "events": {"signal": "paintbrush_tuple"}, - "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" - } - ] + "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/interactive_paintbrush_interval.vg.json b/examples/compiled/interactive_paintbrush_interval.vg.json index 5740623884..c20c519020 100644 --- a/examples/compiled/interactive_paintbrush_interval.vg.json +++ b/examples/compiled/interactive_paintbrush_interval.vg.json @@ -144,13 +144,16 @@ {"signal": "paintbrush_Horsepower"}, {"signal": "paintbrush_Miles_per_Gallon"} ], - "update": "paintbrush_Horsepower && paintbrush_Miles_per_Gallon ? {unit: \"\", fields: paintbrush_tuple_fields, values: [paintbrush_Horsepower, paintbrush_Miles_per_Gallon]} : null" + "update": "paintbrush_Horsepower && paintbrush_Miles_per_Gallon ? {unit: \"\", fields: paintbrush_tuple_fields, values: [paintbrush_Horsepower,paintbrush_Miles_per_Gallon]} : null" } ] }, { "name": "paintbrush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "paintbrush_translate_anchor", @@ -227,12 +230,7 @@ }, { "name": "paintbrush_modify", - "on": [ - { - "events": {"signal": "paintbrush_tuple"}, - "update": "modify(\"paintbrush_store\", paintbrush_tuple, true)" - } - ] + "update": "modify(\"paintbrush_store\", paintbrush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_paintbrush_simple_all.vg.json b/examples/compiled/interactive_paintbrush_simple_all.vg.json index 911a2dcf7e..a4784d50c4 100644 --- a/examples/compiled/interactive_paintbrush_simple_all.vg.json +++ b/examples/compiled/interactive_paintbrush_simple_all.vg.json @@ -28,7 +28,6 @@ }, { "name": "paintbrush_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "mouseover"}], @@ -39,7 +38,7 @@ }, { "name": "paintbrush_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" + "value": [{"field": "_vgsid_", "type": "E"}] }, { "name": "paintbrush_toggle", @@ -53,12 +52,7 @@ }, { "name": "paintbrush_modify", - "on": [ - { - "events": {"signal": "paintbrush_tuple"}, - "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" - } - ] + "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/interactive_paintbrush_simple_none.vg.json b/examples/compiled/interactive_paintbrush_simple_none.vg.json index 13b03d3231..4c60f17b1a 100644 --- a/examples/compiled/interactive_paintbrush_simple_none.vg.json +++ b/examples/compiled/interactive_paintbrush_simple_none.vg.json @@ -28,7 +28,6 @@ }, { "name": "paintbrush_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "mouseover"}], @@ -39,7 +38,7 @@ }, { "name": "paintbrush_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" + "value": [{"field": "_vgsid_", "type": "E"}] }, { "name": "paintbrush_toggle", @@ -53,12 +52,7 @@ }, { "name": "paintbrush_modify", - "on": [ - { - "events": {"signal": "paintbrush_tuple"}, - "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" - } - ] + "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/interactive_panzoom_splom.vg.json b/examples/compiled/interactive_panzoom_splom.vg.json index 7d388c87be..80ab3e9ac0 100644 --- a/examples/compiled/interactive_panzoom_splom.vg.json +++ b/examples/compiled/interactive_panzoom_splom.vg.json @@ -75,13 +75,16 @@ {"signal": "grid_Miles_per_Gallon"}, {"signal": "grid_Horsepower"} ], - "update": "grid_Miles_per_Gallon && grid_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon, grid_Horsepower]} : null" + "update": "grid_Miles_per_Gallon && grid_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon,grid_Horsepower]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Horsepower\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Miles_per_Gallon", "channel": "x", "type": "R"}, + {"field": "Horsepower", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -134,12 +137,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -273,13 +271,16 @@ {"signal": "grid_Acceleration"}, {"signal": "grid_Horsepower"} ], - "update": "grid_Acceleration && grid_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration, grid_Horsepower]} : null" + "update": "grid_Acceleration && grid_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration,grid_Horsepower]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Horsepower\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Acceleration", "channel": "x", "type": "R"}, + {"field": "Horsepower", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -332,12 +333,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -460,7 +456,7 @@ }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Horsepower", "channel": "x", "type": "R"}] }, { "name": "grid_translate_anchor", @@ -513,12 +509,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -652,13 +643,16 @@ {"signal": "grid_Miles_per_Gallon"}, {"signal": "grid_Acceleration"} ], - "update": "grid_Miles_per_Gallon && grid_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon, grid_Acceleration]} : null" + "update": "grid_Miles_per_Gallon && grid_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon,grid_Acceleration]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Acceleration\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Miles_per_Gallon", "channel": "x", "type": "R"}, + {"field": "Acceleration", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -711,12 +705,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -839,7 +828,7 @@ }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Acceleration", "channel": "x", "type": "R"}] }, { "name": "grid_translate_anchor", @@ -892,12 +881,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -1031,13 +1015,16 @@ {"signal": "grid_Horsepower"}, {"signal": "grid_Acceleration"} ], - "update": "grid_Horsepower && grid_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower, grid_Acceleration]} : null" + "update": "grid_Horsepower && grid_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Acceleration]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Acceleration\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Acceleration", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -1090,12 +1077,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -1218,7 +1200,7 @@ }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Miles_per_Gallon", "channel": "x", "type": "R"}] }, { "name": "grid_translate_anchor", @@ -1271,12 +1253,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -1410,13 +1387,16 @@ {"signal": "grid_Acceleration"}, {"signal": "grid_Miles_per_Gallon"} ], - "update": "grid_Acceleration && grid_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration, grid_Miles_per_Gallon]} : null" + "update": "grid_Acceleration && grid_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration,grid_Miles_per_Gallon]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Acceleration", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -1469,12 +1449,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -1608,13 +1583,16 @@ {"signal": "grid_Horsepower"}, {"signal": "grid_Miles_per_Gallon"} ], - "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower, grid_Miles_per_Gallon]} : null" + "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Miles_per_Gallon]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -1667,12 +1645,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_panzoom_vconcat_shared.vg.json b/examples/compiled/interactive_panzoom_vconcat_shared.vg.json index c57eb633bf..07291a8234 100644 --- a/examples/compiled/interactive_panzoom_vconcat_shared.vg.json +++ b/examples/compiled/interactive_panzoom_vconcat_shared.vg.json @@ -78,13 +78,16 @@ {"signal": "region_Horsepower"}, {"signal": "region_Miles_per_Gallon"} ], - "update": "region_Horsepower && region_Miles_per_Gallon ? {unit: \"concat_0\", fields: region_tuple_fields, values: [region_Horsepower, region_Miles_per_Gallon]} : null" + "update": "region_Horsepower && region_Miles_per_Gallon ? {unit: \"concat_0\", fields: region_tuple_fields, values: [region_Horsepower,region_Miles_per_Gallon]} : null" } ] }, { "name": "region_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "region_translate_anchor", @@ -137,12 +140,7 @@ }, { "name": "region_modify", - "on": [ - { - "events": {"signal": "region_tuple"}, - "update": "modify(\"region_store\", region_tuple, true)" - } - ] + "update": "modify(\"region_store\", region_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_query_widgets.svg b/examples/compiled/interactive_query_widgets.svg index c897598e4c..2f14c7d2d1 100644 --- a/examples/compiled/interactive_query_widgets.svg +++ b/examples/compiled/interactive_query_widgets.svg @@ -1 +1 @@ -EuropeJapanUSAOrigin050100150200Horsepower01020304050Miles_per_Gallon \ No newline at end of file +EuropeJapanUSAOrigin050100150200Horsepower01020304050Miles_per_Gallon \ No newline at end of file diff --git a/examples/compiled/interactive_query_widgets.vg.json b/examples/compiled/interactive_query_widgets.vg.json index 13f805021c..8e3e9783f5 100644 --- a/examples/compiled/interactive_query_widgets.vg.json +++ b/examples/compiled/interactive_query_widgets.vg.json @@ -37,7 +37,7 @@ }, { "name": "CylYr_Year", - "value": "", + "init": "1977", "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -48,7 +48,7 @@ }, { "name": "CylYr_Cylinders", - "value": "", + "init": "4", "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -62,18 +62,20 @@ "name": "CylYr_tuple", "update": "CylYr_Cylinders !== null && CylYr_Year !== null ? {fields: CylYr_tuple_fields, values: [CylYr_Cylinders, CylYr_Year]} : null" }, + { + "name": "CylYr_init", + "init": "modify(\"CylYr_store\", [{unit: \"layer_0\", fields: CylYr_tuple_fields, values: [4, 1977]}])" + }, { "name": "CylYr_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"type\":\"E\"},{\"field\":\"Year\",\"type\":\"E\"}]" + "value": [ + {"field": "Cylinders", "type": "E"}, + {"field": "Year", "type": "E"} + ] }, { "name": "CylYr_modify", - "on": [ - { - "events": {"signal": "CylYr_tuple"}, - "update": "modify(\"CylYr_store\", CylYr_tuple, true)" - } - ] + "update": "modify(\"CylYr_store\", CylYr_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_seattle_weather.vg.json b/examples/compiled/interactive_seattle_weather.vg.json index bffcb3153a..366f42d127 100644 --- a/examples/compiled/interactive_seattle_weather.vg.json +++ b/examples/compiled/interactive_seattle_weather.vg.json @@ -156,7 +156,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"monthdate_date\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "monthdate_date", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -233,12 +233,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -428,7 +423,6 @@ "signals": [ { "name": "click_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -439,7 +433,7 @@ }, { "name": "click_tuple_fields", - "update": "[{\"field\":\"weather\",\"channel\":\"color\",\"type\":\"E\"}]" + "value": [{"field": "weather", "channel": "color", "type": "E"}] }, { "name": "click_toggle", @@ -453,12 +447,7 @@ }, { "name": "click_modify", - "on": [ - { - "events": {"signal": "click_tuple"}, - "update": "modify(\"click_store\", click_toggle ? null : click_tuple, click_toggle ? null : true, click_toggle ? click_tuple : null)" - } - ] + "update": "modify(\"click_store\", click_toggle ? null : click_tuple, click_toggle ? null : true, click_toggle ? click_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/interactive_splom.vg.json b/examples/compiled/interactive_splom.vg.json index 69ab4b481c..aa39c70913 100644 --- a/examples/compiled/interactive_splom.vg.json +++ b/examples/compiled/interactive_splom.vg.json @@ -170,13 +170,16 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Horsepower"} ], - "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Horsepower]} : null" + "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Horsepower]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Horsepower\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Miles_per_Gallon", "channel": "x", "type": "R"}, + {"field": "Horsepower", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -257,12 +260,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Miles_per_Gallon\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Miles_per_Gallon\"})" }, { "name": "grid_Miles_per_Gallon", @@ -300,13 +298,16 @@ {"signal": "grid_Miles_per_Gallon"}, {"signal": "grid_Horsepower"} ], - "update": "grid_Miles_per_Gallon && grid_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon, grid_Horsepower]} : null" + "update": "grid_Miles_per_Gallon && grid_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon,grid_Horsepower]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Horsepower\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Miles_per_Gallon", "channel": "x", "type": "R"}, + {"field": "Horsepower", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -383,12 +384,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -655,13 +651,16 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Horsepower"} ], - "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Horsepower]} : null" + "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Horsepower]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Horsepower\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Acceleration", "channel": "x", "type": "R"}, + {"field": "Horsepower", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -742,12 +741,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Acceleration\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Acceleration\"})" }, { "name": "grid_Acceleration", @@ -785,13 +779,16 @@ {"signal": "grid_Acceleration"}, {"signal": "grid_Horsepower"} ], - "update": "grid_Acceleration && grid_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration, grid_Horsepower]} : null" + "update": "grid_Acceleration && grid_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration,grid_Horsepower]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Horsepower\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Acceleration", "channel": "x", "type": "R"}, + {"field": "Horsepower", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -868,12 +865,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -1086,7 +1078,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Horsepower", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -1167,12 +1159,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Horsepower\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Horsepower\"})" }, { "name": "grid_Horsepower", @@ -1199,7 +1186,7 @@ }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Horsepower", "channel": "x", "type": "R"}] }, { "name": "grid_translate_anchor", @@ -1276,12 +1263,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -1545,13 +1527,16 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Acceleration"} ], - "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Acceleration]} : null" + "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Acceleration]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Acceleration\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Miles_per_Gallon", "channel": "x", "type": "R"}, + {"field": "Acceleration", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -1632,12 +1617,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Miles_per_Gallon\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Miles_per_Gallon\"})" }, { "name": "grid_Miles_per_Gallon", @@ -1675,13 +1655,16 @@ {"signal": "grid_Miles_per_Gallon"}, {"signal": "grid_Acceleration"} ], - "update": "grid_Miles_per_Gallon && grid_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon, grid_Acceleration]} : null" + "update": "grid_Miles_per_Gallon && grid_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon,grid_Acceleration]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Acceleration\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Miles_per_Gallon", "channel": "x", "type": "R"}, + {"field": "Acceleration", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -1758,12 +1741,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -1976,7 +1954,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Acceleration", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -2057,12 +2035,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Acceleration\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Acceleration\"})" }, { "name": "grid_Acceleration", @@ -2089,7 +2062,7 @@ }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Acceleration", "channel": "x", "type": "R"}] }, { "name": "grid_translate_anchor", @@ -2166,12 +2139,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -2435,13 +2403,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Acceleration"} ], - "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Acceleration]} : null" + "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Acceleration]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Acceleration\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Acceleration", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -2522,12 +2493,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Horsepower\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Horsepower\"})" }, { "name": "grid_Horsepower", @@ -2565,13 +2531,16 @@ {"signal": "grid_Horsepower"}, {"signal": "grid_Acceleration"} ], - "update": "grid_Horsepower && grid_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower, grid_Acceleration]} : null" + "update": "grid_Horsepower && grid_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Acceleration]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Acceleration\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Acceleration", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -2648,12 +2617,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -2866,7 +2830,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Miles_per_Gallon", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -2947,12 +2911,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Miles_per_Gallon\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Miles_per_Gallon\"})" }, { "name": "grid_Miles_per_Gallon", @@ -2979,7 +2938,7 @@ }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Miles_per_Gallon", "channel": "x", "type": "R"}] }, { "name": "grid_translate_anchor", @@ -3056,12 +3015,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -3325,13 +3279,16 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Miles_per_Gallon]} : null" + "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Acceleration", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -3412,12 +3369,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Acceleration\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Acceleration\"})" }, { "name": "grid_Acceleration", @@ -3455,13 +3407,16 @@ {"signal": "grid_Acceleration"}, {"signal": "grid_Miles_per_Gallon"} ], - "update": "grid_Acceleration && grid_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration, grid_Miles_per_Gallon]} : null" + "update": "grid_Acceleration && grid_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration,grid_Miles_per_Gallon]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Acceleration", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -3538,12 +3493,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ @@ -3810,13 +3760,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -3897,12 +3850,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Horsepower\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Horsepower\"})" }, { "name": "grid_Horsepower", @@ -3940,13 +3888,16 @@ {"signal": "grid_Horsepower"}, {"signal": "grid_Miles_per_Gallon"} ], - "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower, grid_Miles_per_Gallon]} : null" + "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Miles_per_Gallon]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -4023,12 +3974,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/interactive_stocks_nearest_index.vg.json b/examples/compiled/interactive_stocks_nearest_index.vg.json index 970fa97435..a702c0d67b 100644 --- a/examples/compiled/interactive_stocks_nearest_index.vg.json +++ b/examples/compiled/interactive_stocks_nearest_index.vg.json @@ -34,7 +34,6 @@ {"name": "index", "update": "vlSelectionResolve(\"index_store\")"}, { "name": "index_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "mousemove"}], @@ -45,16 +44,11 @@ }, { "name": "index_tuple_fields", - "update": "[{\"field\":\"date\",\"channel\":\"x\",\"type\":\"E\"}]" + "value": [{"field": "date", "channel": "x", "type": "E"}] }, { "name": "index_modify", - "on": [ - { - "events": {"signal": "index_tuple"}, - "update": "modify(\"index_store\", index_tuple, true)" - } - ] + "update": "modify(\"index_store\", index_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/isotype_grid.vg.json b/examples/compiled/isotype_grid.vg.json index 18aaf7e3b5..5fa74f8fb5 100644 --- a/examples/compiled/isotype_grid.vg.json +++ b/examples/compiled/isotype_grid.vg.json @@ -243,13 +243,16 @@ "on": [ { "events": [{"signal": "highlight_col"}, {"signal": "highlight_row"}], - "update": "highlight_col && highlight_row ? {unit: \"\", fields: highlight_tuple_fields, values: [highlight_col, highlight_row]} : null" + "update": "highlight_col && highlight_row ? {unit: \"\", fields: highlight_tuple_fields, values: [highlight_col,highlight_row]} : null" } ] }, { "name": "highlight_tuple_fields", - "update": "[{\"field\":\"col\",\"channel\":\"x\",\"type\":\"E\"},{\"field\":\"row\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [ + {"field": "col", "channel": "x", "type": "E"}, + {"field": "row", "channel": "y", "type": "E"} + ] }, { "name": "highlight_translate_anchor", @@ -326,12 +329,7 @@ }, { "name": "highlight_modify", - "on": [ - { - "events": {"signal": "highlight_tuple"}, - "update": "modify(\"highlight_store\", highlight_tuple, true)" - } - ] + "update": "modify(\"highlight_store\", highlight_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_bind_cylyr.vg.json b/examples/compiled/selection_bind_cylyr.vg.json index a392e19a8c..b56e985cce 100644 --- a/examples/compiled/selection_bind_cylyr.vg.json +++ b/examples/compiled/selection_bind_cylyr.vg.json @@ -26,7 +26,7 @@ }, { "name": "CylYr_Year", - "value": "", + "value": null, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -37,7 +37,7 @@ }, { "name": "CylYr_Cylinders", - "value": "", + "value": null, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -53,16 +53,14 @@ }, { "name": "CylYr_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"type\":\"E\"},{\"field\":\"Year\",\"type\":\"E\"}]" + "value": [ + {"field": "Cylinders", "type": "E"}, + {"field": "Year", "type": "E"} + ] }, { "name": "CylYr_modify", - "on": [ - { - "events": {"signal": "CylYr_tuple"}, - "update": "modify(\"CylYr_store\", CylYr_tuple, true)" - } - ] + "update": "modify(\"CylYr_store\", CylYr_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_bind_origin.vg.json b/examples/compiled/selection_bind_origin.vg.json index fdf6865bb5..418cd8e7e9 100644 --- a/examples/compiled/selection_bind_origin.vg.json +++ b/examples/compiled/selection_bind_origin.vg.json @@ -19,7 +19,7 @@ }, { "name": "org_Origin", - "value": "", + "value": null, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -33,19 +33,8 @@ "name": "org_tuple", "update": "org_Origin !== null ? {fields: org_tuple_fields, values: [org_Origin]} : null" }, - { - "name": "org_tuple_fields", - "update": "[{\"field\":\"Origin\",\"type\":\"E\"}]" - }, - { - "name": "org_modify", - "on": [ - { - "events": {"signal": "org_tuple"}, - "update": "modify(\"org_store\", org_tuple, true)" - } - ] - } + {"name": "org_tuple_fields", "value": [{"field": "Origin", "type": "E"}]}, + {"name": "org_modify", "update": "modify(\"org_store\", org_tuple, true)"} ], "marks": [ { diff --git a/examples/compiled/selection_brush_timeunit.vg.json b/examples/compiled/selection_brush_timeunit.vg.json index 11bd061996..6d795ac3b2 100644 --- a/examples/compiled/selection_brush_timeunit.vg.json +++ b/examples/compiled/selection_brush_timeunit.vg.json @@ -142,7 +142,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"seconds_date\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "seconds_date", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -219,12 +219,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_composition_and.vg.json b/examples/compiled/selection_composition_and.vg.json index 918c4df9af..d4bbc06a18 100644 --- a/examples/compiled/selection_composition_and.vg.json +++ b/examples/compiled/selection_composition_and.vg.json @@ -153,13 +153,16 @@ "on": [ { "events": [{"signal": "alex_Cylinders"}, {"signal": "alex_Origin"}], - "update": "alex_Cylinders && alex_Origin ? {unit: \"\", fields: alex_tuple_fields, values: [alex_Cylinders, alex_Origin]} : null" + "update": "alex_Cylinders && alex_Origin ? {unit: \"\", fields: alex_tuple_fields, values: [alex_Cylinders,alex_Origin]} : null" } ] }, { "name": "alex_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"channel\":\"x\",\"type\":\"E\"},{\"field\":\"Origin\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [ + {"field": "Cylinders", "channel": "x", "type": "E"}, + {"field": "Origin", "channel": "y", "type": "E"} + ] }, { "name": "alex_translate_anchor", @@ -237,12 +240,7 @@ }, { "name": "alex_modify", - "on": [ - { - "events": {"signal": "alex_tuple"}, - "update": "modify(\"alex_store\", alex_tuple, true)" - } - ] + "update": "modify(\"alex_store\", alex_tuple, true)" }, { "name": "morgan_x", @@ -362,13 +360,16 @@ {"signal": "morgan_Cylinders"}, {"signal": "morgan_Origin"} ], - "update": "morgan_Cylinders && morgan_Origin ? {unit: \"\", fields: morgan_tuple_fields, values: [morgan_Cylinders, morgan_Origin]} : null" + "update": "morgan_Cylinders && morgan_Origin ? {unit: \"\", fields: morgan_tuple_fields, values: [morgan_Cylinders,morgan_Origin]} : null" } ] }, { "name": "morgan_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"channel\":\"x\",\"type\":\"E\"},{\"field\":\"Origin\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [ + {"field": "Cylinders", "channel": "x", "type": "E"}, + {"field": "Origin", "channel": "y", "type": "E"} + ] }, { "name": "morgan_translate_anchor", @@ -446,12 +447,7 @@ }, { "name": "morgan_modify", - "on": [ - { - "events": {"signal": "morgan_tuple"}, - "update": "modify(\"morgan_store\", morgan_tuple, true)" - } - ] + "update": "modify(\"morgan_store\", morgan_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_composition_or.vg.json b/examples/compiled/selection_composition_or.vg.json index 6429918e1b..e27b90767b 100644 --- a/examples/compiled/selection_composition_or.vg.json +++ b/examples/compiled/selection_composition_or.vg.json @@ -153,13 +153,16 @@ "on": [ { "events": [{"signal": "alex_Cylinders"}, {"signal": "alex_Origin"}], - "update": "alex_Cylinders && alex_Origin ? {unit: \"\", fields: alex_tuple_fields, values: [alex_Cylinders, alex_Origin]} : null" + "update": "alex_Cylinders && alex_Origin ? {unit: \"\", fields: alex_tuple_fields, values: [alex_Cylinders,alex_Origin]} : null" } ] }, { "name": "alex_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"channel\":\"x\",\"type\":\"E\"},{\"field\":\"Origin\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [ + {"field": "Cylinders", "channel": "x", "type": "E"}, + {"field": "Origin", "channel": "y", "type": "E"} + ] }, { "name": "alex_translate_anchor", @@ -237,12 +240,7 @@ }, { "name": "alex_modify", - "on": [ - { - "events": {"signal": "alex_tuple"}, - "update": "modify(\"alex_store\", alex_tuple, true)" - } - ] + "update": "modify(\"alex_store\", alex_tuple, true)" }, { "name": "morgan_x", @@ -362,13 +360,16 @@ {"signal": "morgan_Cylinders"}, {"signal": "morgan_Origin"} ], - "update": "morgan_Cylinders && morgan_Origin ? {unit: \"\", fields: morgan_tuple_fields, values: [morgan_Cylinders, morgan_Origin]} : null" + "update": "morgan_Cylinders && morgan_Origin ? {unit: \"\", fields: morgan_tuple_fields, values: [morgan_Cylinders,morgan_Origin]} : null" } ] }, { "name": "morgan_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"channel\":\"x\",\"type\":\"E\"},{\"field\":\"Origin\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [ + {"field": "Cylinders", "channel": "x", "type": "E"}, + {"field": "Origin", "channel": "y", "type": "E"} + ] }, { "name": "morgan_translate_anchor", @@ -446,12 +447,7 @@ }, { "name": "morgan_modify", - "on": [ - { - "events": {"signal": "morgan_tuple"}, - "update": "modify(\"morgan_store\", morgan_tuple, true)" - } - ] + "update": "modify(\"morgan_store\", morgan_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_concat.vg.json b/examples/compiled/selection_concat.vg.json index 20edcc6648..3b98685d48 100644 --- a/examples/compiled/selection_concat.vg.json +++ b/examples/compiled/selection_concat.vg.json @@ -166,13 +166,16 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Horsepower"} ], - "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"concat_0\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Horsepower]} : null" + "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"concat_0\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Horsepower]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Horsepower\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Miles_per_Gallon", "channel": "x", "type": "R"}, + {"field": "Horsepower", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -249,12 +252,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -470,13 +468,16 @@ {"signal": "grid_Displacement"}, {"signal": "grid_Acceleration"} ], - "update": "grid_Displacement && grid_Acceleration ? {unit: \"concat_1\", fields: grid_tuple_fields, values: [grid_Displacement, grid_Acceleration]} : null" + "update": "grid_Displacement && grid_Acceleration ? {unit: \"concat_1\", fields: grid_tuple_fields, values: [grid_Displacement,grid_Acceleration]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Displacement\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Acceleration\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Displacement", "channel": "x", "type": "R"}, + {"field": "Acceleration", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -529,12 +530,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_filter.vg.json b/examples/compiled/selection_filter.vg.json index 9af440f226..acfad9ffae 100644 --- a/examples/compiled/selection_filter.vg.json +++ b/examples/compiled/selection_filter.vg.json @@ -169,13 +169,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"concat_0\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"concat_0\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -252,12 +255,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_filter_composition.vg.json b/examples/compiled/selection_filter_composition.vg.json index e6a6e038e3..cd2d7fc0bd 100644 --- a/examples/compiled/selection_filter_composition.vg.json +++ b/examples/compiled/selection_filter_composition.vg.json @@ -169,13 +169,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"concat_0\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"concat_0\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -252,12 +255,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_insert.vg.json b/examples/compiled/selection_insert.vg.json index 9abfa53c9f..a008fed611 100644 --- a/examples/compiled/selection_insert.vg.json +++ b/examples/compiled/selection_insert.vg.json @@ -28,7 +28,6 @@ }, { "name": "paintbrush_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -39,16 +38,11 @@ }, { "name": "paintbrush_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" + "value": [{"field": "_vgsid_", "type": "E"}] }, { "name": "paintbrush_modify", - "on": [ - { - "events": {"signal": "paintbrush_tuple"}, - "update": "modify(\"paintbrush_store\", paintbrush_tuple, null)" - } - ] + "update": "modify(\"paintbrush_store\", paintbrush_tuple, null)" } ], "marks": [ diff --git a/examples/compiled/selection_interval_mark_style.vg.json b/examples/compiled/selection_interval_mark_style.vg.json index b8a52f9b5e..76642864ec 100644 --- a/examples/compiled/selection_interval_mark_style.vg.json +++ b/examples/compiled/selection_interval_mark_style.vg.json @@ -153,13 +153,16 @@ "on": [ { "events": [{"signal": "alex_Cylinders"}, {"signal": "alex_Origin"}], - "update": "alex_Cylinders && alex_Origin ? {unit: \"\", fields: alex_tuple_fields, values: [alex_Cylinders, alex_Origin]} : null" + "update": "alex_Cylinders && alex_Origin ? {unit: \"\", fields: alex_tuple_fields, values: [alex_Cylinders,alex_Origin]} : null" } ] }, { "name": "alex_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"channel\":\"x\",\"type\":\"E\"},{\"field\":\"Origin\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [ + {"field": "Cylinders", "channel": "x", "type": "E"}, + {"field": "Origin", "channel": "y", "type": "E"} + ] }, { "name": "alex_translate_anchor", @@ -237,12 +240,7 @@ }, { "name": "alex_modify", - "on": [ - { - "events": {"signal": "alex_tuple"}, - "update": "modify(\"alex_store\", alex_tuple, true)" - } - ] + "update": "modify(\"alex_store\", alex_tuple, true)" }, { "name": "morgan_x", @@ -362,13 +360,16 @@ {"signal": "morgan_Cylinders"}, {"signal": "morgan_Origin"} ], - "update": "morgan_Cylinders && morgan_Origin ? {unit: \"\", fields: morgan_tuple_fields, values: [morgan_Cylinders, morgan_Origin]} : null" + "update": "morgan_Cylinders && morgan_Origin ? {unit: \"\", fields: morgan_tuple_fields, values: [morgan_Cylinders,morgan_Origin]} : null" } ] }, { "name": "morgan_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"channel\":\"x\",\"type\":\"E\"},{\"field\":\"Origin\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [ + {"field": "Cylinders", "channel": "x", "type": "E"}, + {"field": "Origin", "channel": "y", "type": "E"} + ] }, { "name": "morgan_translate_anchor", @@ -446,12 +447,7 @@ }, { "name": "morgan_modify", - "on": [ - { - "events": {"signal": "morgan_tuple"}, - "update": "modify(\"morgan_store\", morgan_tuple, true)" - } - ] + "update": "modify(\"morgan_store\", morgan_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_layer_bar_month.vg.json b/examples/compiled/selection_layer_bar_month.vg.json index 2aa8739870..14139d7f8d 100644 --- a/examples/compiled/selection_layer_bar_month.vg.json +++ b/examples/compiled/selection_layer_bar_month.vg.json @@ -134,7 +134,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"month_date\",\"channel\":\"x\",\"type\":\"E\"}]" + "value": [{"field": "month_date", "channel": "x", "type": "E"}] }, { "name": "brush_translate_anchor", @@ -207,12 +207,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_multi_condition.vg.json b/examples/compiled/selection_multi_condition.vg.json index b3e733872d..9dab15098b 100644 --- a/examples/compiled/selection_multi_condition.vg.json +++ b/examples/compiled/selection_multi_condition.vg.json @@ -151,13 +151,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -230,16 +233,10 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" }, { "name": "hoverbrush_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "mouseover"}], @@ -250,7 +247,7 @@ }, { "name": "hoverbrush_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" + "value": [{"field": "_vgsid_", "type": "E"}] }, { "name": "hoverbrush_toggle", @@ -264,12 +261,7 @@ }, { "name": "hoverbrush_modify", - "on": [ - { - "events": {"signal": "hoverbrush_tuple"}, - "update": "modify(\"hoverbrush_store\", hoverbrush_toggle ? null : hoverbrush_tuple, hoverbrush_toggle ? null : true, hoverbrush_toggle ? hoverbrush_tuple : null)" - } - ] + "update": "modify(\"hoverbrush_store\", hoverbrush_toggle ? null : hoverbrush_tuple, hoverbrush_toggle ? null : true, hoverbrush_toggle ? hoverbrush_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/selection_project_binned_interval.vg.json b/examples/compiled/selection_project_binned_interval.vg.json index 3d24176777..e67ef7ad79 100644 --- a/examples/compiled/selection_project_binned_interval.vg.json +++ b/examples/compiled/selection_project_binned_interval.vg.json @@ -156,7 +156,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Acceleration", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -229,12 +229,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_project_interval.vg.json b/examples/compiled/selection_project_interval.vg.json index 073c066a9e..ba71fa943b 100644 --- a/examples/compiled/selection_project_interval.vg.json +++ b/examples/compiled/selection_project_interval.vg.json @@ -145,13 +145,16 @@ "on": [ { "events": [{"signal": "pts_Cylinders"}, {"signal": "pts_Origin"}], - "update": "pts_Cylinders && pts_Origin ? {unit: \"\", fields: pts_tuple_fields, values: [pts_Cylinders, pts_Origin]} : null" + "update": "pts_Cylinders && pts_Origin ? {unit: \"\", fields: pts_tuple_fields, values: [pts_Cylinders,pts_Origin]} : null" } ] }, { "name": "pts_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"channel\":\"x\",\"type\":\"E\"},{\"field\":\"Origin\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [ + {"field": "Cylinders", "channel": "x", "type": "E"}, + {"field": "Origin", "channel": "y", "type": "E"} + ] }, { "name": "pts_translate_anchor", @@ -222,15 +225,7 @@ } ] }, - { - "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } - ] - } + {"name": "pts_modify", "update": "modify(\"pts_store\", pts_tuple, true)"} ], "marks": [ { diff --git a/examples/compiled/selection_project_interval_x.vg.json b/examples/compiled/selection_project_interval_x.vg.json index 32b9d9bf2c..20a80608e1 100644 --- a/examples/compiled/selection_project_interval_x.vg.json +++ b/examples/compiled/selection_project_interval_x.vg.json @@ -101,7 +101,7 @@ }, { "name": "pts_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"channel\":\"x\",\"type\":\"E\"}]" + "value": [{"field": "Cylinders", "channel": "x", "type": "E"}] }, { "name": "pts_translate_anchor", @@ -172,15 +172,7 @@ } ] }, - { - "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } - ] - } + {"name": "pts_modify", "update": "modify(\"pts_store\", pts_tuple, true)"} ], "marks": [ { diff --git a/examples/compiled/selection_project_interval_x_y.vg.json b/examples/compiled/selection_project_interval_x_y.vg.json index 073c066a9e..ba71fa943b 100644 --- a/examples/compiled/selection_project_interval_x_y.vg.json +++ b/examples/compiled/selection_project_interval_x_y.vg.json @@ -145,13 +145,16 @@ "on": [ { "events": [{"signal": "pts_Cylinders"}, {"signal": "pts_Origin"}], - "update": "pts_Cylinders && pts_Origin ? {unit: \"\", fields: pts_tuple_fields, values: [pts_Cylinders, pts_Origin]} : null" + "update": "pts_Cylinders && pts_Origin ? {unit: \"\", fields: pts_tuple_fields, values: [pts_Cylinders,pts_Origin]} : null" } ] }, { "name": "pts_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"channel\":\"x\",\"type\":\"E\"},{\"field\":\"Origin\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [ + {"field": "Cylinders", "channel": "x", "type": "E"}, + {"field": "Origin", "channel": "y", "type": "E"} + ] }, { "name": "pts_translate_anchor", @@ -222,15 +225,7 @@ } ] }, - { - "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } - ] - } + {"name": "pts_modify", "update": "modify(\"pts_store\", pts_tuple, true)"} ], "marks": [ { diff --git a/examples/compiled/selection_project_interval_y.vg.json b/examples/compiled/selection_project_interval_y.vg.json index 810041fece..13f35a462d 100644 --- a/examples/compiled/selection_project_interval_y.vg.json +++ b/examples/compiled/selection_project_interval_y.vg.json @@ -101,7 +101,7 @@ }, { "name": "pts_tuple_fields", - "update": "[{\"field\":\"Origin\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [{"field": "Origin", "channel": "y", "type": "E"}] }, { "name": "pts_translate_anchor", @@ -172,15 +172,7 @@ } ] }, - { - "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } - ] - } + {"name": "pts_modify", "update": "modify(\"pts_store\", pts_tuple, true)"} ], "marks": [ { diff --git a/examples/compiled/selection_project_multi.vg.json b/examples/compiled/selection_project_multi.vg.json index e3645b79a0..6633548ec2 100644 --- a/examples/compiled/selection_project_multi.vg.json +++ b/examples/compiled/selection_project_multi.vg.json @@ -25,7 +25,6 @@ {"name": "pts", "update": "vlSelectionResolve(\"pts_store\")"}, { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -34,10 +33,7 @@ } ] }, - { - "name": "pts_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" - }, + {"name": "pts_tuple_fields", "value": [{"field": "_vgsid_", "type": "E"}]}, { "name": "pts_toggle", "value": false, @@ -50,12 +46,7 @@ }, { "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_toggle ? null : pts_tuple, pts_toggle ? null : true, pts_toggle ? pts_tuple : null)" - } - ] + "update": "modify(\"pts_store\", pts_toggle ? null : pts_tuple, pts_toggle ? null : true, pts_toggle ? pts_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/selection_project_multi_cylinders.vg.json b/examples/compiled/selection_project_multi_cylinders.vg.json index 6528b93ff6..11f56bed72 100644 --- a/examples/compiled/selection_project_multi_cylinders.vg.json +++ b/examples/compiled/selection_project_multi_cylinders.vg.json @@ -20,7 +20,6 @@ {"name": "pts", "update": "vlSelectionResolve(\"pts_store\")"}, { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -31,7 +30,7 @@ }, { "name": "pts_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"type\":\"E\"}]" + "value": [{"field": "Cylinders", "type": "E"}] }, { "name": "pts_toggle", @@ -45,12 +44,7 @@ }, { "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_toggle ? null : pts_tuple, pts_toggle ? null : true, pts_toggle ? pts_tuple : null)" - } - ] + "update": "modify(\"pts_store\", pts_toggle ? null : pts_tuple, pts_toggle ? null : true, pts_toggle ? pts_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/selection_project_multi_cylinders_origin.vg.json b/examples/compiled/selection_project_multi_cylinders_origin.vg.json index 15ccba305e..eb502fb056 100644 --- a/examples/compiled/selection_project_multi_cylinders_origin.vg.json +++ b/examples/compiled/selection_project_multi_cylinders_origin.vg.json @@ -20,7 +20,6 @@ {"name": "pts", "update": "vlSelectionResolve(\"pts_store\")"}, { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -31,7 +30,10 @@ }, { "name": "pts_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"type\":\"E\"},{\"field\":\"Origin\",\"type\":\"E\"}]" + "value": [ + {"field": "Cylinders", "type": "E"}, + {"field": "Origin", "type": "E"} + ] }, { "name": "pts_toggle", @@ -45,12 +47,7 @@ }, { "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_toggle ? null : pts_tuple, pts_toggle ? null : true, pts_toggle ? pts_tuple : null)" - } - ] + "update": "modify(\"pts_store\", pts_toggle ? null : pts_tuple, pts_toggle ? null : true, pts_toggle ? pts_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/selection_project_multi_origin.vg.json b/examples/compiled/selection_project_multi_origin.vg.json index f4db50ba59..94c61c853a 100644 --- a/examples/compiled/selection_project_multi_origin.vg.json +++ b/examples/compiled/selection_project_multi_origin.vg.json @@ -20,7 +20,6 @@ {"name": "pts", "update": "vlSelectionResolve(\"pts_store\")"}, { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -29,10 +28,7 @@ } ] }, - { - "name": "pts_tuple_fields", - "update": "[{\"field\":\"Origin\",\"type\":\"E\"}]" - }, + {"name": "pts_tuple_fields", "value": [{"field": "Origin", "type": "E"}]}, { "name": "pts_toggle", "value": false, @@ -45,12 +41,7 @@ }, { "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_toggle ? null : pts_tuple, pts_toggle ? null : true, pts_toggle ? pts_tuple : null)" - } - ] + "update": "modify(\"pts_store\", pts_toggle ? null : pts_tuple, pts_toggle ? null : true, pts_toggle ? pts_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/selection_project_single.vg.json b/examples/compiled/selection_project_single.vg.json index 46cb621d49..97441ceeca 100644 --- a/examples/compiled/selection_project_single.vg.json +++ b/examples/compiled/selection_project_single.vg.json @@ -25,7 +25,6 @@ {"name": "pts", "update": "vlSelectionResolve(\"pts_store\")"}, { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -34,19 +33,8 @@ } ] }, - { - "name": "pts_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" - }, - { - "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } - ] - } + {"name": "pts_tuple_fields", "value": [{"field": "_vgsid_", "type": "E"}]}, + {"name": "pts_modify", "update": "modify(\"pts_store\", pts_tuple, true)"} ], "marks": [ { diff --git a/examples/compiled/selection_project_single_cylinders.vg.json b/examples/compiled/selection_project_single_cylinders.vg.json index a7a5a9086a..012ea1f980 100644 --- a/examples/compiled/selection_project_single_cylinders.vg.json +++ b/examples/compiled/selection_project_single_cylinders.vg.json @@ -20,7 +20,6 @@ {"name": "pts", "update": "vlSelectionResolve(\"pts_store\")"}, { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -31,17 +30,9 @@ }, { "name": "pts_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"type\":\"E\"}]" + "value": [{"field": "Cylinders", "type": "E"}] }, - { - "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } - ] - } + {"name": "pts_modify", "update": "modify(\"pts_store\", pts_tuple, true)"} ], "marks": [ { diff --git a/examples/compiled/selection_project_single_cylinders_origin.vg.json b/examples/compiled/selection_project_single_cylinders_origin.vg.json index e727164f3b..1c3961313f 100644 --- a/examples/compiled/selection_project_single_cylinders_origin.vg.json +++ b/examples/compiled/selection_project_single_cylinders_origin.vg.json @@ -20,7 +20,6 @@ {"name": "pts", "update": "vlSelectionResolve(\"pts_store\")"}, { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -31,17 +30,12 @@ }, { "name": "pts_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"type\":\"E\"},{\"field\":\"Origin\",\"type\":\"E\"}]" - }, - { - "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } + "value": [ + {"field": "Cylinders", "type": "E"}, + {"field": "Origin", "type": "E"} ] - } + }, + {"name": "pts_modify", "update": "modify(\"pts_store\", pts_tuple, true)"} ], "marks": [ { diff --git a/examples/compiled/selection_project_single_origin.vg.json b/examples/compiled/selection_project_single_origin.vg.json index 430a7128fc..44327ed445 100644 --- a/examples/compiled/selection_project_single_origin.vg.json +++ b/examples/compiled/selection_project_single_origin.vg.json @@ -20,7 +20,6 @@ {"name": "pts", "update": "vlSelectionResolve(\"pts_store\")"}, { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -29,19 +28,8 @@ } ] }, - { - "name": "pts_tuple_fields", - "update": "[{\"field\":\"Origin\",\"type\":\"E\"}]" - }, - { - "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } - ] - } + {"name": "pts_tuple_fields", "value": [{"field": "Origin", "type": "E"}]}, + {"name": "pts_modify", "update": "modify(\"pts_store\", pts_tuple, true)"} ], "marks": [ { diff --git a/examples/compiled/selection_resolution_global.vg.json b/examples/compiled/selection_resolution_global.vg.json index ac5bd247e0..3585c2ba65 100644 --- a/examples/compiled/selection_resolution_global.vg.json +++ b/examples/compiled/selection_resolution_global.vg.json @@ -155,13 +155,16 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Horsepower"} ], - "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Horsepower]} : null" + "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Horsepower]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Horsepower\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Miles_per_Gallon", "channel": "x", "type": "R"}, + {"field": "Horsepower", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -238,12 +241,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -553,13 +551,16 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Horsepower"} ], - "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Horsepower]} : null" + "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Horsepower]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Horsepower\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Acceleration", "channel": "x", "type": "R"}, + {"field": "Horsepower", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -636,12 +637,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -899,7 +895,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Horsepower", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -976,12 +972,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -1288,13 +1279,16 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Acceleration"} ], - "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Acceleration]} : null" + "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Acceleration]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Acceleration\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Miles_per_Gallon", "channel": "x", "type": "R"}, + {"field": "Acceleration", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -1371,12 +1365,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -1634,7 +1623,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Acceleration", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -1711,12 +1700,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -2023,13 +2007,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Acceleration"} ], - "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Acceleration]} : null" + "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Acceleration]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Acceleration\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Acceleration", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -2106,12 +2093,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -2369,7 +2351,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Miles_per_Gallon", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -2446,12 +2428,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -2758,13 +2735,16 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Miles_per_Gallon]} : null" + "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Acceleration", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -2841,12 +2821,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ @@ -3156,13 +3131,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -3239,12 +3217,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_resolution_intersect.vg.json b/examples/compiled/selection_resolution_intersect.vg.json index 5b2c7e0fe1..f9522272e9 100644 --- a/examples/compiled/selection_resolution_intersect.vg.json +++ b/examples/compiled/selection_resolution_intersect.vg.json @@ -158,13 +158,16 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Horsepower"} ], - "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Horsepower]} : null" + "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Horsepower]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Horsepower\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Miles_per_Gallon", "channel": "x", "type": "R"}, + {"field": "Horsepower", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -241,12 +244,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Miles_per_Gallon\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Miles_per_Gallon\"})" } ], "marks": [ @@ -508,13 +506,16 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Horsepower"} ], - "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Horsepower]} : null" + "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Horsepower]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Horsepower\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Acceleration", "channel": "x", "type": "R"}, + {"field": "Horsepower", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -591,12 +592,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Acceleration\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Acceleration\"})" } ], "marks": [ @@ -806,7 +802,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Horsepower", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -883,12 +879,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Horsepower\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Horsepower\"})" } ], "marks": [ @@ -1147,13 +1138,16 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Acceleration"} ], - "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Acceleration]} : null" + "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Acceleration]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Acceleration\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Miles_per_Gallon", "channel": "x", "type": "R"}, + {"field": "Acceleration", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -1230,12 +1224,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Miles_per_Gallon\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Miles_per_Gallon\"})" } ], "marks": [ @@ -1445,7 +1434,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Acceleration", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -1522,12 +1511,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Acceleration\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Acceleration\"})" } ], "marks": [ @@ -1786,13 +1770,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Acceleration"} ], - "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Acceleration]} : null" + "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Acceleration]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Acceleration\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Acceleration", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -1869,12 +1856,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Horsepower\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Horsepower\"})" } ], "marks": [ @@ -2084,7 +2066,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Miles_per_Gallon", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -2161,12 +2143,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Miles_per_Gallon\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Miles_per_Gallon\"})" } ], "marks": [ @@ -2425,13 +2402,16 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Miles_per_Gallon]} : null" + "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Acceleration", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -2508,12 +2488,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Acceleration\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Acceleration\"})" } ], "marks": [ @@ -2775,13 +2750,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -2858,12 +2836,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Horsepower\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Horsepower\"})" } ], "marks": [ diff --git a/examples/compiled/selection_resolution_union.vg.json b/examples/compiled/selection_resolution_union.vg.json index 41a897a593..c1859f2439 100644 --- a/examples/compiled/selection_resolution_union.vg.json +++ b/examples/compiled/selection_resolution_union.vg.json @@ -158,13 +158,16 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Horsepower"} ], - "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Horsepower]} : null" + "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Horsepower]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Horsepower\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Miles_per_Gallon", "channel": "x", "type": "R"}, + {"field": "Horsepower", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -241,12 +244,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Miles_per_Gallon\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Miles_per_Gallon\"})" } ], "marks": [ @@ -508,13 +506,16 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Horsepower"} ], - "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Horsepower]} : null" + "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Horsepower]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Horsepower\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Acceleration", "channel": "x", "type": "R"}, + {"field": "Horsepower", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -591,12 +592,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Acceleration\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Acceleration\"})" } ], "marks": [ @@ -806,7 +802,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Horsepower", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -883,12 +879,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Horsepower\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Horsepower\"})" } ], "marks": [ @@ -1147,13 +1138,16 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Acceleration"} ], - "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Acceleration]} : null" + "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Acceleration]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Acceleration\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Miles_per_Gallon", "channel": "x", "type": "R"}, + {"field": "Acceleration", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -1230,12 +1224,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Miles_per_Gallon\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Miles_per_Gallon\"})" } ], "marks": [ @@ -1445,7 +1434,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Acceleration", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -1522,12 +1511,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Acceleration\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Acceleration\"})" } ], "marks": [ @@ -1786,13 +1770,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Acceleration"} ], - "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Acceleration]} : null" + "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Acceleration]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Acceleration\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Acceleration", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -1869,12 +1856,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Horsepower\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Horsepower\"})" } ], "marks": [ @@ -2084,7 +2066,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Miles_per_Gallon\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "Miles_per_Gallon", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -2161,12 +2143,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Miles_per_Gallon\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Miles_per_Gallon\"})" } ], "marks": [ @@ -2425,13 +2402,16 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Miles_per_Gallon]} : null" + "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Acceleration\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Acceleration", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -2508,12 +2488,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Acceleration\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Acceleration\"})" } ], "marks": [ @@ -2775,13 +2750,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -2858,12 +2836,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Horsepower\"})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Horsepower\"})" } ], "marks": [ diff --git a/examples/compiled/selection_toggle_altKey.vg.json b/examples/compiled/selection_toggle_altKey.vg.json index 0a3d2cc756..76cc35ed2e 100644 --- a/examples/compiled/selection_toggle_altKey.vg.json +++ b/examples/compiled/selection_toggle_altKey.vg.json @@ -28,7 +28,6 @@ }, { "name": "paintbrush_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -39,7 +38,7 @@ }, { "name": "paintbrush_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" + "value": [{"field": "_vgsid_", "type": "E"}] }, { "name": "paintbrush_toggle", @@ -53,12 +52,7 @@ }, { "name": "paintbrush_modify", - "on": [ - { - "events": {"signal": "paintbrush_tuple"}, - "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" - } - ] + "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/selection_toggle_altKey_shiftKey.vg.json b/examples/compiled/selection_toggle_altKey_shiftKey.vg.json index 139379c78b..fc1e900816 100644 --- a/examples/compiled/selection_toggle_altKey_shiftKey.vg.json +++ b/examples/compiled/selection_toggle_altKey_shiftKey.vg.json @@ -28,7 +28,6 @@ }, { "name": "paintbrush_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -39,7 +38,7 @@ }, { "name": "paintbrush_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" + "value": [{"field": "_vgsid_", "type": "E"}] }, { "name": "paintbrush_toggle", @@ -53,12 +52,7 @@ }, { "name": "paintbrush_modify", - "on": [ - { - "events": {"signal": "paintbrush_tuple"}, - "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" - } - ] + "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/selection_toggle_shiftKey.vg.json b/examples/compiled/selection_toggle_shiftKey.vg.json index 69909351fd..10f808a907 100644 --- a/examples/compiled/selection_toggle_shiftKey.vg.json +++ b/examples/compiled/selection_toggle_shiftKey.vg.json @@ -28,7 +28,6 @@ }, { "name": "paintbrush_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -39,7 +38,7 @@ }, { "name": "paintbrush_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" + "value": [{"field": "_vgsid_", "type": "E"}] }, { "name": "paintbrush_toggle", @@ -53,12 +52,7 @@ }, { "name": "paintbrush_modify", - "on": [ - { - "events": {"signal": "paintbrush_tuple"}, - "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" - } - ] + "update": "modify(\"paintbrush_store\", paintbrush_toggle ? null : paintbrush_tuple, paintbrush_toggle ? null : true, paintbrush_toggle ? paintbrush_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/selection_translate_brush_drag.vg.json b/examples/compiled/selection_translate_brush_drag.vg.json index e28d4055a9..b401a51a67 100644 --- a/examples/compiled/selection_translate_brush_drag.vg.json +++ b/examples/compiled/selection_translate_brush_drag.vg.json @@ -140,13 +140,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -219,12 +222,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_translate_brush_shift-drag.vg.json b/examples/compiled/selection_translate_brush_shift-drag.vg.json index 574cc9cf35..2222c77c25 100644 --- a/examples/compiled/selection_translate_brush_shift-drag.vg.json +++ b/examples/compiled/selection_translate_brush_shift-drag.vg.json @@ -140,13 +140,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -225,12 +228,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_translate_scatterplot_drag.vg.json b/examples/compiled/selection_translate_scatterplot_drag.vg.json index d0baaf50cd..dc8d4a6c5d 100644 --- a/examples/compiled/selection_translate_scatterplot_drag.vg.json +++ b/examples/compiled/selection_translate_scatterplot_drag.vg.json @@ -52,13 +52,16 @@ {"signal": "grid_Horsepower"}, {"signal": "grid_Miles_per_Gallon"} ], - "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"\", fields: grid_tuple_fields, values: [grid_Horsepower, grid_Miles_per_Gallon]} : null" + "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Miles_per_Gallon]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -111,12 +114,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_translate_scatterplot_shift-drag.vg.json b/examples/compiled/selection_translate_scatterplot_shift-drag.vg.json index 29eb63aca6..47fada7e66 100644 --- a/examples/compiled/selection_translate_scatterplot_shift-drag.vg.json +++ b/examples/compiled/selection_translate_scatterplot_shift-drag.vg.json @@ -52,13 +52,16 @@ {"signal": "grid_Horsepower"}, {"signal": "grid_Miles_per_Gallon"} ], - "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"\", fields: grid_tuple_fields, values: [grid_Horsepower, grid_Miles_per_Gallon]} : null" + "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Miles_per_Gallon]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -121,12 +124,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_type_interval.vg.json b/examples/compiled/selection_type_interval.vg.json index 073c066a9e..ba71fa943b 100644 --- a/examples/compiled/selection_type_interval.vg.json +++ b/examples/compiled/selection_type_interval.vg.json @@ -145,13 +145,16 @@ "on": [ { "events": [{"signal": "pts_Cylinders"}, {"signal": "pts_Origin"}], - "update": "pts_Cylinders && pts_Origin ? {unit: \"\", fields: pts_tuple_fields, values: [pts_Cylinders, pts_Origin]} : null" + "update": "pts_Cylinders && pts_Origin ? {unit: \"\", fields: pts_tuple_fields, values: [pts_Cylinders,pts_Origin]} : null" } ] }, { "name": "pts_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"channel\":\"x\",\"type\":\"E\"},{\"field\":\"Origin\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [ + {"field": "Cylinders", "channel": "x", "type": "E"}, + {"field": "Origin", "channel": "y", "type": "E"} + ] }, { "name": "pts_translate_anchor", @@ -222,15 +225,7 @@ } ] }, - { - "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } - ] - } + {"name": "pts_modify", "update": "modify(\"pts_store\", pts_tuple, true)"} ], "marks": [ { diff --git a/examples/compiled/selection_type_interval_invert.vg.json b/examples/compiled/selection_type_interval_invert.vg.json index d75fc0ebf3..3b6bb1fc65 100644 --- a/examples/compiled/selection_type_interval_invert.vg.json +++ b/examples/compiled/selection_type_interval_invert.vg.json @@ -145,13 +145,16 @@ "on": [ { "events": [{"signal": "pts_Cylinders"}, {"signal": "pts_Origin"}], - "update": "pts_Cylinders && pts_Origin ? {unit: \"\", fields: pts_tuple_fields, values: [pts_Cylinders, pts_Origin]} : null" + "update": "pts_Cylinders && pts_Origin ? {unit: \"\", fields: pts_tuple_fields, values: [pts_Cylinders,pts_Origin]} : null" } ] }, { "name": "pts_tuple_fields", - "update": "[{\"field\":\"Cylinders\",\"channel\":\"x\",\"type\":\"E\"},{\"field\":\"Origin\",\"channel\":\"y\",\"type\":\"E\"}]" + "value": [ + {"field": "Cylinders", "channel": "x", "type": "E"}, + {"field": "Origin", "channel": "y", "type": "E"} + ] }, { "name": "pts_translate_anchor", @@ -222,15 +225,7 @@ } ] }, - { - "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } - ] - } + {"name": "pts_modify", "update": "modify(\"pts_store\", pts_tuple, true)"} ], "marks": [ { diff --git a/examples/compiled/selection_type_multi.vg.json b/examples/compiled/selection_type_multi.vg.json index 576298ded3..948437c0dd 100644 --- a/examples/compiled/selection_type_multi.vg.json +++ b/examples/compiled/selection_type_multi.vg.json @@ -40,7 +40,6 @@ {"name": "pts", "update": "vlSelectionResolve(\"pts_store\")"}, { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -49,10 +48,7 @@ } ] }, - { - "name": "pts_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" - }, + {"name": "pts_tuple_fields", "value": [{"field": "_vgsid_", "type": "E"}]}, { "name": "pts_toggle", "value": false, @@ -65,12 +61,7 @@ }, { "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_toggle ? null : pts_tuple, pts_toggle ? null : true, pts_toggle ? pts_tuple : null)" - } - ] + "update": "modify(\"pts_store\", pts_toggle ? null : pts_tuple, pts_toggle ? null : true, pts_toggle ? pts_tuple : null)" } ], "marks": [ diff --git a/examples/compiled/selection_type_single.vg.json b/examples/compiled/selection_type_single.vg.json index 857edec63d..9370081aa6 100644 --- a/examples/compiled/selection_type_single.vg.json +++ b/examples/compiled/selection_type_single.vg.json @@ -40,7 +40,6 @@ {"name": "pts", "update": "vlSelectionResolve(\"pts_store\")"}, { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -49,19 +48,8 @@ } ] }, - { - "name": "pts_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" - }, - { - "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } - ] - } + {"name": "pts_tuple_fields", "value": [{"field": "_vgsid_", "type": "E"}]}, + {"name": "pts_modify", "update": "modify(\"pts_store\", pts_tuple, true)"} ], "marks": [ { diff --git a/examples/compiled/selection_type_single_dblclick.vg.json b/examples/compiled/selection_type_single_dblclick.vg.json index 854dde04f4..453da22da8 100644 --- a/examples/compiled/selection_type_single_dblclick.vg.json +++ b/examples/compiled/selection_type_single_dblclick.vg.json @@ -40,7 +40,6 @@ {"name": "pts", "update": "vlSelectionResolve(\"pts_store\")"}, { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "dblclick"}], @@ -49,19 +48,8 @@ } ] }, - { - "name": "pts_tuple_fields", - "update": "[{\"field\":\"_vgsid_\",\"type\":\"E\"}]" - }, - { - "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_tuple, true)" - } - ] - } + {"name": "pts_tuple_fields", "value": [{"field": "_vgsid_", "type": "E"}]}, + {"name": "pts_modify", "update": "modify(\"pts_store\", pts_tuple, true)"} ], "marks": [ { diff --git a/examples/compiled/selection_zoom_brush_shift-wheel.vg.json b/examples/compiled/selection_zoom_brush_shift-wheel.vg.json index cedb1ccfe8..506e660ee7 100644 --- a/examples/compiled/selection_zoom_brush_shift-wheel.vg.json +++ b/examples/compiled/selection_zoom_brush_shift-wheel.vg.json @@ -140,13 +140,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -221,12 +224,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_zoom_brush_wheel.vg.json b/examples/compiled/selection_zoom_brush_wheel.vg.json index e28d4055a9..b401a51a67 100644 --- a/examples/compiled/selection_zoom_brush_wheel.vg.json +++ b/examples/compiled/selection_zoom_brush_wheel.vg.json @@ -140,13 +140,16 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "brush_translate_anchor", @@ -219,12 +222,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, true)" - } - ] + "update": "modify(\"brush_store\", brush_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_zoom_scatterplot_shift-wheel.vg.json b/examples/compiled/selection_zoom_scatterplot_shift-wheel.vg.json index ccee64434e..831a3b97f1 100644 --- a/examples/compiled/selection_zoom_scatterplot_shift-wheel.vg.json +++ b/examples/compiled/selection_zoom_scatterplot_shift-wheel.vg.json @@ -52,13 +52,16 @@ {"signal": "grid_Horsepower"}, {"signal": "grid_Miles_per_Gallon"} ], - "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"\", fields: grid_tuple_fields, values: [grid_Horsepower, grid_Miles_per_Gallon]} : null" + "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Miles_per_Gallon]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -125,12 +128,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/selection_zoom_scatterplot_wheel.vg.json b/examples/compiled/selection_zoom_scatterplot_wheel.vg.json index d0baaf50cd..dc8d4a6c5d 100644 --- a/examples/compiled/selection_zoom_scatterplot_wheel.vg.json +++ b/examples/compiled/selection_zoom_scatterplot_wheel.vg.json @@ -52,13 +52,16 @@ {"signal": "grid_Horsepower"}, {"signal": "grid_Miles_per_Gallon"} ], - "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"\", fields: grid_tuple_fields, values: [grid_Horsepower, grid_Miles_per_Gallon]} : null" + "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Miles_per_Gallon]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"Horsepower\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Miles_per_Gallon\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "Horsepower", "channel": "x", "type": "R"}, + {"field": "Miles_per_Gallon", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -111,12 +114,7 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/trellis_selections.vg.json b/examples/compiled/trellis_selections.vg.json index 478e9ac415..fe3ba2a87f 100644 --- a/examples/compiled/trellis_selections.vg.json +++ b/examples/compiled/trellis_selections.vg.json @@ -30,7 +30,7 @@ }, { "name": "xenc_X", - "value": "", + "value": null, "on": [ { "events": [{"source": "scope", "type": "mouseover"}], @@ -209,7 +209,7 @@ }, { "name": "brush_tuple_fields", - "update": "[{\"field\":\"X\",\"channel\":\"x\",\"type\":\"R\"}]" + "value": [{"field": "X", "channel": "x", "type": "R"}] }, { "name": "brush_translate_anchor", @@ -287,12 +287,7 @@ }, { "name": "brush_modify", - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child\" + '_' + (facet[\"Series\"])})" - } - ] + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child\" + '_' + (facet[\"Series\"])})" }, { "name": "grid_X", @@ -327,13 +322,16 @@ "on": [ { "events": [{"signal": "grid_X"}, {"signal": "grid_Y"}], - "update": "grid_X && grid_Y ? {unit: \"child\" + '_' + (facet[\"Series\"]), fields: grid_tuple_fields, values: [grid_X, grid_Y]} : null" + "update": "grid_X && grid_Y ? {unit: \"child\" + '_' + (facet[\"Series\"]), fields: grid_tuple_fields, values: [grid_X,grid_Y]} : null" } ] }, { "name": "grid_tuple_fields", - "update": "[{\"field\":\"X\",\"channel\":\"x\",\"type\":\"R\"},{\"field\":\"Y\",\"channel\":\"y\",\"type\":\"R\"}]" + "value": [ + {"field": "X", "channel": "x", "type": "R"}, + {"field": "Y", "channel": "y", "type": "R"} + ] }, { "name": "grid_translate_anchor", @@ -395,29 +393,16 @@ }, { "name": "grid_modify", - "on": [ - { - "events": {"signal": "grid_tuple"}, - "update": "modify(\"grid_store\", grid_tuple, true)" - } - ] + "update": "modify(\"grid_store\", grid_tuple, true)" }, { "name": "xenc_tuple", "update": "xenc_X !== null ? {fields: xenc_tuple_fields, values: [xenc_X]} : null" }, - { - "name": "xenc_tuple_fields", - "update": "[{\"field\":\"X\",\"type\":\"E\"}]" - }, + {"name": "xenc_tuple_fields", "value": [{"field": "X", "type": "E"}]}, { "name": "xenc_modify", - "on": [ - { - "events": {"signal": "xenc_tuple"}, - "update": "modify(\"xenc_store\", xenc_tuple, true)" - } - ] + "update": "modify(\"xenc_store\", xenc_tuple, true)" } ], "marks": [ diff --git a/examples/compiled/vconcat_flatten.vg.json b/examples/compiled/vconcat_flatten.vg.json index 6c8d730d68..49a320fa8f 100644 --- a/examples/compiled/vconcat_flatten.vg.json +++ b/examples/compiled/vconcat_flatten.vg.json @@ -101,7 +101,6 @@ "signals": [ { "name": "pts_tuple", - "value": {}, "on": [ { "events": [{"source": "scope", "type": "click"}], @@ -110,10 +109,7 @@ } ] }, - { - "name": "pts_tuple_fields", - "update": "[{\"field\":\"id\",\"type\":\"E\"}]" - }, + {"name": "pts_tuple_fields", "value": [{"field": "id", "type": "E"}]}, { "name": "pts_toggle", "value": false, @@ -126,12 +122,7 @@ }, { "name": "pts_modify", - "on": [ - { - "events": {"signal": "pts_tuple"}, - "update": "modify(\"pts_store\", pts_toggle ? null : pts_tuple, pts_toggle ? null : true, pts_toggle ? pts_tuple : null)" - } - ] + "update": "modify(\"pts_store\", pts_toggle ? null : pts_tuple, pts_toggle ? null : true, pts_toggle ? pts_tuple : null)" } ], "marks": [ From 7f796587beb5d476e278d9227ea7e6804bc32c1e Mon Sep 17 00:00:00 2001 From: Dominik Moritz Date: Wed, 19 Dec 2018 16:13:54 -0800 Subject: [PATCH 11/18] Remove any type. See https://stackoverflow.com/questions/51571733/cannot-invoke-an-expression-whose-type-lacks-a-call-signature-map for explanation. @arvind. --- src/compile/selection/selection.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compile/selection/selection.ts b/src/compile/selection/selection.ts index bc7f7f5972..a3016a5f8f 100644 --- a/src/compile/selection/selection.ts +++ b/src/compile/selection/selection.ts @@ -416,9 +416,12 @@ export function positionalProjections(selCmpt: SelectionComponent) { return {x, xi, y, yi}; } -export function assembleInit(init: any, wrap: (str: string) => string = identity): string { +export function assembleInit( + init: SelectionInit | SelectionInitArray, + wrap: (str: string) => string = identity +): string { return isArray(init) - ? `[${init.map(v => assembleInit(v, wrap)).join(', ')}]` + ? `[${(init as SelectionInit[]).map(v => assembleInit(v, wrap)).join(', ')}]` : isDateTime(init) ? wrap(dateTimeExpr(init)) : wrap(JSON.stringify(init)); From 3afb9bfabc5af4e50a85a021c100d8bd9dd646c5 Mon Sep 17 00:00:00 2001 From: Kanit Wongsuphasawat Date: Fri, 22 Feb 2019 16:38:29 -0800 Subject: [PATCH 12/18] Correct the type casting --- src/compile/selection/selection.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/compile/selection/selection.ts b/src/compile/selection/selection.ts index b0f36ef5f6..905a5c4b83 100644 --- a/src/compile/selection/selection.ts +++ b/src/compile/selection/selection.ts @@ -2,7 +2,7 @@ import {Binding, NewSignal, SignalRef} from 'vega'; import {selector as parseSelector} from 'vega-event-selector'; import {identity, isArray, isString, stringValue} from 'vega-util'; import {Channel, FACET_CHANNELS, ScaleChannel, SingleDefChannel, X, Y} from '../../channel'; -import {dateTimeExpr, isDateTime} from '../../datetime'; +import {DateTime, dateTimeExpr, isDateTime} from '../../datetime'; import {warn} from '../../log'; import {LogicalOperand} from '../../logical'; import { @@ -423,9 +423,14 @@ export function assembleInit( init: SelectionInit | SelectionInitArray, wrap: (str: string) => string = identity ): string { - return isArray(init) - ? `[${(init as SelectionInit[]).map(v => assembleInit(v, wrap)).join(', ')}]` - : isDateTime(init) - ? wrap(dateTimeExpr(init)) - : wrap(JSON.stringify(init)); + if (isArray(init)) { + const str = (init as (number | boolean | DateTime | string)[]) + // Need to do casting according to https://stackoverflow.com/questions/51571733/cannot-invoke-an-expression-whose-type-lacks-a-call-signature-map + .map(v => assembleInit(v, wrap)) + .join(', '); + return `[${str}]`; + } else if (isDateTime(init)) { + return wrap(dateTimeExpr(init)); + } + return wrap(JSON.stringify(init)); } From 4f96f975ecadd9610a68d79af7b0304978deabac Mon Sep 17 00:00:00 2001 From: Kanit Wongsuphasawat Date: Fri, 22 Feb 2019 17:41:29 -0800 Subject: [PATCH 13/18] Fix typings while preserving logic + Add stricter type for selectionCmpt --- src/compile/selection/interval.ts | 11 +++++-- src/compile/selection/multi.ts | 10 ++++-- src/compile/selection/selection.ts | 34 ++++++++++++--------- src/compile/selection/single.ts | 2 +- src/compile/selection/transforms/project.ts | 21 +++++++++---- src/selection.ts | 10 +++++- 6 files changed, 59 insertions(+), 29 deletions(-) diff --git a/src/compile/selection/interval.ts b/src/compile/selection/interval.ts index bbbc88fb33..01fa166614 100644 --- a/src/compile/selection/interval.ts +++ b/src/compile/selection/interval.ts @@ -21,7 +21,7 @@ import scales from './transforms/scales'; export const BRUSH = '_brush'; export const SCALE_TRIGGER = '_scale_trigger'; -const interval: SelectionCompiler = { +const interval: SelectionCompiler<'interval'> = { signals: (model, selCmpt) => { const name = selCmpt.name; const fieldsSg = name + TUPLE + TUPLE_FIELDS; @@ -180,7 +180,12 @@ export default interval; /** * Returns the visual and data signals for an interval selection. */ -function channelSignals(model: UnitModel, selCmpt: SelectionComponent, channel: 'x' | 'y', idx: number): any { +function channelSignals( + model: UnitModel, + selCmpt: SelectionComponent<'interval'>, + channel: 'x' | 'y', + idx: number +): any { const vname = channelSignalName(selCmpt, channel, 'visual'); const dname = channelSignalName(selCmpt, channel, 'data'); const init = selCmpt.init && selCmpt.init[idx]; @@ -232,7 +237,7 @@ function channelSignals(model: UnitModel, selCmpt: SelectionComponent, channel: ]; } -function events(selCmpt: SelectionComponent, cb: (...args: any[]) => void) { +function events(selCmpt: SelectionComponent<'interval'>, cb: (...args: any[]) => void) { return selCmpt.events.reduce((on: any[], evt: EventStream) => { if (!evt.between) { warn(`${evt} is not an ordered event stream for interval selections`); diff --git a/src/compile/selection/multi.ts b/src/compile/selection/multi.ts index 1cbf2c5d4d..2c11e3d954 100644 --- a/src/compile/selection/multi.ts +++ b/src/compile/selection/multi.ts @@ -1,10 +1,11 @@ import {stringValue} from 'vega-util'; +import {SelectionInit} from '../../selection'; import {accessPathWithDatum} from '../../util'; import {UnitModel} from '../unit'; import {assembleInit, SelectionCompiler, SelectionComponent, STORE, TUPLE, unitName} from './selection'; import {TUPLE_FIELDS} from './transforms/project'; -export function multiSignals(model: UnitModel, selCmpt: SelectionComponent) { +export function multiSignals(model: UnitModel, selCmpt: SelectionComponent<'single' | 'multi'>) { const name = selCmpt.name; const fieldsSg = name + TUPLE + TUPLE_FIELDS; const proj = selCmpt.project; @@ -42,7 +43,10 @@ export function multiSignals(model: UnitModel, selCmpt: SelectionComponent) { ]; if (selCmpt.init) { - const insert = selCmpt.init.map(i => `{${update}: ${assembleInit(i)}}`); + const insert = selCmpt.init.map((i: SelectionInit | SelectionInit[]) => { + const str = assembleInit(i); + return `{${update}: ${str}}`; + }); signals.push({ name: `${name}_init`, init: `modify(${stringValue(selCmpt.name + STORE)}, [${insert}])` @@ -52,7 +56,7 @@ export function multiSignals(model: UnitModel, selCmpt: SelectionComponent) { return signals; } -const multi: SelectionCompiler = { +const multi: SelectionCompiler<'multi'> = { signals: multiSignals, modifyExpr: (model, selCmpt) => { diff --git a/src/compile/selection/selection.ts b/src/compile/selection/selection.ts index 905a5c4b83..b2c3d0bcc3 100644 --- a/src/compile/selection/selection.ts +++ b/src/compile/selection/selection.ts @@ -2,7 +2,7 @@ import {Binding, NewSignal, SignalRef} from 'vega'; import {selector as parseSelector} from 'vega-event-selector'; import {identity, isArray, isString, stringValue} from 'vega-util'; import {Channel, FACET_CHANNELS, ScaleChannel, SingleDefChannel, X, Y} from '../../channel'; -import {DateTime, dateTimeExpr, isDateTime} from '../../datetime'; +import {dateTimeExpr, isDateTime} from '../../datetime'; import {warn} from '../../log'; import {LogicalOperand} from '../../logical'; import { @@ -34,10 +34,17 @@ export const MODIFY = '_modify'; export const SELECTION_DOMAIN = '_selection_domain_'; export const VL_SELECTION_RESOLVE = 'vlSelectionResolve'; -export interface SelectionComponent { +export interface SelectionComponent { name: string; - type: SelectionType; - init?: (SelectionInit | SelectionInitArray)[]; + type: T; + + // Use conditional typing (https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html) + // so we have stricter type of init (as the type of init depends on selection type) + init?: (T extends 'interval' + ? SelectionInitArray // + : T extends 'single' + ? SelectionInit + : SelectionInit | SelectionInit[])[]; // multi events: EventStream; // predicate?: string; bind?: 'scales' | Binding | Dict; @@ -68,15 +75,15 @@ export interface ProjectSelectionComponent { type: TupleStoreType; } -export interface SelectionCompiler { - signals: (model: UnitModel, selCmpt: SelectionComponent) => NewSignal[]; - topLevelSignals?: (model: Model, selCmpt: SelectionComponent, signals: NewSignal[]) => NewSignal[]; - modifyExpr: (model: UnitModel, selCmpt: SelectionComponent) => string; - marks?: (model: UnitModel, selCmpt: SelectionComponent, marks: any[]) => any[]; +export interface SelectionCompiler { + signals: (model: UnitModel, selCmpt: SelectionComponent) => NewSignal[]; + topLevelSignals?: (model: Model, selCmpt: SelectionComponent, signals: NewSignal[]) => NewSignal[]; + modifyExpr: (model: UnitModel, selCmpt: SelectionComponent) => string; + marks?: (model: UnitModel, selCmpt: SelectionComponent, marks: any[]) => any[]; } export function parseUnitSelection(model: UnitModel, selDefs: Dict) { - const selCmpts: Dict = {}; + const selCmpts: Dict> = {}; const selectionConfig = model.config.selection; if (selDefs) { @@ -420,14 +427,11 @@ export function positionalProjections(selCmpt: SelectionComponent) { } export function assembleInit( - init: SelectionInit | SelectionInitArray, + init: (SelectionInit | SelectionInit[] | SelectionInitArray)[] | SelectionInit, wrap: (str: string) => string = identity ): string { if (isArray(init)) { - const str = (init as (number | boolean | DateTime | string)[]) - // Need to do casting according to https://stackoverflow.com/questions/51571733/cannot-invoke-an-expression-whose-type-lacks-a-call-signature-map - .map(v => assembleInit(v, wrap)) - .join(', '); + const str = init.map(v => assembleInit(v, wrap)).join(', '); return `[${str}]`; } else if (isDateTime(init)) { return wrap(dateTimeExpr(init)); diff --git a/src/compile/selection/single.ts b/src/compile/selection/single.ts index 8aea7458a7..d1cc31f2ac 100644 --- a/src/compile/selection/single.ts +++ b/src/compile/selection/single.ts @@ -1,7 +1,7 @@ import {multiSignals} from './multi'; import {SelectionCompiler, TUPLE, unitName} from './selection'; -const single: SelectionCompiler = { +const single: SelectionCompiler<'single'> = { signals: multiSignals, modifyExpr: (model, selCmpt) => { diff --git a/src/compile/selection/transforms/project.ts b/src/compile/selection/transforms/project.ts index f55d446145..c4ba95a7ba 100644 --- a/src/compile/selection/transforms/project.ts +++ b/src/compile/selection/transforms/project.ts @@ -1,8 +1,8 @@ -import {array} from 'vega-util'; +import {isArray} from 'vega-util'; import {ScaleChannel} from '../../../channel'; import * as log from '../../../log'; import {hasContinuousDomain, isBinScale} from '../../../scale'; -import {SelectionDef} from '../../../selection'; +import {isIntervalSelection, SelectionDef, SelectionInitArrayMapping, SelectionInitMapping} from '../../../selection'; import {Dict, keys} from '../../../util'; import {TimeUnitComponent, TimeUnitNode} from '../../data/timeunit'; import {ProjectSelectionComponent, SelectionComponent, TUPLE, TupleStoreType} from '../selection'; @@ -20,8 +20,9 @@ const project: TransformCompiler = { parse: (model, selDef, selCmpt) => { const timeUnits: Dict = {}; const f: Dict = {}; + + // Selection component may already have a projection from the config. (Interval selection will have `encodings: ['x', 'y'].) const proj = selCmpt.project || (selCmpt.project = []); - const init = selDef.init; selCmpt.fields = {}; // TODO: find a possible channel mapping for these fields. @@ -72,12 +73,20 @@ const project: TransformCompiler = { } } - if (init) { + if (selDef.init) { if (scales.has(selCmpt)) { log.warn(log.message.NO_INIT_SCALE_BINDINGS); } else { - const parseInit = (i: any) => proj.map(p => (i[p.channel] !== undefined ? i[p.channel] : i[p.field])); - selCmpt.init = selCmpt.type === 'interval' ? parseInit(init) : array(init).map(parseInit); + function parseInit(i: T): T['a'][] { + return proj.map(p => (i[p.channel] !== undefined ? i[p.channel] : i[p.field])); + } + + if (isIntervalSelection(selDef)) { + selCmpt.init = parseInit(selDef.init); + } else { + const init = isArray(selDef.init) ? selDef.init : [selDef.init]; + selCmpt.init = init.map(parseInit); + } } } diff --git a/src/selection.ts b/src/selection.ts index 0540b3cdba..74691dc6a0 100644 --- a/src/selection.ts +++ b/src/selection.ts @@ -13,6 +13,10 @@ export interface SelectionInitMapping { [key: string]: SelectionInit; } +export interface SelectionInitArrayMapping { + [key: string]: SelectionInitArray; +} + export interface BaseSelectionDef { /** * A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection. @@ -186,7 +190,7 @@ export interface IntervalSelectionConfig extends BaseSelectionDef { * Initialize the selection with a mapping between field names and arrays of * initial values. */ - init?: {[key: string]: SelectionInitArray}; + init?: SelectionInitArrayMapping; } export interface SingleSelection extends SingleSelectionConfig { @@ -203,6 +207,10 @@ export interface IntervalSelection extends IntervalSelectionConfig { export type SelectionDef = SingleSelection | MultiSelection | IntervalSelection; +export function isIntervalSelection(s: SelectionDef): s is IntervalSelection { + return s.type === 'interval'; +} + export interface SelectionConfig { /** * The default definition for a [`single`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All properties and transformations From abdc534583ccbfaa3c8c64528ad6845cce4e3162 Mon Sep 17 00:00:00 2001 From: Kanit Wongsuphasawat Date: Sat, 23 Feb 2019 09:34:36 -0800 Subject: [PATCH 14/18] Fix init description --- src/selection.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/selection.ts b/src/selection.ts index 74691dc6a0..ea0714558c 100644 --- a/src/selection.ts +++ b/src/selection.ts @@ -76,7 +76,7 @@ export interface SingleSelectionConfig extends BaseSelectionDef { nearest?: boolean; /** - * Initialize the selection with a mapping between field names and initial values. + * Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and initial values. */ init?: SelectionInitMapping; } @@ -103,7 +103,7 @@ export interface MultiSelectionConfig extends BaseSelectionDef { nearest?: boolean; /** - * Initialize the selection with a mapping between field names and an initial + * Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and an initial * value (or array of values). */ init?: SelectionInitMapping | SelectionInitMapping[]; @@ -187,7 +187,7 @@ export interface IntervalSelectionConfig extends BaseSelectionDef { mark?: BrushConfig; /** - * Initialize the selection with a mapping between field names and arrays of + * Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and arrays of * initial values. */ init?: SelectionInitArrayMapping; From bd1b70773c7cd817ec4f5abdd216cb3116da3cb5 Mon Sep 17 00:00:00 2001 From: Kanit Wongsuphasawat Date: Sat, 23 Feb 2019 09:37:34 -0800 Subject: [PATCH 15/18] Rename `multiSignals` => `singleOrMultiSignals` --- src/compile/selection/multi.ts | 4 ++-- src/compile/selection/single.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compile/selection/multi.ts b/src/compile/selection/multi.ts index 2c11e3d954..17aa77c446 100644 --- a/src/compile/selection/multi.ts +++ b/src/compile/selection/multi.ts @@ -5,7 +5,7 @@ import {UnitModel} from '../unit'; import {assembleInit, SelectionCompiler, SelectionComponent, STORE, TUPLE, unitName} from './selection'; import {TUPLE_FIELDS} from './transforms/project'; -export function multiSignals(model: UnitModel, selCmpt: SelectionComponent<'single' | 'multi'>) { +export function singleOrMultiSignals(model: UnitModel, selCmpt: SelectionComponent<'single' | 'multi'>) { const name = selCmpt.name; const fieldsSg = name + TUPLE + TUPLE_FIELDS; const proj = selCmpt.project; @@ -57,7 +57,7 @@ export function multiSignals(model: UnitModel, selCmpt: SelectionComponent<'sing } const multi: SelectionCompiler<'multi'> = { - signals: multiSignals, + signals: singleOrMultiSignals, modifyExpr: (model, selCmpt) => { const tpl = selCmpt.name + TUPLE; diff --git a/src/compile/selection/single.ts b/src/compile/selection/single.ts index d1cc31f2ac..5c4683353e 100644 --- a/src/compile/selection/single.ts +++ b/src/compile/selection/single.ts @@ -1,8 +1,8 @@ -import {multiSignals} from './multi'; +import {singleOrMultiSignals} from './multi'; import {SelectionCompiler, TUPLE, unitName} from './selection'; const single: SelectionCompiler<'single'> = { - signals: multiSignals, + signals: singleOrMultiSignals, modifyExpr: (model, selCmpt) => { const tpl = selCmpt.name + TUPLE; From 5f4537874e510cc4f30b1954bf1b95df15e1c641 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 23 Feb 2019 17:58:05 +0000 Subject: [PATCH 16/18] [Travis] Update schema (build: 21313) --- build/vega-lite-schema.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json index e70402bbfc..862a467370 100644 --- a/build/vega-lite-schema.json +++ b/build/vega-lite-schema.json @@ -5989,11 +5989,8 @@ "type": "array" }, "init": { - "additionalProperties": { - "$ref": "#/definitions/SelectionInitArray" - }, - "description": "Initialize the selection with a mapping between field names and arrays of\ninitial values.", - "type": "object" + "$ref": "#/definitions/SelectionInitArrayMapping", + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and arrays of\ninitial values." }, "mark": { "$ref": "#/definitions/BrushConfig", @@ -6066,11 +6063,8 @@ "type": "array" }, "init": { - "additionalProperties": { - "$ref": "#/definitions/SelectionInitArray" - }, - "description": "Initialize the selection with a mapping between field names and arrays of\ninitial values.", - "type": "object" + "$ref": "#/definitions/SelectionInitArrayMapping", + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and arrays of\ninitial values." }, "mark": { "$ref": "#/definitions/BrushConfig", @@ -7691,7 +7685,7 @@ "type": "array" } ], - "description": "Initialize the selection with a mapping between field names and an initial\nvalue (or array of values)." + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and an initial\nvalue (or array of values)." }, "nearest": { "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](https://vega.github.io/vega-lite/docs/nearest.html) documentation for more information.", @@ -7761,7 +7755,7 @@ "type": "array" } ], - "description": "Initialize the selection with a mapping between field names and an initial\nvalue (or array of values)." + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and an initial\nvalue (or array of values)." }, "nearest": { "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](https://vega.github.io/vega-lite/docs/nearest.html) documentation for more information.", @@ -9333,6 +9327,12 @@ } ] }, + "SelectionInitArrayMapping": { + "additionalProperties": { + "$ref": "#/definitions/SelectionInitArray" + }, + "type": "object" + }, "SelectionInitMapping": { "additionalProperties": { "$ref": "#/definitions/SelectionInit" @@ -9452,7 +9452,7 @@ }, "init": { "$ref": "#/definitions/SelectionInitMapping", - "description": "Initialize the selection with a mapping between field names and initial values." + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and initial values." }, "nearest": { "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](https://vega.github.io/vega-lite/docs/nearest.html) documentation for more information.", @@ -9519,7 +9519,7 @@ }, "init": { "$ref": "#/definitions/SelectionInitMapping", - "description": "Initialize the selection with a mapping between field names and initial values." + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and initial values." }, "nearest": { "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\nSee the [nearest transform](https://vega.github.io/vega-lite/docs/nearest.html) documentation for more information.", From 2c81e16e3844a20e2827cc2da2716dd42badc6f6 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 23 Feb 2019 18:00:58 +0000 Subject: [PATCH 17/18] [Travis] Update examples (build: 21313) --- .../interactive_panzoom_splom.vg.json | 36 +--- examples/compiled/interactive_splom.vg.json | 171 +++--------------- .../selection_resolution_global.vg.json | 36 +--- .../selection_resolution_intersect.vg.json | 135 ++------------ .../selection_resolution_union.vg.json | 135 ++------------ examples/compiled/trellis_selections.vg.json | 17 +- 6 files changed, 65 insertions(+), 465 deletions(-) diff --git a/examples/compiled/interactive_panzoom_splom.vg.json b/examples/compiled/interactive_panzoom_splom.vg.json index 1a08b99b63..7b9dee33a2 100644 --- a/examples/compiled/interactive_panzoom_splom.vg.json +++ b/examples/compiled/interactive_panzoom_splom.vg.json @@ -75,11 +75,7 @@ {"signal": "grid_Miles_per_Gallon"}, {"signal": "grid_Horsepower"} ], -<<<<<<< HEAD - "update": "grid_Miles_per_Gallon && grid_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon,grid_Horsepower]} : null" -======= - "update": "grid_Miles_per_Gallon && grid_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon, grid_Horsepower]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "grid_Miles_per_Gallon && grid_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon,grid_Horsepower]} : null" } ] }, @@ -275,11 +271,7 @@ {"signal": "grid_Acceleration"}, {"signal": "grid_Horsepower"} ], -<<<<<<< HEAD - "update": "grid_Acceleration && grid_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration,grid_Horsepower]} : null" -======= - "update": "grid_Acceleration && grid_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration, grid_Horsepower]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "grid_Acceleration && grid_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration,grid_Horsepower]} : null" } ] }, @@ -651,11 +643,7 @@ {"signal": "grid_Miles_per_Gallon"}, {"signal": "grid_Acceleration"} ], -<<<<<<< HEAD - "update": "grid_Miles_per_Gallon && grid_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon,grid_Acceleration]} : null" -======= - "update": "grid_Miles_per_Gallon && grid_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon, grid_Acceleration]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "grid_Miles_per_Gallon && grid_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon,grid_Acceleration]} : null" } ] }, @@ -1027,11 +1015,7 @@ {"signal": "grid_Horsepower"}, {"signal": "grid_Acceleration"} ], -<<<<<<< HEAD - "update": "grid_Horsepower && grid_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Acceleration]} : null" -======= - "update": "grid_Horsepower && grid_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower, grid_Acceleration]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "grid_Horsepower && grid_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Acceleration]} : null" } ] }, @@ -1403,11 +1387,7 @@ {"signal": "grid_Acceleration"}, {"signal": "grid_Miles_per_Gallon"} ], -<<<<<<< HEAD - "update": "grid_Acceleration && grid_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration,grid_Miles_per_Gallon]} : null" -======= - "update": "grid_Acceleration && grid_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration, grid_Miles_per_Gallon]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "grid_Acceleration && grid_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration,grid_Miles_per_Gallon]} : null" } ] }, @@ -1603,11 +1583,7 @@ {"signal": "grid_Horsepower"}, {"signal": "grid_Miles_per_Gallon"} ], -<<<<<<< HEAD - "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Miles_per_Gallon]} : null" -======= - "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower, grid_Miles_per_Gallon]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Miles_per_Gallon]} : null" } ] }, diff --git a/examples/compiled/interactive_splom.vg.json b/examples/compiled/interactive_splom.vg.json index 373d1a98ee..cb3a7d36f1 100644 --- a/examples/compiled/interactive_splom.vg.json +++ b/examples/compiled/interactive_splom.vg.json @@ -170,11 +170,7 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Horsepower"} ], -<<<<<<< HEAD - "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Horsepower]} : null" -======= - "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Horsepower]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Horsepower]} : null" } ] }, @@ -264,16 +260,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Miles_per_Gallon\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\"})" }, { "name": "grid_Miles_per_Gallon", @@ -311,11 +298,7 @@ {"signal": "grid_Miles_per_Gallon"}, {"signal": "grid_Horsepower"} ], -<<<<<<< HEAD - "update": "grid_Miles_per_Gallon && grid_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon,grid_Horsepower]} : null" -======= - "update": "grid_Miles_per_Gallon && grid_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon, grid_Horsepower]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "grid_Miles_per_Gallon && grid_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon,grid_Horsepower]} : null" } ] }, @@ -668,11 +651,7 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Horsepower"} ], -<<<<<<< HEAD - "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Horsepower]} : null" -======= - "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Horsepower]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Horsepower]} : null" } ] }, @@ -762,16 +741,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Acceleration\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\"})" }, { "name": "grid_Acceleration", @@ -809,11 +779,7 @@ {"signal": "grid_Acceleration"}, {"signal": "grid_Horsepower"} ], -<<<<<<< HEAD - "update": "grid_Acceleration && grid_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration,grid_Horsepower]} : null" -======= - "update": "grid_Acceleration && grid_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration, grid_Horsepower]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "grid_Acceleration && grid_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration,grid_Horsepower]} : null" } ] }, @@ -1193,16 +1159,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Horsepower\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Horsepower\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Horsepower\"})" }, { "name": "grid_Horsepower", @@ -1570,11 +1527,7 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Acceleration"} ], -<<<<<<< HEAD - "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Acceleration]} : null" -======= - "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Acceleration]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Acceleration]} : null" } ] }, @@ -1664,16 +1617,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Miles_per_Gallon\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\"})" }, { "name": "grid_Miles_per_Gallon", @@ -1711,11 +1655,7 @@ {"signal": "grid_Miles_per_Gallon"}, {"signal": "grid_Acceleration"} ], -<<<<<<< HEAD - "update": "grid_Miles_per_Gallon && grid_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon,grid_Acceleration]} : null" -======= - "update": "grid_Miles_per_Gallon && grid_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon, grid_Acceleration]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "grid_Miles_per_Gallon && grid_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\", fields: grid_tuple_fields, values: [grid_Miles_per_Gallon,grid_Acceleration]} : null" } ] }, @@ -2095,16 +2035,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Acceleration\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Acceleration\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Acceleration\"})" }, { "name": "grid_Acceleration", @@ -2472,11 +2403,7 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Acceleration"} ], -<<<<<<< HEAD - "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Acceleration]} : null" -======= - "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Acceleration]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Acceleration]} : null" } ] }, @@ -2566,16 +2493,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Horsepower\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\"})" }, { "name": "grid_Horsepower", @@ -2613,11 +2531,7 @@ {"signal": "grid_Horsepower"}, {"signal": "grid_Acceleration"} ], -<<<<<<< HEAD - "update": "grid_Horsepower && grid_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Acceleration]} : null" -======= - "update": "grid_Horsepower && grid_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower, grid_Acceleration]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "grid_Horsepower && grid_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Acceleration]} : null" } ] }, @@ -2997,16 +2911,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Miles_per_Gallon\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Miles_per_Gallon\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Miles_per_Gallon\"})" }, { "name": "grid_Miles_per_Gallon", @@ -3374,11 +3279,7 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Miles_per_Gallon"} ], -<<<<<<< HEAD - "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Miles_per_Gallon]} : null" -======= - "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Miles_per_Gallon]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Miles_per_Gallon]} : null" } ] }, @@ -3468,16 +3369,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Acceleration\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\"})" }, { "name": "grid_Acceleration", @@ -3515,11 +3407,7 @@ {"signal": "grid_Acceleration"}, {"signal": "grid_Miles_per_Gallon"} ], -<<<<<<< HEAD - "update": "grid_Acceleration && grid_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration,grid_Miles_per_Gallon]} : null" -======= - "update": "grid_Acceleration && grid_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration, grid_Miles_per_Gallon]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "grid_Acceleration && grid_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\", fields: grid_tuple_fields, values: [grid_Acceleration,grid_Miles_per_Gallon]} : null" } ] }, @@ -3872,11 +3760,7 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], -<<<<<<< HEAD - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" -======= - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, @@ -3966,16 +3850,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Horsepower\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\"})" }, { "name": "grid_Horsepower", @@ -4013,11 +3888,7 @@ {"signal": "grid_Horsepower"}, {"signal": "grid_Miles_per_Gallon"} ], -<<<<<<< HEAD - "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Miles_per_Gallon]} : null" -======= - "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower, grid_Miles_per_Gallon]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "grid_Horsepower && grid_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\", fields: grid_tuple_fields, values: [grid_Horsepower,grid_Miles_per_Gallon]} : null" } ] }, diff --git a/examples/compiled/selection_resolution_global.vg.json b/examples/compiled/selection_resolution_global.vg.json index 289bb40518..c958958f0d 100644 --- a/examples/compiled/selection_resolution_global.vg.json +++ b/examples/compiled/selection_resolution_global.vg.json @@ -155,11 +155,7 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Horsepower"} ], -<<<<<<< HEAD - "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Horsepower]} : null" -======= - "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Horsepower]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Horsepower]} : null" } ] }, @@ -555,11 +551,7 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Horsepower"} ], -<<<<<<< HEAD - "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Horsepower]} : null" -======= - "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Horsepower]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Horsepower]} : null" } ] }, @@ -1287,11 +1279,7 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Acceleration"} ], -<<<<<<< HEAD - "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Acceleration]} : null" -======= - "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Acceleration]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Acceleration]} : null" } ] }, @@ -2019,11 +2007,7 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Acceleration"} ], -<<<<<<< HEAD - "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Acceleration]} : null" -======= - "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Acceleration]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Acceleration]} : null" } ] }, @@ -2751,11 +2735,7 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Miles_per_Gallon"} ], -<<<<<<< HEAD - "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Miles_per_Gallon]} : null" -======= - "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Miles_per_Gallon]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Miles_per_Gallon]} : null" } ] }, @@ -3151,11 +3131,7 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], -<<<<<<< HEAD - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" -======= - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, diff --git a/examples/compiled/selection_resolution_intersect.vg.json b/examples/compiled/selection_resolution_intersect.vg.json index 2c26d09fed..0941df2b99 100644 --- a/examples/compiled/selection_resolution_intersect.vg.json +++ b/examples/compiled/selection_resolution_intersect.vg.json @@ -158,11 +158,7 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Horsepower"} ], -<<<<<<< HEAD - "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Horsepower]} : null" -======= - "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Horsepower]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Horsepower]} : null" } ] }, @@ -248,16 +244,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Miles_per_Gallon\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\"})" } ], "marks": [ @@ -519,11 +506,7 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Horsepower"} ], -<<<<<<< HEAD - "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Horsepower]} : null" -======= - "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Horsepower]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Horsepower]} : null" } ] }, @@ -609,16 +592,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Acceleration\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\"})" } ], "marks": [ @@ -905,16 +879,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Horsepower\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Horsepower\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Horsepower\"})" } ], "marks": [ @@ -1173,11 +1138,7 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Acceleration"} ], -<<<<<<< HEAD - "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Acceleration]} : null" -======= - "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Acceleration]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Acceleration]} : null" } ] }, @@ -1263,16 +1224,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Miles_per_Gallon\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\"})" } ], "marks": [ @@ -1559,16 +1511,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Acceleration\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Acceleration\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Acceleration\"})" } ], "marks": [ @@ -1827,11 +1770,7 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Acceleration"} ], -<<<<<<< HEAD - "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Acceleration]} : null" -======= - "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Acceleration]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Acceleration]} : null" } ] }, @@ -1917,16 +1856,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Horsepower\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\"})" } ], "marks": [ @@ -2213,16 +2143,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Miles_per_Gallon\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Miles_per_Gallon\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Miles_per_Gallon\"})" } ], "marks": [ @@ -2481,11 +2402,7 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Miles_per_Gallon"} ], -<<<<<<< HEAD - "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Miles_per_Gallon]} : null" -======= - "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Miles_per_Gallon]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Miles_per_Gallon]} : null" } ] }, @@ -2571,16 +2488,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Acceleration\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\"})" } ], "marks": [ @@ -2842,11 +2750,7 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], -<<<<<<< HEAD - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" -======= - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, @@ -2932,16 +2836,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Horsepower\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\"})" } ], "marks": [ diff --git a/examples/compiled/selection_resolution_union.vg.json b/examples/compiled/selection_resolution_union.vg.json index 764f23b1f3..9794ef2513 100644 --- a/examples/compiled/selection_resolution_union.vg.json +++ b/examples/compiled/selection_resolution_union.vg.json @@ -158,11 +158,7 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Horsepower"} ], -<<<<<<< HEAD - "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child_Horsepower_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Horsepower]} : null" -======= - "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Horsepower]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Miles_per_Gallon && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Horsepower]} : null" } ] }, @@ -248,16 +244,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Miles_per_Gallon\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Miles_per_Gallon\"})" } ], "marks": [ @@ -519,11 +506,7 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Horsepower"} ], -<<<<<<< HEAD - "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child_Horsepower_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Horsepower]} : null" -======= - "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Horsepower]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Acceleration && brush_Horsepower ? {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Horsepower]} : null" } ] }, @@ -609,16 +592,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Acceleration\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Acceleration\"})" } ], "marks": [ @@ -905,16 +879,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Horsepower_Horsepower\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Horsepower\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Horsepower__repeat_column_Horsepower\"})" } ], "marks": [ @@ -1173,11 +1138,7 @@ {"signal": "brush_Miles_per_Gallon"}, {"signal": "brush_Acceleration"} ], -<<<<<<< HEAD - "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child_Acceleration_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Acceleration]} : null" -======= - "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon, brush_Acceleration]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Miles_per_Gallon && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\", fields: brush_tuple_fields, values: [brush_Miles_per_Gallon,brush_Acceleration]} : null" } ] }, @@ -1263,16 +1224,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Miles_per_Gallon\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Miles_per_Gallon\"})" } ], "marks": [ @@ -1559,16 +1511,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Acceleration\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Acceleration\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Acceleration\"})" } ], "marks": [ @@ -1827,11 +1770,7 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Acceleration"} ], -<<<<<<< HEAD - "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child_Acceleration_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Acceleration]} : null" -======= - "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Acceleration]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Horsepower && brush_Acceleration ? {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Acceleration]} : null" } ] }, @@ -1917,16 +1856,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Acceleration_Horsepower\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Acceleration__repeat_column_Horsepower\"})" } ], "marks": [ @@ -2213,16 +2143,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Miles_per_Gallon\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Miles_per_Gallon\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Miles_per_Gallon\"})" } ], "marks": [ @@ -2481,11 +2402,7 @@ {"signal": "brush_Acceleration"}, {"signal": "brush_Miles_per_Gallon"} ], -<<<<<<< HEAD - "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Miles_per_Gallon]} : null" -======= - "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration, brush_Miles_per_Gallon]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Acceleration && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\", fields: brush_tuple_fields, values: [brush_Acceleration,brush_Miles_per_Gallon]} : null" } ] }, @@ -2571,16 +2488,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Acceleration\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Acceleration\"})" } ], "marks": [ @@ -2842,11 +2750,7 @@ {"signal": "brush_Horsepower"}, {"signal": "brush_Miles_per_Gallon"} ], -<<<<<<< HEAD - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child_Miles_per_Gallon_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" -======= - "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower, brush_Miles_per_Gallon]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null" } ] }, @@ -2932,16 +2836,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child_Miles_per_Gallon_Horsepower\"})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\"})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child__repeat_row_Miles_per_Gallon__repeat_column_Horsepower\"})" } ], "marks": [ diff --git a/examples/compiled/trellis_selections.vg.json b/examples/compiled/trellis_selections.vg.json index d75dcb83e3..3cb43a99ee 100644 --- a/examples/compiled/trellis_selections.vg.json +++ b/examples/compiled/trellis_selections.vg.json @@ -287,16 +287,7 @@ }, { "name": "brush_modify", -<<<<<<< HEAD - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child\" + '_' + (facet[\"Series\"])})" -======= - "on": [ - { - "events": {"signal": "brush_tuple"}, - "update": "modify(\"brush_store\", brush_tuple, {unit: \"child\" + '__facet_column_' + (facet[\"Series\"])})" - } - ] ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "modify(\"brush_store\", brush_tuple, {unit: \"child\" + '__facet_column_' + (facet[\"Series\"])})" }, { "name": "grid_X", @@ -331,11 +322,7 @@ "on": [ { "events": [{"signal": "grid_X"}, {"signal": "grid_Y"}], -<<<<<<< HEAD - "update": "grid_X && grid_Y ? {unit: \"child\" + '_' + (facet[\"Series\"]), fields: grid_tuple_fields, values: [grid_X,grid_Y]} : null" -======= - "update": "grid_X && grid_Y ? {unit: \"child\" + '__facet_column_' + (facet[\"Series\"]), fields: grid_tuple_fields, values: [grid_X, grid_Y]} : null" ->>>>>>> 2f14410baf4d7cd0c4744799ae905de8132036f9 + "update": "grid_X && grid_Y ? {unit: \"child\" + '__facet_column_' + (facet[\"Series\"]), fields: grid_tuple_fields, values: [grid_X,grid_Y]} : null" } ] }, From 9c0f54424e4dd44912def82d1ce03e2399528572 Mon Sep 17 00:00:00 2001 From: Kanit Wongsuphasawat Date: Sat, 23 Feb 2019 14:32:38 -0800 Subject: [PATCH 18/18] Remove unnecessary change to yarn.lock --- yarn.lock | 5 ----- 1 file changed, 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 021bbd2427..556b140891 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6810,11 +6810,6 @@ vega-util@^1.7.0, vega-util@^1.7.1: resolved "https://registry.yarnpkg.com/vega-util/-/vega-util-1.7.1.tgz#0b95bbe6058895c332596c215247507caa68ab61" integrity sha512-jdzigLdaXH0rClqkr/qHY//xvmLyxQyZL4Wxb3mew29QpITrMk/USV6v/399h29xVt1+hJuw1vpLoJqAq6WerA== -vega-util@^1.7.1: - version "1.7.1" - resolved "https://registry.yarnpkg.com/vega-util/-/vega-util-1.7.1.tgz#0b95bbe6058895c332596c215247507caa68ab61" - integrity sha512-jdzigLdaXH0rClqkr/qHY//xvmLyxQyZL4Wxb3mew29QpITrMk/USV6v/399h29xVt1+hJuw1vpLoJqAq6WerA== - vega-view-transforms@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/vega-view-transforms/-/vega-view-transforms-2.0.3.tgz#9999f83301efbe65ed1971018f538f5aeb62a16e"