Skip to content

Commit

Permalink
bonsai
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed May 27, 2018
1 parent c552a51 commit 2f6811a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions output/dot/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import (
"github.com/jessevdk/go-assets"
)

var _Assets21532ae17ad95976ac467eeaeab81f2bb1d537e4 = "digraph {{ .Schema.Name }} {\n // Config\n graph [rankdir=TB, layout=dot, margin=0.2, fontname=\"Arial\"];\n node [shape=record, fontsize=14, fontname=\"Arial\"];\n edge [fontsize=10, labelfloat=false, splines=none, fontname=\"Arial\"];\n\n // Tables\n {{- range $i, $t := .Schema.Tables }}\n {{ $t.Name }} [shape=none, margin=0.2, label=<<table border=\"0\" cellborder=\"1\" cellspacing=\"0\" cellpadding=\"4\">\n <tr><td><b>{{ $t.Name }}</b> <font color=\"#666666\">[{{ $t.Type }}]</font></td></tr>\n {{- range $ii, $c := $t.Columns }}\n <tr><td port=\"{{ $c.Name }}\" align=\"left\">{{ $c.Name }} <font color=\"#666666\">[{{ $c.Type }}]</font></td></tr>\n {{- end }}\n </table>>];\n {{- end }}\n\n // Relations\n {{- range $j, $r := .Schema.Relations }}\n {{ $r.Table.Name }}:{{ $c := index $r.Columns 0 }}{{ $c.Name }} -> {{ $r.ParentTable.Name }}:{{ $pc := index $r.ParentColumns 0 }}{{ $pc.Name }} [arrowhead=crow, taillabel=<<table cellpadding=\"5\" border=\"0\" cellborder=\"0\"><tr><td>{{ $r.Def }}</td></tr></table>>];\n {{- end }}\n}\n"
var _Assets21532ae17ad95976ac467eeaeab81f2bb1d537e4 = "digraph {{ .Schema.Name }} {\n // Config\n graph [rankdir=TB, layout=dot, margin=0.2, fontname=\"Arial\"];\n node [shape=record, fontsize=14, fontname=\"Arial\"];\n edge [fontsize=10, labelfloat=false, splines=none, fontname=\"Arial\"];\n\n // Tables\n {{- range $i, $t := .Schema.Tables }}\n {{ $t.Name }} [shape=none, margin=0.2, label=<<table border=\"0\" cellborder=\"1\" cellspacing=\"0\" cellpadding=\"6\">\n <tr><td bgcolor=\"#EFEFEF\"><font face=\"Arial Bold\" point-size=\"18\">{{ $t.Name }}</font> <font color=\"#666666\">[{{ $t.Type }}]</font></td></tr>\n {{- range $ii, $c := $t.Columns }}\n <tr><td port=\"{{ $c.Name }}\" align=\"left\">{{ $c.Name }} <font color=\"#666666\">[{{ $c.Type }}]</font></td></tr>\n {{- end }}\n </table>>];\n {{- end }}\n\n // Relations\n {{- range $j, $r := .Schema.Relations }}\n {{ $r.Table.Name }}:{{ $c := index $r.Columns 0 }}{{ $c.Name }} -> {{ $r.ParentTable.Name }}:{{ $pc := index $r.ParentColumns 0 }}{{ $pc.Name }} [dir=back, arrowtail=crow, taillabel=<<table cellpadding=\"5\" border=\"0\" cellborder=\"0\"><tr><td>{{ $r.Def }}</td></tr></table>>];\n {{- end }}\n}\n"

// Assets returns go-assets FileSystem
var Assets = assets.NewFileSystem(map[string][]string{"/": []string{"schema.dot.tmpl"}}, map[string]*assets.File{
"/": &assets.File{
Path: "/",
FileMode: 0x800001ed,
Mtime: time.Unix(1527429522, 1527429522000000000),
Data: nil,
}, "/schema.dot.tmpl": &assets.File{
"/schema.dot.tmpl": &assets.File{
Path: "/schema.dot.tmpl",
FileMode: 0x1a4,
Mtime: time.Unix(1527429522, 1527429522000000000),
Mtime: time.Unix(1527431106, 1527431106000000000),
Data: []byte(_Assets21532ae17ad95976ac467eeaeab81f2bb1d537e4),
}, "/": &assets.File{
Path: "/",
FileMode: 0x800001ed,
Mtime: time.Unix(1527431106, 1527431106000000000),
Data: nil,
}}, "")
6 changes: 3 additions & 3 deletions output/dot/templates/schema.dot.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ digraph {{ .Schema.Name }} {

// Tables
{{- range $i, $t := .Schema.Tables }}
{{ $t.Name }} [shape=none, margin=0.2, label=<<table border="0" cellborder="1" cellspacing="0" cellpadding="4">
<tr><td><b>{{ $t.Name }}</b> <font color="#666666">[{{ $t.Type }}]</font></td></tr>
{{ $t.Name }} [shape=none, margin=0.2, label=<<table border="0" cellborder="1" cellspacing="0" cellpadding="6">
<tr><td bgcolor="#EFEFEF"><font face="Arial Bold" point-size="18">{{ $t.Name }}</font> <font color="#666666">[{{ $t.Type }}]</font></td></tr>
{{- range $ii, $c := $t.Columns }}
<tr><td port="{{ $c.Name }}" align="left">{{ $c.Name }} <font color="#666666">[{{ $c.Type }}]</font></td></tr>
{{- end }}
Expand All @@ -16,6 +16,6 @@ digraph {{ .Schema.Name }} {

// Relations
{{- range $j, $r := .Schema.Relations }}
{{ $r.Table.Name }}:{{ $c := index $r.Columns 0 }}{{ $c.Name }} -> {{ $r.ParentTable.Name }}:{{ $pc := index $r.ParentColumns 0 }}{{ $pc.Name }} [arrowhead=crow, taillabel=<<table cellpadding="5" border="0" cellborder="0"><tr><td>{{ $r.Def }}</td></tr></table>>];
{{ $r.Table.Name }}:{{ $c := index $r.Columns 0 }}{{ $c.Name }} -> {{ $r.ParentTable.Name }}:{{ $pc := index $r.ParentColumns 0 }}{{ $pc.Name }} [dir=back, arrowtail=crow, taillabel=<<table cellpadding="5" border="0" cellborder="0"><tr><td>{{ $r.Def }}</td></tr></table>>];
{{- end }}
}
12 changes: 6 additions & 6 deletions output/md/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ var _Assetsac44302fb6150a621aa9d04a0350aac972bf7e18 = "# {{ .Table.Name }}\n\n##

// Assets returns go-assets FileSystem
var Assets = assets.NewFileSystem(map[string][]string{"/": []string{"index.md.tmpl", "table.md.tmpl"}}, map[string]*assets.File{
"/table.md.tmpl": &assets.File{
Path: "/table.md.tmpl",
FileMode: 0x1a4,
Mtime: time.Unix(1527296235, 1527296235000000000),
Data: []byte(_Assetsac44302fb6150a621aa9d04a0350aac972bf7e18),
}, "/": &assets.File{
"/": &assets.File{
Path: "/",
FileMode: 0x800001ed,
Mtime: time.Unix(1527296235, 1527296235000000000),
Expand All @@ -26,4 +21,9 @@ var Assets = assets.NewFileSystem(map[string][]string{"/": []string{"index.md.tm
FileMode: 0x1a4,
Mtime: time.Unix(1526904993, 1526904993000000000),
Data: []byte(_Assets43889384df1c6f74d764c29d91b9d5637eb46061),
}, "/table.md.tmpl": &assets.File{
Path: "/table.md.tmpl",
FileMode: 0x1a4,
Mtime: time.Unix(1527296235, 1527296235000000000),
Data: []byte(_Assetsac44302fb6150a621aa9d04a0350aac972bf7e18),
}}, "")

0 comments on commit 2f6811a

Please # to comment.