transformGroup = (
bHorizontalWrappingConfig,
bVerticalWrappingConfig,
bDiagonalWrappingConfig,
offsetX,
offsetY
) => {
if (
bDiagonalWrappingConfig != null &&
bDiagonalWrappingConfig &&
datasetname.indexOf("matrix") >= 0
) {
if (offsetX >= 0 && offsetY >= 0) {
configuration.canvasX += Math.max(Math.abs(offsetX), Math.abs(offsetY));
configuration.canvasY += Math.max(Math.abs(offsetX), Math.abs(offsetY));
} else if (offsetX < 0 && offsetY < 0) {
configuration.canvasX -= Math.max(Math.abs(offsetX), Math.abs(offsetY));
configuration.canvasY -= Math.max(Math.abs(offsetX), Math.abs(offsetY));
} else if (offsetX >= 0 && offsetY <= 0) {
if (Math.abs(offsetX) > Math.abs(offsetY)) {
configuration.canvasX += Math.max(Math.abs(offsetX), Math.abs(offsetY));
configuration.canvasY += Math.max(Math.abs(offsetX), Math.abs(offsetY));
} else if (Math.abs(offsetX) < Math.abs(offsetY)) {
configuration.canvasX -= Math.max(Math.abs(offsetX), Math.abs(offsetY));
configuration.canvasY -= Math.max(Math.abs(offsetX), Math.abs(offsetY));
}
} else if (offsetX < 0 && offsetY > 0) {
if (Math.abs(offsetX) > Math.abs(offsetY)) {
configuration.canvasX -= Math.max(Math.abs(offsetX), Math.abs(offsetY));
configuration.canvasY -= Math.max(Math.abs(offsetX), Math.abs(offsetY));
} else if (Math.abs(offsetX) < Math.abs(offsetY)) {
configuration.canvasX += Math.max(Math.abs(offsetX), Math.abs(offsetY));
configuration.canvasY += Math.max(Math.abs(offsetX), Math.abs(offsetY));
}
}
} else if (
bDiagonalWrappingConfig != null &&
bDiagonalWrappingConfig &&
datasetname.indexOf("rockscissorpaper") >= 0
) {
// antidiagonal, project on (-1,1)
if (offsetX >= 0 && offsetY <= 0) {
configuration.canvasX += Math.max(Math.abs(offsetX), Math.abs(offsetY));
configuration.canvasY -= Math.max(Math.abs(offsetX), Math.abs(offsetY));
} else if (offsetX < 0 && offsetY > 0) {
configuration.canvasX -= Math.max(Math.abs(offsetX), Math.abs(offsetY));
configuration.canvasY += Math.max(Math.abs(offsetX), Math.abs(offsetY));
} else if (offsetX > 0 && offsetY > 0) {
if (offsetX > offsetY) {
configuration.canvasX += Math.max(Math.abs(offsetX), Math.abs(offsetY));
configuration.canvasY -= Math.max(Math.abs(offsetX), Math.abs(offsetY));
} else {
configuration.canvasX -= Math.max(Math.abs(offsetX), Math.abs(offsetY));
configuration.canvasY += Math.max(Math.abs(offsetX), Math.abs(offsetY));
}
} else if (offsetX < 0 && offsetY < 0) {
if (Math.abs(offsetX) > Math.abs(offsetY)) {
configuration.canvasX -= Math.max(Math.abs(offsetX), Math.abs(offsetY));
configuration.canvasY += Math.max(Math.abs(offsetX), Math.abs(offsetY));
} else {
configuration.canvasX += Math.max(Math.abs(offsetX), Math.abs(offsetY));
configuration.canvasY -= Math.max(Math.abs(offsetX), Math.abs(offsetY));
}
}
} else {
if (bHorizontalWrappingConfig != null && bHorizontalWrappingConfig)
configuration.canvasX += offsetX;
if (bVerticalWrappingConfig != null && bVerticalWrappingConfig)
configuration.canvasY += offsetY;
}
if (configuration.canvasX > boundaryConfig.twoThirdsWidth) {
configuration.canvasX -= boundaryConfig.oneThirdWidth;
} else if (configuration.canvasX < boundaryConfig.oneThirdWidth) {
configuration.canvasX += boundaryConfig.oneThirdWidth;
}
if (configuration.canvasY > boundaryConfig.twoThirdsHeight) {
configuration.canvasY -= boundaryConfig.oneThirdHeight;
} else if (configuration.canvasY < boundaryConfig.oneThirdHeight) {
configuration.canvasY += boundaryConfig.oneThirdHeight;
}
for (var i = 0; i < 9; i++) {
foreignObject[i].attr("x", configuration.canvasX + shiftDistance[i].x);
if (
datasetname.indexOf("matrix") >= 0 ||
datasetname.indexOf("horizonchart") >= 0
)
foreignObject[i].attr(
"y",
configuration.canvasY + horizontalAxisHeight + shiftDistance[i].y
);
else foreignObject[i].attr("y", configuration.canvasY + shiftDistance[i].y);
}
svgs
.selectAll(".draggableGroup")
.selectAll(".whiteRectangle")
.raise();
for (var i = 0; i < 3; i++) {
axisXObject[i].attr("x", configuration.canvasX + axisXShiftDistance[i].x);
if (
datasetname.indexOf("matrix") >= 0 ||
datasetname.indexOf("horizonchart") >= 0
)
axisYObject[i].attr(
"y",
configuration.canvasY + horizontalAxisHeight + axisYShiftDistance[i].y
);
else
axisYObject[i].attr("y", configuration.canvasY + axisYShiftDistance[i].y);
}
}