Thank you very much for the answers  At the moment we use the latest version of mindfusion since we're just testing I downloaded the dagram-starter-angular project and modified that. In the package.json we have: "@mindfusion/diagramming-angular": "latest". The idea with changing the text-padding worked and I also changed the Shape to "Alternative". But the ordering still doesn't work  I changed the example to be smaller. Regarding the TreeLayout, I tought it couldn't handle multiple parents? const node = new Diagramming.ShapeNode(this.diagram);
nodeMap[entity.id] = node;
node.text = entity.name;
node.id = entity.id;
node.tag = `${entity.tier}-${entity.order ?? 1}`;
const l = new Diagramming.DiagramLink(this.diagram, nodeMap[link.from], nodeMap[link.to]);
l.headShape = Diagramming.ArrowHeads.None();
l.tag = li;
li++;
this.diagram.addItem(l);
const layout = new Graphs.LayeredLayout();
layout.direction = Graphs.LayoutDirection.TopToBottom;
layout.siftingRounds = 0;
layout.nodeDistance = 8;
layout.layerDistance = 12;
layout.anchoring = Graphs.Anchoring.Reassign;
this.diagram.arrange(layout);
this.diagram.nodes.sort((a:any, b:any) => {
const aP = a.tag.split("-");
const bP = b.tag.split("-");
if (aP[0] != bP[0]) return aP[0] - bP[0];
return aP[1] - bP[1];
});
this.diagram.links.sort((a:any, b:any) => {
return a.tag - b.tag;
});
{ "entities": [ { "id": "if_a", "order": 4, "name": "Investment Fund A", "jurisdiction": "Ontario", "shape": "triangle", "tier": 5 }, { "id": "h_b", "name": "Holding B", "order": 2, "jurisdiction": "Luxembourg", "shape": "oval", "highlight": true, "tier": 6, "isMain": true }, { "id": "h_a", "name": "Holding A", "order": 1, "jurisdiction": "Spain", "shape": "oval", "tier": 6 }, { "id": "h_c", "name": "Holding C", "order": 3, "jurisdiction": "Spain", "shape": "oval", "tier": 6 }, { "id": "c_aa", "name": "Company AA", "order": 5, "jurisdiction": "Spain", "shape": "rectangle", "tier": 7 }, { "id": "c_bb", "name": "Company BB", "order": 6, "jurisdiction": "Spain", "shape": "rectangle", "tier": 8 }, { "id": "c_a", "name": "Company A", "order": 7, "jurisdiction": "Spain", "shape": "rectangle", "tax_group_spain": true, "tier": 9 }, { "id": "c_b", "name": "Company B", "order": 8, "jurisdiction": "Spain", "shape": "rectangle", "tax_group_spain": true, "tier": 9 }, { "id": "c_c", "name": "Company C", "order": 9, "jurisdiction": "Spain", "shape": "rectangle", "tax_group_spain": true, "tier": 9 }, { "id": "c_d", "name": "Company D", "order": 10, "jurisdiction": "Spain", "shape": "rectangle", "tax_group_spain": true, "tier": 9 } ], "relationships": [ { "from": "if_a", "to": "h_b", "type": "ownership", "stake_pct": 100 }, { "from": "h_b", "to": "c_aa", "type": "ownership", "stake_pct": 64.78 }, { "from": "h_a", "to": "c_aa", "type": "ownership", "stake_pct": 5.0 }, { "from": "h_c", "to": "c_aa", "type": "ownership", "stake_pct": 5.0 }, { "from": "c_aa", "to": "c_bb", "type": "ownership", "stake_pct": 100 }, { "from": "c_bb", "to": "c_a", "type": "ownership", "stake_pct": 99.9 }, { "from": "c_bb", "to": "c_b", "type": "ownership", "stake_pct": 89.82 }, { "from": "c_bb", "to": "c_c", "type": "ownership", "stake_pct": 89.82 }, { "from": "c_bb", "to": "c_d", "type": "ownership", "stake_pct": 89.82 } ] } |
|