Emacs creates a schema diagram using Graphviz-dot-mode

Source: Internet
Author: User
Tags id3

Installation

First of all to install the Graphviz-dot-mode module, assuming that List-packages's website is not available in the country, instead of manually download Graphviz-dot-model.el. Put it in the ~/.emacs.d/folder.

Then change the Init.el file:

;; Graphviz-dot-model (load-file "~/.emacs.d/graphviz-dot-model.el")

UBUTNU system to install the Graphviz program,

Apt-get Install Graphviz

Installation is complete.

Restart Emacs and create the. dot file to start working.


There is a map to the record node

Now look at a simple example. Dot Language writing:

digraph departments {parts [shape=record, label = "<f0> Infrastructure | <f1> Data Warehouse | <f2> data Mining "];}



Diagraph that this is a graph, departments is the ID of this figure, note that the name here can not be used-symbolic connection, can be used to connect with the _ symbol.

Parts is a node whose shape is a record, that is, a continuous grid of records, each of which is a field, and the label is the text that is displayed. <f0> This class identifies each field.


C-c c to generate PNG files:



Edge

The following example is a two user node with a corresponding edge to each other.

digraph Colla_schema {UserA-Userb[label = "liked", color = green]; UserB-Usera[label = "liked_by", color = red];}



This sample draws the edge. And there are labels and color these attributes, two sides represented respectively the active with being dynamic.


The direction can be drawn from left to right in RID order. This is required in very many architectural diagrams.
digraph colla_data {rankdir=lr;id2, Id1[label = "liked", color = green];id2, Id3[label = "liked", color = green] ; ID3-Id1[label = "liked", color = green];id3, Id4[label = "liked", color = green];id5, Id1[label = "liked" , color = green];id5, Id2[label = "liked", color = green];id5, Id4[label = "liked", color = green];}

Effects such as the following:





Emacs creates a schema diagram using Graphviz-dot-mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.