mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 04:35:20 +00:00
graph fixes
This commit is contained in:
parent
84d8a3e916
commit
9355fe6c58
@ -145,18 +145,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
fetchGraphData();
|
fetchGraphData();
|
||||||
window.document.getElementById('graph-depth').value = window.maxGraphDepth;
|
window.document.getElementById('graph-depth').value = window.maxGraphDepth;
|
||||||
window.document.getElementById('depth-display').innerText = window.maxGraphDepth;
|
window.document.getElementById('depth-display').innerText = window.maxGraphDepth;
|
||||||
window.document.getElementById('graph-depth').addEventListener('input', (evt) => {
|
window.document.getElementById('graph-depth').addEventListener('input', (evt) => {
|
||||||
|
|
||||||
window.maxGraphDepth = evt.target.value;
|
window.maxGraphDepth = evt.target.value;
|
||||||
window.document.getElementById('depth-display').innerText = window.maxGraphDepth;
|
window.document.getElementById('depth-display').innerText = window.maxGraphDepth;
|
||||||
if (Graph != null) {
|
if (Graph != null) {
|
||||||
Graph._destructor();
|
Graph._destructor();
|
||||||
Graph = null;
|
Graph = null;
|
||||||
}
|
}
|
||||||
renderGraph(filterToDepth(JSON.parse(JSON.stringify(window.graphData))), "link-graph", 1);
|
Graph = renderGraph(filterToDepth(JSON.parse(JSON.stringify(window.graphData))), "link-graph", 1);
|
||||||
})
|
setTimeout(() => {
|
||||||
|
Graph.zoomToFit(5, 75);
|
||||||
|
}, 1);
|
||||||
|
});
|
||||||
|
|
||||||
window.fullGraph = null;
|
window.fullGraph = null;
|
||||||
function renderFullGraph() {
|
function renderFullGraph() {
|
||||||
@ -186,11 +189,14 @@
|
|||||||
const el = document.querySelector('.graph');
|
const el = document.querySelector('.graph');
|
||||||
if (el.classList.contains('graph-fs')) {
|
if (el.classList.contains('graph-fs')) {
|
||||||
el.classList.remove('graph-fs');
|
el.classList.remove('graph-fs');
|
||||||
Graph.width(el.offsetWidth).height(el.offsetHeight);
|
Graph.width(el.offsetWidth).height(el.offsetWidth);
|
||||||
} else {
|
} else {
|
||||||
el.classList.add('graph-fs');
|
el.classList.add('graph-fs');
|
||||||
Graph.width(el.offsetWidth).height(el.offsetHeight);
|
Graph.width(el.offsetWidth).height(el.offsetWidth);
|
||||||
}
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
Graph.zoomToFit(5, 75);
|
||||||
|
}, 1);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user