Verified Commit bc055de7 authored by Peter van der meulen's avatar Peter van der meulen
Browse files

Deal with sources being offline

parent 25c18c34
...@@ -60,16 +60,19 @@ export const auroraDataToGraphData = async () => { ...@@ -60,16 +60,19 @@ export const auroraDataToGraphData = async () => {
const data = locationNames.map((name) => { const data = locationNames.map((name) => {
const location = locations[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 { return {
type:'scattermapbox', type:'scattermapbox',
lat:[location.lat.toString()], lat:[location.lat.toString()],
lon:[location.long.toString()], lon:[location.long.toString()],
mode:'markers', mode:'markers',
marker: { marker: {
size: ((location.kp + 1) * 3) + 5, size: (((location.kp || 0) + 1) * 3) + 5,
color: `rgba(83, 207, 85, ${Math.min((location.kp / 7) + 0.3, 1)})`, color,
}, },
text:[`${humanizeLocationName(name)} Kp${location.kp}`], text:[`${humanizeLocationName(name)} ${kpText}`],
name: '', name: '',
} as Data } as Data
}); });
......
Supports Markdown
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