Deal with sources being offline

parent 25c18c34
......@@ -60,16 +60,19 @@ export const auroraDataToGraphData = async () => {
const data = locationNames.map((name) => {
const location = locations[name]
const kpText = location.kp === null ? 'offline' : `Kp${location.kp}`
const color = location.kp === null ? 'rgba(200, 200, 200, 0.8)' : `rgba(83, 207, 85, ${Math.min((location.kp / 7) + 0.3, 1)})`
return {
type:'scattermapbox',
lat:[location.lat.toString()],
lon:[location.long.toString()],
mode:'markers',
marker: {
size: ((location.kp + 1) * 3) + 5,
color: `rgba(83, 207, 85, ${Math.min((location.kp / 7) + 0.3, 1)})`,
size: (((location.kp || 0) + 1) * 3) + 5,
color,
},
text:[`${humanizeLocationName(name)} Kp${location.kp}`],
text:[`${humanizeLocationName(name)} ${kpText}`],
name: '',
} as Data
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment