3d-force-graph-ar
3d-force-graph-ar copied to clipboard
Control fullscreen
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.
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
.
Ola Manuel, thanks for reaching out!
You can control the canvas viewport size using the
width
andheight
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
andyOffset
.
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.
@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.