Skip to content

Commit

Permalink
Some minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pverscha committed Sep 22, 2023
1 parent 4054556 commit cf9391d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/visualizations/HierarchicalOutline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<v-col
id="searchtree"
class="treeView multi pt-0"
class="treeView multi pt-2"
cols="6"
/>

Expand Down
23 changes: 16 additions & 7 deletions src/components/visualizations/Sunburst.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ import { Sunburst as UnipeptSunburst, SunburstSettings } from 'unipept-visualiza
import { onMounted, ref, watch } from 'vue';
import { tooltipContent } from './VisualizationHelper';
// The amount of milliseconds that the SunBurst should wait with animating movement before or after a filter was
// changed.
const rerootTimeout = 0;
export interface Props {
data: NcbiTree
Expand Down Expand Up @@ -101,10 +105,12 @@ watch(() => props.doReset, () => {
});
watch(() => props.filterId, () => {
if(visualizationComputed.value) {
// @ts-ignore (reroot is not exported in the interface of the visualization)
visualizationComputed.value.reroot(props.filterId, false);
}
new Promise<void>((resolve) => setTimeout(resolve, rerootTimeout)).then(() => {
if (visualizationComputed.value) {
// @ts-ignore (reroot is not exported in the interface of the visualization)
visualizationComputed.value.reroot(props.filterId, false);
}
});
});
watch(() => props.isFixedColors, () => {
Expand All @@ -123,9 +129,12 @@ const initializeVisualisation = () => {
height: props.height,
useFixedColors: props.isFixedColors,
rerootCallback: d => {
if(visualizationComputed.value) {
emits("update-selected-taxon-id", d.id);
}
// Wait 500ms to start the animation to avoid stutter in the interface.
new Promise(resolve => setTimeout(resolve, rerootTimeout)).then(() => {
if (visualizationComputed.value) {
emits("update-selected-taxon-id", d.id);
}
});
},
getTooltipText: d => tooltipContent(d)
} as SunburstSettings;
Expand Down
2 changes: 0 additions & 2 deletions src/components/visualizations/TreeMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ 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
2 changes: 1 addition & 1 deletion src/interface/Assay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default interface Assay {
peptides: string[]
amountOfPeptides: number
createdAt: Date
};
}

0 comments on commit cf9391d

Please sign in to comment.