How to use the interactjs.maxInteractions function in interactjs

To help you get started, we’ve selected a few interactjs 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 AndrewJakubowicz / networkVizJS / src / networkViz.ts View on Github external
// layoutOptions.imgResize && layoutOptions.imgResize(true);
            internalOptions.isImgResize = true;
            const target = event.target,
                x = (parseFloat(target.getAttribute("data-x")) || 0),
                y = (parseFloat(target.getAttribute("data-x")) || 0);

            target.style.width = event.rect.width + "px";
            target.style.height = event.rect.width + "px";
            target.style.webkitTransform = target.style.transform =
                "translate(" + x + "px," + y + "px)";
            target.setAttribute("data-x", x);

            restart();
        });

    interact.maxInteractions(Infinity);

    /**
     * Return nodes and edges within a boundary
     * @param {Object} boundary - Bounds to search within
     * @param {Number} boundary.x
     * @param {Number} boundary.X
     * @param {Number} boundary.y
     * @param {Number} boundary.Y
     * @returns {{nodes: any[]; edges: any[]}} - object containing node array and edge array
     */
    function selectByCoords(boundary: { x: number, X: number, y: number, Y: number }) {
        const nodeSelect = [];
        const groupSelect = [];
        const x = Math.min(boundary.x, boundary.X);
        const X = Math.max(boundary.x, boundary.X);
        const y = Math.min(boundary.y, boundary.Y);

interactjs

Drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)

MIT
Latest version published 8 months ago

Package Health Score

71 / 100
Full package analysis