Skip to content

Commit 391353b

Browse files
committed
Fix missing value on knn graph tooltip
1 parent 476484c commit 391353b

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@testing-library/svelte": "^4.1.0",
2323
"@tsconfig/svelte": "^5.0.4",
2424
"@types/browser-lang": "^0.1.1",
25-
"@types/d3": "^7.4.1",
25+
"@types/d3": "^7.4.3",
2626
"@types/js-cookie": "^3.0.3",
2727
"@types/node": "^18.16.0",
2828
"@types/three": "^0.152.0",

src/components/graphs/knngraph/KNNModelGraphDrawer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
} from '../../../script/utils/graphUtils';
1414
import { state, stores } from '../../../script/stores/Stores';
1515
import { get } from 'svelte/store';
16+
import * as d3 from "d3";
1617

1718
export type GraphDrawConfig = {
1819
xRot: number;

src/components/graphs/knngraph/KnnPointToolTipView.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
};
2828
2929
$: borderColor = $knnHighlightedPoint?.color;
30+
$: console.log(content.values);
3031
</script>
3132

3233
<div
@@ -35,9 +36,9 @@
3536
class="absolute bg-white py-1 px-1 border-solid border-2 rounded font-bold"
3637
style={`top:${position.y}px; left:${position.x}px;border-color:${borderColor}`}>
3738
{#each content.values as val, index}
38-
{#if val}<!--val may be undefined for 2d knn graph-->
39+
{#if val !== undefined}<!--val may be undefined for 2d knn graph-->
3940
<p style={`color:${StaticConfiguration.graphColors[index]}`}>
40-
{val?.toFixed(2)}
41+
{val.toFixed(2)}
4142
</p>
4243
{/if}
4344
{/each}

0 commit comments

Comments
 (0)