Skip to content

Commit

Permalink
style: format
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Aug 7, 2023
1 parent 03a4337 commit 7703290
Show file tree
Hide file tree
Showing 27 changed files with 769 additions and 766 deletions.
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,53 +79,53 @@
"url": "https://github.com/vega/vega-lite/issues"
},
"devDependencies": {
"@babel/core": "^7.21.8",
"@babel/core": "^7.22.10",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.21.5",
"@babel/preset-typescript": "^7.21.5",
"@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.0",
"@rollup/plugin-commonjs": "^25.0.3",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-terser": "^0.4.1",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-terser": "^0.4.3",
"@types/chai": "^4.3.5",
"@types/d3": "^7.4.0",
"@types/jest": "^27.4.1",
"@types/pako": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"chai": "^4.3.7",
"cheerio": "^1.0.0-rc.12",
"conventional-changelog-cli": "^3.0.0",
"d3": "^7.8.4",
"d3": "^7.8.5",
"del-cli": "^5.0.0",
"eslint": "^8.40.0",
"eslint": "^8.46.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-prettier": "^5.0.0",
"highlight.js": "^11.8.0",
"jest": "^27.5.1",
"jest-dev-server": "^6.1.1",
"mkdirp": "^3.0.1",
"pako": "^2.1.0",
"prettier": "^3.0.1",
"puppeteer": "^15.0.0",
"release-it": "^16.1.2",
"rollup": "^3.21.6",
"release-it": "^16.1.3",
"rollup": "^3.27.2",
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-sourcemaps": "^0.6.3",
"serve": "^14.2.0",
"terser": "^5.17.3",
"ts-jest": "^29.1.0",
"terser": "^5.19.2",
"ts-jest": "^29.1.1",
"ts-json-schema-generator": "^1.2.0",
"typescript": "~4.9.5",
"vega-cli": "^5.25.0",
"vega-datasets": "^2.7.0",
"vega-embed": "^6.22.1",
"vega-embed": "^6.22.2",
"vega-tooltip": "^0.32.0",
"yaml-front-matter": "^4.1.1"
},
Expand All @@ -135,7 +135,7 @@
"fast-deep-equal": "~3.1.3",
"fast-json-stable-stringify": "~2.1.0",
"json-stringify-pretty-compact": "~3.0.0",
"tslib": "~2.6.0",
"tslib": "~2.6.1",
"vega-event-selector": "~3.0.1",
"vega-expression": "~5.1.0",
"vega-util": "~1.17.2",
Expand Down
5 changes: 4 additions & 1 deletion site/static/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ body {
width: 100%;
}
body {
font: 16px/1.5em 'Helvetica Neue', Helvetica, sans-serif;
font:
16px/1.5em 'Helvetica Neue',
Helvetica,
sans-serif;
box-sizing: border-box;
line-height: 1.5;
color: #373a3c;
Expand Down
2 changes: 1 addition & 1 deletion site/tutorials/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ You have learned about basic components of a Vega-Lite specification. Now, let's
You can use [Vega-Embed](https://github.com/vega/vega-embed) to embed your Vega-Lite visualization in a webpage. For example, you can create a web page with the following content:

```html
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<title>Vega-Lite Bar Chart</title>
Expand Down
2 changes: 1 addition & 1 deletion site/usage/embed.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Vega-Embed automatically adds links to export an image, view the source, and ope
Here is the final HTML file in the easiest way to embed Vega-Lite (assuming that you use the [CDN approach](#cdn) from above). See the [output in your browser]({{site.baseurl}}/demo.html).

```html
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<title>Embedding Vega-Lite</title>
Expand Down
6 changes: 5 additions & 1 deletion src/compile/data/aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ export class AggregateNode extends DataFlowNode {
* @param dimensions string set for dimensions
* @param measures dictionary mapping field name => dict of aggregation functions and names to use
*/
constructor(parent: DataFlowNode, private dimensions: Set<string>, private measures: Measures) {
constructor(
parent: DataFlowNode,
private dimensions: Set<string>,
private measures: Measures
) {
super(parent);
}

Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ export class BinNode extends DataFlowNode {
return new BinNode(null, duplicate(this.bins));
}

constructor(parent: DataFlowNode, private bins: Dict<BinComponent>) {
constructor(
parent: DataFlowNode,
private bins: Dict<BinComponent>
) {
super(parent);
}

Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/calculate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export class CalculateNode extends DataFlowNode {
return new CalculateNode(null, duplicate(this.transform));
}

constructor(parent: DataFlowNode, private readonly transform: CalculateTransform) {
constructor(
parent: DataFlowNode,
private readonly transform: CalculateTransform
) {
super(parent);

this._dependentFields = getDependentFields(this.transform.calculate);
Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/dataflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export abstract class DataFlowNode {

protected _hash: string | number;

constructor(parent: DataFlowNode, public readonly debugName?: string) {
constructor(
parent: DataFlowNode,
public readonly debugName?: string
) {
if (parent) {
this.parent = parent;
}
Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/density.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class DensityTransformNode extends DataFlowNode {
return new DensityTransformNode(null, duplicate(this.transform));
}

constructor(parent: DataFlowNode, private transform: DensityTransform) {
constructor(
parent: DataFlowNode,
private transform: DensityTransform
) {
super(parent);
this.transform = duplicate(transform); // duplicate to prevent side effects
const specifiedAs = this.transform.as ?? [undefined, undefined];
Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/extent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class ExtentTransformNode extends DataFlowNode {
return new ExtentTransformNode(null, duplicate(this.transform));
}

constructor(parent: DataFlowNode, private transform: ExtentTransform) {
constructor(
parent: DataFlowNode,
private transform: ExtentTransform
) {
super(parent);
this.transform = duplicate(transform);
}
Expand Down
32 changes: 19 additions & 13 deletions src/compile/data/filterinvalid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export class FilterInvalidNode extends DataFlowNode {
return new FilterInvalidNode(null, {...this.filter});
}

constructor(parent: DataFlowNode, public readonly filter: Dict<TypedFieldDef<string>>) {
constructor(
parent: DataFlowNode,
public readonly filter: Dict<TypedFieldDef<string>>
) {
super(parent);
}

Expand All @@ -25,20 +28,23 @@ export class FilterInvalidNode extends DataFlowNode {
return null;
}

const filter = model.reduceFieldDef((aggregator: Dict<TypedFieldDef<string>>, fieldDef, channel) => {
const scaleComponent = isScaleChannel(channel) && model.getScaleComponent(channel);
if (scaleComponent) {
const scaleType = scaleComponent.get('type');
const filter = model.reduceFieldDef(
(aggregator: Dict<TypedFieldDef<string>>, fieldDef, channel) => {
const scaleComponent = isScaleChannel(channel) && model.getScaleComponent(channel);
if (scaleComponent) {
const scaleType = scaleComponent.get('type');

// While discrete domain scales can handle invalid values, continuous scales can't.
// Thus, for non-path marks, we have to filter null for scales with continuous domains.
// (For path marks, we will use "defined" property and skip these values instead.)
if (hasContinuousDomain(scaleType) && fieldDef.aggregate !== 'count' && !isPathMark(mark)) {
aggregator[fieldDef.field] = fieldDef as any; // we know that the fieldDef is a typed field def
// While discrete domain scales can handle invalid values, continuous scales can't.
// Thus, for non-path marks, we have to filter null for scales with continuous domains.
// (For path marks, we will use "defined" property and skip these values instead.)
if (hasContinuousDomain(scaleType) && fieldDef.aggregate !== 'count' && !isPathMark(mark)) {
aggregator[fieldDef.field] = fieldDef as any; // we know that the fieldDef is a typed field def
}
}
}
return aggregator;
}, {} as Dict<TypedFieldDef<string>>);
return aggregator;
},
{} as Dict<TypedFieldDef<string>>
);

if (!keys(filter).length) {
return null;
Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/flatten.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class FlattenTransformNode extends DataFlowNode {
return new FlattenTransformNode(this.parent, duplicate(this.transform));
}

constructor(parent: DataFlowNode, private transform: FlattenTransform) {
constructor(
parent: DataFlowNode,
private transform: FlattenTransform
) {
super(parent);
this.transform = duplicate(transform); // duplicate to prevent side effects
const {flatten, as = []} = this.transform;
Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/fold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class FoldTransformNode extends DataFlowNode {
return new FoldTransformNode(null, duplicate(this.transform));
}

constructor(parent: DataFlowNode, private transform: FoldTransform) {
constructor(
parent: DataFlowNode,
private transform: FoldTransform
) {
super(parent);
this.transform = duplicate(transform); // duplicate to prevent side effects
const specifiedAs = this.transform.as ?? [undefined, undefined];
Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/graticule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export class GraticuleNode extends DataFlowNode {
return new GraticuleNode(null, this.params);
}

constructor(parent: DataFlowNode, private params: true | GraticuleParams) {
constructor(
parent: DataFlowNode,
private params: true | GraticuleParams
) {
super(parent);
}

Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/impute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export class ImputeNode extends DataFlowNode {
return new ImputeNode(null, duplicate(this.transform));
}

constructor(parent: DataFlowNode, private readonly transform: ImputeTransform) {
constructor(
parent: DataFlowNode,
private readonly transform: ImputeTransform
) {
super(parent);
}

Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/joinaggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export class JoinAggregateTransformNode extends DataFlowNode {
return new JoinAggregateTransformNode(null, duplicate(this.transform));
}

constructor(parent: DataFlowNode, private readonly transform: JoinAggregateTransform) {
constructor(
parent: DataFlowNode,
private readonly transform: JoinAggregateTransform
) {
super(parent);
}

Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/loess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class LoessTransformNode extends DataFlowNode {
return new LoessTransformNode(null, duplicate(this.transform));
}

constructor(parent: DataFlowNode, private transform: LoessTransform) {
constructor(
parent: DataFlowNode,
private transform: LoessTransform
) {
super(parent);
this.transform = duplicate(transform); // duplicate to prevent side effects
const specifiedAs = this.transform.as ?? [undefined, undefined];
Expand Down
6 changes: 5 additions & 1 deletion src/compile/data/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export class LookupNode extends DataFlowNode {
return new LookupNode(null, duplicate(this.transform), this.secondary);
}

constructor(parent: DataFlowNode, public readonly transform: LookupTransform, public readonly secondary: string) {
constructor(
parent: DataFlowNode,
public readonly transform: LookupTransform,
public readonly secondary: string
) {
super(parent);
}

Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/pivot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class PivotTransformNode extends DataFlowNode {
return new PivotTransformNode(null, duplicate(this.transform));
}

constructor(parent: DataFlowNode, private transform: PivotTransform) {
constructor(
parent: DataFlowNode,
private transform: PivotTransform
) {
super(parent);
}

Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/quantile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class QuantileTransformNode extends DataFlowNode {
return new QuantileTransformNode(null, duplicate(this.transform));
}

constructor(parent: DataFlowNode, private transform: QuantileTransform) {
constructor(
parent: DataFlowNode,
private transform: QuantileTransform
) {
super(parent);
this.transform = duplicate(transform); // duplicate to prevent side effects
const specifiedAs = this.transform.as ?? [undefined, undefined];
Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/regression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class RegressionTransformNode extends DataFlowNode {
return new RegressionTransformNode(null, duplicate(this.transform));
}

constructor(parent: DataFlowNode, private transform: RegressionTransform) {
constructor(
parent: DataFlowNode,
private transform: RegressionTransform
) {
super(parent);
this.transform = duplicate(transform); // duplicate to prevent side effects
const specifiedAs = this.transform.as ?? [undefined, undefined];
Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class SampleTransformNode extends DataFlowNode {
return new SampleTransformNode(null, duplicate(this.transform));
}

constructor(parent: DataFlowNode, private transform: SampleTransform) {
constructor(
parent: DataFlowNode,
private transform: SampleTransform
) {
super(parent);
}

Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/sequence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export class SequenceNode extends DataFlowNode {
return new SequenceNode(null, this.params);
}

constructor(parent: DataFlowNode, private params: SequenceParams) {
constructor(
parent: DataFlowNode,
private params: SequenceParams
) {
super(parent);
}

Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/timeunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export class TimeUnitNode extends DataFlowNode {
return new TimeUnitNode(null, duplicate(this.formula));
}

constructor(parent: DataFlowNode, private formula: Dict<TimeUnitComponent>) {
constructor(
parent: DataFlowNode,
private formula: Dict<TimeUnitComponent>
) {
super(parent);
}

Expand Down
5 changes: 4 additions & 1 deletion src/compile/data/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export class WindowTransformNode extends DataFlowNode {
return new WindowTransformNode(null, duplicate(this.transform));
}

constructor(parent: DataFlowNode, private readonly transform: WindowTransform) {
constructor(
parent: DataFlowNode,
private readonly transform: WindowTransform
) {
super(parent);
}

Expand Down
Loading

0 comments on commit 7703290

Please sign in to comment.