diff --git a/app/ecolyo.dc827a2b7459e470a140.js b/app/ecolyo.3294386fdd770ba940e6.js similarity index 99% rename from app/ecolyo.dc827a2b7459e470a140.js rename to app/ecolyo.3294386fdd770ba940e6.js index 31ece753e534e75f6d128160a70d8666aaf78792..f2779393a1a013b3fd7b04d37a2e60aba8362253 100644 --- a/app/ecolyo.dc827a2b7459e470a140.js +++ b/app/ecolyo.3294386fdd770ba940e6.js @@ -31374,15 +31374,31 @@ var Bar = function Bar(_ref) { setClicked(false); setCompareAnimationEnded(true); }; + /** Get date of each fluid to display placeholder bar for multifluid */ - var value = dataload.value; - /** - * Use 10% of average as the placeholder if average is above 1, - * otherwise use a minimum of 1 as the placeholder. - */ - if (value === -1 && average) { - value = average > 1 ? average * 0.1 : 1; + var lastDataDates = fluidStatus.map(function (fluid) { + var _fluid$lastDataDate; + + return (_fluid$lastDataDate = fluid.lastDataDate) !== null && _fluid$lastDataDate !== void 0 ? _fluid$lastDataDate : _luxon.DateTime.local(0); + }); + + var lastDataDate = _luxon.DateTime.max.apply(_luxon.DateTime, (0, _toConsumableArray2.default)(lastDataDates)); + + var dataMissingUpcoming = Boolean(dataload.date > lastDataDate && dataload.date < _luxon.DateTime.local()); + var value = dataload.value; + /** Adjust value for upcoming data (placeholder bars) */ + + if (dataMissingUpcoming && average) { + if (average < 0) { + // Use 1 if average is negative + value = 1; + } else if (average > 1) { + // Use 10% of average if average is above 1 + value = average * 0.1; + } else { + value = average; + } } var yScaleValue = (_yScale = yScale(value)) !== null && _yScale !== void 0 ? _yScale : 0; @@ -31421,18 +31437,6 @@ var Bar = function Bar(_ref) { var getBandWidth = function getBandWidth() { return compare ? xScale.bandwidth() / 2 : xScale.bandwidth(); }; - /** Get date of each fluid to display placeholder bar for multifluid */ - - - var lastDataDates = fluidStatus.map(function (fluid) { - var _fluid$lastDataDate; - - return (_fluid$lastDataDate = fluid.lastDataDate) !== null && _fluid$lastDataDate !== void 0 ? _fluid$lastDataDate : _luxon.DateTime.local(0); - }); - - var lastDataDate = _luxon.DateTime.max.apply(_luxon.DateTime, (0, _toConsumableArray2.default)(lastDataDates)); - - var dataMissingUpcoming = Boolean(dataload.date > lastDataDate && dataload.date < _luxon.DateTime.local()); var topRoundedRect = function topRoundedRect(x, y, width, height) { var radius = height > 4 ? 4 : height / 4; diff --git a/index.html b/index.html index 6d5b33e750f453a00d8c291bf1a83e9bcd9fb614..8539c96698a56be53bfa9292329bc56cc13718a2 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo</title><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><!-- PWA Chrome --><link rel="icon" sizes="192x192" href="/android-chrome-192x192.png"><link rel="icon" sizes="512x512" href="/android-chrome-512x512.png"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="vendors/ecolyo.796f5a66f0367dd5452d.js"></script><script src="app/ecolyo.dc827a2b7459e470a140.js"></script></div></body></html> \ No newline at end of file +<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo</title><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><!-- PWA Chrome --><link rel="icon" sizes="192x192" href="/android-chrome-192x192.png"><link rel="icon" sizes="512x512" href="/android-chrome-512x512.png"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="vendors/ecolyo.796f5a66f0367dd5452d.js"></script><script src="app/ecolyo.3294386fdd770ba940e6.js"></script></div></body></html> \ No newline at end of file