Skip to content

Commit

Permalink
feat: update Vega and other deps
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Nov 27, 2023
1 parent c229a32 commit eefb39d
Show file tree
Hide file tree
Showing 16 changed files with 1,555 additions and 1,519 deletions.
8 changes: 6 additions & 2 deletions build/vega-lite-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"valid",
"values",
"variance",
"variancep"
"variancep",
"exponential",
"exponentialb"
],
"type": "string"
},
Expand Down Expand Up @@ -17882,7 +17884,9 @@
"valid",
"values",
"variance",
"variancep"
"variancep",
"exponential",
"exponentialb"
],
"type": "string"
},
Expand Down
66 changes: 33 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,54 +79,54 @@
"url": "https://github.com/vega/vega-lite/issues"
},
"devDependencies": {
"@babel/core": "^7.22.10",
"@babel/core": "^7.23.3",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.22.10",
"@babel/preset-typescript": "^7.22.5",
"@release-it/conventional-changelog": "^7.0.0",
"@rollup/plugin-alias": "^5.0.0",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.2.1",
"@rollup/plugin-terser": "^0.4.3",
"@types/chai": "^4.3.5",
"@types/d3": "^7.4.0",
"@types/jest": "^29.5.4",
"@types/pako": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"@babel/preset-env": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@release-it/conventional-changelog": "^8.0.1",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@types/chai": "^4.3.11",
"@types/d3": "^7.4.3",
"@types/jest": "^29.5.10",
"@types/pako": "^2.0.3",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"chai": "^4.3.7",
"chai": "^4.3.10",
"cheerio": "^1.0.0-rc.12",
"conventional-changelog-cli": "^4.0.0",
"conventional-changelog-cli": "^4.1.0",
"d3": "^7.8.5",
"del-cli": "^5.0.0",
"eslint": "^8.47.0",
"del-cli": "^5.1.0",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-prettier": "^5.0.1",
"fast-json-stable-stringify": "~2.1.0",
"highlight.js": "^11.8.0",
"jest": "^29.6.3",
"jest-dev-server": "^9.0.0",
"highlight.js": "^11.9.0",
"jest": "^29.7.0",
"jest-dev-server": "^9.0.1",
"mkdirp": "^3.0.1",
"pako": "^2.1.0",
"prettier": "^3.0.2",
"prettier": "^3.1.0",
"puppeteer": "^15.0.0",
"release-it": "^16.1.5",
"rollup": "^3.28.1",
"release-it": "^17.0.0",
"rollup": "^4.6.0",
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-sourcemaps": "^0.6.3",
"serve": "^14.2.1",
"terser": "^5.19.2",
"terser": "^5.24.0",
"ts-jest": "^29.1.1",
"ts-json-schema-generator": "^1.3.0",
"typescript": "~5.2.2",
"vega-cli": "^5.25.0",
"ts-json-schema-generator": "^1.4.1",
"typescript": "~5.3.2",
"vega-cli": "^5.26.1",
"vega-datasets": "^2.7.0",
"vega-embed": "^6.22.2",
"vega-embed": "^6.23.0",
"vega-tooltip": "^0.33.0",
"yaml-front-matter": "^4.1.1"
},
Expand Down
2 changes: 2 additions & 0 deletions src/aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const AGGREGATE_OP_INDEX: Flag<AggregateOp> = {
average: 1,
count: 1,
distinct: 1,
exponential: 1,
exponentialb: 1,
product: 1,
max: 1,
mean: 1,
Expand Down
40 changes: 20 additions & 20 deletions src/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,16 @@ export function isSecondaryRangeChannel(c: ExtendedChannel): c is SecondaryRange
export type MainChannelOf<C extends ExtendedChannel> = C extends 'x2'
? 'x'
: C extends 'y2'
? 'y'
: C extends 'latitude2'
? 'latitude'
: C extends 'longitude2'
? 'longitude'
: C extends 'theta2'
? 'theta'
: C extends 'radius2'
? 'radius'
: C;
? 'y'
: C extends 'latitude2'
? 'latitude'
: C extends 'longitude2'
? 'longitude'
: C extends 'theta2'
? 'theta'
: C extends 'radius2'
? 'radius'
: C;

/**
* Get the main channel for a range channel. E.g. `x` for `x2`.
Expand All @@ -254,16 +254,16 @@ export function getMainRangeChannel<C extends ExtendedChannel>(channel: C): Main
export type SecondaryChannelOf<C extends Channel> = C extends 'x'
? 'x2'
: C extends 'y'
? 'y2'
: C extends 'latitude'
? 'latitude2'
: C extends 'longitude'
? 'longitude2'
: C extends 'theta'
? 'theta2'
: C extends 'radius'
? 'radius2'
: undefined;
? 'y2'
: C extends 'latitude'
? 'latitude2'
: C extends 'longitude'
? 'longitude2'
: C extends 'theta'
? 'theta2'
: C extends 'radius'
? 'radius2'
: undefined;

export function getVgPositionChannel(channel: PolarPositionChannel | PositionChannel) {
if (isPolarPositionChannel(channel)) {
Expand Down
8 changes: 4 additions & 4 deletions src/channeldef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1097,10 +1097,10 @@ export function initFieldOrDatumDef(
const guideType = isPositionFieldOrDatumDef(fd)
? 'axis'
: isMarkPropFieldOrDatumDef(fd)
? 'legend'
: isFacetFieldDef(fd)
? 'header'
: null;
? 'legend'
: isFacetFieldDef(fd)
? 'header'
: null;
if (guideType && fd[guideType]) {
const {format, formatType, ...newGuide} = fd[guideType];
if (isCustomFormatType(formatType) && !config.customFormatTypes) {
Expand Down
12 changes: 6 additions & 6 deletions src/compile/axis/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ export function getAxisConfigs(
scaleType === 'band'
? ['axisDiscrete', 'axisBand']
: scaleType === 'point'
? ['axisDiscrete', 'axisPoint']
: isQuantitative(scaleType)
? ['axisQuantitative']
: scaleType === 'time' || scaleType === 'utc'
? ['axisTemporal']
: [];
? ['axisDiscrete', 'axisPoint']
: isQuantitative(scaleType)
? ['axisQuantitative']
: scaleType === 'time' || scaleType === 'utc'
? ['axisTemporal']
: [];

const axisChannel = channel === 'x' ? 'axisX' : 'axisY';
const axisOrient = isSignalRef(orient) ? 'axisOrient' : `axis${titleCase(orient)}`; // axisTop, axisBottom, ...
Expand Down
8 changes: 4 additions & 4 deletions src/compile/data/facet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ export class FacetNode extends DataFlowNode {
...(isSortField(sort)
? {sortField: sort}
: isArray(sort)
? {sortIndexField: sortArrayIndexField(fieldDef, channel)}
: {})
? {sortIndexField: sortArrayIndexField(fieldDef, channel)}
: {})
};
}
}
Expand Down Expand Up @@ -231,8 +231,8 @@ export class FacetNode extends DataFlowNode {
? {signal: `ceil(${cardinality} / ${columns})`}
: 1
: columns
? {signal: `min(${cardinality}, ${columns})`}
: {signal: cardinality};
? {signal: `min(${cardinality}, ${columns})`}
: {signal: cardinality};

data.push({
name: `${this.facet.name}_${headerChannel}`,
Expand Down
8 changes: 4 additions & 4 deletions src/compile/data/geojson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export class GeoJSONNode extends DataFlowNode {
return isFieldDef(def)
? def.field
: isDatumDef(def)
? {expr: `${def.datum}`}
: isValueDef(def)
? {expr: `${def['value']}`}
: undefined;
? {expr: `${def.datum}`}
: isValueDef(def)
? {expr: `${def['value']}`}
: undefined;
}) as [GeoPositionChannel, GeoPositionChannel];

if (pair[0] || pair[1]) {
Expand Down
8 changes: 4 additions & 4 deletions src/compile/data/geopoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ export class GeoPointNode extends DataFlowNode {
return isFieldDef(def)
? def.field
: isDatumDef(def)
? {expr: `${def.datum}`}
: isValueDef(def)
? {expr: `${def['value']}`}
: undefined;
? {expr: `${def.datum}`}
: isValueDef(def)
? {expr: `${def['value']}`}
: undefined;
}) as [GeoPositionChannel, GeoPositionChannel];

const suffix = coordinates[0] === LONGITUDE2 ? '2' : '';
Expand Down
12 changes: 6 additions & 6 deletions src/compile/mark/encode/position-rect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ function positionAndSize(
? 0
: 0.5
: isSignalRef(bandSize)
? {signal: `(1-${bandSize})/2`}
: isRelativeBandSize(bandSize)
? (1 - bandSize.band) / 2
: 0
? {signal: `(1-${bandSize})/2`}
: isRelativeBandSize(bandSize)
? (1 - bandSize.band) / 2
: 0
});

if (vgSizeChannel) {
Expand Down Expand Up @@ -338,8 +338,8 @@ function rectBinPosition({
const bandPositionForBandSize = isSignalRef(bandSize)
? {signal: `(1-${bandSize.signal})/2`}
: isRelativeBandSize(bandSize)
? (1 - bandSize.band) / 2
: 0.5;
? (1 - bandSize.band) / 2
: 0.5;

const bandPosition = getBandPosition({fieldDef, fieldDef2, markDef, config});

Expand Down
4 changes: 2 additions & 2 deletions src/compile/selection/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ const project: SelectionCompiler = {
hasContinuousDomain(model.getScaleComponent(channel).get('type'))
? 'R'
: fieldDef.bin
? 'R-RE'
: 'E';
? 'R-RE'
: 'E';

const p: SelectionProjection = {field, channel, type: tplType, index: proj.items.length};
p.signals = {...signalName(p, 'data'), ...signalName(p, 'visual')};
Expand Down
20 changes: 10 additions & 10 deletions src/compile/selection/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,19 @@ function onDelta(
!boundScales || !scaleCmpt
? 'panLinear'
: scaleType === 'log'
? 'panLog'
: scaleType === 'symlog'
? 'panSymlog'
: scaleType === 'pow'
? 'panPow'
: 'panLinear';
? 'panLog'
: scaleType === 'symlog'
? 'panSymlog'
: scaleType === 'pow'
? 'panPow'
: 'panLinear';
const arg = !boundScales
? ''
: scaleType === 'pow'
? `, ${scaleCmpt.get('exponent') ?? 1}`
: scaleType === 'symlog'
? `, ${scaleCmpt.get('constant') ?? 1}`
: '';
? `, ${scaleCmpt.get('exponent') ?? 1}`
: scaleType === 'symlog'
? `, ${scaleCmpt.get('constant') ?? 1}`
: '';
const update = `${panFn}(${extent}, ${offset}${arg})`;

signal.on.push({
Expand Down
20 changes: 10 additions & 10 deletions src/compile/selection/zoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,19 @@ function onDelta(
!boundScales || !scaleCmpt
? 'zoomLinear'
: scaleType === 'log'
? 'zoomLog'
: scaleType === 'symlog'
? 'zoomSymlog'
: scaleType === 'pow'
? 'zoomPow'
: 'zoomLinear';
? 'zoomLog'
: scaleType === 'symlog'
? 'zoomSymlog'
: scaleType === 'pow'
? 'zoomPow'
: 'zoomLinear';
const arg = !boundScales
? ''
: scaleType === 'pow'
? `, ${scaleCmpt.get('exponent') ?? 1}`
: scaleType === 'symlog'
? `, ${scaleCmpt.get('constant') ?? 1}`
: '';
? `, ${scaleCmpt.get('exponent') ?? 1}`
: scaleType === 'symlog'
? `, ${scaleCmpt.get('constant') ?? 1}`
: '';
const update = `${zoomFn}(${base}, ${anchor}, ${delta}${arg})`;

signal.on.push({
Expand Down
8 changes: 4 additions & 4 deletions src/compositemark/errorbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,10 @@ function errorBarAggregationAndCalculation<
const center: ErrorBarCenter = markDef.center
? markDef.center
: markDef.extent
? markDef.extent === 'iqr'
? 'median'
: 'mean'
: config.errorbar.center;
? markDef.extent === 'iqr'
? 'median'
: 'mean'
: config.errorbar.center;
const extent: ErrorBarExtent = markDef.extent ? markDef.extent : center === 'mean' ? 'stderr' : 'iqr';

if ((center === 'median') !== (extent === 'iqr')) {
Expand Down
8 changes: 4 additions & 4 deletions src/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ export interface SelectionParameter<T extends SelectionType = SelectionType> {
value?: T extends 'point'
? SelectionInit | SelectionInitMapping[]
: T extends 'interval'
? SelectionInitIntervalMapping
: never;
? SelectionInitIntervalMapping
: never;

/**
* When set, a selection is populated by input elements (also known as dynamic query widgets)
Expand All @@ -240,8 +240,8 @@ export interface SelectionParameter<T extends SelectionType = SelectionType> {
bind?: T extends 'point'
? Binding | Record<string, Binding> | LegendBinding
: T extends 'interval'
? 'scales'
: never;
? 'scales'
: never;
}

export type TopLevelSelectionParameter = SelectionParameter & {
Expand Down
Loading

0 comments on commit eefb39d

Please sign in to comment.