How to use the d3-force.forceRadial function in d3-force

To help you get started, we’ve selected a few d3-force examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / d3-force / d3-force-tests.ts View on Github external
// create ForceRadial force --------------------------------------------------------------

let forceRadial: d3Force.ForceRadial;

// Radius set only
forceRadial = d3Force.forceRadial(50);
forceRadial = d3Force.forceRadial((node, index, nodes) => {
    const n: SimNode = node;
    const i: number = index;
    const ns: SimNode[] = nodes;
    return 50 * n.group;
});

// Radius and x-coordinate of center set only
forceRadial = d3Force.forceRadial(50, 10);
forceRadial = d3Force.forceRadial(
    50, // radius
    (node, index, nodes) => {
        const n: SimNode = node;
        const i: number = index;
        const ns: SimNode[] = nodes;
        return 10 * n.group;
    } // center-x
);

// Radius and center set
forceRadial = d3Force.forceRadial(50, 10, 10);
forceRadial = d3Force.forceRadial(
    50, // radius
    10, // center-x
    (node, index, nodes) => {
github DefinitelyTyped / DefinitelyTyped / types / d3-force / d3-force-tests.ts View on Github external
});

// Radius and x-coordinate of center set only
forceRadial = d3Force.forceRadial(50, 10);
forceRadial = d3Force.forceRadial(
    50, // radius
    (node, index, nodes) => {
        const n: SimNode = node;
        const i: number = index;
        const ns: SimNode[] = nodes;
        return 10 * n.group;
    } // center-x
);

// Radius and center set
forceRadial = d3Force.forceRadial(50, 10, 10);
forceRadial = d3Force.forceRadial(
    50, // radius
    10, // center-x
    (node, index, nodes) => {
        const n: SimNode = node;
        const i: number = index;
        const ns: SimNode[] = nodes;
        return 10 * n.group;
    } // center-y
);

forceRadial = d3Force.forceRadial(
    (node, index, nodes) => {
        const n: SimNode = node;
        const i: number = index;
        const ns: SimNode[] = nodes;
github DefinitelyTyped / DefinitelyTyped / types / d3-force / d3-force-tests.ts View on Github external
simNodeNumberAccessor = forcePosY.y();

// Use ForceY force -----------------------------------------------------------------

forcePosY.initialize(graph.nodes);
forcePosY(0.1); // alpha

// ForceRadial ==============================================================================

// create ForceRadial force --------------------------------------------------------------

let forceRadial: d3Force.ForceRadial;

// Radius set only
forceRadial = d3Force.forceRadial(50);
forceRadial = d3Force.forceRadial((node, index, nodes) => {
    const n: SimNode = node;
    const i: number = index;
    const ns: SimNode[] = nodes;
    return 50 * n.group;
});

// Radius and x-coordinate of center set only
forceRadial = d3Force.forceRadial(50, 10);
forceRadial = d3Force.forceRadial(
    50, // radius
    (node, index, nodes) => {
        const n: SimNode = node;
        const i: number = index;
        const ns: SimNode[] = nodes;
        return 10 * n.group;
    } // center-x
github DefinitelyTyped / DefinitelyTyped / types / d3-force / d3-force-tests.ts View on Github external
);

// Radius and center set
forceRadial = d3Force.forceRadial(50, 10, 10);
forceRadial = d3Force.forceRadial(
    50, // radius
    10, // center-x
    (node, index, nodes) => {
        const n: SimNode = node;
        const i: number = index;
        const ns: SimNode[] = nodes;
        return 10 * n.group;
    } // center-y
);

forceRadial = d3Force.forceRadial(
    (node, index, nodes) => {
        const n: SimNode = node;
        const i: number = index;
        const ns: SimNode[] = nodes;
        return 50 * n.group;
    }, // radius
    (node, index, nodes) => {
        const n: SimNode = node;
        const i: number = index;
        const ns: SimNode[] = nodes;
        return 10 * n.group;
    }, // center-x
    (node, index, nodes) => {
        const n: SimNode = node;
        const i: number = index;
        const ns: SimNode[] = nodes;
github DefinitelyTyped / DefinitelyTyped / types / d3-force / d3-force-tests.ts View on Github external
// create ForceRadial force --------------------------------------------------------------

let forceRadial: d3Force.ForceRadial;

// Radius set only
forceRadial = d3Force.forceRadial(50);
forceRadial = d3Force.forceRadial((node, index, nodes) => {
    const n: SimNode = node;
    const i: number = index;
    const ns: SimNode[] = nodes;
    return 50 * n.group;
});

// Radius and x-coordinate of center set only
forceRadial = d3Force.forceRadial(50, 10);
forceRadial = d3Force.forceRadial(
    50, // radius
    (node, index, nodes) => {
        const n: SimNode = node;
        const i: number = index;
        const ns: SimNode[] = nodes;
        return 10 * n.group;
    } // center-x
);

// Radius and center set
forceRadial = d3Force.forceRadial(50, 10, 10);
forceRadial = d3Force.forceRadial(
    50, // radius
    10, // center-x
    (node, index, nodes) => {
        const n: SimNode = node;