jonasthewolf / gsn2x

Tool to create graphical representations of Goal Structuring Notations from YAML.
MIT License
27 stars 9 forks source link

SVG Rendering - Gravity Suggestion #173

Closed jsavage closed 2 years ago

jsavage commented 2 years ago

Hi @jonasthewolf, This is a minor observation. While in general the generated SVG is pleasing to the eye and intuitive, here are a couple of examples where the layout is less intuitive. image Hopefully you can see the issue without being able to read the underlying text.

I wonder whether gravity might encourage a more pleasing result.

jsavage commented 2 years ago

Ah, I have just seen your note that "The order of the GSN elements on the same horizontal rank can be influenced by their ID. The elements are sorted lexicographically. Thus, a goal G1 if placed on the same vertical level is placed before G2." I don't believe this is the case here. G5: text: Rationale supportedBy: [Sn227, Sn211] G8: text: Completeness of HSRs supportedBy: [Sn216, Sn227]

Sn216: text: HSRs

Sn227: text: Requirements Traceability Reports url: txt

Sn211: text: TSRs Report url: txt

jonasthewolf commented 2 years ago

Thanks again for the valuable feedback. The upper right issue is going to be addressed with #154. The other one is really odd at a first glance. I will need to check it that tonight.

jonasthewolf commented 2 years ago

Hi @jsavage, I checked your minimal example: If you replace the Sn216 with Snx216, the rendering appears as I guess you would expect it. I am glad you found the place in the documentation, that I tried to explain how to solve such issues.

G5:
  text: Rationale
  supportedBy: [Sn227, Sn211]

G8:
  text: Completeness of HSRs
  supportedBy: [Snx216, Sn227]

Snx216:
  text: HSRs

Sn227:
  text: Requirements Traceability Reports
  url: txt

Sn211:
  text: TSRs Report
  url: txt
jsavage commented 2 years ago

Snx216 didn't but changing Sn211 to Snx211 certainly worked as a workaround. Some degree of influence from the id seems fine in the absence of other forces but avoiding un-sightly crossing of connections would I am sure be a preferable default. image

jonasthewolf commented 2 years ago

Absolutely agreed, @jsavage.

I will check if ordering can be improved.

jonasthewolf commented 2 years ago

@jsavage I just merged a small change that should resolve the issue you found without the workaround. You can find a binary on the releases page (latest pre-release). Please let me know if you see the issue again. Thanks.

jsavage commented 2 years ago

@jonasthewolf Were you referring to 2.4.3?. If so, when I removed the workaround the issue returned. image jsexample1.5-db.zip

jonasthewolf commented 2 years ago

Hi @jsavage, I was referring to https://github.com/jonasthewolf/gsn2x/releases/tag/latest-build

jsavage commented 2 years ago

Ah yes, got it. Resolved. The cross-over is resolved with workaround removed. image

jonasthewolf commented 2 years ago

@jsavage I released version 2.5.0. That should improve layout even further.

jonasthewolf commented 2 years ago

@jsavage I think with v2.5.1 also the other layout issue is resolved now. Feel free to test. You can find the release here https://github.com/jonasthewolf/gsn2x/releases.

jsavage commented 2 years ago

@jonasthewolf something is causing this latest release (v2.5.1) to break when to ingesting my example. Two previous releases still accept this yaml but not this one. Your own example.yaml looks ok too. V2.4.3 is the most recent formal Release that doesn't have this issue. Not had a chance to dig further but this is one example that it doesnt like. The SVG is created but displays no graphics. jsexample1.5-db.zip FYI I am using the windows build only. I drag and drop the YAML file onto the exe and then insect the SVG. If there is a log file I have not found it. jsexample1.51-Copy.svg.zip