Skip to content

Commit b1691c5

Browse files
committed
Rerender on resize
1 parent 39a7ed2 commit b1691c5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

client/src/components/WorkflowInvocationState/VegaWrapper.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
</template>
44

55
<script setup lang="ts">
6+
import { useResizeObserver } from "@vueuse/core";
67
import embed, { type VisualizationSpec } from "vega-embed";
78
import { onBeforeUnmount, onMounted, ref, watch } from "vue";
89
@@ -28,6 +29,9 @@ async function embedChart() {
2829
onMounted(embedChart);
2930
3031
watch(props, embedChart, { immediate: true, deep: true });
32+
useResizeObserver(chartContainer, () => {
33+
embedChart();
34+
});
3135
3236
// Cleanup the chart when the component is unmounted
3337
onBeforeUnmount(() => {

client/src/components/WorkflowInvocationState/WorkflowInvocationMetrics.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ function itemToSpec(item: boxplotData) {
150150
}
151151
152152
const specs = computed(() => {
153-
const items = [wallclock.value, coresAllocated.value, memoryAllocated.value].filter((item) => item.values?.length);
153+
const items = [wallclock.value, coresAllocated.value, memoryAllocated.value, peakMemory.value].filter(
154+
(item) => item.values?.length
155+
);
154156
const specs = Object.fromEntries(items.map((item) => [item.y_title, itemToSpec(item)]));
155157
return specs;
156158
});

0 commit comments

Comments
 (0)