6
我首次使用dot + GraphViz來幫助規劃出圖形DB架構。圖形DB架構的最佳點/ GraphViz佈局
當我添加更多節點時,輸出看起來不太理想。特別是語言和國家看起來相當混亂。
我試過一些基本的排名,但一直無法影響它。
我如何獲得更清晰的輸出?
代碼:
digraph ReferenceGraph {
nodesep = 2;
edge [color=gray50, fontname=Calibri, fontsize=11]
node [shape=record, fontname=Calibri, fontsize=11]
root [label="Reference Node", color=darkgreen, fontcolor=darkgreen, fontname=Calibri, fontsize=11]
sue [label="{{User}|{GivenName=Sue}|{FamilyName=Williams}|{Username=swilliams}|{[email protected]}|{BusinessPhone=02 1234 5678}|{MobilePhone=0414 123 456}|{PasswordSalt=fcd376dc}|{PasswordHash=a8635cfd2930ebc0cc78}|{PreviousPasswordSalt=gggf6dc}|{PreviousPasswordHash=wer435cfd2930ebc0cc78}|{RequirePasswordChangeOnNextLogin=true}|FailedLoginAttempts=0|LastLoginAttemptUtc=21 Jun 2011 16:43:01 UTC|{DateCreatedUtc=20 Jun 2011 15:43:07 UTC}}", color=blue, fontcolor=blue]
sue -> root [label="ADMINISTERS"]
clint [label="{{Client}|{UniqueId=100}|{GivenName=Clint}|{MiddleNames=ian bill}|{FamilyName=Wood}|{PreferredName=Woods}|{Gender=Male Female Unknown}|{PlaceOfBirthTown}|{PlaceOfBirthState}|{PlaceOfBirthCountry}|{[email protected]}|{LanguageComments}|{InterpreterRequired=true false}|{InterpreterComments}|{Religion=Buddhist}|{LegalOrders=order1}|{DateOfBirth=21 June 1979}|{DateOfBirthCertainty=Confirmed Unconfirmed Estimated}}", color=blue, fontcolor=blue]
clint -> acme [label="CLIENT_BELONGS_TO"]
clint -> english [label ="SPEAKS"]
cat [label="Cat (Client)"]
cat -> acme [label="CLIENT_BELONGS_TO"]
cat -> english [label ="SPEAKS"]
cat -> mandarin [label ="SPEAKS"]
acme [label="{{Agency}|{UniqueId=100}|{Key=acme}|{Name=Acme Australia}}", color=blue, fontcolor=blue]
root -> acme [label="HOSTS"]
john [label="John (User)"]
john -> acme [label="USER_BELONGS_TO"]
jack [label="Jack (User)"]
jack -> acme [label="USER_BELONGS_TO"]
centreA [label="{{Centre}|{Name=CentreA}|{BusinessPhone=02 1234 5678}|{Fax=0414 123 456}|{[email protected]}|{Status=Active}}", color=blue, fontcolor=blue]
centreA -> acme [label="CENTRE_BELONGS_TO"]
centreAStreetAddress [label="{{PhysicalAddress}|{Line 1=Level 1}|{Line 2=11 Sydney Road}|{TownSuburb=Sydney}|{State=NSW}|{Postcode=2000}|{Country=Australia}}", color=blue, fontcolor=blue]
centreA -> centreAStreetAddress [label="HAS_STREET_ADDRESS"]
centreAPostalAddress [label="PO Box 123 (PhysicalAddress)"]
centreA -> centreAPostalAddress [label="HAS_POSTAL_ADDRESS"]
clintCurrentAddress [label="{{CurrentAddress}|{Line 1=Level 1}|{Line 2=11 Sydney Road}|{TownSuburb=Sydney}|{State=NSW}|{Postcode=2000}|{Country=Australia}}", color=blue, fontcolor=blue]
clint -> clintCurrentAddress [label="HAS_STREET_ADDRESS"]
referenceData [label="Reference Data"]
root -> referenceData [label="HAS_REFERENCE_DATA"]
languagesReferenceData [label="Languages"]
referenceData -> languagesReferenceData [label="HAS_LANGUAGES"]
english [label="{{Language}|{Name=English}}", color=blue, fontcolor=blue]
languagesReferenceData -> english [label="HAS_LANGUAGE"]
mandarin [label="Mandarin (Language)"]
languagesReferenceData -> mandarin [label="HAS_LANGUAGE"]
japanese [label="Japanese (Language)"]
languagesReferenceData -> japanese [label="HAS_LANGUAGE"]
countriesReferenceData [label="Countries"]
referenceData -> countriesReferenceData [label="HAS_COUNTRIES"]
australia [label="{{Country}|{Name=Australia}}", color=blue, fontcolor=blue]
countriesReferenceData -> australia [label="HAS_COUNTRY"]
china [label="China (Country)"]
countriesReferenceData -> china[label="HAS_COUNTRY"]
}
最後我用 splines = true; overlap = portho; model = subset; 這讓我走上了正軌。謝謝! –
非常好,這確實是更好! – marapet