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

aligned background image and network export (aspect ratio/scaling)

0 votes

Dear,

I need to create a graph which is aligned to a geographic map (i.e. Switzerland) with nodes representing Cities/locations. I don't mind to tweak the graph manually to make it fit to the geography. However, I did not manage to get a background image aligned with the graph not in the editor, nor in the output. So far the best procedure I ended up with, is:

  • squared background image (Swiss map and a ruler with concentric circles for testing)
  • background image preference set to "stretched" ("dynamic" and other options don't appear to work)
  • export to PDF, "original size", "visible" (currently set to A4; my target is A0 (which has worked fine for the stand alone graph which, unfortunately does not reflect the geography)
  • in any case, one needs to resize the canvas as the background does not, the graph, however, does scale with zooming 

I have tried systematically many variants/options,  all ending up in unsuccessful trial-and-error.

  • what are the bases for scaling background and graph; i.e. which scaling factor and option to apply where?
  • is there any possibility to scale background with graph in the editor/canvas?
  • pixel formats (PNG, JPG,..) seem to be worse compared to PDF
  • is yEd (using V3.22 desktop) the right tool?
  • do you have any advise for me?

I must admit that I'm hopelessly stuck after a lot of trial and error. I have also consulted the Help and Q&A many years back. 

With best regards,

Jörg

in Help by

1 Answer

0 votes

While yEd is not well suited to your task, I think it is nevertheless possible to achieve the desired result.

  1. Use background mode "Dynamic". This way your background image will be placed such that its upper left corner is at graph location (0,0). Moreover, "Dynamic" background images are panned and zoomed the same way graph elements are panned and zoomed. I.e. panning and zooming will retain the node locations relative to the background image.
    The other modes are not suited for your use case, because the placement of the background image depends on the visible region of the editor area for those modes. Thus panning or zooming would change the node locations in relation to the background image.
  2. Create two invisible nodes and place them on the upper left and lower right corners of your background image. When exporting a diagram with region "Complete Diagram" only graph elements are taken into account when calculating the area that contains the "complete diagram". With the invisible nodes, the whole background image will be included.

Alternatively, do not use a background image at all. Instead

  1. create a group node (e.g. the outline-only group node from the BPMN palette section should work well for this use case),
  2. enlarge the group node so its size matches the size of the "background image",
  3. add a label to your group node with placement "Internal: Center",
  4. set your "background image" as the label's icon,
  5. add all your nodes as child nodes to the group node.

The advantage of this second approach is that the label icon with the background image will be saved to GraphML.

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