add row plot cursor syncing

This commit is contained in:
Christoph Kluge
2026-02-19 15:42:20 +01:00
parent 7789489d08
commit 705d70ddc0
2 changed files with 8 additions and 1 deletions

View File

@@ -20,6 +20,7 @@
import { queryStore, gql, getContextClient } from "@urql/svelte"; import { queryStore, gql, getContextClient } from "@urql/svelte";
import { Card, Spinner } from "@sveltestrap/sveltestrap"; import { Card, Spinner } from "@sveltestrap/sveltestrap";
import { maxScope, checkMetricAvailability } from "../utils.js"; import { maxScope, checkMetricAvailability } from "../utils.js";
import uPlot from "uplot";
import JobInfo from "./JobInfo.svelte"; import JobInfo from "./JobInfo.svelte";
import MetricPlot from "../plots/MetricPlot.svelte"; import MetricPlot from "../plots/MetricPlot.svelte";
import JobFootprint from "../helper/JobFootprint.svelte"; import JobFootprint from "../helper/JobFootprint.svelte";
@@ -74,13 +75,17 @@
} }
`; `;
/* Var Init*/
// svelte-ignore state_referenced_locally
let plotSync = uPlot.sync(`jobMetricStack-${job.cluster}-${job.id}`);
/* State Init */ /* State Init */
let zoomStates = $state({}); let zoomStates = $state({});
let thresholdStates = $state({}); let thresholdStates = $state({});
/* Derived */ /* Derived */
const resampleDefault = $derived(resampleConfig ? Math.max(...resampleConfig.resolutions) : 0); const resampleDefault = $derived(resampleConfig ? Math.max(...resampleConfig.resolutions) : 0);
const jobId = $derived(job?.id); const jobId = $derived(job.id);
const scopes = $derived.by(() => { const scopes = $derived.by(() => {
if (job.numNodes == 1) { if (job.numNodes == 1) {
if (job.numAcc >= 1) return ["core", "accelerator"]; if (job.numAcc >= 1) return ["core", "accelerator"];
@@ -233,6 +238,7 @@
numaccs={job.numAcc} numaccs={job.numAcc}
zoomState={zoomStates[metric.data.name] || null} zoomState={zoomStates[metric.data.name] || null}
thresholdState={thresholdStates[metric.data.name] || null} thresholdState={thresholdStates[metric.data.name] || null}
{plotSync}
/> />
{:else} {:else}
<Card body class="mx-2" color="warning"> <Card body class="mx-2" color="warning">

View File

@@ -211,6 +211,7 @@
timestep={metricData.data.metric.timestep} timestep={metricData.data.metric.timestep}
series={metricData.data.metric.series} series={metricData.data.metric.series}
height={375} height={375}
{plotSync}
forNode forNode
/> />
{/if} {/if}