Property definitions

nitc $ CmdInheritanceGraph :: defaultinit
# Render a hierarchy graph for `mentity` if any.
class CmdInheritanceGraph
	super CmdEntity
	super CmdGraph

	autoinit(model, mainmodule, filter, mentity, mentity_name, pdepth, cdepth, format, graph)

	# Parents depth to display
	var pdepth: nullable Int = null is optional, writable

	# Children depth to display
	var cdepth: nullable Int = null is optional, writable

	# Inheritance graph to return
	var graph: nullable InheritanceGraph = null is optional, writable

	redef fun init_command do
		if graph != null then return new CmdSuccess

		var res = super
		if not res isa CmdSuccess then return res
		var mentity = self.mentity.as(not null)

		graph = new InheritanceGraph(mentity, model, mainmodule, filter)
		return res
	end

	redef fun render do
		var graph = self.graph
		if graph == null then return ""
		self.dot = graph.draw(pdepth, cdepth).to_dot
		return super
	end
end
src/doc/commands/commands_graph.nit:140,1--173,3