Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/ui/astronomy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function QuantityWithError({
decimalPlaces = 2,
}: QuantityWithErrorProps): ReactElement {
return (
<div className="flex items-center gap-2">
<div className="flex items-center whitespace-pre-wrap">
{children} ± <Quantity value={error.toFixed(decimalPlaces)} unit={unit} />
</div>
);
Expand Down
45 changes: 18 additions & 27 deletions src/components/ui/catalog-data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,33 @@ export function CatalogData({
}

if (catalogs?.coordinates) {
if (catalogs.coordinates.equatorial?.ra !== undefined) {
data.push({
Parameter: "Equatorial RA",
Value: (
data.push({
Parameter: "Equatorial coordinates",
Value: (
<span className="flex whitespace-pre-wrap">
&alpha; ={" "}
<QuantityWithError
error={catalogs.coordinates.equatorial?.e_ra}
unit={schema.units.coordinates?.equatorial?.ra || "deg"}
>
<RightAscension value={catalogs.coordinates.equatorial.ra} />
</QuantityWithError>
),
});
}

if (catalogs.coordinates.equatorial?.dec !== undefined) {
data.push({
Parameter: "Equatorial Dec",
Value: (
, &delta; ={" "}
<QuantityWithError
error={catalogs.coordinates.equatorial?.e_dec}
unit={schema.units.coordinates?.equatorial?.dec || "deg"}
>
<Declination value={catalogs.coordinates.equatorial.dec} />
</QuantityWithError>
),
});
}
</span>
),
});

data.push(
{
Parameter: "Galactic l",
Value: (
data.push({
Parameter: "Galactic coordinates",
Value: (
<span className="flex whitespace-pre-wrap">
l ={" "}
<QuantityWithError
error={catalogs.coordinates.galactic?.e_lon}
unit={schema.units.coordinates?.galactic?.lon}
Expand All @@ -72,11 +67,7 @@ export function CatalogData({
unit={schema.units.coordinates?.galactic?.lon}
/>
</QuantityWithError>
),
},
{
Parameter: "Galactic b",
Value: (
, b ={" "}
<QuantityWithError
error={catalogs.coordinates.galactic?.e_lat}
unit={schema.units.coordinates?.galactic?.lat}
Expand All @@ -86,9 +77,9 @@ export function CatalogData({
unit={schema.units.coordinates?.galactic?.lat}
/>
</QuantityWithError>
),
},
);
</span>
),
});
}

if (catalogs?.redshift) {
Expand Down