diff --git a/WebApp/src/components/widgets/gauge-circular.tsx b/WebApp/src/components/widgets/gauge-circular.tsx index e932fec..c03986a 100644 --- a/WebApp/src/components/widgets/gauge-circular.tsx +++ b/WebApp/src/components/widgets/gauge-circular.tsx @@ -51,7 +51,7 @@ export class GaugeCircular extends Gauge { bg.classList.add('gauge-bg'); svgElement.append(bg); - let barHeight = 12; + let barHeight = 10; const barGap = barHeight * 0.2; let numBars = Math.round(arcLength / (barHeight + barGap)); diff --git a/WebApp/src/components/widgets/gauge-linear.tsx b/WebApp/src/components/widgets/gauge-linear.tsx index b8b15ad..9620a8e 100644 --- a/WebApp/src/components/widgets/gauge-linear.tsx +++ b/WebApp/src/components/widgets/gauge-linear.tsx @@ -33,7 +33,7 @@ export class GaugeLinear extends Gauge { bg.classList.add('gauge-bg'); svgElement.append(bg); - let barHeight = 15; + let barHeight = 10; const barGap = barHeight * 0.2; let numBars = Math.round((h - paddingTop) / (barHeight + barGap)); diff --git a/WebApp/src/components/widgets/gauge.tsx b/WebApp/src/components/widgets/gauge.tsx index 53966e6..ae48e1b 100644 --- a/WebApp/src/components/widgets/gauge.tsx +++ b/WebApp/src/components/widgets/gauge.tsx @@ -14,6 +14,17 @@ export class Gauge extends Widget { private integralValueElement: HTMLElement; private decimalValueElement: HTMLElement; + private displayedValue = 0.0; + private targetValue = 0.0; + private valueChangeRate = 0.0; + private litBars = 0; + + private animating = false; + private shuttingDown = false; + + private lastGaugeUpdate = 0.0; + private lastAnimationTick = 0.0; + constructor(vnode: any) { super(vnode); @@ -25,6 +36,11 @@ export class Gauge extends Widget { this.gaugeValue.onChange(() => this.updateGauge()); } + onbeforeremove(vnode: m.Vnode<{}, {}>) { + this.shuttingDown = true; + super.onbeforeremove(vnode); + } + view(vnode: m.Vnode<{}, {}>): m.Children { return