summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/index.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/pages/index.tsx b/pages/index.tsx
index b13d13f..2f3881e 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -964,17 +964,19 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) {
highlightedNodes[node.id!] || previouslyHighlightedNodes[node.id!]
? 1 + opacity * (visuals.highlightNodeSize - 1)
: 1
- return basicSize * highlightSize
+ return (basicSize * highlightSize) / Math.pow(zoom, visuals.nodeZoomSize)
}
const [dragging, setDragging] = useState(false)
+ const [zoom, setZoom] = useState(1)
const graphCommonProps: ComponentPropsWithoutRef<typeof TForceGraph2D> = {
graphData: scope.nodeIds.length ? scopedGraphData : filteredGraphData,
width: windowWidth,
height: windowHeight,
backgroundColor: theme.colors.gray[visuals.backgroundColor],
warmupTicks: scope.nodeIds.length === 1 ? 100 : scope.nodeIds.length > 1 ? 20 : 0,
+ onZoom: ({ k, x, y }) => setZoom(k),
nodeLabel: (node) => (node as OrgRoamNode).title,
nodeColor: (node) => {
return getNodeColor(node as OrgRoamNode)