From a19be947681edbaa5e410c022c32d4432e0dc012 Mon Sep 17 00:00:00 2001 From: accius Date: Sun, 1 Feb 2026 23:34:21 -0500 Subject: [PATCH] fixing callsign bounding, k index, legend --- src/components/SolarPanel.jsx | 51 ++++++++++++++++++++++++----------- src/components/WorldMap.jsx | 37 ++++++++++++++++--------- 2 files changed, 61 insertions(+), 27 deletions(-) diff --git a/src/components/SolarPanel.jsx b/src/components/SolarPanel.jsx index f6eabee..762d360 100644 --- a/src/components/SolarPanel.jsx +++ b/src/components/SolarPanel.jsx @@ -11,7 +11,7 @@ export const SolarPanel = ({ solarIndices }) => { return saved === 'indices'; } catch (e) { return false; } }); - const [imageType, setImageType] = useState('0193'); // AIA 193 (corona) + const [imageType, setImageType] = useState('0193'); const toggleMode = () => { const newMode = !showIndices; @@ -21,7 +21,6 @@ export const SolarPanel = ({ solarIndices }) => { } catch (e) {} }; - // SDO/AIA image types const imageTypes = { '0193': { name: 'AIA 193Å', desc: 'Corona' }, '0304': { name: 'AIA 304Å', desc: 'Chromosphere' }, @@ -30,7 +29,6 @@ export const SolarPanel = ({ solarIndices }) => { 'HMIIC': { name: 'HMI Int', desc: 'Visible' } }; - // SDO images update every ~15 minutes const timestamp = Math.floor(Date.now() / 900000) * 900000; const imageUrl = `https://sdo.gsfc.nasa.gov/assets/img/latest/latest_256_${imageType}.jpg?t=${timestamp}`; @@ -42,6 +40,9 @@ export const SolarPanel = ({ solarIndices }) => { return '#00ff88'; }; + // Get K-Index data - server returns 'kp' not 'kIndex' + const kpData = solarIndices?.data?.kp || solarIndices?.data?.kIndex; + return (
{/* Header with toggle */} @@ -131,23 +132,43 @@ export const SolarPanel = ({ solarIndices }) => {
K-Index
-
- {solarIndices.data.kIndex?.current ?? '--'} +
+ {kpData?.current ?? '--'}
- {solarIndices.data.kIndex?.forecast?.length > 0 && ( + {kpData?.forecast?.length > 0 ? ( +
+ {kpData.forecast.slice(0, 8).map((item, i) => { + const val = typeof item === 'object' ? item.value : item; + return ( +
+ ); + })} +
+ ) : kpData?.history?.length > 0 ? (
- {solarIndices.data.kIndex.forecast.slice(0, 8).map((kp, i) => ( -
- ))} + {kpData.history.slice(-8).map((item, i) => { + const val = typeof item === 'object' ? item.value : item; + return ( +
+ ); + })}
+ ) : ( +
No forecast data
)}
diff --git a/src/components/WorldMap.jsx b/src/components/WorldMap.jsx index f792238..cef7eb5 100644 --- a/src/components/WorldMap.jsx +++ b/src/components/WorldMap.jsx @@ -290,7 +290,7 @@ export const WorldMap = ({ if (showDXLabels || isHovered) { const labelIcon = L.divIcon({ className: '', - html: `
${path.dxCall}
`, + html: `
${path.dxCall}
`, iconAnchor: [0, -10] }); const label = L.marker([path.dxLat, path.dxLon], { icon: labelIcon, interactive: false }).addTo(map); @@ -438,34 +438,47 @@ export const WorldMap = ({ background: 'rgba(0, 0, 0, 0.85)', border: '1px solid #444', borderRadius: '6px', - padding: '6px 12px', + padding: '8px 14px', zIndex: 1000, display: 'flex', - gap: '12px', + gap: '10px', alignItems: 'center', - fontSize: '10px', + fontSize: '12px', fontFamily: 'JetBrains Mono, monospace' }}> {showDXPaths && ( -
+
DX: - 160m - 40m - 20m - 15m - 10m + 160m + 80m + 40m + 30m + 20m + 17m + 15m + 12m + 10m + 6m
)} +
+ ● DE + ● DX +
{showPOTA && (
- ● POTA + ● POTA
)} {showSatellites && (
- 🛰 SAT + 🛰 SAT
)} +
+ ☀ Sun + 🌙 Moon +
);