Skip to content

Commit

Permalink
Center PieCharts horizontally
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Dec 9, 2024
1 parent 631da64 commit f07d673
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
9 changes: 6 additions & 3 deletions client/src/components/WorkflowInvocationState/VegaWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,15 @@ const groupByInTitles = computed(() => {
</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 @@ -412,14 +412,14 @@ const groupByInTitles = 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

0 comments on commit f07d673

Please sign in to comment.