Ezhil-Language-Foundation / Ezhil-Lang

எழில் - ஒரு தமிழ் நிரலாக்க மொழி; தமிழ் மாணவர்களுக்கு இது முதல்முறை கணிப்பொறி நிரல் ஏழுத உதவும் (Ezhil, is a fun Tamil programming language for K-12).
http://ezhillang.org/
GNU General Public License v3.0
169 stars 46 forks source link

எழில் ஓர-முனையம் உருப்பை DOT மொழியில் வரைக #165

Open arcturusannamalai opened 8 years ago

arcturusannamalai commented 8 years ago

எ.கா

Quickstart

Create a graph object:

>>> from graphviz import Digraph

>>> dot = Digraph(comment='The Round Table')

>>> dot  #doctest: +ELLIPSIS
<graphviz.dot.Digraph object at 0x...>
Add nodes and edges:

>>> dot.node('A', 'King Arthur')
>>> dot.node('B', 'Sir Bedevere the Wise')
>>> dot.node('L', 'Sir Lancelot the Brave')

>>> dot.edges(['AB', 'AL'])
>>> dot.edge('B', 'L', constraint='false')
Check the generated source code:

>>> print(dot.source)  # doctest: +NORMALIZE_WHITESPACE
// The Round Table
digraph {
    A [label="King Arthur"]
    B [label="Sir Bedevere the Wise"]
    L [label="Sir Lancelot the Brave"]
        A -> B
        A -> L
        B -> L [constraint=false]
}
Save and render the source code, optionally view the result:

>>> dot.render('test-output/round-table.gv', view=True)
'test-output/round-table.gv.pdf'

Ref : https://pypi.python.org/pypi/graphviz

Ref : http://matthiaseisen.com/articles/graphviz/ : http://graphviz.org/pdf/dotguide.pdf