summaryrefslogtreecommitdiff
path: root/src/graph.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/graph.js')
-rw-r--r--src/graph.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/graph.js b/src/graph.js
index dfe608a..c4d7765 100644
--- a/src/graph.js
+++ b/src/graph.js
@@ -289,6 +289,12 @@ export default function buildGraph({ db, handlers }) {
graph.d3Force("charge").strength(-100);
+ window.addEventListener("resize", function () {
+ graph.renderer().setSize(window.innerWidth, window.innerHeight);
+ graph.camera().aspect = window.innerWidth / window.innerHeight;
+ graph.camera().updateProjectionMatrix();
+ });
+
// camera orbit
initialZoom();