summaryrefslogtreecommitdiff
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
parentbf772125e8c2d623fe8cea841415cd544e2f8f58 (diff)
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 = {
556 edge = { 556 edge = {
557 color = "black" 557 color = "black"
558 }, 558 },
559 bg_color = "transparent" 559 bg_color = "transparent",
560 rank_dir = "TB",
561 size = "6"
560} 562}
561 563
562local current_theme = default_theme 564local current_theme = default_theme
@@ -606,6 +608,12 @@ local validate_theme = function(tb)
606 if not tb.bg_color then 608 if not tb.bg_color then
607 tb.bg_color = default_theme.bg_color 609 tb.bg_color = default_theme.bg_color
608 end 610 end
611 if not tb.rank_dir then
612 tb.rank_dir = default_theme.rank_dir
613 end
614 if not tb.size then
615 tb.size = default_theme.size
616 end
609 if type(tb.node) ~= "table" then 617 if type(tb.node) ~= "table" then
610 return false 618 return false
611 end 619 end
@@ -615,6 +623,12 @@ local validate_theme = function(tb)
615 if type(tb.bg_color) ~= "string" then 623 if type(tb.bg_color) ~= "string" then
616 return false 624 return false
617 end 625 end
626 if type(tb.rank_dir) ~= "string" then
627 return false
628 end
629 if type(tb.size) ~= "string" then
630 return false
631 end
618 if not validate_ctheme(tb, "regular") then 632 if not validate_ctheme(tb, "regular") then
619 return false 633 return false
620 end 634 end
@@ -694,8 +708,8 @@ local build_igraph = function(cl)
694 local graph = { 708 local graph = {
695 type = "hierarchy", 709 type = "hierarchy",
696 attrs = { 710 attrs = {
697 rankdir = "TB", 711 rankdir = current_theme.rank_dir,
698 size = "6", 712 size = current_theme.size,
699 bgcolor = current_theme.bg_color 713 bgcolor = current_theme.bg_color
700 }, 714 },
701 node = current_theme.node, 715 node = current_theme.node,