summaryrefslogtreecommitdiffstats
path: root/templates/repo/graph/svgcontainer.tmpl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-10-11 10:27:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-10-11 10:27:00 +0000
commit65aa53fc52ff15efe54df4147564828d535837f8 (patch)
tree31c51dad04fdcca80e6d3043c8bd49d2f1a51f83 /templates/repo/graph/svgcontainer.tmpl
parentInitial commit. (diff)
downloadforgejo-debian.tar.xz
forgejo-debian.zip
Adding upstream version 8.0.3.HEADupstream/8.0.3upstreamdebian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'templates/repo/graph/svgcontainer.tmpl')
-rw-r--r--templates/repo/graph/svgcontainer.tmpl24
1 files changed, 24 insertions, 0 deletions
diff --git a/templates/repo/graph/svgcontainer.tmpl b/templates/repo/graph/svgcontainer.tmpl
new file mode 100644
index 00000000..99c3c873
--- /dev/null
+++ b/templates/repo/graph/svgcontainer.tmpl
@@ -0,0 +1,24 @@
+<div id="rel-container">
+ <svg viewbox="{{Eval .Graph.MinColumn "*" 5}} {{Eval .Graph.MinRow "*" 12}} {{Eval .Graph.Width "*" 5 "+" 5}} {{Eval .Graph.Height "*" 12}}" width="{{Eval .Graph.Width "*" 10 "+" 10}}px">
+ {{range $flowid, $flow := .Graph.Flows}}
+ <g id="flow-{{$flow.ID}}" class="flow-group flow-color-{{$flow.ColorNumber}} flow-color-16-{{$flow.Color16}}" data-flow="{{$flow.ID}}" data-color="{{$flow.ColorNumber}}">
+ <path d="{{range $i, $glyph := $flow.Glyphs -}}
+ {{- if or (eq $glyph.Glyph '*') (eq $glyph.Glyph '|') -}}
+ M {{Eval $glyph.Column "*" 5 "+" 5}} {{Eval $glyph.Row "*" 12 "+" 0}} v 12 {{/* */ -}}
+ {{- else if eq $glyph.Glyph '/' -}}
+ M {{Eval $glyph.Column "*" 5 "+" 10}} {{Eval $glyph.Row "*" 12 "+" 0}} l -10 12 {{/* */ -}}
+ {{- else if eq $glyph.Glyph '\\' -}}
+ M {{Eval $glyph.Column "*" 5 "+" 0}} {{Eval $glyph.Row "*" 12 "+" 0}} l 10 12 {{/* */ -}}
+ {{- else if or (eq $glyph.Glyph '-') (eq $glyph.Glyph '.') -}}
+ M {{Eval $glyph.Column "*" 5 "+" 0}} {{Eval $glyph.Row "*" 12 "+" 12}} h 5 {{/* */ -}}
+ {{- else if eq $glyph.Glyph '_' -}}
+ M {{Eval $glyph.Column "*" 5 "+" 0}} {{Eval $glyph.Row "*" 12 "+" 12}} h 10 {{/* */ -}}
+ {{- end -}}
+ {{- end}}" stroke-width="1" fill="none" id="flow-{{$flow.ID}}-path" stroke-linecap="round"></path>
+ {{range $flow.Commits}}
+ <circle class="flow-commit" cx="{{Eval .Column "*" 5 "+" 5}}" cy="{{Eval .Row "*" 12 "+" 6}}" r="2.5" stroke="none" id="flow-commit-{{.Rev}}" data-rev="{{.Rev}}"></circle>
+ {{end}}
+ </g>
+ {{end}}
+ </svg>
+</div>