mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 20:55:21 +00:00
better zooming
This commit is contained in:
parent
5fcee3da0b
commit
fb91fc90c7
@ -93,7 +93,7 @@
|
|||||||
.onNodeClick(node => {
|
.onNodeClick(node => {
|
||||||
window.location = node.url;
|
window.location = node.url;
|
||||||
});
|
});
|
||||||
if (delay != null) {
|
if (delay != null && graphData.nodes.length > 2) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Graph.zoomToFit(5, 75);
|
Graph.zoomToFit(5, 75);
|
||||||
}, delay);
|
}, delay);
|
||||||
@ -104,7 +104,7 @@
|
|||||||
function fetchGraphData() {
|
function fetchGraphData() {
|
||||||
fetch('/graph.json').then(res => res.json()).then(data => {
|
fetch('/graph.json').then(res => res.json()).then(data => {
|
||||||
window.graphData = data;
|
window.graphData = data;
|
||||||
Graph = renderGraph(filterToDepth(JSON.parse(JSON.stringify(data))), "link-graph", 330, 330);
|
Graph = renderGraph(filterToDepth(JSON.parse(JSON.stringify(data))), "link-graph", 330, 330, 1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +119,7 @@
|
|||||||
Graph._destructor();
|
Graph._destructor();
|
||||||
Graph = null;
|
Graph = null;
|
||||||
}
|
}
|
||||||
renderGraph(filterToDepth(JSON.parse(JSON.stringify(window.graphData))), "link-graph", 330, 330, null);
|
renderGraph(filterToDepth(JSON.parse(JSON.stringify(window.graphData))), "link-graph", 330, 330, 1);
|
||||||
})
|
})
|
||||||
|
|
||||||
window.fullGraph = null;
|
window.fullGraph = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user