mirror of
https://github.com/semver/semver.git
synced 2026-07-11 09:43:20 -05:00
[GH-ISSUE #576] Simplification for the SVG #2154
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Vampire on GitHub (Jun 12, 2020).
Original GitHub issue: https://github.com/semver/semver/issues/576
The pre-release and build parts can be simplified.
The part before and after the dot are identical in both cases.
So you can simply loop back to the beginning of the respective cluster start after the dots.
@alexandrtovmach commented on GitHub (Jun 19, 2020):
Would you like to create a PR?
@Vampire commented on GitHub (Jun 20, 2020):
The problem is, that the current SVG is not really made for editing.
Its source is a JavaScript regex matching semvers that was sent through a railroad generator.
And in regex you cannot really write it so that the proposed change is realized.
@Vampire commented on GitHub (Jun 21, 2020):
What I could provide instead is a GraphViz dot file with a graph that renders similarly (and the rendered SVG of course), but with the simplifications applied.

Current state I threw together:
What do you think?
If you want to have some colors, tell me which and where.
If you want the nodes displayed differently, tell me your ideas.
If you want some arrows removed or added (for example at the joinpoints where I left them out), tell me which and where.
@alexandrtovmach commented on GitHub (Jun 22, 2020):
@Vampire It's possible to make lines with shape corners?
@Vampire commented on GitHub (Jun 22, 2020):
In GraphViz you define nodes and how they relate and GraphViz calculates where to draw the edges.
As far as I know you cannot influence directly how the edges are drawn.
What you can do is configuring the weight of an edge and the higher the weight, the more straight the edge becomes. This I used for having the "straight lanes" in the clusters, like for alnum identifier and numeric identifier.
Of course you could use some Graphics tool to draw what you want.
But I'm not a Graphics expert and didn't know which tool is best suited.
And GraphViz I knew and was able to provide something that also most devs should be able to easily interpret and adapt.
What I can do is introducing non-visible fake nodes to influence the routing of the edges in a limited way, depending on what exactly you want by saying "shape corners".
@tangx commented on GitHub (Aug 21, 2020):
perl regex
@Vampire commented on GitHub (Aug 21, 2020):
Besides that your regex is wrong for matching a semver, what has it to do with this issue @tangx?
(semver has no
vas start,\walso matches underscore, the regex would match other strings that are not valid semvers, ...)