digraph hierarchy {

	ranksep=1;

	subgraph cluster_1 {
		label="future user: a parent sheet"
		ext_gnd [shape=diamond]
		ext_vcc [shape=diamond]
		ext_ctrl [shape=diamond]
		ext_enable [shape=diamond]
		ext [style=invisible]
		chgnd [shape=diamond]
	}

	subgraph cluster_2 {
		label=""
		top [label="top sheet" shape=plaintext]

		enable [label="v/enable" shape=diamond color=green]

		gnd [label="./gnd" shape=diamond color=blue]
		vcc [label="./vcc" shape=diamond color=blue]

		agnd [label="./agnd" shape=diamond color=blue]
		dgnd [label="./dgnd" shape=diamond color=blue]
		avcc [label="./avcc" shape=diamond color=blue]
		dvcc [label="./dvcc" shape=diamond color=blue]
		ctrl [label="./ctrl" shape=diamond color=blue]

		{rank=same; agnd, dgnd, avcc, dvcc, ctrl, enable, top}

		gnd -> agnd [color=blue]
		gnd -> dgnd [color=blue]
		vcc -> avcc [color=blue]
		vcc -> dvcc [color=blue]
	}

	an [shape=box]
	dig [shape=box]
	amp1 [shape=box]
	amp2 [shape=box]
	amp3 [shape=box]
	amp4 [shape=box]

	ext -> top [color="#dddddd" constaint=0]
	ext_gnd -> gnd [color=red]
	ext_vcc -> vcc [color=red]
	ext_ctrl -> ctrl [color=red]
	ext_enable -> enable [color=red]


	top -> dig [color="#dddddd" weight=100]
	top -> an [color="#dddddd"  weight=100]
	an -> amp1 [color="#dddddd" weight=100]
	an -> amp2 [color="#dddddd" weight=100]
	an -> amp3 [color="#dddddd" weight=100]
	an -> amp4 [color="#dddddd" weight=100]

	amp1 [label="amp"]
	amp2 [label="amp"]
	amp3 [label="amp"]
	amp4 [label="amp"]

	agnd -> an [color=red]
	dgnd -> dig [color=red]
	avcc -> an [color=red]
	dvcc -> dig [color=red]
	ctrl -> an [color=red]
	ctrl -> dig [color=red]

	dig ->  enable [color=green constraint=1]
	amp1 -> enable [color=green constraint=1]
	amp2 -> enable [color=green constraint=1]
	amp3 -> enable [color=green constraint=1]
	amp4 -> enable [color=green constraint=1]

	an -> amp1 [color="red" constraint=0]
	an -> amp2 [color="red" constraint=0]
	an -> amp3 [color="red" constraint=0]
	an -> amp4 [color="red" constraint=0]

	amp1 -> chgnd1 [color="purple" constraint=0 arrowhead=none]
	amp2 -> chgnd1 [color="purple" constraint=0 arrowhead=none]
	amp3 -> chgnd1 [color="purple" constraint=0 arrowhead=none]
	amp4 -> chgnd1 [color="purple" constraint=0 arrowhead=none]
	dig -> chgnd [color="purple" constraint=1]
	top -> chgnd [color="purple" constraint=0]

	chgnd1:n -> chgnd [color="purple" constraint=0]
	chgnd1 [shape=none width=0 height=0 label=""]

	{rank=same; dig, chgnd1}
}
