Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.2] Fix workflow metrics chart style #19291

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions client/src/components/WorkflowInvocationState/VegaWrapper.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div ref="chartContainer" class="chart" :style="style"></div>
<div ref="chartContainer" :style="style"></div>
</template>

<script setup lang="ts">
Expand All @@ -9,15 +9,18 @@ import { computed, onBeforeUnmount, onMounted, ref, watch } from "vue";

export interface VisSpec {
spec: VisualizationSpec;
width: string;
fillWidth?: boolean;
}

const props = withDefaults(defineProps<VisSpec>(), {
width: "100%",
fillWidth: true,
});

const style = computed(() => {
return { width: props.width };
if (props.fillWidth) {
return { width: "100%" };
}
return {};
});

const chartContainer = ref<HTMLDivElement | null>(null);
Expand Down Expand Up @@ -49,8 +52,3 @@ onBeforeUnmount(() => {
}
});
</script>

<style scoped>
.chart {
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -275,18 +275,9 @@ function itemToPieChartSpec(item: piechartData) {
type: "nominal",
legend: {
type: "symbol",
title: "", // should be item.category_title but it doesn't align right so just hide it
direction: "vertical",
titleAlign: "right",
padding: 10,
// rowPadding: 3,
labelOffset: 40,
// symbolOffset: 50,
labelLimit: 120,
// labelAlign: 'center',
columnPadding: 5,
// clipHeight: 20,
titleOrient: "top",
title: item.category_title,
titleFontSize: 16,
labelFontSize: 14,
},
},
tooltip: [
Expand Down Expand Up @@ -381,6 +372,10 @@ function getTimingInTitle(timing: string): string {
const timingInTitles = computed(() => {
return getTimingInTitle(timing.value);
});

const groupByInTitles = computed(() => {
return attributeToLabel[groupBy.value];
});
</script>

<template>
Expand All @@ -393,22 +388,22 @@ const timingInTitles = computed(() => {
<b-dropdown-item @click="timing = 'minutes'">{{ getTimingInTitle("minutes") }}</b-dropdown-item>
<b-dropdown-item @click="timing = 'hours'">{{ getTimingInTitle("hours") }}</b-dropdown-item>
</b-dropdown>
<b-dropdown right text="Group By: Tool">
<b-dropdown right :text="'Group By: ' + groupByInTitles">
<b-dropdown-item @click="groupBy = 'tool_id'">Tool</b-dropdown-item>
<b-dropdown-item @click="groupBy = 'step_id'">Workflow Step</b-dropdown-item>
</b-dropdown>
</BButtonGroup>
</BRow>
<BRow>
<BCol v-if="wallclockAggregate && wallclockAggregate.values">
<BCol v-if="wallclockAggregate && wallclockAggregate.values" class="text-center">
<h2 class="h-l truncate text-center">
Aggregate
<HelpText :for-title="true" uri="galaxy.jobs.metrics.walltime" text="Runtime Time" /> (in
{{ timingInTitles }})
</h2>
<VegaWrapper :spec="itemToPieChartSpec(wallclockAggregate)" />
<VegaWrapper :spec="itemToPieChartSpec(wallclockAggregate)" :fill-width="false" />
</BCol>
<BCol v-if="allocatedCoreTimeAggregate && allocatedCoreTimeAggregate.values">
<BCol v-if="allocatedCoreTimeAggregate && allocatedCoreTimeAggregate.values" class="text-center">
<h2 class="h-l truncate text-center">
Aggregate
<HelpText
Expand All @@ -417,14 +412,14 @@ const timingInTitles = computed(() => {
text="Allocated Core Time" />
(in {{ timingInTitles }})
</h2>
<VegaWrapper :spec="itemToPieChartSpec(allocatedCoreTimeAggregate)" />
<VegaWrapper :spec="itemToPieChartSpec(allocatedCoreTimeAggregate)" :fill-width="false" />
</BCol>
</BRow>
<BRow v-for="({ spec, item }, key) in metrics" :key="key">
<BCol>
<h2 class="h-l truncate text-center">
<span v-if="item.helpTerm">
<HelpText :for-title="true" :uri="item.helpTerm" :text="key" />
<HelpText :for-title="true" :uri="item.helpTerm" :text="`${key}`" />
</span>
<span v-else>
{{ key }}
Expand Down
Loading