Commit f7ca9588 authored by vertighel's avatar vertighel
Browse files

Fix synoptic: apply data-transform to SVG telemetry values



Import noctuaTransforms in synoptic.js and apply the transform named
in each element's data-transform attribute before rendering the value,
so unix_to_isot / round_3 / deg_to_arcsec are actually executed.

Co-Authored-By: default avatarClaude Sonnet 4.6 <noreply@anthropic.com>
parent 1ba986e0
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
// synoptic.js
// SVG Sinoptic Animator and Telemetry Listener.

import { parseStatusKey } from './ui-core.js';
import { parseStatusKey, noctuaTransforms } from './ui-core.js';

const svgUrl = window.SYNOPTIC_SVG_URL;
const container = document.getElementById('svg-container');
@@ -237,7 +237,12 @@ document.addEventListener('noctua-telemetry', (e) => {
            finalValue = 'boh';
        }

        const displayValue = typeof finalValue === 'object' ? JSON.stringify(finalValue) : finalValue;
        const transformName = el.dataset.transform;
        let transformedValue = finalValue;
        if (transformName && noctuaTransforms[transformName]) {
            transformedValue = noctuaTransforms[transformName](finalValue);
        }
        const displayValue = typeof transformedValue === 'object' ? JSON.stringify(transformedValue) : transformedValue;
        const tagName = el.tagName.toLowerCase();

        if (tagName === 'text' || tagName === 'tspan') {