Skip to content

Commit

Permalink
Fix ImageDownloadModal and TreeMap
Browse files Browse the repository at this point in the history
  • Loading branch information
pverscha committed Aug 25, 2023
1 parent 6bf6f4f commit 4054556
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/modals/DownloadImageModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</div>

<div class="ma-4">
<div class="d-flex justify-start align-center">
<div class="d-flex justify-start align-center mb-2">
<span
class="mr-2"
style="position: relative; top: 3px;"
Expand All @@ -44,7 +44,7 @@
v-model="formatValue"
:items="formatValues"
item-text="label"
dense
density="compact"
hide-details
/>
</div>
Expand All @@ -59,7 +59,7 @@
v-model="scalingValue"
:items="enlargementValues"
item-title="label"
dense
density="compact"
hide-details
:disabled="isSvg()"
/>
Expand Down
14 changes: 13 additions & 1 deletion src/components/visualizations/TreeMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,18 @@ const initializeVisualisation = () => {
visualization.value.innerHTML = "";
}
let width: number = props.width ? props.width : (visualization.value?.clientWidth || 0);
if (!props.width) {
let currentEl = visualization.value;
while (currentEl && currentEl.clientWidth === 0) {
// Wait until the visualization has a width
currentEl = currentEl.parentElement;
}
width = currentEl?.clientWidth || 0;
}
const settings = {
width: props.width ? props.width : visualization.value?.clientWidth,
width: width,
height: props.height - 20,
rerootCallback: d => {
if(visualizationComputed.value) {
Expand All @@ -137,6 +147,8 @@ const initializeVisualisation = () => {
getTooltipText: d => tooltipContent(d)
} as TreemapSettings;
console.log(JSON.stringify(settings));
const treemap = new UnipeptTreemap(
visualization.value as HTMLElement,
props.data.getRoot(),
Expand Down

0 comments on commit 4054556

Please sign in to comment.