Skip to content

Commit b421a44

Browse files
domoritzGitHub Actions Bot
and
GitHub Actions Bot
authored
fix: update ts and fix typing issues (#9066)
Co-authored-by: GitHub Actions Bot <[email protected]>
1 parent a1bc91a commit b421a44

30 files changed

+51
-38
lines changed

Diff for: build/vega-lite-schema.json

+14
Original file line numberDiff line numberDiff line change
@@ -12472,6 +12472,13 @@
1247212472
},
1247312473
"type": "array"
1247412474
},
12475+
"fields": {
12476+
"description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.",
12477+
"items": {
12478+
"$ref": "#/definitions/FieldName"
12479+
},
12480+
"type": "array"
12481+
},
1247512482
"mark": {
1247612483
"$ref": "#/definitions/BrushConfig",
1247712484
"description": "An interval selection also adds a rectangle mark to depict the extents of the interval. The `mark` property can be used to customize the appearance of the mark.\n\n__See also:__ [`mark` examples](https://vega.github.io/vega-lite/docs/selection.html#mark) in the documentation."
@@ -12540,6 +12547,13 @@
1254012547
},
1254112548
"type": "array"
1254212549
},
12550+
"fields": {
12551+
"description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.",
12552+
"items": {
12553+
"$ref": "#/definitions/FieldName"
12554+
},
12555+
"type": "array"
12556+
},
1254312557
"mark": {
1254412558
"$ref": "#/definitions/BrushConfig",
1254512559
"description": "An interval selection also adds a rectangle mark to depict the extents of the interval. The `mark` property can be used to customize the appearance of the mark.\n\n__See also:__ [`mark` examples](https://vega.github.io/vega-lite/docs/selection.html#mark) in the documentation."

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
"terser": "^5.19.2",
123123
"ts-jest": "^29.1.1",
124124
"ts-json-schema-generator": "^1.3.0",
125-
"typescript": "~4.9.5",
125+
"typescript": "~5.1.6",
126126
"vega-cli": "^5.25.0",
127127
"vega-datasets": "^2.7.0",
128128
"vega-embed": "^6.22.2",

Diff for: src/compile/buildmodel.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {Config} from '../config';
33
import * as log from '../log';
44
import {isAnyConcatSpec, isFacetSpec, isLayerSpec, isUnitSpec, LayoutSizeMixins, NormalizedSpec} from '../spec';

Diff for: src/compile/format.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {isString} from 'vega-util';
33
import {isBinning} from '../bin';
44
import {

Diff for: src/compile/mark/encode/nonposition.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {NonPositionScaleChannel} from '../../../channel';
33
import {Value} from '../../../channeldef';
44
import {VgEncodeChannel, VgEncodeEntry, VgValueRef} from '../../../vega.schema';

Diff for: src/compile/mark/encode/offset.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Utility files for producing Vega ValueRef for marks
33
*/
4-
import {SignalRef} from 'vega';
4+
import type {SignalRef} from 'vega';
55
import {PolarPositionChannel, PositionChannel} from '../../../channel';
66
import {Encoding} from '../../../encoding';
77
import {Mark, MarkDef} from '../../../mark';

Diff for: src/compile/mark/encode/position-range.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {getMainRangeChannel, getSecondaryRangeChannel, getSizeChannel, getVgPositionChannel} from '../../../channel';
33
import {isFieldOrDatumDef} from '../../../channeldef';
44
import * as log from '../../../log';

Diff for: src/compile/mark/encode/position-rect.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {isArray, isNumber} from 'vega-util';
33
import {isBinned, isBinning, isBinParams} from '../../../bin';
44
import {

Diff for: src/compile/mark/encode/valueref.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Utility files for producing Vega ValueRef for marks
33
*/
4-
import {SignalRef} from 'vega';
4+
import type {SignalRef} from 'vega';
55
import {isFunction, isString} from 'vega-util';
66
import {isCountingAggregateOp} from '../../../aggregate';
77
import {isBinned, isBinning} from '../../../bin';
@@ -176,7 +176,7 @@ export function interpolatedSignalRef({
176176
offset: number | SignalRef | VgValueRef;
177177
bandPosition: number | SignalRef;
178178
}): VgValueRef {
179-
const expr = 0 < bandPosition && bandPosition < 1 ? 'datum' : undefined;
179+
const expr = !isSignalRef(bandPosition) && 0 < bandPosition && bandPosition < 1 ? 'datum' : undefined;
180180
const start = vgField(fieldOrDatumDef, {expr, suffix: startSuffix});
181181
const end =
182182
fieldOrDatumDef2 !== undefined

Diff for: src/compile/mark/text.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {Config} from '../../config';
33
import {Encoding} from '../../encoding';
44
import {MarkDef} from '../../mark';

Diff for: src/compile/mark/tick.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {isNumber} from 'vega-util';
33
import {getViewConfigDiscreteStep} from '../../config';
44
import {isVgRangeStep} from '../../vega.schema';

Diff for: src/compile/projection/parse.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {hasOwnProperty} from 'vega-util';
33
import {LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, SHAPE} from '../../channel';
44
import {getFieldOrDatumDef} from '../../channeldef';

Diff for: src/compile/scale/component.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {SignalRef} from 'vega';
2-
import {isArray} from 'vega-util';
1+
import type {SignalRef} from 'vega';
2+
import {isArray, isNumber} from 'vega-util';
33
import {ScaleChannel} from '../../channel';
44
import {Scale, ScaleType} from '../../scale';
55
import {ParameterExtent} from '../../selection';
@@ -37,7 +37,10 @@ export class ScaleComponent extends Split<ScaleComponentProps> {
3737
if (this.get('zero') !== false) {
3838
return true;
3939
}
40-
return some(this.get('domains'), d => isArray(d) && d.length === 2 && d[0] <= 0 && d[1] >= 0);
40+
return some(
41+
this.get('domains'),
42+
d => isArray(d) && d.length === 2 && isNumber(d[0]) && d[0] <= 0 && isNumber(d[1]) && d[1] >= 0
43+
);
4144
}
4245
}
4346

Diff for: src/compile/scale/domain.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {isObject, isString} from 'vega-util';
33
import {
44
Aggregate,

Diff for: src/compile/scale/properties.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {SignalRef, TimeInterval} from 'vega';
2-
import {isArray} from 'vega-util';
2+
import {isArray, isNumber} from 'vega-util';
33
import {isBinned, isBinning, isBinParams} from '../../bin';
44
import {
55
COLOR,
@@ -414,8 +414,8 @@ export function zero(
414414
const first = specifiedDomain[0];
415415
const last = specifiedDomain[specifiedDomain.length - 1];
416416

417-
if (first <= 0 && last >= 0) {
418-
// if the domain includes zero, make zero remains true
417+
if (isNumber(first) && first <= 0 && isNumber(last) && last >= 0) {
418+
// if the domain includes zero, make zero remain true
419419
return true;
420420
}
421421
}

Diff for: src/compile/signal.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22

33
export type Rename = (oldSignalName: string) => string;
44

Diff for: src/normalize/base.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {FieldName} from '../channeldef';
33
import {Config} from '../config';
44
import {Encoding} from '../encoding';

Diff for: src/normalize/core.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {isArray} from 'vega-util';
33
import {COLUMN, FACET, ROW} from '../channel';
44
import {Field, FieldName, hasConditionalFieldOrDatumDef, isFieldOrDatumDef, isValueDef} from '../channeldef';

Diff for: src/normalize/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {isString} from 'vega-util';
33
import {Field} from '../channeldef';
44
import {Config, initConfig} from '../config';

Diff for: src/normalize/pathoverlay.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {isObject} from 'vega-util';
33
import {Config} from '../config';
44
import {Encoding, normalizeEncoding} from '../encoding';

Diff for: src/predicate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {isArray} from 'vega-util';
33
import {FieldName, valueExpr, vgField} from './channeldef';
44
import {DateTime} from './datetime';

Diff for: src/selection.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,17 @@ export interface BaseSelectionConfig<T extends SelectionType = SelectionType> {
7373
* __See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.
7474
*/
7575
encodings?: SingleDefUnitChannel[];
76-
}
7776

78-
export interface PointSelectionConfig extends BaseSelectionConfig<'point'> {
7977
/**
8078
* An array of field names whose values must match for a data tuple to
8179
* fall within the selection.
8280
*
8381
* __See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.
8482
*/
8583
fields?: FieldName[];
84+
}
8685

86+
export interface PointSelectionConfig extends BaseSelectionConfig<'point'> {
8787
/**
8888
* Controls whether data values should be toggled (inserted or removed from a point selection)
8989
* or only ever inserted into point selections.

Diff for: test/channeldef.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {COUNTING_OPS} from '../src/aggregate';
33
import {CHANNELS} from '../src/channel';
44
import {

Diff for: test/compile/facet.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {ROW} from '../../src/channel';
33
import {FacetModel} from '../../src/compile/facet';
44
import {assembleLabelTitle} from '../../src/compile/header/assemble';

Diff for: test/compile/mark/encode/offset.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {positionOffset} from '../../../../src/compile/mark/encode/offset';
33
import {Mark, MarkDef} from '../../../../src/mark';
44

Diff for: test/compile/scale/domain.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {ScaleChannel} from '../../../src/channel';
33
import {PositionFieldDef} from '../../../src/channeldef';
44
import {domainSort, mergeDomains, parseDomainForChannel} from '../../../src/compile/scale/domain';

Diff for: test/config.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {
33
Config,
44
defaultConfig,

Diff for: test/util.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SignalRef} from 'vega';
1+
import type {SignalRef} from 'vega';
22
import {Field} from '../src/channeldef';
33
import {buildModel} from '../src/compile/buildmodel';
44
import {ConcatModel} from '../src/compile/concat';

Diff for: tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"suppressImplicitAnyIndexErrors": true,
1717
"isolatedModules": true,
1818
"lib": ["ESNext.Array", "DOM", "DOM.Iterable", "ES2021.String"],
19+
"ignoreDeprecations": "5.0",
1920
"noEmit": true
2021
},
2122
"files": ["src/index.ts"],

Diff for: yarn.lock

-5
Original file line numberDiff line numberDiff line change
@@ -8755,11 +8755,6 @@ typedarray@^0.0.6:
87558755
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
87568756
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==
87578757

8758-
typescript@~4.9.5:
8759-
version "4.9.5"
8760-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
8761-
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
8762-
87638758
typescript@~5.1.6:
87648759
version "5.1.6"
87658760
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274"

0 commit comments

Comments
 (0)