New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@kieler/klighd-interactive

Package Overview
Dependencies
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kieler/klighd-interactive - npm Package Compare versions

Comparing version 0.3.0-next.f2c1105 to 0.3.0-next.ff4a31b

23

lib/actions.d.ts

@@ -1,2 +0,2 @@

import { Action } from 'sprotty/lib/base/actions/action';
import { Action } from 'sprotty-protocol';
import { DeleteConstraint } from './layered/constraint-types';

@@ -6,14 +6,19 @@ /**

*/
export declare class RefreshDiagramAction implements Action {
static readonly KIND: string;
readonly kind: string;
export interface RefreshDiagramAction extends Action {
kind: typeof RefreshDiagramAction.KIND;
}
export declare namespace RefreshDiagramAction {
const KIND = "refreshDiagram";
function create(): RefreshDiagramAction;
}
/**
* A sprotty action to delete a constraint on a specific node.
*/
export declare class DeleteConstraintAction implements Action {
readonly constraint: DeleteConstraint;
static readonly KIND: string;
readonly kind: string;
constructor(constraint: DeleteConstraint);
export interface DeleteConstraintAction extends Action {
kind: typeof DeleteConstraintAction.KIND;
constraint: DeleteConstraint;
}
export declare namespace DeleteConstraintAction {
const KIND = "deleteStaticConstraint";
function create(constraint: DeleteConstraint): DeleteConstraintAction;
}

@@ -7,3 +7,3 @@ "use strict";

*
* Copyright 2020 by
* Copyright 2020-2021 by
* + Kiel University

@@ -21,25 +21,23 @@ * + Department of Computer Science

exports.DeleteConstraintAction = exports.RefreshDiagramAction = void 0;
/**
* A sprotty action to refresh the diagram. Send from client to server.
*/
var RefreshDiagramAction = /** @class */ (function () {
function RefreshDiagramAction() {
this.kind = RefreshDiagramAction.KIND;
}
var RefreshDiagramAction;
(function (RefreshDiagramAction) {
RefreshDiagramAction.KIND = 'refreshDiagram';
return RefreshDiagramAction;
}());
exports.RefreshDiagramAction = RefreshDiagramAction;
/**
* A sprotty action to delete a constraint on a specific node.
*/
var DeleteConstraintAction = /** @class */ (function () {
function DeleteConstraintAction(constraint) {
this.constraint = constraint;
this.kind = DeleteConstraintAction.KIND;
function create() {
return {
kind: RefreshDiagramAction.KIND,
};
}
RefreshDiagramAction.create = create;
})(RefreshDiagramAction = exports.RefreshDiagramAction || (exports.RefreshDiagramAction = {}));
var DeleteConstraintAction;
(function (DeleteConstraintAction) {
DeleteConstraintAction.KIND = 'deleteStaticConstraint';
return DeleteConstraintAction;
}());
exports.DeleteConstraintAction = DeleteConstraintAction;
function create(constraint) {
return {
kind: DeleteConstraintAction.KIND,
constraint: constraint,
};
}
DeleteConstraintAction.create = create;
})(DeleteConstraintAction = exports.DeleteConstraintAction || (exports.DeleteConstraintAction = {}));
//# sourceMappingURL=actions.js.map

@@ -1,2 +0,3 @@

import { Point, RectangularNode, SEdge, SParentElement } from 'sprotty/lib';
import { RectangularNode, SEdge, SParentElement } from 'sprotty';
import { Point } from 'sprotty-protocol';
/**

@@ -35,3 +36,3 @@ * This is the superclass of all elements of a graph such as nodes, edges, ports,

hasFeature(feature: symbol): boolean;
properties: NodeProperties;
properties: Record<string, unknown>;
direction: Direction;

@@ -50,18 +51,2 @@ shadow: boolean;

/**
* Properties needed for client side layout or visualization.
* Send together with the nodes from server to client.
* They correspond to properties on the server.
*/
export declare class NodeProperties {
algorithm: string;
aspectRatio: number;
currentPosition: number;
desiredPosition: number;
interactiveLayout: boolean;
layerConstraint: number;
layerId: number;
positionConstraint: number;
positionId: number;
}
/**
* This class can be extended to hold arbitrary additional data for

@@ -68,0 +53,0 @@ * graph elements, such as layout or rendering information.

@@ -7,3 +7,3 @@ "use strict";

*
* Copyright 2019, 2020 by
* Copyright 2019-2021 by
* + Kiel University

@@ -35,4 +35,4 @@ * + Department of Computer Science

Object.defineProperty(exports, "__esModule", { value: true });
exports.KEdge = exports.NodeProperties = exports.Direction = exports.KNode = void 0;
var lib_1 = require("sprotty/lib");
exports.KEdge = exports.Direction = exports.KNode = void 0;
var sprotty_1 = require("sprotty");
/**

@@ -50,6 +50,6 @@ * Represents its java counterpart in KLighD.

KNode.prototype.hasFeature = function (feature) {
return feature === lib_1.selectFeature || (feature === lib_1.moveFeature && this.parent.properties.interactiveLayout);
return feature === sprotty_1.selectFeature || (feature === sprotty_1.moveFeature && this.parent.properties['org.eclipse.elk.interactiveLayout']);
};
return KNode;
}(lib_1.RectangularNode));
}(sprotty_1.RectangularNode));
exports.KNode = KNode;

@@ -65,13 +65,2 @@ var Direction;

/**
* Properties needed for client side layout or visualization.
* Send together with the nodes from server to client.
* They correspond to properties on the server.
*/
var NodeProperties = /** @class */ (function () {
function NodeProperties() {
}
return NodeProperties;
}());
exports.NodeProperties = NodeProperties;
/**
* Represents its java counterpart in KLighD.

@@ -88,7 +77,7 @@ */

KEdge.prototype.hasFeature = function (feature) {
return feature === lib_1.selectFeature;
return feature === sprotty_1.selectFeature;
};
return KEdge;
}(lib_1.SEdge));
}(sprotty_1.SEdge));
exports.KEdge = KEdge;
//# sourceMappingURL=constraint-classes.js.map

@@ -20,3 +20,3 @@ "use strict";

exports.isChildSelected = exports.getSelectedNode = exports.filterKNodes = void 0;
var sgraph_1 = require("sprotty/lib/graph/sgraph");
var sprotty_1 = require("sprotty");
/**

@@ -30,3 +30,3 @@ * Filters the KNodes out of graphElements.

var elem = graphElements_1[_i];
if (elem instanceof sgraph_1.SNode) {
if (elem instanceof sprotty_1.SNode) {
nodes[nodes.length] = elem;

@@ -62,3 +62,3 @@ }

var node = nodes_2[_i];
if (node instanceof sgraph_1.SNode && node.selected) {
if (node instanceof sprotty_1.SNode && node.selected) {
return true;

@@ -65,0 +65,0 @@ }

@@ -1,2 +0,3 @@

import { VNode } from 'snabbdom/vnode';
/** @jsx svg */
import { VNode } from 'snabbdom';
import { Direction } from './constraint-classes';

@@ -3,0 +4,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderArrow = exports.renderLock = exports.renderCircle = exports.createVerticalLine = exports.createRect = void 0;
/*
* KIELER - Kiel Integrated Environment for Layout Eclipse RichClient
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2019, 2020 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*/
/** @jsx svg */
var snabbdom_jsx_1 = require("snabbdom-jsx"); // eslint-disable-line @typescript-eslint/no-unused-vars
var sprotty_1 = require("sprotty"); // eslint-disable-line @typescript-eslint/no-unused-vars
var constraint_classes_1 = require("./constraint-classes");

@@ -39,5 +22,5 @@ var svg_path_1 = require("./svg-path");

// @ts-ignore
return snabbdom_jsx_1.svg("g", null,
return sprotty_1.svg("g", null,
" ",
snabbdom_jsx_1.svg("rect", { x: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.UNDEFINED) ? begin : direction === constraint_classes_1.Direction.LEFT ? end : top, y: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.UNDEFINED || direction === constraint_classes_1.Direction.LEFT) ? top : direction === constraint_classes_1.Direction.UP ? end : begin, width: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.UNDEFINED || direction === constraint_classes_1.Direction.LEFT) ? Math.abs(begin - end) : bottom - top, height: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.UNDEFINED || direction === constraint_classes_1.Direction.LEFT) ? bottom - top : Math.abs(begin - end), fill: forbidden ? forbiddenColor : backgroundColor, stroke: forbidden ? forbiddenColor : 'grey', style: { 'stroke-dasharray': "4" } }));
sprotty_1.svg("rect", { x: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.UNDEFINED) ? begin : direction === constraint_classes_1.Direction.LEFT ? end : top, y: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.UNDEFINED || direction === constraint_classes_1.Direction.LEFT) ? top : direction === constraint_classes_1.Direction.UP ? end : begin, width: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.UNDEFINED || direction === constraint_classes_1.Direction.LEFT) ? Math.abs(begin - end) : bottom - top, height: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.UNDEFINED || direction === constraint_classes_1.Direction.LEFT) ? bottom - top : Math.abs(begin - end), fill: forbidden ? forbiddenColor : backgroundColor, stroke: forbidden ? forbiddenColor : 'grey', style: { 'stroke-dasharray': "4" } }));
}

@@ -54,5 +37,5 @@ exports.createRect = createRect;

// @ts-ignore
return snabbdom_jsx_1.svg("g", null,
return sprotty_1.svg("g", null,
" ",
snabbdom_jsx_1.svg("line", { x1: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.LEFT || direction === constraint_classes_1.Direction.UNDEFINED) ? mid : top, y1: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.LEFT || direction === constraint_classes_1.Direction.UNDEFINED) ? top : mid, x2: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.LEFT || direction === constraint_classes_1.Direction.UNDEFINED) ? mid : bot, y2: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.LEFT || direction === constraint_classes_1.Direction.UNDEFINED) ? bot : mid, fill: 'none', stroke: 'grey', style: { 'stroke-dasharray': 4 } }));
sprotty_1.svg("line", { x1: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.LEFT || direction === constraint_classes_1.Direction.UNDEFINED) ? mid : top, y1: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.LEFT || direction === constraint_classes_1.Direction.UNDEFINED) ? top : mid, x2: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.LEFT || direction === constraint_classes_1.Direction.UNDEFINED) ? mid : bot, y2: (direction === constraint_classes_1.Direction.RIGHT || direction === constraint_classes_1.Direction.LEFT || direction === constraint_classes_1.Direction.UNDEFINED) ? bot : mid, fill: 'none', stroke: 'grey', style: { 'stroke-dasharray': '4' } }));
}

@@ -71,5 +54,5 @@ exports.createVerticalLine = createVerticalLine;

// @ts-ignore
return snabbdom_jsx_1.svg("g", null,
return sprotty_1.svg("g", null,
" ",
snabbdom_jsx_1.svg("circle", { cx: x, cy: y, r: "2", stroke: color, fill: fill ? color : "none", style: { 'stroke-width': 0.5 } }));
sprotty_1.svg("circle", { cx: x, cy: y, r: "2", stroke: color, fill: fill ? color : "none", style: { 'stroke-width': '0.5' } }));
}

@@ -87,4 +70,4 @@ exports.renderCircle = renderCircle;

// @ts-ignore
return snabbdom_jsx_1.svg("g", { transform: s, fill: "grey", stroke: "none" },
snabbdom_jsx_1.svg("path", { d: svg_path_1.lockPath }));
return sprotty_1.svg("g", { transform: s, fill: "grey", stroke: "none" },
sprotty_1.svg("path", { d: svg_path_1.lockPath }));
}

@@ -104,9 +87,9 @@ exports.renderLock = renderLock;

// @ts-ignore
return snabbdom_jsx_1.svg("g", { transform: s, fill: "grey", stroke: "none" },
snabbdom_jsx_1.svg("path", { d: svg_path_1.arrowVertical }));
return sprotty_1.svg("g", { transform: s, fill: "grey", stroke: "none" },
sprotty_1.svg("path", { d: svg_path_1.arrowVertical }));
}
else {
// @ts-ignore
return snabbdom_jsx_1.svg("g", { transform: s, fill: "grey", stroke: "none" },
snabbdom_jsx_1.svg("path", { d: svg_path_1.arrowHorizontal }));
return sprotty_1.svg("g", { transform: s, fill: "grey", stroke: "none" },
sprotty_1.svg("path", { d: svg_path_1.arrowHorizontal }));
}

@@ -113,0 +96,0 @@ }

@@ -1,2 +0,3 @@

import { VNode } from "snabbdom/vnode";
/** @jsx svg */
import { VNode } from "snabbdom";
import { KNode } from './constraint-classes';

@@ -3,0 +4,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderConstraints = exports.renderInteractiveLayout = void 0;
/*
* KIELER - Kiel Integrated Environment for Layout Eclipse RichClient
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2019 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*/
/** @jsx svg */
var snabbdom_jsx_1 = require("snabbdom-jsx"); // eslint-disable-line @typescript-eslint/no-unused-vars
var sprotty_1 = require("sprotty"); // eslint-disable-line @typescript-eslint/no-unused-vars
var helper_methods_1 = require("./helper-methods");
var layered_interactive_view_1 = require("./layered/layered-interactive-view");
var rect_packing_interactive_view_1 = require("./rect-packing/rect-packing-interactive-view");
var util_1 = require("util");
/**

@@ -34,6 +16,6 @@ * Visualize the layers and available positions in the graph

var result = undefined;
if (util_1.isUndefined(root.properties.algorithm) || root.properties.algorithm.endsWith('layered')) {
if (root.properties['org.eclipse.elk.algorithm'] === undefined || root.properties['org.eclipse.elk.algorithm'].endsWith('layered')) {
result = layered_interactive_view_1.renderHierarchyLevel(nodes);
}
else if (root.properties.algorithm.endsWith('rectpacking')) {
else if (root.properties['org.eclipse.elk.algorithm'].endsWith('rectpacking')) {
result = rect_packing_interactive_view_1.renderHierarchyLevel(nodes);

@@ -45,3 +27,3 @@ }

// @ts-ignore
return snabbdom_jsx_1.svg("g", null, result);
return sprotty_1.svg("g", null, result);
}

@@ -54,9 +36,9 @@ exports.renderInteractiveLayout = renderInteractiveLayout;

function renderConstraints(node) {
var result = snabbdom_jsx_1.svg("g", null);
var algorithm = node.parent.properties.algorithm;
if (util_1.isUndefined(algorithm) || algorithm.endsWith('layered')) {
var result = sprotty_1.svg("g", null);
var algorithm = node.parent.properties['org.eclipse.elk.algorithm'];
if (algorithm === undefined || algorithm.endsWith('layered')) {
result = layered_interactive_view_1.renderLayeredConstraint(node);
}
else if (algorithm.endsWith('rectpacking')) {
if (node.properties.desiredPosition !== -1) {
if (node.properties['org.eclipse.elk.alg.rectpacking.desiredPosition'] !== -1) {
result = rect_packing_interactive_view_1.renderRectPackConstraint(node);

@@ -63,0 +45,0 @@ }

@@ -1,2 +0,3 @@

import { Action, MoveMouseListener, SModelElement } from 'sprotty';
import { MoveMouseListener, SModelElement } from 'sprotty';
import { Action } from "sprotty-protocol";
export declare class KlighdInteractiveMouseListener extends MoveMouseListener {

@@ -3,0 +4,0 @@ /**

@@ -7,3 +7,3 @@ "use strict";

*
* Copyright 2019, 2020 by
* Copyright 2019-2021 by
* + Kiel University

@@ -44,3 +44,2 @@ * + Department of Computer Science

var sprotty_1 = require("sprotty");
var util_1 = require("util");
var actions_1 = require("./actions");

@@ -102,9 +101,9 @@ var helper_methods_1 = require("./helper-methods");

if (targetNode && targetNode instanceof sprotty_1.SNode) {
if (targetNode.parent.properties.interactiveLayout) {
if (targetNode.parent.properties['org.eclipse.elk.interactiveLayout']) {
this.target = targetNode;
// Set layer bounds
this.nodes = helper_methods_1.filterKNodes(this.target.parent.children);
var algorithm = targetNode.parent.properties.algorithm;
var algorithm = targetNode.parent.properties['org.eclipse.elk.algorithm'];
// Set algorithm specific data
if (util_1.isUndefined(algorithm) || algorithm.endsWith('layered')) {
if (algorithm === undefined || algorithm.endsWith('layered')) {
this.data.set('layered', constraint_utils_1.getLayers(this.nodes, this.target.direction));

@@ -121,4 +120,4 @@ }

if (event.altKey) {
if (util_1.isUndefined(algorithm) || algorithm.endsWith('layered')) {
return [new actions_2.DeleteStaticConstraintAction({
if (algorithm === undefined || algorithm.endsWith('layered')) {
return [actions_2.DeleteStaticConstraintAction.create({
id: this.target.id

@@ -128,3 +127,3 @@ })];

else if (algorithm.endsWith('rectpacking')) {
return [new actions_3.RectPackDeletePositionConstraintAction({
return [actions_3.RectPackDeletePositionConstraintAction.create({
id: this.target.id

@@ -152,4 +151,4 @@ })];

var result = _super.prototype.mouseUp.call(this, this.target, event);
var algorithm = this.target.parent.properties.algorithm;
if (util_1.isUndefined(algorithm) || algorithm.endsWith('layered')) {
var algorithm = this.target.parent.properties['org.eclipse.elk.algorithm'];
if (algorithm === undefined || algorithm.endsWith('layered')) {
result = [constraint_utils_1.setProperty(this.nodes, this.data.get('layered'), this.target)].concat(_super.prototype.mouseUp.call(this, this.target, event));

@@ -172,3 +171,3 @@ }

else {
return result.concat([new actions_1.RefreshDiagramAction()]);
return result.concat([actions_1.RefreshDiagramAction.create()]);
}

@@ -178,3 +177,3 @@ }

this.target.selected = false;
var result = _super.prototype.mouseUp.call(this, this.target, event).concat([new actions_1.RefreshDiagramAction()]);
var result = _super.prototype.mouseUp.call(this, this.target, event).concat([actions_1.RefreshDiagramAction.create()]);
this.target = undefined;

@@ -181,0 +180,0 @@ return result;

@@ -1,2 +0,2 @@

import { Action } from 'sprotty/lib';
import { Action } from 'sprotty-protocol';
import { DeleteConstraint, LayerConstraint, PositionConstraint, StaticConstraint } from './constraint-types';

@@ -6,17 +6,21 @@ /**

*/
export declare class SetStaticConstraintAction implements Action {
readonly constraint: StaticConstraint;
static readonly KIND: string;
readonly kind: string;
constructor(constraint: StaticConstraint);
export interface SetStaticConstraintAction extends Action {
kind: typeof SetStaticConstraintAction.KIND;
constraint: StaticConstraint;
}
export declare namespace SetStaticConstraintAction {
const KIND = "setStaticConstraint";
function create(constraint: StaticConstraint): SetStaticConstraintAction;
}
/**
* Sent from client to server to delete position and layer constraint on a node.
*/
export declare class DeleteStaticConstraintAction implements Action {
readonly constraint: DeleteConstraint;
static readonly KIND: string;
readonly kind: string;
constructor(constraint: DeleteConstraint);
export interface DeleteStaticConstraintAction extends Action {
kind: typeof DeleteStaticConstraintAction.KIND;
constraint: DeleteConstraint;
}
export declare namespace DeleteStaticConstraintAction {
const KIND = "deleteStaticConstraint";
function create(constraint: DeleteConstraint): DeleteStaticConstraintAction;
}
/**

@@ -26,8 +30,10 @@ * Sent from client to server to delete position constraint on a node.

*/
export declare class DeletePositionConstraintAction implements Action {
readonly constraint: DeleteConstraint;
static readonly KIND: string;
readonly kind: string;
constructor(constraint: DeleteConstraint);
export interface DeletePositionConstraintAction extends Action {
kind: typeof DeletePositionConstraintAction.KIND;
constraint: DeleteConstraint;
}
export declare namespace DeletePositionConstraintAction {
const KIND = "deletePositionConstraint";
function create(constraint: DeleteConstraint): DeletePositionConstraintAction;
}
/**

@@ -37,25 +43,31 @@ * Sent from client to server to delete layer constraint on a node.

*/
export declare class DeleteLayerConstraintAction implements Action {
readonly constraint: DeleteConstraint;
static readonly KIND: string;
readonly kind: string;
constructor(constraint: DeleteConstraint);
export interface DeleteLayerConstraintAction extends Action {
kind: typeof DeleteLayerConstraintAction.KIND;
constraint: DeleteConstraint;
}
export declare namespace DeleteLayerConstraintAction {
const KIND = "deleteLayerConstraint";
function create(constraint: DeleteConstraint): DeleteLayerConstraintAction;
}
/**
* Sent from client to server to set a layer constraint on a node.
*/
export declare class SetLayerConstraintAction implements Action {
readonly constraint: LayerConstraint;
static readonly KIND: string;
readonly kind: string;
constructor(constraint: LayerConstraint);
export interface SetLayerConstraintAction extends Action {
kind: typeof SetLayerConstraintAction.KIND;
constraint: LayerConstraint;
}
export declare namespace SetLayerConstraintAction {
const KIND = "setLayerConstraint";
function create(constraint: LayerConstraint): SetLayerConstraintAction;
}
/**
* Sent from client to server to set a position constraint on a node.
*/
export declare class SetPositionConstraintAction implements Action {
readonly constraint: PositionConstraint;
static readonly KIND: string;
readonly kind: string;
constructor(constraint: PositionConstraint);
export interface SetPositionConstraintAction extends Action {
kind: typeof SetPositionConstraintAction.KIND;
constraint: PositionConstraint;
}
export declare namespace SetPositionConstraintAction {
const KIND = "setPositionConstraint";
function create(constraint: PositionConstraint): SetPositionConstraintAction;
}

@@ -7,3 +7,3 @@ "use strict";

*
* Copyright 2019 by
* Copyright 2019-2021 by
* + Kiel University

@@ -21,76 +21,68 @@ * + Department of Computer Science

exports.SetPositionConstraintAction = exports.SetLayerConstraintAction = exports.DeleteLayerConstraintAction = exports.DeletePositionConstraintAction = exports.DeleteStaticConstraintAction = exports.SetStaticConstraintAction = void 0;
/**
* Sent from client to server to set a position and layer constraint.
*/
var SetStaticConstraintAction = /** @class */ (function () {
function SetStaticConstraintAction(constraint) {
this.constraint = constraint;
this.kind = SetStaticConstraintAction.KIND;
}
var SetStaticConstraintAction;
(function (SetStaticConstraintAction) {
SetStaticConstraintAction.KIND = 'setStaticConstraint';
return SetStaticConstraintAction;
}());
exports.SetStaticConstraintAction = SetStaticConstraintAction;
/**
* Sent from client to server to delete position and layer constraint on a node.
*/
var DeleteStaticConstraintAction = /** @class */ (function () {
function DeleteStaticConstraintAction(constraint) {
this.constraint = constraint;
this.kind = DeleteStaticConstraintAction.KIND;
function create(constraint) {
return {
kind: SetStaticConstraintAction.KIND,
constraint: constraint,
};
}
SetStaticConstraintAction.create = create;
})(SetStaticConstraintAction = exports.SetStaticConstraintAction || (exports.SetStaticConstraintAction = {}));
var DeleteStaticConstraintAction;
(function (DeleteStaticConstraintAction) {
DeleteStaticConstraintAction.KIND = 'deleteStaticConstraint';
return DeleteStaticConstraintAction;
}());
exports.DeleteStaticConstraintAction = DeleteStaticConstraintAction;
/**
* Sent from client to server to delete position constraint on a node.
* Currently unused.
*/
var DeletePositionConstraintAction = /** @class */ (function () {
function DeletePositionConstraintAction(constraint) {
this.constraint = constraint;
this.kind = DeletePositionConstraintAction.KIND;
function create(constraint) {
return {
kind: DeleteStaticConstraintAction.KIND,
constraint: constraint,
};
}
DeleteStaticConstraintAction.create = create;
})(DeleteStaticConstraintAction = exports.DeleteStaticConstraintAction || (exports.DeleteStaticConstraintAction = {}));
var DeletePositionConstraintAction;
(function (DeletePositionConstraintAction) {
DeletePositionConstraintAction.KIND = 'deletePositionConstraint';
return DeletePositionConstraintAction;
}());
exports.DeletePositionConstraintAction = DeletePositionConstraintAction;
/**
* Sent from client to server to delete layer constraint on a node.
* Currently unused.
*/
var DeleteLayerConstraintAction = /** @class */ (function () {
function DeleteLayerConstraintAction(constraint) {
this.constraint = constraint;
this.kind = DeleteLayerConstraintAction.KIND;
function create(constraint) {
return {
kind: DeletePositionConstraintAction.KIND,
constraint: constraint,
};
}
DeletePositionConstraintAction.create = create;
})(DeletePositionConstraintAction = exports.DeletePositionConstraintAction || (exports.DeletePositionConstraintAction = {}));
var DeleteLayerConstraintAction;
(function (DeleteLayerConstraintAction) {
DeleteLayerConstraintAction.KIND = 'deleteLayerConstraint';
return DeleteLayerConstraintAction;
}());
exports.DeleteLayerConstraintAction = DeleteLayerConstraintAction;
/**
* Sent from client to server to set a layer constraint on a node.
*/
var SetLayerConstraintAction = /** @class */ (function () {
function SetLayerConstraintAction(constraint) {
this.constraint = constraint;
this.kind = SetLayerConstraintAction.KIND;
function create(constraint) {
return {
kind: DeleteLayerConstraintAction.KIND,
constraint: constraint,
};
}
DeleteLayerConstraintAction.create = create;
})(DeleteLayerConstraintAction = exports.DeleteLayerConstraintAction || (exports.DeleteLayerConstraintAction = {}));
var SetLayerConstraintAction;
(function (SetLayerConstraintAction) {
SetLayerConstraintAction.KIND = 'setLayerConstraint';
return SetLayerConstraintAction;
}());
exports.SetLayerConstraintAction = SetLayerConstraintAction;
/**
* Sent from client to server to set a position constraint on a node.
*/
var SetPositionConstraintAction = /** @class */ (function () {
function SetPositionConstraintAction(constraint) {
this.constraint = constraint;
this.kind = SetPositionConstraintAction.KIND;
function create(constraint) {
return {
kind: SetLayerConstraintAction.KIND,
constraint: constraint,
};
}
SetLayerConstraintAction.create = create;
})(SetLayerConstraintAction = exports.SetLayerConstraintAction || (exports.SetLayerConstraintAction = {}));
var SetPositionConstraintAction;
(function (SetPositionConstraintAction) {
SetPositionConstraintAction.KIND = 'setPositionConstraint';
return SetPositionConstraintAction;
}());
exports.SetPositionConstraintAction = SetPositionConstraintAction;
function create(constraint) {
return {
kind: SetPositionConstraintAction.KIND,
constraint: constraint,
};
}
SetPositionConstraintAction.create = create;
})(SetPositionConstraintAction = exports.SetPositionConstraintAction || (exports.SetPositionConstraintAction = {}));
//# sourceMappingURL=actions.js.map

@@ -1,2 +0,3 @@

import { Action, SModelElement } from 'sprotty';
import { SModelElement } from 'sprotty';
import { Action } from 'sprotty-protocol';
import { Direction, KNode } from '../constraint-classes';

@@ -3,0 +4,0 @@ import { Layer } from './constraint-types';

@@ -7,3 +7,3 @@ "use strict";

*
* Copyright 2019, 2020 by
* Copyright 2019-2021 by
* + Kiel University

@@ -69,3 +69,4 @@ * + Department of Computer Science

// Examine all nodes that have a layer Id left or equal to the layerCandidate and that have a layerCons > their layerId
var layerConstraintLeftOfCandidate = nodes.filter(function (n) { return n.properties.layerId <= layerCandidate && n.properties.layerConstraint > n.properties.layerId; });
var layerConstraintLeftOfCandidate = nodes.filter(function (n) { return n.properties['org.eclipse.elk.layered.layering.layerId'] <= layerCandidate
&& n.properties['org.eclipse.elk.layered.layering.layerChoiceConstraint'] > n.properties['org.eclipse.elk.layered.layering.layerId']; });
// In case that there are no such nodes return the layerCandidate

@@ -82,3 +83,3 @@ if (layerConstraintLeftOfCandidate.length === 0) {

var n = layerConstraintLeftOfCandidate_1[_i];
var layerConstraint = n.properties.layerConstraint;
var layerConstraint = n.properties['org.eclipse.elk.layered.layering.layerChoiceConstraint'];
if (layerConstraint > maxCons) {

@@ -90,3 +91,3 @@ nodeWithMaxCons = n;

if (nodeWithMaxCons !== null) {
var idDiff = layerCandidate - nodeWithMaxCons.properties.layerId;
var idDiff = layerCandidate - nodeWithMaxCons.properties['org.eclipse.elk.layered.layering.layerId'];
return maxCons + idDiff;

@@ -110,5 +111,5 @@ }

var upperNeighbor = layerNodes[upperIndex];
var posConsOfUpper = upperNeighbor.properties.positionConstraint;
var posConsOfUpper = upperNeighbor.properties['org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint'];
if (posConsOfUpper > upperIndex) {
if (alreadyInLayer && upperNeighbor.properties.positionId === localTargetIndex) {
if (alreadyInLayer && upperNeighbor.properties['org.eclipse.elk.layered.crossingMinimization.positionId'] === localTargetIndex) {
localTargetIndex = posConsOfUpper;

@@ -130,3 +131,3 @@ }

// All nodes within one hierarchy level have the same direction
nodes.sort(function (a, b) { return a.properties.layerId - b.properties.layerId; });
nodes.sort(function (a, b) { return a.properties['org.eclipse.elk.layered.layering.layerId'] - b.properties['org.eclipse.elk.layered.layering.layerId']; });
var layers = [];

@@ -143,3 +144,3 @@ var layer = 0;

var node = nodes[i];
if (node.properties.layerId !== layer) {
if (node.properties['org.eclipse.elk.layered.layering.layerId'] !== layer) {
// node is in the next layer

@@ -277,3 +278,3 @@ layers[layer] = new constraint_types_1.Layer(beginCoordinate, endCoordinate, beginCoordinate + (endCoordinate - beginCoordinate) / 2, direction);

var node = nodes_1[_i];
if (node.properties.layerId === layer) {
if (node.properties['org.eclipse.elk.layered.layering.layerId'] === layer) {
nodesOfLayer[nodesOfLayer.length] = node;

@@ -329,3 +330,5 @@ }

var node_1 = connectedNodes_1[_b];
if (node_1.properties.layerId === layer && node_1.properties.layerConstraint !== -1) {
if (node_1.properties['org.eclipse.elk.layered.layering.layerId'] === layer
&& node_1.properties['org.eclipse.elk.layered.layering.layerChoiceConstraint'] !== -1
&& node_1.properties['org.eclipse.elk.layered.layering.layerChoiceConstraint'] !== undefined) {
// layer is forbidden for the given node

@@ -372,9 +375,9 @@ return true;

// If layer is forbidden just refresh
return new actions_1.RefreshDiagramAction();
return actions_1.RefreshDiagramAction.create();
}
else if (targetNode.properties.layerId !== layerOfTarget) {
else if (targetNode.properties['org.eclipse.elk.layered.layering.layerId'] !== layerOfTarget) {
// layer constraint should only be set if the layer index changed
if (shouldOnlyLCBeSet(targetNode, layers, direction)) {
// only the layer constraint should be set
return new actions_2.SetLayerConstraintAction({
return actions_2.SetLayerConstraintAction.create({
id: targetNode.id,

@@ -387,3 +390,3 @@ layer: layerOfTarget,

// If layer and position constraint should be set - send them both in one StaticConstraint
return new actions_2.SetStaticConstraintAction({
return actions_2.SetStaticConstraintAction.create({
id: targetNode.id,

@@ -399,5 +402,5 @@ layer: layerOfTarget,

// position constraint should only be set if the position of the node changed
if (targetNode.properties.positionId !== positionOfTarget) {
if (targetNode.properties['org.eclipse.elk.layered.crossingMinimization.positionId'] !== positionOfTarget) {
// set the position Constraint
return new actions_2.SetPositionConstraintAction({
return actions_2.SetPositionConstraintAction.create({
id: targetNode.id,

@@ -410,5 +413,5 @@ position: positionOfTarget,

// If the node was moved without setting a constraint - let it snap back
return new actions_1.RefreshDiagramAction();
return actions_1.RefreshDiagramAction.create();
}
exports.setProperty = setProperty;
//# sourceMappingURL=constraint-utils.js.map

@@ -1,2 +0,3 @@

import { VNode } from "snabbdom/vnode";
/** @jsx svg */
import { VNode } from "snabbdom";
import { Direction, KNode } from '../constraint-classes';

@@ -3,0 +4,0 @@ import { Layer } from './constraint-types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderLayeredConstraint = exports.renderPositions = exports.renderHierarchyLevel = void 0;
/*
* KIELER - Kiel Integrated Environment for Layout Eclipse RichClient
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2019, 2020 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*/
/** @jsx svg */
var snabbdom_jsx_1 = require("snabbdom-jsx"); // eslint-disable-line @typescript-eslint/no-unused-vars
var sprotty_1 = require("sprotty"); // eslint-disable-line @typescript-eslint/no-unused-vars
var constraint_classes_1 = require("../constraint-classes");

@@ -44,9 +27,9 @@ var helper_methods_1 = require("../helper-methods");

// determines whether only the layer constraint will be set when the node is released
var onlyLC = constraint_utils_1.shouldOnlyLCBeSet(selNode, layers, direction) && selNode.properties.layerId !== currentLayer;
var onlyLC = constraint_utils_1.shouldOnlyLCBeSet(selNode, layers, direction) && selNode.properties['org.eclipse.elk.layered.layering.layerId'] !== currentLayer;
// create layers
var result = snabbdom_jsx_1.svg("g", null);
var result = sprotty_1.svg("g", null);
for (var i = 0; i < layers.length; i++) {
var layer = layers[i];
if (i === currentLayer) {
result = snabbdom_jsx_1.svg("g", null,
result = sprotty_1.svg("g", null,
result,

@@ -57,3 +40,3 @@ interactive_view_objects_1.createRect(layer.begin, layer.end, topBorder, bottomBorder, forbidden, onlyLC, direction));

if (!constraint_utils_1.isLayerForbidden(selNode, i)) {
result = snabbdom_jsx_1.svg("g", null,
result = sprotty_1.svg("g", null,
result,

@@ -71,3 +54,3 @@ interactive_view_objects_1.createVerticalLine(layer.mid, topBorder, bottomBorder, direction));

if (currentLayer === layers.length) {
result = snabbdom_jsx_1.svg("g", null,
result = sprotty_1.svg("g", null,
result,

@@ -77,3 +60,3 @@ interactive_view_objects_1.createRect(lastLayer.end, lastLayer.end + (lastLayer.end - lastLayer.begin), topBorder, bottomBorder, forbidden, onlyLC, direction));

else {
result = snabbdom_jsx_1.svg("g", null,
result = sprotty_1.svg("g", null,
result,

@@ -86,3 +69,3 @@ interactive_view_objects_1.createVerticalLine(lastLayer.mid + (lastLayer.end - lastLayer.begin), topBorder, bottomBorder, direction));

// @ts-ignore
return snabbdom_jsx_1.svg("g", null,
return sprotty_1.svg("g", null,
result,

@@ -98,3 +81,3 @@ renderPositions(currentLayer, nodes, layers, forbidden, direction));

// @ts-ignore
return snabbdom_jsx_1.svg("g", null);
return sprotty_1.svg("g", null);
}

@@ -122,5 +105,5 @@ exports.renderHierarchyLevel = renderHierarchyLevel;

var curPos = constraint_utils_1.getPositionInLayer(layerNodes, target);
layerNodes.sort(function (a, b) { return a.properties.positionId - b.properties.positionId; });
layerNodes.sort(function (a, b) { return a.properties['org.eclipse.elk.layered.crossingMinimization.positionId'] - b.properties['org.eclipse.elk.layered.crossingMinimization.positionId']; });
if (layerNodes.length > 0) {
var result = snabbdom_jsx_1.svg("g", null);
var result = sprotty_1.svg("g", null);
// mid of the current layer

@@ -166,3 +149,3 @@ var shift = 1;

}
result = snabbdom_jsx_1.svg("g", null,
result = sprotty_1.svg("g", null,
result,

@@ -201,3 +184,3 @@ interactive_view_objects_1.renderCircle(curPos === i + shift, x, y, forbidden));

}
result = snabbdom_jsx_1.svg("g", null,
result = sprotty_1.svg("g", null,
result,

@@ -232,3 +215,3 @@ interactive_view_objects_1.renderCircle(curPos === 0, x, y, forbidden));

}
result = snabbdom_jsx_1.svg("g", null,
result = sprotty_1.svg("g", null,
result,

@@ -272,3 +255,3 @@ interactive_view_objects_1.renderCircle(curPos === layerNodes.length - 1 + shift, x, y, forbidden));

// @ts-ignore
return snabbdom_jsx_1.svg("g", null, interactive_view_objects_1.renderCircle(true, x, y, forbidden));
return sprotty_1.svg("g", null, interactive_view_objects_1.renderCircle(true, x, y, forbidden));
}

@@ -282,19 +265,19 @@ }

function renderLayeredConstraint(node) {
var result = snabbdom_jsx_1.svg("g", null);
var result = sprotty_1.svg("g", null);
var x = node.size.width;
var y = 0;
var constraintOffset = 2;
var positionConstraint = node.properties.positionConstraint;
var layerConstraint = node.properties.layerConstraint;
if (layerConstraint !== -1 && positionConstraint !== -1) {
var positionConstraint = node.properties['org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint'];
var layerConstraint = node.properties['org.eclipse.elk.layered.layering.layerChoiceConstraint'];
if (layerConstraint !== -1 && positionConstraint !== -1 && layerConstraint !== undefined && positionConstraint !== undefined) {
// layer and position Constraint are set
result = snabbdom_jsx_1.svg("g", null, interactive_view_objects_1.renderLock(x, y));
result = sprotty_1.svg("g", null, interactive_view_objects_1.renderLock(x, y));
}
else if (layerConstraint !== -1) {
else if (layerConstraint !== -1 && layerConstraint !== undefined) {
// only layer Constraint is set
result = snabbdom_jsx_1.svg("g", null, renderLayerConstraint(x + constraintOffset, y - constraintOffset, node.direction));
result = sprotty_1.svg("g", null, renderLayerConstraint(x + constraintOffset, y - constraintOffset, node.direction));
}
else if (positionConstraint !== -1) {
else if (positionConstraint !== -1 && positionConstraint !== undefined) {
// only position Constraint is set
result = snabbdom_jsx_1.svg("g", null, renderPositionConstraint(x + constraintOffset, y - constraintOffset, node.direction));
result = sprotty_1.svg("g", null, renderPositionConstraint(x + constraintOffset, y - constraintOffset, node.direction));
}

@@ -319,3 +302,3 @@ // @ts-ignore

// @ts-ignore
return snabbdom_jsx_1.svg("g", null,
return sprotty_1.svg("g", null,
" ",

@@ -335,3 +318,3 @@ interactive_view_objects_1.renderLock(x, y),

// @ts-ignore
return snabbdom_jsx_1.svg("g", null,
return sprotty_1.svg("g", null,
" ",

@@ -338,0 +321,0 @@ interactive_view_objects_1.renderLock(x, y),

@@ -1,2 +0,2 @@

import { Action } from 'sprotty/lib';
import { Action } from 'sprotty-protocol';
import { AspectRatio, RectPackDeletePositionConstraint, RectPackSetPositionConstraint } from './constraint-types';

@@ -6,25 +6,31 @@ /**

*/
export declare class SetAspectRatioAction implements Action {
readonly constraint: AspectRatio;
static readonly KIND: string;
readonly kind: string;
constructor(constraint: AspectRatio);
export interface SetAspectRatioAction extends Action {
kind: typeof SetAspectRatioAction.KIND;
constraint: AspectRatio;
}
export declare namespace SetAspectRatioAction {
const KIND = "setAspectRatio";
function create(constraint: AspectRatio): SetAspectRatioAction;
}
/**
* Send from client to server to delete an position constraint on a node.
*/
export declare class RectPackDeletePositionConstraintAction implements Action {
readonly constraint: RectPackDeletePositionConstraint;
static readonly KIND: string;
readonly kind: string;
constructor(constraint: RectPackDeletePositionConstraint);
export interface RectPackDeletePositionConstraintAction extends Action {
kind: typeof RectPackDeletePositionConstraintAction.KIND;
constraint: RectPackDeletePositionConstraint;
}
export declare namespace RectPackDeletePositionConstraintAction {
const KIND = "rectPackDeletePositionConstraint";
function create(constraint: RectPackDeletePositionConstraint): RectPackDeletePositionConstraintAction;
}
/**
* Send from client to server to set a position to force a node on a specific position.
*/
export declare class RectPackSetPositionConstraintAction implements Action {
readonly constraint: RectPackSetPositionConstraint;
static readonly KIND: string;
readonly kind: string;
constructor(constraint: RectPackSetPositionConstraint);
export interface RectPackSetPositionConstraintAction extends Action {
kind: typeof RectPackSetPositionConstraintAction.KIND;
constraint: RectPackSetPositionConstraint;
}
export declare namespace RectPackSetPositionConstraintAction {
const KIND = "rectPackSetPositionConstraint";
function create(constraint: RectPackSetPositionConstraint): RectPackSetPositionConstraintAction;
}

@@ -7,3 +7,3 @@ "use strict";

*
* Copyright 2020 by
* Copyright 2020-2021 by
* + Kiel University

@@ -21,38 +21,35 @@ * + Department of Computer Science

exports.RectPackSetPositionConstraintAction = exports.RectPackDeletePositionConstraintAction = exports.SetAspectRatioAction = void 0;
/**
* Send from client to server to set the aspect ratio.
*/
var SetAspectRatioAction = /** @class */ (function () {
function SetAspectRatioAction(constraint) {
this.constraint = constraint;
this.kind = SetAspectRatioAction.KIND;
}
var SetAspectRatioAction;
(function (SetAspectRatioAction) {
SetAspectRatioAction.KIND = 'setAspectRatio';
return SetAspectRatioAction;
}());
exports.SetAspectRatioAction = SetAspectRatioAction;
/**
* Send from client to server to delete an position constraint on a node.
*/
var RectPackDeletePositionConstraintAction = /** @class */ (function () {
function RectPackDeletePositionConstraintAction(constraint) {
this.constraint = constraint;
this.kind = RectPackDeletePositionConstraintAction.KIND;
function create(constraint) {
return {
kind: SetAspectRatioAction.KIND,
constraint: constraint,
};
}
SetAspectRatioAction.create = create;
})(SetAspectRatioAction = exports.SetAspectRatioAction || (exports.SetAspectRatioAction = {}));
var RectPackDeletePositionConstraintAction;
(function (RectPackDeletePositionConstraintAction) {
RectPackDeletePositionConstraintAction.KIND = 'rectPackDeletePositionConstraint';
return RectPackDeletePositionConstraintAction;
}());
exports.RectPackDeletePositionConstraintAction = RectPackDeletePositionConstraintAction;
/**
* Send from client to server to set a position to force a node on a specific position.
*/
var RectPackSetPositionConstraintAction = /** @class */ (function () {
function RectPackSetPositionConstraintAction(constraint) {
this.constraint = constraint;
this.kind = RectPackSetPositionConstraintAction.KIND;
function create(constraint) {
return {
kind: RectPackDeletePositionConstraintAction.KIND,
constraint: constraint,
};
}
RectPackDeletePositionConstraintAction.create = create;
})(RectPackDeletePositionConstraintAction = exports.RectPackDeletePositionConstraintAction || (exports.RectPackDeletePositionConstraintAction = {}));
var RectPackSetPositionConstraintAction;
(function (RectPackSetPositionConstraintAction) {
RectPackSetPositionConstraintAction.KIND = 'rectPackSetPositionConstraint';
return RectPackSetPositionConstraintAction;
}());
exports.RectPackSetPositionConstraintAction = RectPackSetPositionConstraintAction;
function create(constraint) {
return {
kind: RectPackSetPositionConstraintAction.KIND,
constraint: constraint,
};
}
RectPackSetPositionConstraintAction.create = create;
})(RectPackSetPositionConstraintAction = exports.RectPackSetPositionConstraintAction || (exports.RectPackSetPositionConstraintAction = {}));
//# sourceMappingURL=actions.js.map

@@ -1,3 +0,2 @@

import { SetAspectRatioAction } from './actions';
import { RefreshDiagramAction } from '../actions';
import { Action } from 'sprotty-protocol';
import { KNode } from '../constraint-classes';

@@ -11,2 +10,2 @@ /**

*/
export declare function setGenerateRectPackAction(nodes: KNode[], target: KNode, parent: KNode | undefined, event: MouseEvent): SetAspectRatioAction | RefreshDiagramAction;
export declare function setGenerateRectPackAction(nodes: KNode[], target: KNode, parent: KNode | undefined, event: MouseEvent): Action;

@@ -7,3 +7,3 @@ "use strict";

*
* Copyright 2020 by
* Copyright 2020-2021 by
* + Kiel University

@@ -22,2 +22,3 @@ * + Department of Computer Science

var sprotty_1 = require("sprotty");
var sprotty_protocol_1 = require("sprotty-protocol");
var actions_1 = require("./actions");

@@ -34,3 +35,3 @@ var actions_2 = require("../actions");

// If node is not put to a valid position the diagram will be refreshed.
var result = new actions_2.RefreshDiagramAction();
var result = actions_2.RefreshDiagramAction.create();
// If the node is moved on top of another node it takes its place.

@@ -41,3 +42,3 @@ nodes.forEach(function (node) {

var canvasBounds = target.root.canvasBounds;
var boundsInWindow = sprotty_1.translate(targetBounds, canvasBounds);
var boundsInWindow = sprotty_protocol_1.Bounds.translate(targetBounds, canvasBounds);
var lowX = boundsInWindow.x;

@@ -49,12 +50,14 @@ var lowY = boundsInWindow.y;

&& event.pageY > lowY && event.pageY < highY) {
var actualPosition = node.properties.currentPosition;
if (node.properties.desiredPosition !== -1) {
actualPosition = node.properties.desiredPosition;
var actualPosition = node.properties['org.eclipse.elk.rectPacking.currentPosition'];
if (node.properties['org.eclipse.elk.alg.rectpacking.desiredPosition'] !== -1) {
actualPosition = node.properties['org.eclipse.elk.alg.rectpacking.desiredPosition'];
}
var actualTargetPosition = target.properties.currentPosition;
if (node.properties.desiredPosition !== -1) {
actualTargetPosition = target.properties.desiredPosition;
var actualTargetPosition = target.properties['org.eclipse.elk.rectPacking.currentPosition'];
if (node.properties['org.eclipse.elk.alg.rectpacking.desiredPosition'] !== -1) {
actualTargetPosition = target.properties['org.eclipse.elk.alg.rectpacking.desiredPosition'];
}
if (actualPosition !== actualTargetPosition && actualPosition !== -1) {
result = new actions_1.RectPackSetPositionConstraintAction({ id: target.id, order: actualPosition });
result = actions_1.RectPackSetPositionConstraintAction.create({
id: target.id, order: actualPosition
});
}

@@ -64,3 +67,3 @@ }

});
if (result instanceof actions_2.RefreshDiagramAction) {
if (result.kind === actions_2.RefreshDiagramAction.KIND) {
// Case node should not be swapped.

@@ -88,4 +91,4 @@ // Calculate aspect ratio.

// If changed update aspect ratio.
if (parent && parent.properties.aspectRatio !== aspectRatio) {
return new actions_1.SetAspectRatioAction({
if (parent && parent.properties['org.eclipse.elk.rectPacking.aspectRatio'] !== aspectRatio) {
return actions_1.SetAspectRatioAction.create({
id: parent.id,

@@ -92,0 +95,0 @@ aspectRatio: aspectRatio

@@ -1,2 +0,3 @@

import { VNode } from "snabbdom/vnode";
/** @jsx svg */
import { VNode } from "snabbdom";
import { KNode } from '../constraint-classes';

@@ -3,0 +4,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderRectPackConstraint = exports.renderHierarchyLevel = void 0;
/*
* KIELER - Kiel Integrated Environment for Layout Eclipse RichClient
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2020 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*/
/** @jsx svg */
var snabbdom_jsx_1 = require("snabbdom-jsx"); // eslint-disable-line @typescript-eslint/no-unused-vars
var sprotty_1 = require("sprotty"); // eslint-disable-line @typescript-eslint/no-unused-vars
var interactive_view_objects_1 = require("../interactive-view-objects");

@@ -52,4 +35,4 @@ var boundingBoxMargin = 5;

});
return snabbdom_jsx_1.svg("g", null,
snabbdom_jsx_1.svg("rect", { x: x - boundingBoxMargin, y: y - boundingBoxMargin, width: maxX - x + 2 * boundingBoxMargin, height: maxY - y + 2 * boundingBoxMargin, stroke: color, fill: 'rgba(0,0,0,0)', strokeWidth: 2 * boundingBoxMargin, style: { 'stroke-dasharray': 4 } }));
return sprotty_1.svg("g", null,
sprotty_1.svg("rect", { x: x - boundingBoxMargin, y: y - boundingBoxMargin, width: maxX - x + 2 * boundingBoxMargin, height: maxY - y + 2 * boundingBoxMargin, stroke: color, fill: 'rgba(0,0,0,0)', strokeWidth: 2 * boundingBoxMargin, style: { 'stroke-dasharray': '4' } }));
}

@@ -62,5 +45,5 @@ exports.renderHierarchyLevel = renderHierarchyLevel;

function renderRectPackConstraint(node) {
return snabbdom_jsx_1.svg("g", null, interactive_view_objects_1.renderLock(node.size.width - lockOffset, lockOffset));
return sprotty_1.svg("g", null, interactive_view_objects_1.renderLock(node.size.width - lockOffset, lockOffset));
}
exports.renderRectPackConstraint = renderRectPackConstraint;
//# sourceMappingURL=rect-packing-interactive-view.js.map
{
"name": "@kieler/klighd-interactive",
"version": "0.3.0-next.f2c1105",
"version": "0.3.0-next.ff4a31b",
"description": "A module for klighd-core to interactively apply constraints to the diagram",

@@ -24,3 +24,3 @@ "author": "Kiel University <rt-kieler-devel@informatik.uni-kiel.de>",

"dependencies": {
"sprotty": "0.9.0"
"sprotty": "0.11.1"
},

@@ -27,0 +27,0 @@ "devDependencies": {

@@ -6,3 +6,3 @@ /*

*
* Copyright 2020 by
* Copyright 2020-2021 by
* + Kiel University

@@ -19,3 +19,3 @@ * + Department of Computer Science

import { Action } from 'sprotty/lib/base/actions/action';
import { Action } from 'sprotty-protocol';
import { DeleteConstraint } from './layered/constraint-types';

@@ -26,16 +26,33 @@

*/
export class RefreshDiagramAction implements Action {
static readonly KIND: string = 'refreshDiagram'
readonly kind = RefreshDiagramAction.KIND
export interface RefreshDiagramAction extends Action {
kind: typeof RefreshDiagramAction.KIND
}
export namespace RefreshDiagramAction {
export const KIND = 'refreshDiagram'
export function create(): RefreshDiagramAction {
return {
kind: KIND,
}
}
}
/**
* A sprotty action to delete a constraint on a specific node.
*/
export class DeleteConstraintAction implements Action {
static readonly KIND: string = 'deleteStaticConstraint'
readonly kind = DeleteConstraintAction.KIND
export interface DeleteConstraintAction extends Action {
kind: typeof DeleteConstraintAction.KIND
constraint: DeleteConstraint
}
constructor(public readonly constraint: DeleteConstraint) {
export namespace DeleteConstraintAction {
export const KIND = 'deleteStaticConstraint'
export function create(constraint: DeleteConstraint): DeleteConstraintAction {
return {
kind: KIND,
constraint,
}
}
}

@@ -6,3 +6,3 @@ /*

*
* Copyright 2019, 2020 by
* Copyright 2019-2021 by
* + Kiel University

@@ -19,3 +19,4 @@ * + Department of Computer Science

import { moveFeature, Point, RectangularNode, SEdge, selectFeature, SParentElement } from 'sprotty/lib';
import { moveFeature, RectangularNode, SEdge, selectFeature, SParentElement } from 'sprotty';
import { Point } from 'sprotty-protocol';

@@ -56,6 +57,6 @@ /**

hasFeature(feature: symbol): boolean {
return feature === selectFeature || (feature === moveFeature && (this.parent as KNode).properties.interactiveLayout)
return feature === selectFeature || (feature === moveFeature && (this.parent as KNode).properties['org.eclipse.elk.interactiveLayout'] as boolean)
}
properties: NodeProperties
properties: Record<string, unknown>

@@ -78,19 +79,2 @@ direction: Direction

/**
* Properties needed for client side layout or visualization.
* Send together with the nodes from server to client.
* They correspond to properties on the server.
*/
export class NodeProperties {
algorithm: string
aspectRatio: number
currentPosition: number
desiredPosition: number
interactiveLayout: boolean
layerConstraint: number
layerId: number
positionConstraint: number
positionId: number
}
/**
* This class can be extended to hold arbitrary additional data for

@@ -97,0 +81,0 @@ * graph elements, such as layout or rendering information.

@@ -18,3 +18,3 @@ /*

import { SNode } from "sprotty/lib/graph/sgraph"
import { SNode } from "sprotty"
import { KNode } from "./constraint-classes"

@@ -21,0 +21,0 @@

@@ -6,3 +6,3 @@ /*

*
* Copyright 2019, 2020 by
* Copyright 2019-2021 by
* + Kiel University

@@ -20,4 +20,4 @@ * + Department of Computer Science

import { injectable } from 'inversify';
import { Action, MoveMouseListener, SEdge, SLabel, SModelElement, SNode } from 'sprotty';
import { isUndefined } from 'util';
import { MoveMouseListener, SEdge, SLabel, SModelElement, SNode } from 'sprotty';
import { Action } from "sprotty-protocol"
import { RefreshDiagramAction } from './actions';

@@ -86,3 +86,3 @@ import { KNode } from './constraint-classes';

if (targetNode && targetNode instanceof SNode) {
if (((targetNode as KNode).parent as KNode).properties.interactiveLayout) {
if (((targetNode as KNode).parent as KNode).properties['org.eclipse.elk.interactiveLayout']) {
this.target = targetNode as KNode

@@ -92,5 +92,5 @@ // Set layer bounds

const algorithm = ((targetNode as KNode).parent as KNode).properties.algorithm
const algorithm = ((targetNode as KNode).parent as KNode).properties['org.eclipse.elk.algorithm'] as string
// Set algorithm specific data
if (isUndefined(algorithm) || algorithm.endsWith('layered')) {
if (algorithm === undefined || algorithm.endsWith('layered')) {
this.data.set('layered', getLayers(this.nodes, this.target.direction))

@@ -107,8 +107,8 @@ } else if (algorithm.endsWith('rectpacking')) {

if (event.altKey) {
if (isUndefined(algorithm) || algorithm.endsWith('layered')) {
return [new DeleteStaticConstraintAction({
if (algorithm === undefined || algorithm.endsWith('layered')) {
return [DeleteStaticConstraintAction.create({
id: this.target.id
})]
} else if (algorithm.endsWith('rectpacking')) {
return [new RectPackDeletePositionConstraintAction({
return [RectPackDeletePositionConstraintAction.create({
id: this.target.id

@@ -138,4 +138,4 @@ })]

let result = super.mouseUp(this.target, event)
const algorithm = (this.target.parent as KNode).properties.algorithm
if (isUndefined(algorithm) || algorithm.endsWith('layered')) {
const algorithm = (this.target.parent as KNode).properties['org.eclipse.elk.algorithm'] as string
if (algorithm === undefined || algorithm.endsWith('layered')) {
result = [setProperty(this.nodes, this.data.get('layered'), this.target)].concat(super.mouseUp(this.target, event));

@@ -156,7 +156,7 @@ } else if (algorithm.endsWith('rectpacking')) {

} else {
return result.concat([new RefreshDiagramAction()])
return result.concat([RefreshDiagramAction.create()])
}
} else if (this.target) {
this.target.selected = false
const result = super.mouseUp(this.target, event).concat([new RefreshDiagramAction()]);
const result = super.mouseUp(this.target, event).concat([RefreshDiagramAction.create()]);
this.target = undefined

@@ -163,0 +163,0 @@ return result

@@ -6,3 +6,3 @@ /*

*
* Copyright 2019 by
* Copyright 2019-2021 by
* + Kiel University

@@ -19,3 +19,3 @@ * + Department of Computer Science

import { Action } from 'sprotty/lib';
import { Action } from 'sprotty-protocol';
import { DeleteConstraint, LayerConstraint, PositionConstraint, StaticConstraint } from './constraint-types';

@@ -26,7 +26,15 @@

*/
export class SetStaticConstraintAction implements Action {
static readonly KIND: string = 'setStaticConstraint'
readonly kind = SetStaticConstraintAction.KIND
export interface SetStaticConstraintAction extends Action {
kind: typeof SetStaticConstraintAction.KIND
constraint: StaticConstraint
}
constructor(public readonly constraint: StaticConstraint) {
export namespace SetStaticConstraintAction {
export const KIND = 'setStaticConstraint'
export function create(constraint: StaticConstraint): SetStaticConstraintAction {
return {
kind: KIND,
constraint,
}
}

@@ -38,7 +46,15 @@ }

*/
export class DeleteStaticConstraintAction implements Action {
static readonly KIND: string = 'deleteStaticConstraint'
readonly kind = DeleteStaticConstraintAction.KIND
export interface DeleteStaticConstraintAction extends Action {
kind: typeof DeleteStaticConstraintAction.KIND
constraint: DeleteConstraint
}
constructor(public readonly constraint: DeleteConstraint) {
export namespace DeleteStaticConstraintAction {
export const KIND = 'deleteStaticConstraint'
export function create(constraint: DeleteConstraint): DeleteStaticConstraintAction {
return {
kind: KIND,
constraint,
}
}

@@ -51,7 +67,15 @@ }

*/
export class DeletePositionConstraintAction implements Action {
static readonly KIND: string = 'deletePositionConstraint'
readonly kind = DeletePositionConstraintAction.KIND
export interface DeletePositionConstraintAction extends Action {
kind: typeof DeletePositionConstraintAction.KIND
constraint: DeleteConstraint
}
constructor(public readonly constraint: DeleteConstraint) {
export namespace DeletePositionConstraintAction {
export const KIND = 'deletePositionConstraint'
export function create(constraint: DeleteConstraint): DeletePositionConstraintAction {
return {
kind: KIND,
constraint,
}
}

@@ -64,7 +88,15 @@ }

*/
export class DeleteLayerConstraintAction implements Action {
static readonly KIND: string = 'deleteLayerConstraint'
readonly kind = DeleteLayerConstraintAction.KIND
export interface DeleteLayerConstraintAction extends Action {
kind: typeof DeleteLayerConstraintAction.KIND
constraint: DeleteConstraint
}
constructor(public readonly constraint: DeleteConstraint) {
export namespace DeleteLayerConstraintAction {
export const KIND = 'deleteLayerConstraint'
export function create(constraint: DeleteConstraint): DeleteLayerConstraintAction {
return {
kind: KIND,
constraint,
}
}

@@ -76,7 +108,15 @@ }

*/
export class SetLayerConstraintAction implements Action {
static readonly KIND: string = 'setLayerConstraint'
readonly kind = SetLayerConstraintAction.KIND
export interface SetLayerConstraintAction extends Action {
kind: typeof SetLayerConstraintAction.KIND
constraint: LayerConstraint
}
constructor(public readonly constraint: LayerConstraint) {
export namespace SetLayerConstraintAction {
export const KIND = 'setLayerConstraint'
export function create(constraint: LayerConstraint): SetLayerConstraintAction {
return {
kind: KIND,
constraint,
}
}

@@ -88,8 +128,16 @@ }

*/
export class SetPositionConstraintAction implements Action {
static readonly KIND: string = 'setPositionConstraint'
readonly kind = SetPositionConstraintAction.KIND
export interface SetPositionConstraintAction extends Action {
kind: typeof SetPositionConstraintAction.KIND
constraint: PositionConstraint
}
constructor(public readonly constraint: PositionConstraint) {
export namespace SetPositionConstraintAction {
export const KIND = 'setPositionConstraint'
export function create(constraint: PositionConstraint): SetPositionConstraintAction {
return {
kind: KIND,
constraint,
}
}
}

@@ -6,3 +6,3 @@ /*

*
* Copyright 2019, 2020 by
* Copyright 2019-2021 by
* + Kiel University

@@ -19,3 +19,4 @@ * + Department of Computer Science

import { Action, SModelElement } from 'sprotty';
import { SModelElement } from 'sprotty';
import { Action } from 'sprotty-protocol';
import { RefreshDiagramAction } from '../actions';

@@ -50,3 +51,3 @@ import { Direction, KEdge, KNode } from '../constraint-classes';

(direction === Direction.UNDEFINED || direction === Direction.RIGHT || direction === Direction.DOWN) ||
coordinateInLayoutDirection > layer.end && (direction === Direction.LEFT || direction === Direction.UP)) {
coordinateInLayoutDirection > layer.end && (direction === Direction.LEFT || direction === Direction.UP)) {
return i

@@ -76,3 +77,4 @@ }

// Examine all nodes that have a layer Id left or equal to the layerCandidate and that have a layerCons > their layerId
const layerConstraintLeftOfCandidate = nodes.filter(n => n.properties.layerId <= layerCandidate && n.properties.layerConstraint > n.properties.layerId)
const layerConstraintLeftOfCandidate = nodes.filter(n => n.properties['org.eclipse.elk.layered.layering.layerId'] as number <= layerCandidate
&& (n.properties['org.eclipse.elk.layered.layering.layerChoiceConstraint'] as number) > (n.properties['org.eclipse.elk.layered.layering.layerId'] as number))

@@ -90,3 +92,3 @@ // In case that there are no such nodes return the layerCandidate

for (const n of layerConstraintLeftOfCandidate) {
const layerConstraint = n.properties.layerConstraint
const layerConstraint = n.properties['org.eclipse.elk.layered.layering.layerChoiceConstraint'] as number
if (layerConstraint > maxCons) {

@@ -99,3 +101,3 @@ nodeWithMaxCons = n

if (nodeWithMaxCons !== null) {
const idDiff = layerCandidate - nodeWithMaxCons.properties.layerId
const idDiff = layerCandidate - (nodeWithMaxCons.properties['org.eclipse.elk.layered.layering.layerId'] as number)
return maxCons + idDiff

@@ -120,5 +122,5 @@ }

const upperNeighbor = layerNodes[upperIndex]
const posConsOfUpper = upperNeighbor.properties.positionConstraint
const posConsOfUpper = upperNeighbor.properties['org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint'] as number
if (posConsOfUpper > upperIndex) {
if (alreadyInLayer && upperNeighbor.properties.positionId === localTargetIndex) {
if (alreadyInLayer && upperNeighbor.properties['org.eclipse.elk.layered.crossingMinimization.positionId'] === localTargetIndex) {
localTargetIndex = posConsOfUpper

@@ -139,3 +141,3 @@ } else {

// All nodes within one hierarchy level have the same direction
nodes.sort((a, b) => a.properties.layerId - b.properties.layerId)
nodes.sort((a, b) => (a.properties['org.eclipse.elk.layered.layering.layerId'] as number) - (b.properties['org.eclipse.elk.layered.layering.layerId'] as number))
const layers = []

@@ -152,3 +154,3 @@ let layer = 0

const node = nodes[i]
if (node.properties.layerId !== layer) {
if (node.properties['org.eclipse.elk.layered.layering.layerId'] !== layer) {
// node is in the next layer

@@ -286,3 +288,3 @@ layers[layer] = new Layer(beginCoordinate, endCoordinate, beginCoordinate + (endCoordinate - beginCoordinate) / 2, direction)

for (const node of nodes) {
if (node.properties.layerId === layer) {
if (node.properties['org.eclipse.elk.layered.layering.layerId'] === layer) {
nodesOfLayer[nodesOfLayer.length] = node

@@ -337,3 +339,5 @@ }

for (const node of connectedNodes) {
if (node.properties.layerId === layer && node.properties.layerConstraint !== -1) {
if (node.properties['org.eclipse.elk.layered.layering.layerId'] === layer
&& node.properties['org.eclipse.elk.layered.layering.layerChoiceConstraint'] !== -1
&& node.properties['org.eclipse.elk.layered.layering.layerChoiceConstraint'] !== undefined) {
// layer is forbidden for the given node

@@ -381,8 +385,8 @@ return true

// If layer is forbidden just refresh
return new RefreshDiagramAction()
} else if (targetNode.properties.layerId !== layerOfTarget) {
return RefreshDiagramAction.create()
} else if (targetNode.properties['org.eclipse.elk.layered.layering.layerId'] !== layerOfTarget) {
// layer constraint should only be set if the layer index changed
if (shouldOnlyLCBeSet(targetNode, layers, direction)) {
// only the layer constraint should be set
return new SetLayerConstraintAction({
return SetLayerConstraintAction.create({
id: targetNode.id,

@@ -394,3 +398,3 @@ layer: layerOfTarget,

// If layer and position constraint should be set - send them both in one StaticConstraint
return new SetStaticConstraintAction({
return SetStaticConstraintAction.create({
id: targetNode.id,

@@ -406,5 +410,5 @@ layer: layerOfTarget,

// position constraint should only be set if the position of the node changed
if (targetNode.properties.positionId !== positionOfTarget) {
if (targetNode.properties['org.eclipse.elk.layered.crossingMinimization.positionId'] !== positionOfTarget) {
// set the position Constraint
return new SetPositionConstraintAction({
return SetPositionConstraintAction.create({
id: targetNode.id,

@@ -417,3 +421,3 @@ position: positionOfTarget,

// If the node was moved without setting a constraint - let it snap back
return new RefreshDiagramAction()
return RefreshDiagramAction.create()
}

@@ -6,3 +6,3 @@ /*

*
* Copyright 2020 by
* Copyright 2020-2021 by
* + Kiel University

@@ -19,5 +19,3 @@ * + Department of Computer Science

import {
Action
} from 'sprotty/lib';
import { Action } from 'sprotty-protocol';
import { AspectRatio, RectPackDeletePositionConstraint, RectPackSetPositionConstraint } from './constraint-types';

@@ -28,7 +26,15 @@

*/
export class SetAspectRatioAction implements Action {
static readonly KIND: string = 'setAspectRatio'
readonly kind = SetAspectRatioAction.KIND
export interface SetAspectRatioAction extends Action {
kind: typeof SetAspectRatioAction.KIND
constraint: AspectRatio
}
constructor(public readonly constraint: AspectRatio) {
export namespace SetAspectRatioAction {
export const KIND = 'setAspectRatio'
export function create(constraint: AspectRatio): SetAspectRatioAction {
return {
kind: KIND,
constraint,
}
}

@@ -40,7 +46,15 @@ }

*/
export class RectPackDeletePositionConstraintAction implements Action {
static readonly KIND: string = 'rectPackDeletePositionConstraint'
readonly kind = RectPackDeletePositionConstraintAction.KIND
export interface RectPackDeletePositionConstraintAction extends Action {
kind: typeof RectPackDeletePositionConstraintAction.KIND
constraint: RectPackDeletePositionConstraint
}
constructor(public readonly constraint: RectPackDeletePositionConstraint) {
export namespace RectPackDeletePositionConstraintAction {
export const KIND = 'rectPackDeletePositionConstraint'
export function create(constraint: RectPackDeletePositionConstraint): RectPackDeletePositionConstraintAction {
return {
kind: KIND,
constraint,
}
}

@@ -52,8 +66,16 @@ }

*/
export class RectPackSetPositionConstraintAction implements Action {
static readonly KIND: string = 'rectPackSetPositionConstraint'
readonly kind = RectPackSetPositionConstraintAction.KIND
export interface RectPackSetPositionConstraintAction extends Action {
kind: typeof RectPackSetPositionConstraintAction.KIND
constraint: RectPackSetPositionConstraint
}
constructor(public readonly constraint: RectPackSetPositionConstraint) {
export namespace RectPackSetPositionConstraintAction {
export const KIND = 'rectPackSetPositionConstraint'
export function create(constraint: RectPackSetPositionConstraint): RectPackSetPositionConstraintAction {
return {
kind: KIND,
constraint,
}
}
}

@@ -6,3 +6,3 @@ /*

*
* Copyright 2020 by
* Copyright 2020-2021 by
* + Kiel University

@@ -19,3 +19,4 @@ * + Department of Computer Science

import { getAbsoluteBounds, translate } from 'sprotty';
import { getAbsoluteBounds } from 'sprotty';
import { Action, Bounds } from 'sprotty-protocol';
import { RectPackSetPositionConstraintAction, SetAspectRatioAction } from './actions';

@@ -32,5 +33,5 @@ import { RefreshDiagramAction } from '../actions';

*/
export function setGenerateRectPackAction(nodes: KNode[], target: KNode, parent: KNode | undefined, event: MouseEvent): SetAspectRatioAction | RefreshDiagramAction {
export function setGenerateRectPackAction(nodes: KNode[], target: KNode, parent: KNode | undefined, event: MouseEvent): Action {
// If node is not put to a valid position the diagram will be refreshed.
let result = new RefreshDiagramAction()
let result: Action = RefreshDiagramAction.create()
// If the node is moved on top of another node it takes its place.

@@ -41,3 +42,3 @@ nodes.forEach(node => {

const canvasBounds = target.root.canvasBounds;
const boundsInWindow = translate(targetBounds, canvasBounds);
const boundsInWindow = Bounds.translate(targetBounds, canvasBounds);
const lowX = boundsInWindow.x

@@ -49,19 +50,19 @@ const lowY = boundsInWindow.y

&& event.pageY > lowY && event.pageY < highY) {
let actualPosition = node.properties.currentPosition
if (node.properties.desiredPosition !== -1) {
actualPosition = node.properties.desiredPosition
}
let actualTargetPosition = target.properties.currentPosition
if (node.properties.desiredPosition !== -1) {
actualTargetPosition = target.properties.desiredPosition
}
if (actualPosition !== actualTargetPosition && actualPosition !== -1) {
result = new RectPackSetPositionConstraintAction(
{id: target.id, order: actualPosition}
)
}
let actualPosition = node.properties['org.eclipse.elk.rectPacking.currentPosition'] as number
if (node.properties['org.eclipse.elk.alg.rectpacking.desiredPosition'] !== -1) {
actualPosition = node.properties['org.eclipse.elk.alg.rectpacking.desiredPosition'] as number
}
let actualTargetPosition = target.properties['org.eclipse.elk.rectPacking.currentPosition'] as number
if (node.properties['org.eclipse.elk.alg.rectpacking.desiredPosition'] !== -1) {
actualTargetPosition = target.properties['org.eclipse.elk.alg.rectpacking.desiredPosition'] as number
}
if (actualPosition !== actualTargetPosition && actualPosition !== -1) {
result = RectPackSetPositionConstraintAction.create({
id: target.id, order: actualPosition
})
}
}
}
});
if (result instanceof RefreshDiagramAction) {
if (result.kind === RefreshDiagramAction.KIND) {
// Case node should not be swapped.

@@ -91,4 +92,4 @@

// If changed update aspect ratio.
if (parent && parent.properties.aspectRatio !== aspectRatio) {
return new SetAspectRatioAction({
if (parent && parent.properties['org.eclipse.elk.rectPacking.aspectRatio'] !== aspectRatio) {
return SetAspectRatioAction.create({
id: parent.id,

@@ -95,0 +96,0 @@ aspectRatio: aspectRatio

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc