-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
573 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
145 changes: 0 additions & 145 deletions
145
client/src/components/WorkflowInvocationState/MetricsBoxPlots.vue
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
client/src/components/WorkflowInvocationState/VegaWrapper.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<template> | ||
<div ref="chartContainer" class="chart"></div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import embed, { type VisualizationSpec } from "vega-embed"; | ||
import { onBeforeUnmount, onMounted, ref, watch } from "vue"; | ||
export interface VisSpec { | ||
spec: VisualizationSpec; | ||
} | ||
const props = defineProps<VisSpec>(); | ||
const chartContainer = ref<HTMLDivElement | null>(null); | ||
let vegaView: any; | ||
watch( | ||
props, | ||
async () => { | ||
console.log(props.spec); | ||
if (chartContainer.value) { | ||
const result = await embed(chartContainer.value, props.spec); | ||
vegaView = result.view; | ||
} | ||
}, | ||
{ immediate: true } | ||
); | ||
// Cleanup the chart when the component is unmounted | ||
onBeforeUnmount(() => { | ||
if (vegaView) { | ||
vegaView.finalize(); | ||
} | ||
}); | ||
</script> | ||
|
||
<style scoped> | ||
.chart { | ||
width: 100%; | ||
height: 300rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.