aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-08-02 16:47:29 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-08-02 16:47:54 +0100
commite540a9864be5058bdfd93cdd4529e8589304e438 (patch)
treef1f4d3804e4c86dde74e861ed16745fbfd998589
parentEo: Move Eo back into beta. (diff)
downloadefl-e540a9864be5058bdfd93cdd4529e8589304e438.tar.gz
docs: allow rank dir and size to be changed in theme
-rw-r--r--src/scripts/elua/apps/gendoc.lua20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua
index ec471ab8d6..eee105eb92 100644
--- a/src/scripts/elua/apps/gendoc.lua
+++ b/src/scripts/elua/apps/gendoc.lua
@@ -556,7 +556,9 @@ local default_theme = {
edge = {
color = "black"
},
- bg_color = "transparent"
+ bg_color = "transparent",
+ rank_dir = "TB",
+ size = "6"
}
local current_theme = default_theme
@@ -606,6 +608,12 @@ local validate_theme = function(tb)
if not tb.bg_color then
tb.bg_color = default_theme.bg_color
end
+ if not tb.rank_dir then
+ tb.rank_dir = default_theme.rank_dir
+ end
+ if not tb.size then
+ tb.size = default_theme.size
+ end
if type(tb.node) ~= "table" then
return false
end
@@ -615,6 +623,12 @@ local validate_theme = function(tb)
if type(tb.bg_color) ~= "string" then
return false
end
+ if type(tb.rank_dir) ~= "string" then
+ return false
+ end
+ if type(tb.size) ~= "string" then
+ return false
+ end
if not validate_ctheme(tb, "regular") then
return false
end
@@ -694,8 +708,8 @@ local build_igraph = function(cl)
local graph = {
type = "hierarchy",
attrs = {
- rankdir = "TB",
- size = "6",
+ rankdir = current_theme.rank_dir,
+ size = current_theme.size,
bgcolor = current_theme.bg_color
},
node = current_theme.node,