3d-force-graph-ar icon indicating copy to clipboard operation
3d-force-graph-ar copied to clipboard

Control fullscreen

Open manuelgcsousa opened this issue 4 years ago • 3 comments

I didn't classified this as a bug, because the error might be mine. Is there a way to control the frame size? Everytime I generate any graph, the frame just fills all the available screen, and I wanted to control the canvas size. I tried multiple ways, but at runtime a video tag is appended, and I can't seem to have control of it. Any idea of what I might be doing wrong? Thank you.

manuelgcsousa avatar Oct 04 '20 17:10 manuelgcsousa

Ola Manuel, thanks for reaching out!

You can control the canvas viewport size using the width and height properties. They default to the window width and height, therefore full-screen.

Further you can control the scale and offset of the graph position relatively to the AR marker, using the methods glScale and yOffset.

vasturiano avatar Oct 13 '20 05:10 vasturiano

Ola Manuel, thanks for reaching out!

You can control the canvas viewport size using the width and height properties. They default to the window width and height, therefore full-screen.

Further you can control the scale and offset of the graph position relatively to the AR marker, using the methods glScale and yOffset.

Hello, thank you very much for the answer. From what I can figure out, this would be a way of using those properties right?

const Graph = ForceGraphAR()
        (document.getElementById('3d-graph'))
        .graphData(gData)
        .nodeRelSize(10)
        .linkWidth(3)
        .nodeOpacity(0.9)
        .linkOpacity(0.4)
        .nodeColor(() => 'firebrick')
        .linkColor(() => 'darkgrey')
        .width(500)
        .height(500);

Do I need to insert "width" and "height" in different positions? Thank you once again.

manuelgcsousa avatar Oct 13 '20 08:10 manuelgcsousa

@MGCSousa yes, that's correct. The chaining order doesn't really matter. The application of the input properties is debounced so they all get applied simultaneously regardless of the order.

vasturiano avatar Oct 13 '20 15:10 vasturiano