Fix Polar sizing

- Note: Not adaptive to viewport size, but will snap to grid
This commit is contained in:
Christoph Kluge 2023-08-10 15:10:06 +02:00
parent b42a11d30e
commit bbd8637ca6
2 changed files with 16 additions and 8 deletions

View File

@ -120,7 +120,6 @@
jobTags,
fullWidth,
statsTable;
$: polarPlotSize = Math.min(fullWidth / 3 - 10, 300);
$: document.title = $initq.fetching
? "Loading..."
: $initq.error
@ -233,8 +232,7 @@
{/if}
<Col>
<Polar
width={polarPlotSize}
height={polarPlotSize}
size={fullWidth / 4.1}
metrics={ccconfig[
`job_view_polarPlotMetrics:${$initq.data.job.cluster}`
] || ccconfig[`job_view_polarPlotMetrics`]}
@ -245,7 +243,7 @@
<Col>
<Roofline
width={fullWidth / 3 - 10}
height={polarPlotSize + 20}
height={fullWidth / 5}
cluster={clusters
.find((c) => c.name == $initq.data.job.cluster)
.subClusters.find(

View File

@ -22,8 +22,7 @@
LineElement
);
export let width
export let height
export let size
export let metrics
export let cluster
export let jobMetrics
@ -88,8 +87,19 @@
}
// No custom defined options but keep for clarity
const options = {}
const options = {
maintainAspectRatio: false,
}
</script>
<Radar {data} {options} {width} {height}/>
<div class="chart-container">
<Radar {data} {options} width={size} height={size}/>
</div>
<style>
.chart-container {
margin: auto;
position: relative;
}
</style>