mirror of
https://github.com/TriliumNext/Trilium.git
synced 2025-12-15 19:47:28 -06:00
fix(note_map): initialize map state when switching map type in ribbon
This commit is contained in:
parent
85b4f652f4
commit
2d33b8a958
@ -95,7 +95,7 @@ export default function NoteMap({ note, widgetMode, parentRef }: NoteMapProps) {
|
|||||||
if (!graphRef.current || !notesAndRelationsRef.current) return;
|
if (!graphRef.current || !notesAndRelationsRef.current) return;
|
||||||
graphRef.current.d3Force("link")?.distance(linkDistance);
|
graphRef.current.d3Force("link")?.distance(linkDistance);
|
||||||
graphRef.current.graphData(notesAndRelationsRef.current);
|
graphRef.current.graphData(notesAndRelationsRef.current);
|
||||||
}, [ linkDistance ]);
|
}, [ linkDistance, mapType ]);
|
||||||
|
|
||||||
// React to container size
|
// React to container size
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -114,7 +114,7 @@ export default function NoteMap({ note, widgetMode, parentRef }: NoteMapProps) {
|
|||||||
node.fy = undefined;
|
node.fy = undefined;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, [ fixNodes ]);
|
}, [ fixNodes, mapType ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="note-map-widget">
|
<div className="note-map-widget">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user