diff --git a/src/components/graphs/knngraph/KNNModelGraphDrawer.ts b/src/components/graphs/knngraph/KNNModelGraphDrawer.ts index 71b5cb5bb..8d1901ed7 100644 --- a/src/components/graphs/knngraph/KNNModelGraphDrawer.ts +++ b/src/components/graphs/knngraph/KNNModelGraphDrawer.ts @@ -121,6 +121,7 @@ class KNNModelGraphDrawer { .attr('cy', d => (isNaN(d.projected.y) ? 0 : d.projected.y)) .attr('r', radius) .on('mouseenter', (x, y) => { + // TODO - Could be contained inside another file, using a store to place it, theres no need to share the tooltip between graphs const tooltip = document.getElementById(this.classId); if (tooltip) { tooltip.style.left = y.projected.x + 5 + 'px'; diff --git a/src/components/graphs/knngraph/KnnModelGraphSvgWithControls.svelte b/src/components/graphs/knngraph/KnnModelGraphSvgWithControls.svelte index ca5eefbd8..0c3be3fa4 100644 --- a/src/components/graphs/knngraph/KnnModelGraphSvgWithControls.svelte +++ b/src/components/graphs/knngraph/KnnModelGraphSvgWithControls.svelte @@ -10,6 +10,7 @@ import { classifier, gestures } from '../../../script/stores/Stores'; import ClassifierFactory from '../../../script/domain/ClassifierFactory'; import { FilterType } from '../../../script/domain/FilterTypes'; + import { runInThisContext } from 'vm'; export let controller: KNNModelGraphController | undefined; export let classID: string; @@ -69,8 +70,18 @@
+
-
+
{ + // This is a hack to easily close the tooltip, which otherwise has some odd behaviour + const thisElement = document.getElementById(classID); + if (thisElement) { + thisElement.innerHTML = ''; + } + }} + id={classID} />