getCorrectionRatio
getCorrectionRatio(
viewportDimensions,graphDimensions):number
Defined in: packages/sigma/src/utils/coordinates.ts:12
In sigma, the graph is normalized into a [0, 1], [0, 1] square, before being given to the various renderers. This helps to deal with quadtree in particular. But at some point, we need to rescale it so that it takes the best place in the screen, i.e. we always want to see two nodes “touching” opposite sides of the graph, with the camera being at its default state.
This function determines this ratio.
Parameters
Section titled “Parameters”viewportDimensions
Section titled “viewportDimensions”height
Section titled “height”number
number
graphDimensions
Section titled “graphDimensions”height
Section titled “height”number
number
Returns
Section titled “Returns”number