Skip to content

Commit 0488003

Browse files
author
DhanashreePetare
committed
chore: apply lint formatting fixes
1 parent 2983295 commit 0488003

File tree

4 files changed

+46
-11
lines changed

4 files changed

+46
-11
lines changed

packages/phoenix-event-display/src/helpers/rk-helper.ts

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ export class RKHelper {
107107
): number[][] {
108108
if (!track?.dparams) return [];
109109

110-
const lastPosArr = track.pos && track.pos.length ? track.pos[track.pos.length - 1] : null;
110+
const lastPosArr =
111+
track.pos && track.pos.length ? track.pos[track.pos.length - 1] : null;
111112
if (!lastPosArr) return [];
112113

113114
const lastPos = new Vector3(lastPosArr[0], lastPosArr[1], lastPosArr[2]);
@@ -130,16 +131,35 @@ export class RKHelper {
130131
if (theta < 0) theta += Math.PI;
131132

132133
let p: number;
133-
if (qop !== 0) p = Math.abs(1 / qop); else p = Number.MAX_VALUE;
134+
if (qop !== 0) p = Math.abs(1 / qop);
135+
else p = Number.MAX_VALUE;
134136
const q = Math.round(p * qop);
135137

136-
if (!startDir) startDir = CoordinateHelper.sphericalToCartesian(p, theta, phi).normalize();
138+
if (!startDir)
139+
startDir = CoordinateHelper.sphericalToCartesian(
140+
p,
141+
theta,
142+
phi,
143+
).normalize();
137144

138-
const inbounds = (pos: Vector3) => Math.sqrt(pos.x * pos.x + pos.y * pos.y) <= radius;
145+
const inbounds = (pos: Vector3) =>
146+
Math.sqrt(pos.x * pos.x + pos.y * pos.y) <= radius;
139147

140-
const traj = RungeKutta.propagate(lastPos, startDir, p, q, 5, 1500, inbounds);
148+
const traj = RungeKutta.propagate(
149+
lastPos,
150+
startDir,
151+
p,
152+
q,
153+
5,
154+
1500,
155+
inbounds,
156+
);
141157

142-
const extrapolatedPos = traj.map((val) => [val.pos.x, val.pos.y, val.pos.z]);
158+
const extrapolatedPos = traj.map((val) => [
159+
val.pos.x,
160+
val.pos.y,
161+
val.pos.z,
162+
]);
143163

144164
// Remove any point equal to lastPos (first point of traj may be identical)
145165
const eps = 1e-6;

packages/phoenix-event-display/src/managers/three-manager/scene-manager.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,15 +403,21 @@ export class SceneManager {
403403
trackParams.extendedPos = extendedPos;
404404

405405
// Build new geometries from positions
406-
const points: Vector3[] = positions.map((p) => new Vector3(p[0], p[1], p[2]));
406+
const points: Vector3[] = positions.map(
407+
(p) => new Vector3(p[0], p[1], p[2]),
408+
);
407409
const curve = new CatmullRomCurve3(points);
408410
const vertices = curve.getPoints(50);
409411

410412
// Find tube (Mesh) and line (Line) children
411413
let tubeObject: Mesh | undefined;
412414
let lineObject: Line | undefined;
413415
for (const obj of trackGroup.children) {
414-
if ((obj as any).type === 'Mesh' && (obj as any).material && (obj as any).name !== 'Track') {
416+
if (
417+
(obj as any).type === 'Mesh' &&
418+
(obj as any).material &&
419+
(obj as any).name !== 'Track'
420+
) {
415421
tubeObject = obj as Mesh;
416422
}
417423
if ((obj as any).type === 'Line') {

packages/phoenix-event-display/src/managers/ui-manager/phoenix-menu/phoenix-menu-ui.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ export class PhoenixMenuUI implements PhoenixUI<PhoenixMenuNode> {
2727
/** Manager for managing functions of the three.js scene. */
2828
private sceneManager: SceneManager;
2929
/** Track per-collection extend-to-radius state for Phoenix menu */
30-
private collectionExtendState: { [key: string]: { enabled: boolean; radius: number } } = {};
30+
private collectionExtendState: {
31+
[key: string]: { enabled: boolean; radius: number };
32+
} = {};
3133

3234
/**
3335
* Create Phoenix menu UI with different controls related to detector geometry and event data.
@@ -362,7 +364,10 @@ export class PhoenixMenuUI implements PhoenixUI<PhoenixMenuNode> {
362364
// Extension controls for tracks: add checkbox and radius slider
363365
// Maintain state in this.collectionExtendState
364366
if (!this.collectionExtendState[collectionName]) {
365-
this.collectionExtendState[collectionName] = { enabled: false, radius: 1500 };
367+
this.collectionExtendState[collectionName] = {
368+
enabled: false,
369+
radius: 1500,
370+
};
366371
}
367372
drawOptionsNode.addConfig({
368373
type: 'checkbox',

packages/phoenix-event-display/src/tests/managers/three-manager/scene-manager.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,11 @@ describe('SceneManager', () => {
402402
const trackGroup = new Group();
403403
trackGroup.name = 'Track';
404404
const trackParams = {
405-
pos: [[0, 0, 0], [100, 0, 0], [200, 0, 0]],
405+
pos: [
406+
[0, 0, 0],
407+
[100, 0, 0],
408+
[200, 0, 0],
409+
],
406410
dparams: [0, 0, 0, 1.5707963705062866, 0.001],
407411
};
408412
(trackGroup as any).userData = trackParams;

0 commit comments

Comments
 (0)