From: Alexandre Terrasa Date: Tue, 26 Sep 2017 20:25:45 +0000 (-0400) Subject: nitweb: allow options in graph card X-Git-Url: http://nitlanguage.org nitweb: allow options in graph card Signed-off-by: Alexandre Terrasa --- diff --git a/src/web/api_docdown.nit b/src/web/api_docdown.nit index 80c50c7..a5ca012 100644 --- a/src/web/api_docdown.nit +++ b/src/web/api_docdown.nit @@ -317,7 +317,11 @@ redef class GraphCommand var mentity = v.find_mentity(model, name) if mentity == null then return var g = new InheritanceGraph(mentity, model) - v.add g.draw(3, 3).to_svg + var pdepth = if opts.has_key("pdepth") and opts["pdepth"].is_int then + opts["pdepth"].to_i else 3 + var cdepth = if opts.has_key("cdepth") and opts["cdepth"].is_int then + opts["cdepth"].to_i else 3 + v.add g.draw(pdepth, cdepth).to_svg end end