Skip to content

Commit d6a8beb

Browse files
author
GitHub Actions Bot
committed
style: auto-formatting [CI]
1 parent 902ea34 commit d6a8beb

File tree

7 files changed

+142
-128
lines changed

7 files changed

+142
-128
lines changed

src/compile/selection/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import zoom from './zoom.js';
3030
import {ParameterName} from '../../parameter.js';
3131
import region from './region.js';
3232

33-
3433
export const STORE = '_store';
3534
export const TUPLE = '_tuple';
3635
export const MODIFY = '_modify';

src/compile/selection/region.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {SELECTION_ID} from '../../selection.js';
99
export const SCREEN_PATH = '_screen_path';
1010

1111
const region: SelectionCompiler<'region'> = {
12-
defined: selCmpt => selCmpt.type === 'region',
12+
defined: (selCmpt) => selCmpt.type === 'region',
1313

1414
parse: (model, selCmpt, selDef) => {
1515
// Region selections are only valid over the SELECTION_ID field.
@@ -33,10 +33,10 @@ const region: SelectionCompiler<'region'> = {
3333
{
3434
events: [{signal: screenPathName}],
3535
update: `vlSelectionTuples(intersectLasso(${stringValue(
36-
model.getName('marks')
37-
)}, ${screenPathName}, unit), {unit: ${unitName(model)}})`
38-
}
39-
]
36+
model.getName('marks'),
37+
)}, ${screenPathName}, unit), {unit: ${unitName(model)}})`,
38+
},
39+
],
4040
});
4141

4242
const regionEvents = selCmpt.events.reduce((on, evt) => {
@@ -48,14 +48,14 @@ const region: SelectionCompiler<'region'> = {
4848
return [
4949
...on,
5050
{events: evt.between[0], update: `[[x(unit), y(unit)]]`},
51-
{events: evt, update: `lassoAppend(${screenPathName}, clamp(x(unit), 0, ${w}), clamp(y(unit), 0, ${h}))`}
51+
{events: evt, update: `lassoAppend(${screenPathName}, clamp(x(unit), 0, ${w}), clamp(y(unit), 0, ${h}))`},
5252
];
5353
}, [] as OnEvent[]);
5454

5555
signalsToAdd.push({
5656
name: screenPathName,
5757
init: '[]',
58-
on: regionEvents
58+
on: regionEvents,
5959
});
6060

6161
return [...signals, ...signalsToAdd];
@@ -85,7 +85,7 @@ const region: SelectionCompiler<'region'> = {
8585
fillOpacity: {value: fillOpacity},
8686
stroke: {value: stroke},
8787
strokeWidth: {value: strokeWidth},
88-
strokeDash: {value: strokeDash}
88+
strokeDash: {value: strokeDash},
8989
},
9090
update: {
9191
path:
@@ -94,21 +94,21 @@ const region: SelectionCompiler<'region'> = {
9494
// if it corresponds to a unit different from the one in the store.
9595
selCmpt.resolve === 'global'
9696
? [
97-
{
98-
test: `${store}.length && ${store}[0].unit === ${unitName(model)}`,
99-
...path
100-
},
101-
{
102-
value: '[]'
103-
}
104-
]
105-
: path
106-
}
107-
}
97+
{
98+
test: `${store}.length && ${store}[0].unit === ${unitName(model)}`,
99+
...path,
100+
},
101+
{
102+
value: '[]',
103+
},
104+
]
105+
: path,
106+
},
107+
},
108108
},
109-
...marks
109+
...marks,
110110
];
111-
}
111+
},
112112
};
113113

114114
export default region;

src/selection.ts

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -222,25 +222,25 @@ export interface SelectionParameter<T extends SelectionType = SelectionType> {
222222
* - `"interval"` -- to select a continuous range of data values on `drag`.
223223
*/
224224
select:
225-
| T
226-
| (T extends 'point'
227-
? PointSelectionConfig
228-
: T extends 'interval'
229-
? IntervalSelectionConfig
230-
: T extends 'region'
231-
? RegionSelectionConfig
232-
: never);
225+
| T
226+
| (T extends 'point'
227+
? PointSelectionConfig
228+
: T extends 'interval'
229+
? IntervalSelectionConfig
230+
: T extends 'region'
231+
? RegionSelectionConfig
232+
: never);
233233

234234
/**
235235
* Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/selection.html#project) and initial values.
236236
*
237237
* __See also:__ [`init`](https://vega.github.io/vega-lite/docs/value.html) documentation.
238238
*/
239239
value?: T extends 'point'
240-
? SelectionInit | SelectionInitMapping[]
241-
: T extends 'interval'
242-
? SelectionInitIntervalMapping
243-
: never;
240+
? SelectionInit | SelectionInitMapping[]
241+
: T extends 'interval'
242+
? SelectionInitIntervalMapping
243+
: never;
244244

245245
/**
246246
* When set, a selection is populated by input elements (also known as dynamic query widgets)
@@ -255,10 +255,10 @@ export interface SelectionParameter<T extends SelectionType = SelectionType> {
255255
* __See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation.
256256
*/
257257
bind?: T extends 'point'
258-
? Binding | Record<string, Binding> | LegendBinding
259-
: T extends 'interval'
260-
? 'scales'
261-
: never;
258+
? Binding | Record<string, Binding> | LegendBinding
259+
: T extends 'interval'
260+
? 'scales'
261+
: never;
262262
}
263263

264264
export type TopLevelSelectionParameter = SelectionParameter & {
@@ -271,29 +271,29 @@ export type TopLevelSelectionParameter = SelectionParameter & {
271271

272272
export type ParameterExtent =
273273
| {
274-
/**
275-
* The name of a parameter.
276-
*/
277-
param: ParameterName;
278-
279-
/**
280-
* If a selection parameter is specified, the field name to extract selected values for
281-
* when the selection is [projected](https://vega.github.io/vega-lite/docs/selection.html#project) over multiple fields or encodings.
282-
*/
283-
field?: FieldName;
284-
}
274+
/**
275+
* The name of a parameter.
276+
*/
277+
param: ParameterName;
278+
279+
/**
280+
* If a selection parameter is specified, the field name to extract selected values for
281+
* when the selection is [projected](https://vega.github.io/vega-lite/docs/selection.html#project) over multiple fields or encodings.
282+
*/
283+
field?: FieldName;
284+
}
285285
| {
286-
/**
287-
* The name of a parameter.
288-
*/
289-
param: ParameterName;
290-
291-
/**
292-
* If a selection parameter is specified, the encoding channel to extract selected values for
293-
* when a selection is [projected](https://vega.github.io/vega-lite/docs/selection.html#project) over multiple fields or encodings.
294-
*/
295-
encoding?: SingleDefUnitChannel;
296-
};
286+
/**
287+
* The name of a parameter.
288+
*/
289+
param: ParameterName;
290+
291+
/**
292+
* If a selection parameter is specified, the encoding channel to extract selected values for
293+
* when a selection is [projected](https://vega.github.io/vega-lite/docs/selection.html#project) over multiple fields or encodings.
294+
*/
295+
encoding?: SingleDefUnitChannel;
296+
};
297297

298298
export type PointSelectionConfigWithoutType = Omit<PointSelectionConfig, 'type'>;
299299

@@ -348,7 +348,7 @@ export const defaultConfig: SelectionConfig = {
348348
resolve: 'global',
349349
mark: {fill: '#333', fillOpacity: 0.125, stroke: 'gray', strokeWidth: 2, strokeDash: [8, 5]},
350350
clear: 'dblclick',
351-
}
351+
},
352352
};
353353

354354
export function isLegendBinding(bind: any): bind is LegendBinding {

test-runtime/index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
target = winSrc.indexOf(type) < 0 ? target : window;
2727

2828
target.dispatchEvent(
29-
new PointerEvent('pointermove', {...opts, clientX: opts.clientX - 5, clientY: opts.clientY - 5})
29+
new PointerEvent('pointermove', {...opts, clientX: opts.clientX - 5, clientY: opts.clientY - 5}),
3030
);
3131

3232
target.dispatchEvent(new PointerEvent('pointermove', opts));
3333

3434
target.dispatchEvent(type === 'wheel' ? new WheelEvent('wheel', opts) : new PointerEvent(type, opts));
3535

3636
target.dispatchEvent(
37-
new PointerEvent('pointermove', {...opts, clientX: opts.clientX + 5, clientY: opts.clientY + 5})
37+
new PointerEvent('pointermove', {...opts, clientX: opts.clientX + 5, clientY: opts.clientY + 5}),
3838
);
3939
}
4040

@@ -105,19 +105,19 @@
105105
mouseEvt(
106106
'mousedown',
107107
brushOrEl(el0, parent, targetBrush),
108-
pointOnCircle({clientX: mdX, clientY: mdY}, radius, 0)
108+
pointOnCircle({clientX: mdX, clientY: mdY}, radius, 0),
109109
);
110110
} else if (i === segments - 1) {
111111
mouseEvt(
112112
'mouseup',
113113
window,
114-
pointOnCircle({clientX: mdX, clientY: mdY}, radius, (i / (segments / 2)) * Math.PI)
114+
pointOnCircle({clientX: mdX, clientY: mdY}, radius, (i / (segments / 2)) * Math.PI),
115115
);
116116
} else {
117117
pureMouseEvt(
118118
'mousemove',
119119
brushOrEl(el0, parent, targetBrush),
120-
pointOnCircle({clientX: mdX, clientY: mdY}, radius, (i / (segments / 2)) * Math.PI)
120+
pointOnCircle({clientX: mdX, clientY: mdY}, radius, (i / (segments / 2)) * Math.PI),
121121
);
122122
}
123123
}
@@ -150,20 +150,20 @@
150150
clientY,
151151
deltaX: delta,
152152
deltaY: delta,
153-
deltaZ: delta
153+
deltaZ: delta,
154154
});
155155
pointerEvt('wheel', brushOrEl(el, parent, targetBrush), {
156156
clientX,
157157
clientY,
158158
deltaX: Math.sign(delta),
159159
deltaY: Math.sign(delta),
160-
deltaZ: Math.sign(delta)
160+
deltaZ: Math.sign(delta),
161161
});
162162
return (await view.runAsync()).data('sel_store');
163163
}
164164

165165
async function getState(signals, data) {
166-
(await view.runAsync())
166+
await view.runAsync();
167167
return {
168168
signals: signals.reduce((o, s) => {
169169
o[s] = view.signal(s);
@@ -172,7 +172,7 @@
172172
data: data.reduce((o, d) => {
173173
o[d] = view.data(d);
174174
return o;
175-
}, {})
175+
}, {}),
176176
};
177177
}
178178

@@ -181,7 +181,7 @@
181181
}
182182

183183
async function setSignal(name, value) {
184-
return (await view.signal(name, value).runAsync());
184+
return await view.signal(name, value).runAsync();
185185
}
186186
</script>
187187
</body>

test-runtime/resolve.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {describe, expect, it} from 'vitest';
1616
const fns = {
1717
point: pt,
1818
interval: brush,
19-
region: multiviewRegion
19+
region: multiviewRegion,
2020
};
2121

2222
for (const type of selectionTypes) {
@@ -34,7 +34,7 @@ for (const type of selectionTypes) {
3434
const selection = {
3535
type,
3636
resolve: 'global',
37-
...(specType === 'facet' && type !== 'region' ? {encodings: ['y']} : {})
37+
...(specType === 'facet' && type !== 'region' ? {encodings: ['y']} : {}),
3838
};
3939

4040
for (let i = 0; i < hits[specType].length; i++) {
@@ -59,7 +59,7 @@ for (const type of selectionTypes) {
5959
const selection = {
6060
type,
6161
resolve,
62-
...(specType === 'facet' && type !== 'region' ? {encodings: ['x']} : {})
62+
...(specType === 'facet' && type !== 'region' ? {encodings: ['x']} : {}),
6363
};
6464

6565
/**

0 commit comments

Comments
 (0)