Macaulay2 » Documentation
Packages » Graphs :: html(Digraph)
next | previous | forward | backward | up | index | toc

html(Digraph) -- Create an .svg representation of a graph or digraph

Synopsis

Description

Uses graphviz to create an .svg representation of G, which is returned as a string.

i2 : html completeGraph 2

o2 = <?xml version="1.0" encoding="UTF-8" standalone="no"?>
     <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
      "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
     <!-- Generated by graphviz version 2.43.0 (0)
     <!-- Title: G Pages: 1 -->
     <svg width="62pt" height="116pt"
      viewBox="0.00 0.00 62.00 116.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
     <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 112)">
     <title>G</title>
     <polygon fill="white" stroke="transparent" points="-4,4 -4,-112 58,-112 58,4 -4,4"/>
     <!-- 0 -->
     <g id="node1" class="node">
     <title>0</title>
     <ellipse fill="none" stroke="black" cx="27" cy="-90" rx="27" ry="18"/>
     <text text-anchor="middle" x="27" y="-86.3" font-family="Times,serif" font-size="14.00">0</text>
     </g>
     <!-- 1 -->
     <g id="node2" class="node">
     <title>1</title>
     <ellipse fill="none" stroke="black" cx="27" cy="-18" rx="27" ry="18"/>
     <text text-anchor="middle" x="27" y="-14.3" font-family="Times,serif" font-size="14.00">1</text>
     </g>
     <!-- 0&#45;&#45;1 -->
     <g id="edge1" class="edge">
     <title>0&#45;&#45;1</title>
     <path fill="none" stroke="black" d="M27,-71.7C27,-60.85 27,-46.92 27,-36.1"/>
     </g>
     </g>
     </svg>

Ways to use this method: