vega-lite
Advanced tools
Comparing version 5.20.0 to 5.20.1
{ | ||
"name": "vega-lite", | ||
"author": "Dominik Moritz, Kanit \"Ham\" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer", | ||
"version": "5.20.0", | ||
"version": "5.20.1", | ||
"collaborators": [ | ||
@@ -6,0 +6,0 @@ "Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)", |
@@ -0,1 +1,2 @@ | ||
import { isConditionalDef } from '../../../channeldef'; | ||
import { getMarkPropOrConfig, signalOrValueRef } from '../../common'; | ||
@@ -12,5 +13,11 @@ import { wrapCondition } from './conditional'; | ||
let { defaultRef, defaultValue } = opt; | ||
const channelDef = encoding[channel]; | ||
if (defaultRef === undefined) { | ||
// prettier-ignore | ||
defaultValue ?? (defaultValue = getMarkPropOrConfig(channel, markDef, config, { vgChannel, ignoreVgConfig: true })); | ||
defaultValue ?? (defaultValue = getMarkPropOrConfig(channel, markDef, config, { | ||
vgChannel, | ||
// If there is no conditonal def, we ignore vgConfig so the output spec is concise. | ||
// However, if there is a conditional def, we must include vgConfig so the default is respected. | ||
ignoreVgConfig: !isConditionalDef(channelDef) | ||
})); | ||
if (defaultValue !== undefined) { | ||
@@ -20,3 +27,2 @@ defaultRef = signalOrValueRef(defaultValue); | ||
} | ||
const channelDef = encoding[channel]; | ||
const commonProps = { | ||
@@ -23,0 +29,0 @@ markDef, |
@@ -47,3 +47,3 @@ import { stringValue } from 'vega-util'; | ||
const proj = selCmpt.project; | ||
const signal = signals.filter(s => s.name === name + TUPLE)[0]; | ||
const signal = signals.find(s => s.name === name + TUPLE); | ||
const fields = name + TUPLE_FIELDS; | ||
@@ -50,0 +50,0 @@ const values = proj.items.map(p => varName(`${name}_${p.field}`)); |
@@ -39,3 +39,3 @@ import { isObject } from 'vega'; | ||
const filters = array(((_a = evt.between[0]).filter ?? (_a.filter = []))); | ||
if (filters.indexOf(filterExpr) < 0) { | ||
if (!filters.includes(filterExpr)) { | ||
filters.push(filterExpr); | ||
@@ -42,0 +42,0 @@ } |
@@ -55,3 +55,3 @@ import * as log from '../../log'; | ||
} | ||
else if (name.indexOf(VORONOI) >= 0) { | ||
else if (name.includes(VORONOI)) { | ||
exists = true; | ||
@@ -58,0 +58,0 @@ } |
@@ -45,5 +45,5 @@ import { stringValue } from 'vega-util'; | ||
// the top-level named signal, except no single selCmpt has a global view. | ||
const namedSg = signals.filter(s => s.name === selCmpt.name)[0]; | ||
const namedSg = signals.find(s => s.name === selCmpt.name); | ||
let update = namedSg.update; | ||
if (update.indexOf(VL_SELECTION_RESOLVE) >= 0) { | ||
if (update.includes(VL_SELECTION_RESOLVE)) { | ||
namedSg.update = `{${bound | ||
@@ -50,0 +50,0 @@ .map(proj => `${stringValue(replacePathInField(proj.field))}: ${proj.signals.data}`) |
@@ -58,3 +58,3 @@ import { parseSelector } from 'vega-event-selector'; | ||
const boundScales = scalesCompiler.defined(selCmpt); | ||
const signal = signals.filter(s => s.name === proj.signals[boundScales ? 'data' : 'visual'])[0]; | ||
const signal = signals.find(s => s.name === proj.signals[boundScales ? 'data' : 'visual']); | ||
const sizeSg = model.getSizeSignalRef(size).signal; | ||
@@ -61,0 +61,0 @@ const scaleCmpt = model.getScaleComponent(channel); |
@@ -61,3 +61,3 @@ import { parseSelector } from 'vega-event-selector'; | ||
const boundScales = scalesCompiler.defined(selCmpt); | ||
const signal = signals.filter(s => s.name === proj.signals[boundScales ? 'data' : 'visual'])[0]; | ||
const signal = signals.find(s => s.name === proj.signals[boundScales ? 'data' : 'visual']); | ||
const sizeSg = model.getSizeSignalRef(size).signal; | ||
@@ -64,0 +64,0 @@ const scaleCmpt = model.getScaleComponent(channel); |
{ | ||
"name": "vega-lite", | ||
"author": "Dominik Moritz, Kanit \"Ham\" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer", | ||
"version": "5.20.0", | ||
"version": "5.20.1", | ||
"collaborators": [ | ||
@@ -6,0 +6,0 @@ "Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)", |
import type {SignalRef} from 'vega'; | ||
import {NonPositionScaleChannel} from '../../../channel'; | ||
import {Value} from '../../../channeldef'; | ||
import {Value, isConditionalDef} from '../../../channeldef'; | ||
import {VgEncodeChannel, VgEncodeEntry, VgValueRef} from '../../../vega.schema'; | ||
@@ -27,5 +27,12 @@ import {getMarkPropOrConfig, signalOrValueRef} from '../../common'; | ||
const channelDef = encoding[channel]; | ||
if (defaultRef === undefined) { | ||
// prettier-ignore | ||
defaultValue ??= getMarkPropOrConfig(channel, markDef, config, {vgChannel, ignoreVgConfig: true}); | ||
defaultValue ??= getMarkPropOrConfig(channel, markDef, config, { | ||
vgChannel, | ||
// If there is no conditonal def, we ignore vgConfig so the output spec is concise. | ||
// However, if there is a conditional def, we must include vgConfig so the default is respected. | ||
ignoreVgConfig: !isConditionalDef(channelDef) | ||
}); | ||
@@ -37,3 +44,2 @@ if (defaultValue !== undefined) { | ||
const channelDef = encoding[channel]; | ||
const commonProps = { | ||
@@ -40,0 +46,0 @@ markDef, |
@@ -58,3 +58,3 @@ import {stringValue} from 'vega-util'; | ||
const proj = selCmpt.project; | ||
const signal: NewSignal = signals.filter(s => s.name === name + TUPLE)[0]; | ||
const signal: NewSignal = signals.find(s => s.name === name + TUPLE); | ||
const fields = name + TUPLE_FIELDS; | ||
@@ -61,0 +61,0 @@ const values = proj.items.map(p => varName(`${name}_${p.field}`)); |
@@ -50,3 +50,3 @@ import {isObject, NewSignal, OnEvent, SignalValue, Stream} from 'vega'; | ||
const filters = array((evt.between[0].filter ??= [])); | ||
if (filters.indexOf(filterExpr) < 0) { | ||
if (!filters.includes(filterExpr)) { | ||
filters.push(filterExpr); | ||
@@ -53,0 +53,0 @@ } |
@@ -61,3 +61,3 @@ import * as log from '../../log'; | ||
index = i; | ||
} else if (name.indexOf(VORONOI) >= 0) { | ||
} else if (name.includes(VORONOI)) { | ||
exists = true; | ||
@@ -64,0 +64,0 @@ } |
@@ -60,5 +60,5 @@ import {stringValue} from 'vega-util'; | ||
// the top-level named signal, except no single selCmpt has a global view. | ||
const namedSg: NewSignal = signals.filter(s => s.name === selCmpt.name)[0]; | ||
const namedSg: NewSignal = signals.find(s => s.name === selCmpt.name); | ||
let update = namedSg.update; | ||
if (update.indexOf(VL_SELECTION_RESOLVE) >= 0) { | ||
if (update.includes(VL_SELECTION_RESOLVE)) { | ||
namedSg.update = `{${bound | ||
@@ -65,0 +65,0 @@ .map(proj => `${stringValue(replacePathInField(proj.field))}: ${proj.signals.data}`) |
@@ -83,3 +83,3 @@ import {NewSignal} from 'vega'; | ||
const boundScales = scalesCompiler.defined(selCmpt); | ||
const signal = signals.filter(s => s.name === proj.signals[boundScales ? 'data' : 'visual'])[0]; | ||
const signal = signals.find(s => s.name === proj.signals[boundScales ? 'data' : 'visual']); | ||
const sizeSg = model.getSizeSignalRef(size).signal; | ||
@@ -86,0 +86,0 @@ const scaleCmpt = model.getScaleComponent(channel); |
@@ -85,3 +85,3 @@ import {NewSignal} from 'vega'; | ||
const boundScales = scalesCompiler.defined(selCmpt); | ||
const signal = signals.filter(s => s.name === proj.signals[boundScales ? 'data' : 'visual'])[0]; | ||
const signal = signals.find(s => s.name === proj.signals[boundScales ? 'data' : 'visual']); | ||
const sizeSg = model.getSizeSignalRef(size).signal; | ||
@@ -88,0 +88,0 @@ const scaleCmpt = model.getScaleComponent(channel); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9640188
120868