Extension:QuickGV

The QuickGV extension allows to draw Graphviz with few code.

= How to =

Just a tag
Default graph.

Metadata
Default graph and metadata.

Show full source
Default graph and dot syntax.

With nodes & edges
 rankdir=TB;

// nodes A [label="A. 瀏覽器載入開始"]; B [label="B. 嘗試離線作業\n(檢查 max-age)"]; Z [label="Z. 瀏覽器載入結束"];

subgraph cluster_render { label="Browser 輸出"; color="#00aa00" bgcolor="#e0ffe0";

X1 [label="X1. 更新暫存檔\n(倒數計時 max-age)"]; X2 [label="X2. 使用暫存檔輸出\n(節省流量)"]; X3 [label="X3. 輸出後移除暫存檔\n(安全傳輸)"]; Y1 [label="Y1. 使用個人暫存檔\n(防止資料外洩)"]; Y2 [label="Y2. 使用共用暫存檔\n(節省磁碟空間)"]; }

subgraph cluster_server { label="Web 應用程式"; color="#0000ff" bgcolor="#f0f0ff";

C [label="C. HTTP Request"]; D1 [label="D1. 嘗試驗證"]; D2 [label="D2. 不用驗證"] E1 [label="E1. 時間驗證"]; E2 [label="E2. 摘要驗證"]; E3 [label="E3. 綜合驗證"]; F [label="F. 驗證快取時效"]; G1 [label="G1. 快取有效\n304 Not Modified"]; G2 [label="G2. 快取過期\n200 OK"]; G3 [label="G3. 無快取\n200 OK"]; };

// edges A -> B;

B -> X2 [label="時間差 < max-age\n(離線作業，最省流量)",color="#cc0000",fontcolor="#aa0000"]; B -> C [label="時間差 >= max-age\l或 no-cache、no-store\l(連線作業)"];

C -> D1 [label="有快取機制\n(靜態檔案、很少異動的資訊)"]; C -> D2 [label="無快取機制\n(即時資訊、SSL 傳輸)"]; D1 -> E1 [label="If-Modified-Since: ..."]; D1 -> E2 [label="If-None-Match: ..."]; D1 -> E3 [label="If-Modified-Since: ...\lIf-None-Match: ...\l"]; D2 -> G3;

{E1 E2 E3} -> F;  F -> {G1 G2};

G1 -> X1; G2 -> X2 [label="Last-Modified: ...\lE-Tag: ...\l"]; G3 -> X3 [label="Cache-Control: no-store"];

X1 -> X2; X2 -> Y1 [label="Cache-Control 含 private\n(瀏覽器預設值)"]; X2 -> Y2 [label="Cache-Control 含 public\n(用於公開資訊)"];

{Y1 Y2 X3} -> Z;

ER Model
 node [shape="record", style="filled"];

// nodes A [label="         user_data |  [PK] user_id\l |  user_type\l |         sex\l |  country\l |  city\l }" ];  B [label=" user_type |  [PK] user_type\l | desc\l"]; C [label=" sex |  [PK] sex\l | desc\l"];

// edges A:f0 -> B:fPK [label="1 .. N"]; A:f1 -> C:fPK [label="1 .. N"]; A:f3 -> A:f2;

= Installation =

Step 1: Install from zip package

 * Download ZIP package from QuickGV Releases
 * unzip package
 * rename mw-quickgv to QuickGV

Step 2: Apply this extension
Append following code to LocalSettings.php

= Requirements =
 * graphviz - Tested on graphviz 2.38
 * OSX: brew install graphviz
 * CentOS: yum install graphviz
 * Ubuntu: sudo apt-get install graphviz
 * PHP 5.x - Tested on PHP 5.4.27
 * exec
 * system