mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-04-30 02:35:57 +00:00
Hide conditions page entries if data isn't available
This commit is contained in:
@@ -84,7 +84,7 @@ function loadSolarConditions() {
|
||||
const kIndex = jsonData.k_index;
|
||||
if (kIndex !== null && kIndex !== undefined) {
|
||||
applySwClass('sw-geomag-vals', 'sw-geomag-desc',
|
||||
kIndex < 5 ? 'bg-success-subtle' : kIndex < 7 ? 'bg-warning-subtle' : 'bg-danger-subtle');
|
||||
kIndex < 5 ? 'bg-success-subtle' : kIndex < 6 ? 'bg-warning-subtle' : 'bg-danger-subtle');
|
||||
}
|
||||
|
||||
const xRay = jsonData.x_ray;
|
||||
@@ -142,7 +142,7 @@ function renderKIndexForecast(data) {
|
||||
const withAlpha = hex => tinycolor(hex).setAlpha(0.8).toRgbString();
|
||||
const colors = entries.map(e =>
|
||||
e.kp < 4.5 ? withAlpha(style.getPropertyValue('--bs-success').trim())
|
||||
: e.kp < 6.5 ? withAlpha(style.getPropertyValue('--bs-warning').trim())
|
||||
: e.kp < 5.5 ? withAlpha(style.getPropertyValue('--bs-warning').trim())
|
||||
: withAlpha(style.getPropertyValue('--bs-danger').trim())
|
||||
);
|
||||
const textColor = style.getPropertyValue('--bs-body-color').trim() || '#666';
|
||||
@@ -225,6 +225,7 @@ function renderKIndexForecast(data) {
|
||||
datasets: [{
|
||||
data: entries.map(e => e.kp),
|
||||
backgroundColor: colors,
|
||||
hoverBackgroundColor: colors,
|
||||
borderWidth: 0,
|
||||
}]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user