Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
Fix (NoteMap): map overflows when switching type in ribbon (#7939)
Elian Doran9fcee9cc5304
diff --git a/apps/client/src/widgets/note_map/NoteMap.tsx b/apps/client/src/widgets/note_map/NoteMap.tsxindex 1c503c3637..12e15202d2 100644--- a/apps/client/src/widgets/note_map/NoteMap.tsx+++ b/apps/client/src/widgets/note_map/NoteMap.tsx@@ -95,13 +95,13 @@ export default function NoteMap({ note, widgetMode, parentRef }: NoteMapProps) {if (!graphRef.current || !notesAndRelationsRef.current) return;graphRef.current.d3Force("link")?.distance(linkDistance);graphRef.current.graphData(notesAndRelationsRef.current);- }, [ linkDistance ]);+ }, [ linkDistance, mapType ]);// React to container sizeuseEffect(() => {if (!containerSize || !graphRef.current) return;graphRef.current.width(containerSize.width).height(containerSize.height);- }, [ containerSize?.width, containerSize?.height ]);+ }, [ containerSize?.width, containerSize?.height, mapType ]);// Fixing nodes when dragged.useEffect(() => {@@ -114,7 +114,7 @@ export default function NoteMap({ note, widgetMode, parentRef }: NoteMapProps) {node.fy = undefined;}})- }, [ fixNodes ]);+ }, [ fixNodes, mapType ]);return (<div className="note-map-widget">diff --git a/apps/client/src/widgets/ribbon/NoteMapTab.tsx b/apps/client/src/widgets/ribbon/NoteMapTab.tsxindex ec7f4a7491..c803dfa021 100644--- a/apps/client/src/widgets/ribbon/NoteMapTab.tsx+++ b/apps/client/src/widgets/ribbon/NoteMapTab.tsx@@ -29,14 +29,14 @@ export default function NoteMapTab({ note }: TabContext) {{!isExpanded ? (<ActionButton- icon="bx bx-arrow-to-bottom"+ icon="bx bx-expand-vertical"text={t("note_map.open_full")}className="open-full-button"onClick={() => setExpanded(true)}/>) : (<ActionButton- icon="bx bx-arrow-to-top"+ icon="bx bx-collapse-vertical"text={t("note_map.collapse")}className="collapse-button"onClick={() => setExpanded(false)}