diff --git a/js/entity-mesh.js b/js/entity-mesh.js
index b3d486bfeb19becdb512d2ad6d04a6bcf31da504..1f1b23ccd7e6d9164267b0b9704d858a13b9b8fd 100644
--- a/js/entity-mesh.js
+++ b/js/entity-mesh.js
@@ -40,7 +40,10 @@ function graphGenerate(data, settings) {
 
   // Init Graph:
   let graph = document.querySelector(selector);
-  let width = window.innerWidth - 100;
+  let graph_cstyle = window.getComputedStyle(graph);
+  let width = graph.clientWidth +
+    parseFloat(graph_cstyle.paddingLeft) +
+    parseFloat(graph_cstyle.paddingRight);
   let height = 450;
   if (settings.fullHeight) {
     height = window.innerHeight - 300;
@@ -53,7 +56,7 @@ function graphGenerate(data, settings) {
   const svg = d3
     .select(selector)
     .append("svg")
-    .attr("width", width)
+    .attr("width", "100%")
     .attr("height", height);
 
   // Init simulation: