Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to let the Graph fill the screen?

In this scenario, Graph instance’s width and height must be number, so can’t use 100% as value:
https://codesandbox.io/s/mo-ban-wchooy?file=/src/App.tsx

const graph = new Graph({
      container: containerRef.current!,
      width: 600,
      height: 800,
      background: {
        color: "#F2F7FA"
      }
    });

so how to let the graph fill the parent div?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Just write the code like this:

const graph = new Graph({
  width: document.body.clientWidth,
  height: document.body.clientHeight,
});
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading