Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

Importing data from a .XLS file AND apply configurations to show 3 labels per edge

0 votes

I believe I didn't ask properly the question, so I will try to do it again.

I want to create a Network diagram from a .xls file. In this file I have a table with edges and nodes. The edge table has three properties: switch A port, switch B port, and throughput. I want to create a Properties Mapper for edges to apply as a configuration during the importing phase that automatically use the info in that table to label the edges with the information. The first one must be close to node A, the second one close to node B, and the third in the middle of the line. When I try to do it, I create the nodes, the edges, and the labels. However, the labels are placed overriding each other.

After going to Layout>Label placement to be sure the Label mode was 3 pos Center (because it looks like they all are place in the same position), I pressed "OK" without changing anything and saw a improvement in the diagram (now not all label were overriding each other). However, I still have som labels overriding each other and in one edge throughput label was not between the two ports.

So, I clicked on "One-click layout" and the diagram improved again, but note still had labels overriding each other and a different edge now had the throughput in the wrong position (not between ports):

So, my question is: after importing the data from a .xls file (and applying configuration to nodes and edges in this moment), I had to perform some actions manually and I still had a diagram with label issues. There is a way to import this data applying a specific configuration that doesn't demand further steps in the layout and present labels without overriding each other and in the right position?

in Help by

1 Answer

0 votes

You can try the following approach:

  1. Open an empty document.
  2. Create a user-defined palette section.
  3. Create two nodes and connect them with an edge.
  4. Add three labels to the edge.
  5. Set "Placement" for the first label to "3 Pos Center: Source Center".
  6. Set "Placement" for the second label to "3 Pos Center: Target Center".
  7. Set "Placement" for the third label to "3 Pos Center: Center".
  8. Right-click the edge to open its context menu and choose "Add to Palette".
  9. Go to your user-defined palette section, find the style template that you just added, right-click the template to open its context menu, and choose "Use as Default".
  10. Create a properties mapper configuration that maps property "switch A port" to label 1, "switch B port" to label 2, and "throughput" to label 3.
  11. Open "Layout" -> "Hierarchic" and increase setting "Layer to Layer Distance" on tab "General" to e.g. 100. Click "Ok" so the changed setting will be saved.
  12. Import your spreadsheet. On tab "Presentation" in section "Edges" turn on "Use Configuration" and choose the configuration you created in step 10. Additionally, set "Layout" to "Hierarchical".

Regarding your question if it is possible "to import this data applying a specific configuration that doesn't demand further steps", I can only repeat my answer from Automation by importing Edges and Nodes from .xls file:

yEd is not meant to provide a means for full automation, you will always have to adjust your diagrams manually to some extend.

by [yWorks] (161k points)
Legal Disclosure | Privacy Policy
...