Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// 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);