[GH-ISSUE #576] Simplification for the SVG #6411

Open
opened 2026-06-17 05:11:03 -05:00 by GiteaMirror · 7 comments
Owner

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.

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.
GiteaMirror added the layout label 2026-06-17 05:11:03 -05:00
Author
Owner

@alexandrtovmach commented on GitHub (Jun 19, 2020):

Would you like to create a PR?

<!-- gh-comment-id:646830212 --> @alexandrtovmach commented on GitHub (Jun 19, 2020): Would you like to create a PR?
Author
Owner

@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.

<!-- gh-comment-id:646922995 --> @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.
Author
Owner

@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:
grafik
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.

<!-- gh-comment-id:647195483 --> @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: ![grafik](https://user-images.githubusercontent.com/325196/85237441-37233580-b427-11ea-82b8-eb8994ff2192.png) 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.
Author
Owner

@alexandrtovmach commented on GitHub (Jun 22, 2020):

@Vampire It's possible to make lines with shape corners?

<!-- gh-comment-id:647391059 --> @alexandrtovmach commented on GitHub (Jun 22, 2020): @Vampire It's possible to make lines with shape corners?
Author
Owner

@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".

<!-- gh-comment-id:647409273 --> @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".
Author
Owner

@tangx commented on GitHub (Aug 21, 2020):

perl regex

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:
grafik
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.

v?((0|[1-9]\d*)\.){2}(0|[1-9]\d*)(-?[\d\w][\d\w\.\-]*)?(\+?[\d\w][\d\w\-\.]*)?
<!-- gh-comment-id:678125096 --> @tangx commented on GitHub (Aug 21, 2020): # perl regex > 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: > ![grafik](https://user-images.githubusercontent.com/325196/85237441-37233580-b427-11ea-82b8-eb8994ff2192.png) > 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. ``` v?((0|[1-9]\d*)\.){2}(0|[1-9]\d*)(-?[\d\w][\d\w\.\-]*)?(\+?[\d\w][\d\w\-\.]*)? ```
Author
Owner

@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 v as start, \w also matches underscore, the regex would match other strings that are not valid semvers, ...)

<!-- gh-comment-id:678185415 --> @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 `v` as start, `\w` also matches underscore, the regex would match other strings that are not valid semvers, ...)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#6411