mirror of
https://github.com/zadam/trilium.git
synced 2025-12-16 21:29:56 +01:00
fix(note_map): initialize map state when switching map type in ribbon
This commit is contained in:
@@ -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">
|
||||||
|
|||||||
Reference in New Issue
Block a user