diff --git a/src/app/features/galaxy-system/galaxy-system-scene.component.spec.ts b/src/app/features/galaxy-system/galaxy-system-scene.component.spec.ts index 508f28e..dbd3e3a 100644 --- a/src/app/features/galaxy-system/galaxy-system-scene.component.spec.ts +++ b/src/app/features/galaxy-system/galaxy-system-scene.component.spec.ts @@ -60,6 +60,9 @@ const PROXIMA_B: ExoplanetRecord = { orbit: { semiMajorAxisAu: 0.0485, eccentricity: 0.02 } }; +// A microlensing planet, whose host the archive places 6.7 kpc out. +const LENS_B: ExoplanetRecord = { id: 'KMT-2016-BLG-1107L b', hostStarId: LENS.id, hostStarName: 'KMT-2016-BLG-1107L', name: 'KMT-2016-BLG-1107L b', orbit: {} }; + const DEEP_SKY_OBJECT: DeepSkyRecord = { id: 'NGC0224', name: 'Andromeda Galaxy', @@ -186,7 +189,7 @@ class FakeDataLoaderService { } loadExoplanets(): Promise { - return Promise.resolve([PROXIMA_B]); + return Promise.resolve([PROXIMA_B, LENS_B]); } loadDeepSky(): Promise { @@ -237,6 +240,12 @@ describe('GalaxySystemSceneComponent camera-flight transitions', () => { await flushAsync(); }); + it('rings the systems inside the survey edge, and puts them first in the draw budget, not a host kiloparsecs out', () => { + const scene = fixture.componentInstance as unknown as { hostRings: { count: number }; hostStars: Uint8Array }; + expect(scene.hostRings.count).toBe(2); + expect([...scene.hostStars]).toEqual(STARS.map((star) => (star === SUN || star === PROXIMA ? 1 : 0))); + }); + it('starts in the galaxy view with the system group hidden', () => { const component = fixture.componentInstance as unknown as { galaxyGroup: THREE.Group; systemGroup: THREE.Group }; expect(component.galaxyGroup.visible).toBe(true); @@ -296,7 +305,8 @@ describe('GalaxySystemSceneComponent camera-flight transitions', () => { expect(refocus).toHaveBeenCalledTimes(1); const [focus] = refocus.mock.calls[0]; expect(focus.view).toBeDefined(); - // The Sun has Earth and Proxima its b, so both are hosts; the others have nothing catalogued. + // The Sun has Earth and Proxima its b, so both are hosts; the lens has a planet too, but 6.7 kpc + // out, past the survey edge; the others have nothing catalogued. expect(Array.from(focus.hosts ?? [])).toEqual([1, 0, 1, 0, 0, 0]); }); diff --git a/src/app/features/galaxy-system/galaxy-system-scene.component.ts b/src/app/features/galaxy-system/galaxy-system-scene.component.ts index 84b3cfc..35f48f1 100644 --- a/src/app/features/galaxy-system/galaxy-system-scene.component.ts +++ b/src/app/features/galaxy-system/galaxy-system-scene.component.ts @@ -760,14 +760,15 @@ export class GalaxySystemSceneComponent implements AfterViewInit, OnDestroy { this.starsByBrightness, publishedTemperaturesK(exoplanets), ); - this.hostStars = Uint8Array.from(stars, (star) => - this.starIdsWithBodies.has(star.id) ? 1 : 0, - ); + // Ringed, and drawn ahead of the brightness tier, only inside the survey edge. The 2 883 hosts + // the archive places past it, 916 of them beyond a kiloparsec, mostly the Kepler field's, were + // a band of 1 687 fixed-size rings over the opening view's lower right, on the 250-350 pc grid + // labels, and read as neighbours; they still compete for the budget by brightness, and search + // still enters them. + const ringed = (star: StarRecord): boolean => this.starIdsWithBodies.has(star.id) && Math.hypot(star.x, star.y, star.z) <= SURVEY_EDGE_PC; + this.hostStars = Uint8Array.from(stars, (star) => (ringed(star) ? 1 : 0)); this.galaxyGroup.add(this.starField.object); - this.hostRings = new HostStarRings( - stars.filter((star) => this.starIdsWithBodies.has(star.id)), - HUD_ACCENT, - ); + this.hostRings = new HostStarRings(stars.filter(ringed), HUD_ACCENT); this.galaxyGroup.add(this.hostRings.object); this.jumpLinks = new JumpLinkRenderer(HUD_ACCENT); this.galaxyGroup.add(this.jumpLinks.object);