graph drawing tool
-- return b if it's entirely within a
inner = function(a, b)
	if a == nil then return b end
	if a.x >= b.x then return a end
	if b.x+b.w >= a.x+a.w then
		return a
	end
	if a.y >= b.y then return a end
	if b.y + node_height(b) >= a.y + node_height(a) then
		return a
	end
	return b
end