diff --git a/display/graph.js b/display/graph.js
index 339d15509ae1dfcfa224cb50bf35891de2913d7c..dbde29b5b060bae68f7d730dadaf4604a6bdcb9e 100644
--- a/display/graph.js
+++ b/display/graph.js
@@ -4,6 +4,7 @@ import { loadGraphJson } from "../datasets/datasets";
 
 import * as THREE from "three";
 import ForceGraph3D from "3d-force-graph";
+import screenfull from "screenfull";
 
 import {
     CSS3DRenderer,
@@ -362,7 +363,7 @@ export default class Graph {
     }
 
     resize() {
-        if (document.fullscreenElement == Helpers.getCanvasDivNode()) {
+        if (screenfull.isEnabled) {
             this.graph.height(screen.height);
             this.graph.width(screen.width);
         } else {