src/components/graph/graph.helper.js
function getCenterAndZoomTransformation(d3Node, config) {
    if (!d3Node) {
        return;
    }

    const { width, height, focusZoom } = config;

    return `
        translate(${width / 2}, ${height / 2})
        scale(${focusZoom})
        translate(${-d3Node.x}, ${-d3Node.y})
    `;
}
function getCenterAndZoomTransformation(d3Node, config) {
    if (!d3Node) {
        return;
    }

    const { width, height, focusZoom } = config;

    return `
        translate(${width / 2}, ${height / 2})
        scale(${focusZoom})
        translate(${-d3Node.x}, ${-d3Node.y})
    `;
}
function getCenterAndZoomTransformation ( d3Node , config ) { if ( ! d3Node ) { return ; } const { width , height , focusZoom } = config ; return ` ${ width / 2 } ${ height / 2 } ${ focusZoom } ${ - d3Node . x } ${ - d3Node . y } ` ; }
Returns the transformation to apply in order to center the graph on the
selected node.
@param {Object} d3Node - node to focus the graph view on.
@param {Object} config - same as {@link #graphrenderer|config in renderGraph}.
@returns {string} transform rule to apply.
@memberof Graph/helper
Returns the transformation to apply in order to center the graph on the selected node .