#1295 Edges between subgraphs

This commit is contained in:
Knut Sveidqvist
2020-03-14 17:38:35 +01:00
parent 5f5e453fb3
commit 963a0ce6ef
9 changed files with 296 additions and 35 deletions

View File

@@ -32,7 +32,7 @@ const rect = (parent, node) => {
.attr('width', node.width + padding)
.attr('height', node.height + padding);
logger.info('bbox', bbox.width, node.x, node.width);
// logger.info('bbox', bbox.width, node.x, node.width);
// Center the label
// label.attr('transform', 'translate(' + adj + ', ' + (node.y - node.height / 2) + ')');
label.attr(
@@ -57,7 +57,7 @@ const rect = (parent, node) => {
const shapes = { rect };
const clusterElems = {};
let clusterElems = {};
export const insertCluster = (elem, node) => {
clusterElems[node.id] = shapes[node.shape](elem, node);
@@ -70,6 +70,10 @@ export const getClusterTitleWidth = (elem, node) => {
return width;
};
export const clear = () => {
clusterElems = {};
};
export const positionCluster = node => {
const el = clusterElems[node.id];
el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')');