Mercurial > hg
comparison tests/test-hgweb-commands.t @ 35566:baca93a47992
hgweb: make different kinds of commits look differently on /graph
Regular hg log -G uses different symbols for some graph nodes, such as commits
that close branches and hidden commits. It also marks the currently checked out
commit with "@". Since hg serve is sometimes used/recommended as a more visual
alternative to CLI, it makes sense to port these features to hgweb.
"graphnode" includes the style of a particular node and also if it's currently
checked out or not, both at the same time. This is different from hg log -G
(which uses templatekw.showgraphnode), where there's only place for one
character, but hgweb doesn't have this limitation, since it uses <canvas> and
not plain text. I'm using one string of 1 or 2 characters in this patch, it's
not the most self-explanatory format, but it's concise, uses the same
characters as hg log -G, and is internal to hgweb (i.e. not used for
json-graph).
I'm more or less fine with how things look visually, but there's still room for
improvement. Feel free to criticise or point me to good-looking graphs of this
kind for inspiration.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Tue, 19 Dec 2017 20:41:25 +0800 |
parents | bb5a03dfd7ff |
children | 45a816361926 |
comparison
equal
deleted
inserted
replaced
35565:bdae51a83dfb | 35566:baca93a47992 |
---|---|
1820 </li> | 1820 </li> |
1821 </ul> | 1821 </ul> |
1822 </div> | 1822 </div> |
1823 | 1823 |
1824 <script> | 1824 <script> |
1825 var data = [{"edges": [[0, 0, 1, 3, "FF0000"]], "node": "cad8025a2e87", "vertex": [0, 1]}, {"edges": [[0, 0, 1, 3, ""]], "node": "1d22e65f027e", "vertex": [0, 1]}, {"edges": [[0, 0, 1, 3, ""]], "node": "a4f92ed23982", "vertex": [0, 1]}, {"edges": [], "node": "2ef0ac749a14", "vertex": [0, 1]}]; | 1825 var data = [{"edges": [[0, 0, 1, 3, "FF0000"]], "graphnode": "@o", "node": "cad8025a2e87", "vertex": [0, 1]}, {"edges": [[0, 0, 1, 3, ""]], "graphnode": "o", "node": "1d22e65f027e", "vertex": [0, 1]}, {"edges": [[0, 0, 1, 3, ""]], "graphnode": "o", "node": "a4f92ed23982", "vertex": [0, 1]}, {"edges": [], "graphnode": "o", "node": "2ef0ac749a14", "vertex": [0, 1]}]; |
1826 var graph = new Graph(); | 1826 var graph = new Graph(); |
1827 graph.scale(39); | 1827 graph.scale(39); |
1828 graph.render(data); | 1828 graph.render(data); |
1829 </script> | 1829 </script> |
1830 | 1830 |