Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Add files via upload | 0724fefb4978a0d91e10a93db4e2cfa7c1780908 | poonamveeral | 2020-04-02 15:23:00 |
Add files via upload | dd347084d37bd2ef37b7e3c77cdb6a009e572c8b | poonamveeral | 2020-04-02 15:20:48 |
Add files via upload | 6ee2563c712fcaac7df1d6eb0b23ffc69f2ac4b9 | poonamveeral | 2020-04-02 15:20:33 |
Add files via upload | cf59c5cfcd4f5ec14fbd2f44259c12eeb6807c25 | poonamveeral | 2020-04-02 15:20:07 |
Add files via upload | 55bbdafca8c9203b5b29b3e1548e55e9b8e6299f | poonamveeral | 2020-04-02 15:19:35 |
Add files via upload | 101413087f21fa91a122027b83935f567a154575 | poonamveeral | 2020-04-02 15:18:46 |
Add files via upload | 4b23b55a1a74e30626ffb0908597a02b8c05c1ba | poonamveeral | 2020-04-02 15:17:53 |
Add files via upload | 7de4d7172002df5784c6585a382de55f35d909a8 | poonamveeral | 2020-04-02 15:17:30 |
Add files via upload | e7780bd581399dcc09a61771e79515b4e5eff1c2 | poonamveeral | 2020-04-02 15:16:37 |
Initial commit | 19b3cf0fb56429d4c4b5aabb08367390540246d5 | Poonam Veeral | 2020-04-02 15:09:01 |
File notes/fig/er/Abstract.tex added (mode: 100644) (index 0000000..4bda8f0) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (A) {A}; | ||
6 | \node [relationship] (R) [right=of A] {R} edge node[above]{$\cM$} (A); | ||
7 | \node [entity] (B) [right = of R] {B} edge[total] node[above]{$1$} (R); | ||
8 | \end{tikzpicture} | ||
9 | |||
10 | \end{document} |
File notes/fig/er/Accident.tex added (mode: 100644) (index 0000000..9765abc) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[entity] (person) {Person}; | ||
6 | \node[attribute] (pid) [left of=person] {\key{id}} edge (person); | ||
7 | \node[attribute] (name) [above left of=person] {Name} edge (person); | ||
8 | \node[attribute] (address) [below left of=person] {address} edge (person); | ||
9 | |||
10 | \node[relationship] (owns) [above right of=person] {Owns} edge node[above, sloped]{$M$} (person); | ||
11 | \node[entity] (car) [above right of=owns] {Car} edge node[above, sloped]{$N$} (owns); | ||
12 | \node[attribute] (licence) [above left of=car] {\key{licence}} edge (car); | ||
13 | \node[attribute] (model) [above of =car] {model} edge (car); | ||
14 | \node[attribute] (year) [above right of =car] {year} edge (car); | ||
15 | |||
16 | \node[relationship] (accident) [right = 5cm of person] {Accident} edge[total] node[above, sloped]{$M$} (person); | ||
17 | \node[attribute] (report_number) [below of = accident] {\key{Report Number}} edge (accident); | ||
18 | \node[attribute] (time) [right of = accident] {Time} edge (accident); | ||
19 | \node[attribute] (place) [below right of = accident] {Place} edge (accident); | ||
20 | \node[attribute] (damage_amount) [above right of = accident] {Damage\_Amount} edge (accident); | ||
21 | |||
22 | \draw (car) edge[total] node[above, sloped]{$N$} (accident); | ||
23 | \end{tikzpicture} | ||
24 | |||
25 | \end{document} |
File notes/fig/er/Account.tex added (mode: 100644) (index 0000000..66bcf00) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (CUSTOMER) {CUSTOMER}; | ||
6 | \node [relationship] (POSSESSES) [right=of CUSTOMER] {POSSESSES} edge node[above]{$1$} (CUSTOMER); | ||
7 | \node [entity] [right = of POSSESSES] {ACCOUNT} edge node[above]{$\cN$} (POSSESSES); | ||
8 | \node [entity] [below = of POSSESSES] {BANK} edge node[left]{$1$} (POSSESSES); | ||
9 | \end{tikzpicture} | ||
10 | \end{document} |
File notes/fig/er/Alt_Not1.tex added (mode: 100644) (index 0000000..804a61e) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (CAR) {CAR}; | ||
6 | \node [relationship] (CARPOOLING) [right=of CAR] {CARPOOLING} edge[total] node[above]{$\cN$} (CAR); | ||
7 | \node [entity] (PERSON) [right = of CARPOOLING] {PERSON} edge node[above]{$\cM$} (CARPOOLING); | ||
8 | \end{tikzpicture} | ||
9 | |||
10 | \end{document} |
File notes/fig/er/Alt_Not2.tex added (mode: 100644) (index 0000000..b105ea3) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (CAR) {CAR}; | ||
6 | \node [relationship] (CARPOOLING) [right=of CAR] {CARPOOLING} edge node[above]{$(1,5)$} (CAR); | ||
7 | \node [entity] (PERSON) [right = of CARPOOLING] {PERSON} edge node[above]{$(0, 3)$} (CARPOOLING); | ||
8 | \end{tikzpicture} | ||
9 | |||
10 | \end{document} |
File notes/fig/er/Alt_Not3.tex added (mode: 100644) (index 0000000..cf8cc70) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | % Above | ||
6 | \node (A) {}; | ||
7 | \node [relationship] (R) [right=of A] {} edge node[above]{$1$} (A); | ||
8 | \node (B) [right = of R] {} edge node[above]{$\cN$} (R); | ||
9 | |||
10 | \node (ar) [right of = B] {\(\Rightarrow\)}; | ||
11 | |||
12 | \node (A1) [right of = ar] {}; | ||
13 | \node [relationship] (R1) [right=of A1] {} edge node[above]{$(0, \cN)$} (A1); | ||
14 | \node (B1) [right = of R1] {} edge node[above]{$(0,1)$} (R1); | ||
15 | |||
16 | % Middle | ||
17 | \node (A2) [below of = A] {}; | ||
18 | \node [relationship] (R2) [right=of A2] {} edge[total] node[above]{$1$} (A2); | ||
19 | \node (B2) [right = of R2] {} edge node[above]{$\cN$} (R2); | ||
20 | |||
21 | \node (ar1) [right of = B2] {\(\Rightarrow\)}; | ||
22 | |||
23 | \node (A21) [right of = ar1] {}; | ||
24 | \node [relationship] (R21) [right=of A21] {} edge node[above]{$(1, \cN)$} (A21); | ||
25 | \node (B21) [right = of R21] {} edge node[above]{$(0,1)$} (R21); | ||
26 | |||
27 | % Below | ||
28 | \node (A3) [below of = A2] {}; | ||
29 | \node [relationship] (R3) [right=of A3] {} edge[total] node[above]{$\cM$} (A3); | ||
30 | \node (B3) [right = of R3] {} edge[total] node[above]{$\cN$} (R3); | ||
31 | |||
32 | \node (ar2) [right of = B3] {\(\Rightarrow\)}; | ||
33 | |||
34 | \node (A5) [right of = ar2] {}; | ||
35 | \node [relationship] (R5) [right=of A5] {} edge node[above]{$(1, \cN)$} (A5); | ||
36 | \node (B5) [right = of R5] {} edge node[above]{$(1, \cM)$} (R5); | ||
37 | \end{tikzpicture} | ||
38 | |||
39 | \end{document} |
File notes/fig/er/Award.tex added (mode: 100644) (index 0000000..e4f48d9) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=1.5cm] | ||
5 | \node[entity] (INSTITUTION) {INSTITUTION}; | ||
6 | \node[attribute] [above of=INSTITUTION] {\key{Name}} edge (INSTITUTION); | ||
7 | \node[attribute] [right = .5cm of INSTITUTION] {Phone} edge (INSTITUTION); | ||
8 | \node[attribute] (Address) [below = .5cm of INSTITUTION] {Address} edge (INSTITUTION); | ||
9 | \node[attribute] [left = .5cm of Address] {Street} edge (Address); | ||
10 | \node[attribute] [below = .5cm of Address] {Zip} edge (Address); | ||
11 | \node[attribute] [below left = .5cm of Address] {City} edge (Address); | ||
12 | \node[attribute] (Location) [below right = .5cm of Address] {Location} edge (Address); | ||
13 | \node[attribute] [below = .5cm of Location] {Country} edge (Location); | ||
14 | \node[attribute] [below right = .5cm of Location] {State} edge (Location); | ||
15 | \node[derived attribute] [right = .5cm of Location] {Code} edge (Location); | ||
16 | % | ||
17 | \node[relationship] (AWARDEDTO) [left = 1.5cm of INSTITUTION] {AWARDED\_TO} edge node[above, pos=0.4] {$\cN$} (INSTITUTION); | ||
18 | % | ||
19 | \node[entity] (AWARD) [left = 1.5cm of AWARDEDTO] {AWARD} edge[total] node[above, pos=0.6]{$\cM$} (AWARDEDTO); | ||
20 | \node[attribute] [below right = .5cm and .5cm of AWARD] {Title} edge (AWARD); | ||
21 | \node[attribute] [left = .5cm of AWARD] {Amount} edge (AWARD); | ||
22 | \node[attribute] (Period) [below left = .5cm of AWARD] {Period} edge (AWARD); | ||
23 | \node[attribute] [below left = .5cm of Period] {Start} edge (Period); | ||
24 | \node[attribute] [below = .5cm of Period] {End} edge (Period); | ||
25 | \node[attribute] [above right of = AWARD] {\key{id}} edge (AWARD); | ||
26 | \node[attribute] [above = 1cm of AWARD] {Program Officier} edge (AWARD); | ||
27 | % | ||
28 | % \node[relationship] (EMPLOYS) [below =0.8cm of INSTITUTION] {EMPLOYS} edge node[right, pos=0.4] {$\cN$} (INSTITUTION); | ||
29 | % | ||
30 | \node[entity] (RESEARCHER) [below = 5cm of AWARD] {RESEARCHER}; | ||
31 | |||
32 | \node[attribute] (Name) [left = 0.5cm of RESEARCHER] {Name} edge (RESEARCHER); | ||
33 | \node[attribute] [above left = 0.5cm and 0.5cm of Name] {First Name} edge (Name); | ||
34 | \node[attribute] [below left = 0.5cm of Name] {Last Name} edge (Name); | ||
35 | \node[attribute] [below = 0.5cm of RESEARCHER] {\key{email}} edge (RESEARCHER); | ||
36 | |||
37 | \node[relationship] (CONDUCTEDBY) [below = 1 cm of AWARD] {CONDUCTED\_BY} edge[total] node[right, pos=0.4] {$\cM$} (AWARD) edge node[left]{$\cN$} (RESEARCHER); | ||
38 | \node[attribute] [right = .5cm of CONDUCTEDBY] {Role} edge (CONDUCTEDBY); | ||
39 | |||
40 | \node[attribute] (RePeriod) [right = .5cm of RESEARCHER] {Period} edge (RESEARCHER); | ||
41 | \node[attribute] [above right = .5cm of RePeriod] {Start} edge (RePeriod); | ||
42 | \node[attribute] [below right = .5cm of RePeriod] {End} edge (RePeriod); | ||
43 | |||
44 | \node[entity] (ORGANIZATION) [left = 3cm of AWARD] {ORGANIZATION}; | ||
45 | \node[attribute] [below = .5cm of ORGANIZATION] {Code} edge (ORGANIZATION); | ||
46 | |||
47 | \node[relationship] (GRANTS) [above left = 1cm and 1.5cm of AWARD] {GRANTS} edge node[above]{$1$} (ORGANIZATION) edge[total] node[above right]{$\cM$}(AWARD); | ||
48 | |||
49 | \node[entity] (DIRECTORATE) [left = 1.5cm of ORGANIZATION] {DIRECTORATE}; | ||
50 | |||
51 | \node[attribute] [below right = .5cm and 0 of DIRECTORATE] {Name} edge (DIRECTORATE); | ||
52 | \node[attribute] [below left = .5cm and 0cm of DIRECTORATE] {Abbreviation} edge (DIRECTORATE); | ||
53 | \node[attribute] [below = 1.3cm of DIRECTORATE] {Assistant Director} edge (DIRECTORATE); | ||
54 | |||
55 | |||
56 | \node[relationship] (BELONG1) [above left = 1cm and 0cm of ORGANIZATION] {BELONGS\_TO} edge node[above]{$\cN$} (ORGANIZATION) edge node[above =0.2cm]{$\cM$}(DIRECTORATE); | ||
57 | |||
58 | \node[entity] (DIVISION) [left = 1.5cm of DIRECTORATE] {DIVISION}; | ||
59 | |||
60 | \node[attribute] [left = .5cm of DIVISION] {Name} edge (DIVISION); | ||
61 | \node[attribute] [below left = 1cm of DIVISION] {Abbreviation} edge (DIVISION); | ||
62 | |||
63 | \node[relationship] (BELONG2) [above left = 1cm and 0cm of DIRECTORATE] {BELONGS\_TO} edge node[above]{$1$} (DIRECTORATE) edge[total] node[above=0.2cm ]{$\cM$}(DIVISION); | ||
64 | \end{tikzpicture} | ||
65 | |||
66 | \end{document} |
File notes/fig/er/Bad_Design.tex added (mode: 100644) (index 0000000..fd71b0c) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=2em] | ||
5 | \node[entity] (people) {PEOPLE}; | ||
6 | \node[relationship] (has) [right=of people] {HAS} edge (people); | ||
7 | \node[entity] (job) [right = of has] {JOB} edge (has); | ||
8 | \node[relationship] (in) [above=of job] {IN} edge (job); | ||
9 | \node[entity] (employer) [above=of in] {EMPLOYER} edge (in); | ||
10 | |||
11 | \draw [->, >=latex] (has)+(0, -1) -- ++(0, -2); | ||
12 | |||
13 | \node[entity] (person) [below right = 6.5 and -2.5 of people] {PERSON}; | ||
14 | \node[relationship] (occupies) [right=of person] {OCCUPIES} edge (person); | ||
15 | \node[entity] (position) [right = of occupies] {POSITION} edge (occupies); | ||
16 | \node[relationship] (offers) [above=of position] {OFFERS} edge (position); | ||
17 | \node[entity] (company) [above=of offers] {COMPANY} edge (offers); | ||
18 | \end{tikzpicture} | ||
19 | |||
20 | \end{document} |
File notes/fig/er/Belongs.tex added (mode: 100644) (index 0000000..a51a071) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[relationship] (contains){BELONGS}; | ||
6 | \node[entity] (burger) [left = 1cm of contains] {HAND} edge node[above] {$N$} (contains); | ||
7 | \node[entity] (ingredient) [right = 1cm of contains] {PERSON} edge node[above]{$1$} (contains); | ||
8 | \end{tikzpicture} | ||
9 | |||
10 | \end{document} |
File notes/fig/er/Bike.tex added (mode: 100644) (index 0000000..d6c5280) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=1.5cm] | ||
5 | \node[entity] (CUSTOMER) {CUSTOMER}; | ||
6 | \node[attribute] [above of=CUSTOMER] {\key{Name}} edge (CUSTOMER); | ||
7 | \node[attribute] [right = .5cm of CUSTOMER] {Phone} edge (CUSTOMER); | ||
8 | % | ||
9 | \node[ident relationship] (DROPPEDBY) [left = 1.5cm of CUSTOMER] {DROPPED\_BY} edge node[above, pos=0.4] {$1$} (CUSTOMER); | ||
10 | % | ||
11 | \node[weak entity] (BIKE) [left = 1.5cm of DROPPEDBY] {BIKE} edge[total] node[above, pos=0.6]{$\cM$} (DROPPEDBY); | ||
12 | \node[attribute] [above of = BIKE] {\pkey{Dropped\_Time\_Date}} edge (BIKE); | ||
13 | \node[attribute] (Description) [left = 0.5cm of BIKE] {Description} edge (BIKE); | ||
14 | \node[attribute] [above left of = Description] {Color} edge (Description); | ||
15 | \node[attribute] [below left of = Description] {Brand} edge (Description); | ||
16 | % | ||
17 | \node[relationship] (ASSIGNEDTO) [below =1cm of CUSTOMER] {ASSIGNED\_TO} edge [total] node[right, pos=0.4] {$\cM$} (CUSTOMER); | ||
18 | \node[attribute] [right = .5cm of ASSIGNEDTO] {Level\_Of\_Satisfaction} edge (ASSIGNEDTO); | ||
19 | % | ||
20 | \node[entity] (EMPLOYEE) [below = 5cm of CUSTOMER] {EMPLOYEE} edge node[right, pos=0.4] {$1$} (ASSIGNEDTO); | ||
21 | \node[attribute] [right = .5cm of EMPLOYEE] {\key{Name}} edge (EMPLOYEE); | ||
22 | \node[multi attribute] [below = .5cm of EMPLOYEE] {Specialty} edge (EMPLOYEE); | ||
23 | % | ||
24 | \node[relationship] (REPAIREDBY) [below right =3cm of BIKE] {REPAIRED\_BY} edge node[below, pos=0.6] {$\cM$} (BIKE) edge node[below, pos=0.6] {$1$} (EMPLOYEE); | ||
25 | |||
26 | |||
27 | %\node[entity] (CUSTOMER) {CUSTOMER}; | ||
28 | % | ||
29 | % | ||
30 | % | ||
31 | %\node[relationship] (SPEAKS) [below right of=CUSTOMER] {SPEAKS} edge node[right, pos=0.4] {$M$} (CUSTOMER); | ||
32 | %\node[entity] (LANGUAGE) [below right of=SPEAKS] {LANGUAGE} edge node[right, pos=0.5] {$N$} (SPEAKS); | ||
33 | %\node[attribute] (code) [left of = LANGUAGE] {\key{Code}} edge (LANGUAGE); | ||
34 | %\node[attribute] (symbol) [right of = LANGUAGE] {Name} edge (LANGUAGE); | ||
35 | % | ||
36 | %\node[relationship] (BWF) [below of = LANGUAGE] {B\_W\_F}; | ||
37 | %\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (BWF.west); | ||
38 | %\draw (LANGUAGE) to node[right, pos=0.6] {$M$} (BWF.east); | ||
39 | % | ||
40 | % | ||
41 | %\node[multi attribute] (color) [right =1cm of anthem] {Creator} edge (anthem); | ||
42 | |||
43 | % | ||
44 | %\node[relationship] (WIN) [above right of =LANGUAGE] {W\_IN}; | ||
45 | %\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (WIN); | ||
46 | %\draw (anthem) to node[right, pos=0.6] {$M$} (WIN); | ||
47 | |||
48 | \end{tikzpicture} | ||
49 | |||
50 | \end{document} |
File notes/fig/er/Binary_LectureNotes.tex added (mode: 100644) (index 0000000..050daf1) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (CLASS) {CLASS}; | ||
6 | \node [entity] (PROFESSOR) [right = 6cm of CLASS] {PROFESSOR}; | ||
7 | \node [entity] (LECTURE NOTES) [below right = of CLASS] {LECTURE NOTES}; | ||
8 | \node [relationship] (USES) [below = 1cm of CLASS] {USES} edge node[left]{$\cM$} (CLASS) edge node[above]{$\cN$} (LECTURE NOTES); | ||
9 | \node [relationship] (WRITTEN BY) [below =.4cm of PROFESSOR] {WRITTEN BY} edge node[above]{$\cM$} (LECTURE NOTES) edge node[right]{$\cN$} (PROFESSOR); | ||
10 | \end{tikzpicture} | ||
11 | \end{document} |
File notes/fig/er/Book.tex added (mode: 100644) (index 0000000..4edddc5) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (PERSON) {PERSON}; | ||
6 | \node [relationship] (BOUGHT) [right=of PERSON] {BOUGHT} edge node[above]{$\cM$} (PERSON); | ||
7 | \node [entity] [right = of BOUGHT] {BOOK} edge node[above]{$\cN$} (BOUGHT); | ||
8 | \node [entity] [below = of BOUGHT] {BOOKSHOP} edge node[left]{$\cO$} (BOUGHT); | ||
9 | \end{tikzpicture} | ||
10 | \end{document} |
File notes/fig/er/Book2.tex added (mode: 100644) (index 0000000..64e12d3) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=8em] | ||
5 | \node [entity] (PERSON) {PERSON}; | ||
6 | \node [relationship] (POSSESSES) [right=of PERSON] {POSSESSES} edge node[above]{$1$} (PERSON); | ||
7 | \node [entity] (BOOK) [right = of POSSESSES] {BOOK} edge node[above]{$\cN$} (POSSESSES); | ||
8 | \node [relationship] (SELLS) [below left = 1cm of BOOK] {SOLD BY} edge node[below right]{$\cM$} (BOOK); | ||
9 | \node [entity] (BOOKSHOP) [below = of POSSESSES] {BOOKSHOP} edge node[left]{$\cO$} (SELLS); | ||
10 | \node [relationship] (VISITS) [below right = 1.8cm of PERSON] {VISITS} edge node[above right]{$\cN$} (BOOKSHOP) edge node[above right]{$\cO$} (PERSON); | ||
11 | \end{tikzpicture} | ||
12 | \end{document} |
File notes/fig/er/Car_Info.tex added (mode: 100644) (index 0000000..9996aad) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=8em] | ||
5 | \node[entity] (person) {PERSON}; | ||
6 | \node[attribute] (pid) [left of=person] {\key{ID}} edge (person); | ||
7 | \node[attribute] (name) [above left of=person] {Name} edge (person); | ||
8 | \node[multi attribute] (phone) [above of=person] {Phone} edge (person); | ||
9 | \node[attribute] (address) [above right of=person] {Address} edge (person); | ||
10 | \node[attribute] (street) [above right of=address] {Street} edge (address); | ||
11 | \node[attribute] (city) [right of=address] {City} edge (address); | ||
12 | %\node[derived attribute] (age) [right of=person] {Age} edge (person); | ||
13 | |||
14 | \node[relationship] (drives) [below right of=person] {DRIVES} edge node[above, pos=0.1] {$1$} (person); | ||
15 | \node[entity] (car) [below left of=drives] {CAR} edge node[above, pos=0.7] {$1$} (drives); | ||
16 | \node[attribute] (make) [left of=car] {Make} edge (car); | ||
17 | \node[attribute] (year) [below left of =car] {Year} edge (car); | ||
18 | \node[attribute] (brand) [below of =car] {Brand} edge (car); | ||
19 | |||
20 | \node[relationship] (seats) [below left of=person] {SEATS\_IN} edge node[above, pos=0.1] {$N$} (person); | ||
21 | \draw (seats) edge node[above, pos=0.3] {$1$} (car); | ||
22 | \node[attribute] (position) [left of=seats] {Position} edge (seats); | ||
23 | |||
24 | \node[ident relationship] (insured) [right of=car] {INSURED} edge node[above, pos=0.3] {$1$} (car); | ||
25 | \node[weak entity] (insurance) [right = 1cm of insured] {CAR\_INSURANCE} edge[total] node[above, pos=0.7] {$N$} (insured); | ||
26 | \node[attribute] (amount) [above of =insurance] {Covered Amount} edge (insurance); | ||
27 | \node[attribute] (policy) [above right of =insurance] {Policy Number} edge (insurance); | ||
28 | \node[attribute] (company) [below right of =insurance] {Company Name} edge (insurance); | ||
29 | \end{tikzpicture} | ||
30 | |||
31 | \end{document} |
File notes/fig/er/Cellphone.tex added (mode: 100644) (index 0000000..965775c) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[entity] (cellphone) {CELLPHONE}; | ||
6 | \node[attribute] (mid) [left of=cellphone] {\key{MIN}} edge (cellphone); | ||
7 | \node[multi attribute] (app) [above of=cellphone] {App\_Installed} edge (cellphone); | ||
8 | \node[attribute] (plan) [right of=cellphone] {Plan} edge (cellphone); | ||
9 | \node[attribute] (carrier) [above right of=plan] {Carrier} edge (plan); | ||
10 | \node[attribute] (price) [right of=plan] {Price} edge (plan); | ||
11 | \end{tikzpicture} | ||
12 | |||
13 | \end{document} |
File notes/fig/er/CompOS.tex added (mode: 100644) (index 0000000..d26366e) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (os) {O.S.}; | ||
6 | \node [relationship] (installed) [right=of os] {IS SUPPORTED BY} edge node[above]{$\cN$} (os); | ||
7 | \node [entity] (comp) [right = of installed] {COMPUTER} edge[total] node[above]{$\cM$} (installed); | ||
8 | \end{tikzpicture} | ||
9 | |||
10 | \end{document} |
File notes/fig/er/Computer.tex added (mode: 100644) (index 0000000..4137046) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[entity] (computer) {COMPUTER}; | ||
6 | \node[attribute] (pid) [left of=computer] {\key{Id}} edge (computer); | ||
7 | \node[multi attribute] (os) [above of=computer] {Operating\_System} edge (computer); | ||
8 | \node[attribute] (devices) [right of=computer] {Devices} edge (computer); | ||
9 | \node[attribute] (mouse) [above right of=devices] {Mouse} edge (devices); | ||
10 | \node[attribute] (keyboard) [right of=devices] {Keyboard} edge (devices); | ||
11 | \end{tikzpicture} | ||
12 | |||
13 | \end{document} |
File notes/fig/er/Computer_User.tex added (mode: 100644) (index 0000000..76ba06d) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[entity] (COMPUTER) {COMPUTER}; | ||
6 | \node[attribute] (mid) [left of=COMPUTER] {\key{MAC}} edge (COMPUTER); | ||
7 | \node[multi attribute] (User) [right of=COMPUTER] {User} edge (COMPUTER); | ||
8 | \node[attribute] [above right of=User] {Name} edge (User); | ||
9 | \node[attribute] [right of=User] {Email} edge (User); | ||
10 | \end{tikzpicture} | ||
11 | |||
12 | \end{document} |
File notes/fig/er/Constraint1.tex added (mode: 100644) (index 0000000..0d36919) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (course) {COURSE}; | ||
6 | \node [relationship] (offeredby) [right=of course] {OFFERED\_BY} edge node[above]{$\cN$} (course); | ||
7 | \node [entity] (department) [right = of offeredby] {DEPARTMENT} edge node[above]{$1$} (offeredby); | ||
8 | \end{tikzpicture} | ||
9 | |||
10 | \end{document} |
File notes/fig/er/Constraint2.tex added (mode: 100644) (index 0000000..b7b12bb) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (course) {COURSE}; | ||
6 | \node [relationship] (offeredby) [right=of course] {OFFERED\_BY} edge[total] node[above]{$\cN$} (course); | ||
7 | \node [entity] (department) [right = of offeredby] {DEPARTMENT} edge node[above]{$1$} (offeredby); | ||
8 | \end{tikzpicture} | ||
9 | |||
10 | \end{document} |
File notes/fig/er/Contains.tex added (mode: 100644) (index 0000000..ed1462b) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[relationship] (contains){CONTAINS}; | ||
6 | \node[entity] (burger) [left = 1cm of contains] {BURGER} edge[total] node[above] {$N$} (contains); | ||
7 | \node[entity] (ingredient) [right = 1cm of contains] {INGREDIENT} edge node[above]{$M$} (contains); | ||
8 | \end{tikzpicture} | ||
9 | |||
10 | \end{document} |
File notes/fig/er/Country.tex added (mode: 100644) (index 0000000..af01a24) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=8em] | ||
5 | \node[entity] (COUNTRY) {COUNTRY}; | ||
6 | \node[attribute] (name) [left of=COUNTRY] {\key{Name}} edge (COUNTRY); | ||
7 | \node[attribute] (population) [below left of=COUNTRY] {Population} edge (COUNTRY); | ||
8 | |||
9 | \node[relationship] (SPEAKS) [below right of=COUNTRY] {SPEAKS} edge node[right, pos=0.4] {$M$} (COUNTRY); | ||
10 | \node[entity] (LANGUAGE) [below right of=SPEAKS] {LANGUAGE} edge node[right, pos=0.5] {$N$} (SPEAKS); | ||
11 | \node[attribute] (code) [left of = LANGUAGE] {\key{Code}} edge (LANGUAGE); | ||
12 | \node[attribute] (symbol) [right of = LANGUAGE] {Name} edge (LANGUAGE); | ||
13 | |||
14 | \node[relationship] (BWF) [below of = LANGUAGE] {B\_W\_F}; | ||
15 | \draw (LANGUAGE) to node[left, pos=0.6] {$N$} (BWF.west); | ||
16 | \draw (LANGUAGE) to node[right, pos=0.6] {$M$} (BWF.east); | ||
17 | |||
18 | %\node[relationship] (boundary) [above of = COUNTRY] {S\_B\_W}; | ||
19 | %\draw (COUNTRY) to node[left, pos=0.6] {$N$} (boundary.west); | ||
20 | %\draw (COUNTRY) to node[right, pos=0.6] {$M$} (boundary.east); | ||
21 | |||
22 | %\node[relationship] (conversion) [below of =LANGUAGE] {CONVERSION}; | ||
23 | %\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (conversion.west); | ||
24 | %\draw (LANGUAGE) to node[right, pos=0.6] {$M$} (conversion.east); | ||
25 | |||
26 | %\node[attribute] (timestamp) [below left of=conversion] {\key{Timestamp}} edge (conversion); | ||
27 | %\node[attribute] (rate) [below right of=conversion] {Exchange\_rate} edge (conversion); | ||
28 | |||
29 | \node[ident relationship] (hasfor) [right of=COUNTRY] {SINGS} edge node[above, pos=0.4] {$1$} (COUNTRY); | ||
30 | \node[weak entity] (anthem) %[right of=hasfor] | ||
31 | [right = 1cm of hasfor] {NATIONAL\_ANTHEM} edge[total] node[above, pos=0.6]{$M$} (hasfor); | ||
32 | \node[multi attribute] (color) [right =1cm of anthem] {Creator} edge (anthem); | ||
33 | \node[attribute] (name) [below right of = anthem] {\pkey{Name}} edge (anthem); | ||
34 | |||
35 | \node[relationship] (WIN) [above right of =LANGUAGE] {W\_IN}; | ||
36 | \draw (LANGUAGE) to node[left, pos=0.6] {$N$} (WIN); | ||
37 | \draw (anthem) to node[right, pos=0.6] {$M$} (WIN); | ||
38 | \end{tikzpicture} | ||
39 | |||
40 | \end{document} |
File notes/fig/er/Customers.tex added (mode: 100644) (index 0000000..08a42f7) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=1.5cm] | ||
5 | \node[entity] (CUSTOMER) {CUSTOMER}; | ||
6 | \node[attribute] [above of=CUSTOMER] {Name} edge (CUSTOMER); | ||
7 | \node[attribute] [right = .5cm of CUSTOMER] {\key{ID}} edge (CUSTOMER); | ||
8 | \node[attribute] [below of=CUSTOMER] {Address} edge (CUSTOMER); | ||
9 | % | ||
10 | \node[ident relationship] (PASSEDBY) [left = 1.5cm of CUSTOMER] {PASSED\_BY} edge node[above, pos=0.4] {$1$} (CUSTOMER); | ||
11 | \node[attribute] [above = .5cm of PASSEDBY] {DateTime} edge (PASSEDBY); | ||
12 | % | ||
13 | \node[weak entity] (ORDER) [left = 1.5cm of PASSEDBY] {ORDER} edge[total] node[above, pos=0.6]{$\cM$} (PASSEDBY); | ||
14 | \node[attribute] [above of = ORDER] {\pkey{ID}} edge (ORDER); | ||
15 | % | ||
16 | \node[entity] (PRODUCT) [below = 4cm of ORDER] {PRODUCT};% edge node[right, pos=0.4] {$1$} (ASSIGNEDTO); | ||
17 | \node[attribute] [above left = .5cm of PRODUCT] {\key{ID}} edge (PRODUCT); | ||
18 | \node[attribute] [left = .5cm of PRODUCT] {Brand} edge (PRODUCT); | ||
19 | \node[attribute] [right = .5cm of PRODUCT] {Price} edge (PRODUCT); | ||
20 | \node[attribute] [below left = .5cm of PRODUCT] {Caution} edge (PRODUCT); | ||
21 | \node[attribute] [below right = .5cm of PRODUCT] {Material} edge (PRODUCT); | ||
22 | \node[attribute] [below = .7cm of PRODUCT] {Description} edge (PRODUCT); | ||
23 | % | ||
24 | \node[relationship] (CONTAINS) [below=1cm of ORDER] {CONTAINS} edge [total] node[right, pos=0.6] {$\cM$} (ORDER) edge node[right, pos=0.6] {$1$} (PRODUCT); | ||
25 | \node[attribute] [right = .5cm of CONTAINS] {Quantity} edge (CONTAINS); | ||
26 | \end{tikzpicture} | ||
27 | |||
28 | \end{document} |
File notes/fig/er/Dependent.tex added (mode: 100644) (index 0000000..7dc8bf5) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=8em] | ||
5 | \node[entity] (EMPLOYEE) {EMPLOYEE}; | ||
6 | \node[attribute] (make) [left of=EMPLOYEE] {\key{SSN}} edge (EMPLOYEE); | ||
7 | \node[attribute] (year) [below left of =EMPLOYEE] {Role} edge (EMPLOYEE); | ||
8 | \node[attribute] (brand) [below of =EMPLOYEE] {Name} edge (EMPLOYEE); | ||
9 | |||
10 | \node[ident relationship] (RELATEDTO) [right of=EMPLOYEE] {RELATED TO} edge node[above, pos=0.3] {$1$} (EMPLOYEE); | ||
11 | \node[weak entity] (DEPENDENT) [right = 1cm of RELATEDTO] {DEPENDENT} edge[total] node[above, pos=0.7] {$N$} (RELATEDTO); | ||
12 | \node[attribute] (amount) [below of =DEPENDENT] {\pkey{Name}} edge (DEPENDENT); | ||
13 | \node[attribute] (company) [below right of =DEPENDENT] {Address} edge (DEPENDENT); | ||
14 | \end{tikzpicture} | ||
15 | |||
16 | \end{document} |
File notes/fig/er/Desk.tex added (mode: 100644) (index 0000000..11f077c) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[entity] (DESK) {DESK}; | ||
6 | \node[attribute] (pid) [left of=DESK] {\key{Serial}} edge (DESK); | ||
7 | \node[multi attribute] [above of=DESK] {Color} edge (DESK); | ||
8 | \node[attribute] (Location) [right of=DESK] {Location} edge (DESK); | ||
9 | \node[attribute] [above right of=Location] {Building} edge (Location); | ||
10 | \node[attribute] [right of=Location] {Room} edge (Location); | ||
11 | \end{tikzpicture} | ||
12 | |||
13 | \end{document} |
File notes/fig/er/Doula.tex added (mode: 100644) (index 0000000..927ca6d) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=8em] | ||
5 | \node[entity] (HEALTHCAREPROVIDER) {HEALTH\_CARE\_PROVIDER}; | ||
6 | \node[ident relationship] (COVERS) [below right of=HEALTHCAREPROVIDER] {COVERS} edge node[above, pos=0.3] {$1$} (HEALTHCAREPROVIDER); | ||
7 | \node[weak entity] (PERSON) [right = 1cm of COVERS] {INSUREE} edge[total] node[above, pos=0.7] {$\cN$} (COVERS); | ||
8 | \node[ident relationship] (ISFOLLOWEDBY) [above right of =PERSON] {IS FOLLOWED BY} edge node[above, pos=0.7] {$1$} (PERSON); | ||
9 | \node[weak entity] (DOULA) [right = 1cm of ISFOLLOWEDBY] {DOULA} edge[total] node[above, pos=0.3] {$\cM$} (ISFOLLOWEDBY); | ||
10 | \end{tikzpicture} | ||
11 | |||
12 | \end{document} |
File notes/fig/er/Entity_Instructor.tex added (mode: 100644) (index 0000000..e459f9e) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[entity] (entity) {INSTRUCTOR}; | ||
6 | \node[attribute] (pid) [left = 2em of entity] {\key{Login}} edge (entity); | ||
7 | \node[attribute] (name) [above left of=entity] {Position Title} edge (entity); | ||
8 | \node[attribute] (name) [above =5em of entity] {Name} edge (entity); | ||
9 | \node[attribute] (fname) [above left of = name] {First Name} edge (name); | ||
10 | \node[attribute] (lname) [above right of = name] {Last Name} edge (name); | ||
11 | \node[multi attribute] (mname) [above of = name] {Middle Name} edge (name); | ||
12 | \node[multi attribute] (phone) [right =2em of entity] {Phone} edge (entity); | ||
13 | \node[attribute] (address) [below =1em of entity] {Location} edge (entity); | ||
14 | \node[attribute] (street) [below right of=address] {Room \#} edge (address); | ||
15 | \node[attribute] (city) [below left of=address] {Building} edge (address); | ||
16 | \node[derived attribute] (age) [above right of=entity] {Tenured} edge (entity); | ||
17 | |||
18 | \end{tikzpicture} | ||
19 | |||
20 | \end{document} |
File notes/fig/er/Example_of_Derived.tex added (mode: 100644) (index 0000000..2638ff5) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[entity] (phone) {PHONE}; | ||
6 | \node[attribute] [left of=phone] {Price} edge (phone); | ||
7 | \node[attribute] [above of=phone] {Weight in oz} edge (phone); | ||
8 | \node[derived attribute] [above right of=phone] {Weight in g} edge (phone); | ||
9 | \end{tikzpicture} | ||
10 | |||
11 | \end{document} |
File notes/fig/er/Gym.tex added (mode: 100644) (index 0000000..212d7ad) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (MEMBER) {MEMBER}; | ||
6 | \node [relationship] (RESERVES) [right=of MEMBER] {RESERVES} edge node[above]{$1$} (MEMBER); | ||
7 | \node [entity] [right = of RESERVES] {EQUIPMENT} edge node[above]{$1$} (RESERVES); | ||
8 | \node [entity] [below = of RESERVES] {TIME\_SLOT} edge node[left]{$\cN$} (RESERVES); | ||
9 | \end{tikzpicture} | ||
10 | \end{document} |
File notes/fig/er/Job.tex added (mode: 100644) (index 0000000..80cd4e3) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=1.5cm] | ||
5 | \node[entity] (COMPANY) {COMPANY}; | ||
6 | \node[attribute] [above of=COMPANY] {\key{Name}} edge (COMPANY); | ||
7 | \node[attribute] (Address) [right = .5cm of COMPANY] {Address} edge (COMPANY); | ||
8 | \node[attribute] [right = .5cm of Address] {Physical} edge (Address); | ||
9 | \node[attribute] [below right = .5cm of Address] {Numerical} edge (Address); | ||
10 | \node[multi attribute] [above right = .5cm of COMPANY] {Benefits} edge (COMPANY); | ||
11 | % | ||
12 | \node[relationship] (ADVERTISEDBY) [left = 1.5cm of COMPANY] {ADVERTISED\_BY} edge node[above, pos=0.4] {$\c1$} (COMPANY); | ||
13 | \node[attribute] [above = .3cm of ADVERTISEDBY] {URL} edge (ADVERTISEDBY); | ||
14 | % | ||
15 | \node[entity] (JOBAD) [left = 1.5cm of ADVERTISEDBY] {JOB\_AD} edge[total] node[above, pos=0.6]{$\cM$} (ADVERTISEDBY); | ||
16 | \node[attribute] [above left of = JOBAD] {Title} edge (JOBAD); | ||
17 | \node[attribute] [left = .5cm of JOBAD] {Salary Range} edge (JOBAD); | ||
18 | \node[multi attribute] [below left = .5cm of JOBAD] {Requirement} edge (JOBAD); | ||
19 | \node[attribute] [above right of = JOBAD] {\key{id}} edge (JOBAD); | ||
20 | % | ||
21 | \node[relationship] (EMPLOYS) [below =0.8cm of COMPANY] {EMPLOYS} edge node[right, pos=0.4] {$\cN$} (COMPANY); | ||
22 | % | ||
23 | \node[entity] (CONTACT) [below left = 3cm and 2cm of COMPANY] {CONTACT} edge node[above, pos=0.4] {$\cM$} (EMPLOYS); | ||
24 | \node[attribute] [right = .5cm of CONTACT] {Name} edge (CONTACT); | ||
25 | \node[attribute] [below right = .5cm and .2cm of CONTACT] {\key{Id}} edge (CONTACT); | ||
26 | \node[attribute] [below = .5cm of CONTACT] {Role} edge (CONTACT); | ||
27 | % | ||
28 | \node[relationship] (DISCUSSED) [below right = 0.8cm and 1cm of JOBAD] {DISCUSSED\_BY} edge node[right, pos=0.4] {$\cN$} (CONTACT) edge node[above, pos=0.4] {$\cM$} (JOBAD); | ||
29 | % \node[relationship] (REPAIREDBY) [below right =3cm of JOBAD] {REPAIRED\_BY} edge node[below, pos=0.6] {$\cM$} (JOBAD) edge node[below, pos=0.6] {$1$} (CONTACT); | ||
30 | % | ||
31 | |||
32 | \node[weak entity] (OFFER) [below = 5cm of JOBAD] {OFFER}; | ||
33 | |||
34 | \node[attribute] [left = 0.5cm of OFFER] {Salary Offered} edge (OFFER); | ||
35 | \node[attribute] [below left = 0.5cm of OFFER] {Start Date} edge (OFFER); | ||
36 | |||
37 | \node[ident relationship] (RESULTEDIN) [below = 1 cm of JOBAD] {RESULTED\_IN} edge node[right, pos=0.4] {$1$} (JOBAD) edge[total] node[left]{$1$} (OFFER); | ||
38 | |||
39 | \node[attribute] [below of = OFFER] {\pkey{Date}} edge (OFFER); | ||
40 | |||
41 | %\node[entity] (COMPANY) {COMPANY}; | ||
42 | % | ||
43 | % | ||
44 | % | ||
45 | %\node[relationship] (SPEAKS) [below right of=COMPANY] {SPEAKS} edge node[right, pos=0.4] {$M$} (COMPANY); | ||
46 | %\node[entity] (LANGUAGE) [below right of=SPEAKS] {LANGUAGE} edge node[right, pos=0.5] {$N$} (SPEAKS); | ||
47 | %\node[attribute] (code) [left of = LANGUAGE] {\key{Code}} edge (LANGUAGE); | ||
48 | %\node[attribute] (symbol) [right of = LANGUAGE] {Name} edge (LANGUAGE); | ||
49 | % | ||
50 | %\node[relationship] (BWF) [below of = LANGUAGE] {B\_W\_F}; | ||
51 | %\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (BWF.west); | ||
52 | %\draw (LANGUAGE) to node[right, pos=0.6] {$M$} (BWF.east); | ||
53 | % | ||
54 | % | ||
55 | %\node[multi attribute] (color) [right =1cm of anthem] {Creator} edge (anthem); | ||
56 | |||
57 | % | ||
58 | %\node[relationship] (WIN) [above right of =LANGUAGE] {W\_IN}; | ||
59 | %\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (WIN); | ||
60 | %\draw (anthem) to node[right, pos=0.6] {$M$} (WIN); | ||
61 | |||
62 | \end{tikzpicture} | ||
63 | |||
64 | \end{document} |
File notes/fig/er/KeyOpensDoor.tex added (mode: 100644) (index 0000000..1450d1d) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (key) {KEY}; | ||
6 | \node [relationship] (opens) [right=of key] {OPENS} edge[total] node[above]{$\cN$} (key); | ||
7 | \node [entity] (door) [right = of opens] {DOOR} edge node[above]{$1$} (opens); | ||
8 | \end{tikzpicture} | ||
9 | |||
10 | \end{document} |
File notes/fig/er/Library.tex added (mode: 100644) (index 0000000..8365502) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=1.5cm] | ||
5 | \node[entity] (COPY) {COPY}; | ||
6 | \node[attribute] [above of=COPY] {\key{Code}} edge (COPY); | ||
7 | % | ||
8 | \node[relationship] (POSSESSES) [left = 1.5cm of COPY] {POSSESSES} edge[total] node[above, pos=0.4] {$\cM$} (COPY); | ||
9 | % | ||
10 | \node[entity] (LIBRARY) [left = 1.5cm of POSSESSES] {LIBRARY} edge node[above, pos=0.6]{$1$} (POSSESSES); | ||
11 | \node[attribute] [above of = LIBRARY] {\key{Name}} edge (LIBRARY); | ||
12 | \node[attribute] (Address) [left = 0.5cm of LIBRARY] {Address} edge (LIBRARY); | ||
13 | \node[attribute] [above left of = Address] {Number} edge (Address); | ||
14 | \node[attribute] [left = .5cm of Address] {Street} edge (Address); | ||
15 | \node[attribute] [below left of = Address] {Zip} edge (Address); | ||
16 | % | ||
17 | \node[relationship] (OF) [right = 1.5cm of COPY] {OF} edge[total] node[above, pos=0.4] {$\cM$} (COPY); | ||
18 | % | ||
19 | \node[entity] (DOCUMENT) [right = 1.5cm of OF] {DOCUMENT} edge node[above, pos=0.6]{$1$} (OF); | ||
20 | \node[attribute] [below of = DOCUMENT] {\key{Catalog Number}} edge (DOCUMENT); | ||
21 | \node[attribute] [above of = DOCUMENT] {Kind} edge (DOCUMENT); | ||
22 | \node[attribute] [right = .5cm of DOCUMENT] {Title} edge (DOCUMENT); | ||
23 | % | ||
24 | \node[relationship] (BORROWEDBY) [below left = 2cm and 0.5cm of COPY] {BORROWED\_BY} edge node[left, pos=0.4] {$\cM$} (COPY); | ||
25 | \node[attribute] [left = .5cm of BORROWEDBY] {Return\_Date} edge (BORROWEDBY); | ||
26 | % | ||
27 | \node[relationship] (HOLDBY) [below right = 2cm and 0.5cm of COPY] {HOLD\_BY} edge node[right, pos=0.4] {$\cM$} (COPY); | ||
28 | \node[attribute] [right = .5cm of HOLDBY] {Expiration\_Date} edge (HOLDBY); | ||
29 | % | ||
30 | \node[entity] (PATRON) [below = 5cm of COPY] {PATRON} edge node[left] {$1$} (HOLDBY) edge node[right] {$1$} (BORROWEDBY); | ||
31 | \node[attribute] [below right = 1cm of PATRON] {\key{Card Number}} edge (PATRON); | ||
32 | \node[attribute] [below = 1cm of PATRON] {Name} edge (PATRON); | ||
33 | \node[attribute] [below left = 1cm of PATRON] {Email} edge (PATRON); | ||
34 | % | ||
35 | % \node[relationship] (REPAIREDBY) [below right =3cm of LIBRARY] {REPAIRED\_BY} edge node[below, pos=0.6] {$\cM$} (LIBRARY) edge node[below, pos=0.6] {$1$} (PATRON); | ||
36 | |||
37 | |||
38 | %\node[entity] (COPY) {COPY}; | ||
39 | % | ||
40 | % | ||
41 | % | ||
42 | %\node[relationship] (SPEAKS) [below right of=COPY] {SPEAKS} edge node[right, pos=0.4] {$M$} (COPY); | ||
43 | %\node[entity] (LANGUAGE) [below right of=SPEAKS] {LANGUAGE} edge node[right, pos=0.5] {$N$} (SPEAKS); | ||
44 | %\node[attribute] (code) [left of = LANGUAGE] {\key{Code}} edge (LANGUAGE); | ||
45 | %\node[attribute] (symbol) [right of = LANGUAGE] {Name} edge (LANGUAGE); | ||
46 | % | ||
47 | %\node[relationship] (BWF) [below of = LANGUAGE] {B\_W\_F}; | ||
48 | %\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (BWF.west); | ||
49 | %\draw (LANGUAGE) to node[right, pos=0.6] {$M$} (BWF.east); | ||
50 | % | ||
51 | % | ||
52 | %\node[multi attribute] (color) [right =1cm of anthem] {Creator} edge (anthem); | ||
53 | |||
54 | % | ||
55 | %\node[relationship] (WIN) [above right of =LANGUAGE] {W\_IN}; | ||
56 | %\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (WIN); | ||
57 | %\draw (anthem) to node[right, pos=0.6] {$M$} (WIN); | ||
58 | |||
59 | \end{tikzpicture} | ||
60 | |||
61 | \end{document} |
File notes/fig/er/MappingRelationships1.tex added (mode: 100644) (index 0000000..fe4cf8e) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[relationship] (contains){REL.}; | ||
6 | \node[entity] (ENTA) [left = 1cm of contains] {ENT. A} edge[total] node[above] {$1$} (contains); | ||
7 | \node[attribute] [above of= ENTA] {\key{KeyA}} edge (ENTA); | ||
8 | \node[entity] (ENTB) [right = 1cm of contains] {ENT. B} edge node[above]{$1$} (contains); | ||
9 | \node[attribute] [above of= ENTB] {\key{KeyB}} edge (ENTB); | ||
10 | \end{tikzpicture} | ||
11 | |||
12 | \end{document} |
File notes/fig/er/MappingRelationships2.tex added (mode: 100644) (index 0000000..153b041) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[relationship] (contains){REL.}; | ||
6 | \node[entity] (ENTA) [left = 1cm of contains] {ENT. A} edge[total] node[above] {$1$} (contains); | ||
7 | \node[attribute] [above of= ENTA] {\key{KeyA}} edge (ENTA); | ||
8 | \node[entity] (ENTB) [right = 1cm of contains] {ENT. B} edge[total] node[above]{$1$} (contains); | ||
9 | \node[attribute] [above of= ENTB] {\key{KeyB}} edge (ENTB); | ||
10 | \end{tikzpicture} | ||
11 | |||
12 | \end{document} |
File notes/fig/er/Membership.tex added (mode: 100644) (index 0000000..f900022) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (PERSON) {PERSON}; | ||
6 | \node [relationship] (MEMBERSHIP) [right=of PERSON] {MEMBERSHIP} edge node[above]{$\cM$} (PERSON); | ||
7 | \node [entity] (CLUB) [right = of MEMBERSHIP] {CLUB} edge node[above]{$1$} (MEMBERSHIP); | ||
8 | \node[attribute] [above of=PERSON] {CLUB\_MEMBERSHIP\_LEVEL} edge (PERSON); | ||
9 | \end{tikzpicture} | ||
10 | |||
11 | \end{document} |
File notes/fig/er/Naming.tex added (mode: 100644) (index 0000000..8c1addb) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[entity] (entity) {ENTITY TYPE NAME}; | ||
6 | \node[attribute] (pid) [left = 2em of entity] {\key{Key}} edge (entity); | ||
7 | \node[attribute] (name) [above left of=entity] {Atomic} edge (entity); | ||
8 | \node[multi attribute] (phone) [right =2em of entity] {Multi-Valued} edge (entity); | ||
9 | \node[attribute] (address) [below =1em of entity] {Composite} edge (entity); | ||
10 | \node[attribute] (street) [below right of=address] {Attribute $n$} edge (address); | ||
11 | \node[attribute] (city) [below left of=address] {Attribute $1$} edge (address); | ||
12 | \node[derived attribute] (age) [above right of=entity] {Derived} edge (entity); | ||
13 | \node (dots) [right = 0.4em of city] {…}; | ||
14 | \end{tikzpicture} | ||
15 | |||
16 | \end{document} |
File notes/fig/er/Naming_short1.tex added (mode: 100644) (index 0000000..e8d0956) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[entity] (entity) {ENTITY TYPE NAME}; | ||
6 | \node[attribute] [above left of=entity] {Attribute $1$} edge (entity); | ||
7 | \node[attribute] [above right of=entity] {Attribute $n$} edge (entity); | ||
8 | \node[above = 3em of entity] {…}; | ||
9 | \end{tikzpicture} | ||
10 | |||
11 | \end{document} |
File notes/fig/er/Naming_short2.tex added (mode: 100644) (index 0000000..802821b) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[entity] {ENTITY TYPE NAME}; | ||
6 | \end{tikzpicture} | ||
7 | |||
8 | \end{document} |
File notes/fig/er/Parents.tex added (mode: 100644) (index 0000000..d676ace) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node [entity] (PERSON) {PERSON}; | ||
6 | \node [relationship] (uses) [right=of PERSON] {DNA HERITAGE} edge[total] node[above]{$1$} (PERSON); | ||
7 | \draw (uses) to [bend left] node[below, pos=0.4]{Biological Father} node[below, pos = 0.9]{$\cN$} (PERSON); | ||
8 | \draw (uses) to [bend right] node[above, pos=0.4]{Biological Mother} node[above, pos = 0.9]{$\cM$} (PERSON); | ||
9 | \end{tikzpicture} | ||
10 | |||
11 | \end{document} |
File notes/fig/er/Person.tex added (mode: 100644) (index 0000000..c9104b4) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[entity] (person) {PERSON}; | ||
6 | \node[attribute] (ssn) [left of=person] {\key{SSN}} edge (person); | ||
7 | \node[attribute] (dob) [above of=person] {Date\_Of\_Birth} edge (person); | ||
8 | \node[derived attribute] (age) [right of=person] {Age} edge (person); | ||
9 | \end{tikzpicture} | ||
10 | |||
11 | |||
12 | \end{document} |
File notes/fig/er/Pet1.tex added (mode: 100644) (index 0000000..09999aa) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=8em] | ||
5 | \node[entity] (FRIEND) {FRIEND}; | ||
6 | \node[attribute] (make) [below of=FRIEND] {\key{Name}} edge (FRIEND); | ||
7 | |||
8 | \node[ident relationship] (POSSESSES) [right of=FRIEND] {POSSESSES} edge node[above, pos=0.3] {$1$} (FRIEND); | ||
9 | \node[weak entity] (PET) [right = 1cm of POSSESSES] {PET} edge[total] node[above, pos=0.7] {$N$} (POSSESSES); | ||
10 | \node[attribute] [below right of =PET] {\pkey{Name}} edge (PET); | ||
11 | \node[attribute] [below left of =PET] {Gender} edge (PET); | ||
12 | \node[attribute] [below of =PET] {Specie} edge (PET); | ||
13 | \end{tikzpicture} | ||
14 | |||
15 | \end{document} |
File notes/fig/er/Pet2.tex added (mode: 100644) (index 0000000..4989295) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=8em] | ||
5 | \node[entity] (FRIEND) {FRIEND}; | ||
6 | \node[attribute] (make) [below of=FRIEND] {\key{Name}} edge (FRIEND); | ||
7 | \node[multi attribute] (PET) [right = 1cm of FRIEND] {PET} edge(FRIEND); | ||
8 | \node[attribute] [below right of =PET] {Name} edge (PET); | ||
9 | \node[attribute] [below left of =PET] {Gender} edge (PET); | ||
10 | \node[attribute] [below of =PET] {Specie} edge (PET); | ||
11 | \end{tikzpicture} | ||
12 | |||
13 | \end{document} |
File notes/fig/er/Pet3.tex added (mode: 100644) (index 0000000..1fb5e1b) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=8em] | ||
5 | \node[entity] (FRIEND) {FRIEND}; | ||
6 | \node[attribute] (make) [below of=FRIEND] {\key{Name}} edge (FRIEND); | ||
7 | |||
8 | \node[ident relationship] (POSSESSES) [right of=FRIEND] {POSSESSES} edge node[above, pos=0.3] {$1$} (FRIEND); | ||
9 | \node[weak entity] (PET) [right = 1cm of POSSESSES] {PET} edge[total] node[above, pos=0.7] {$\cN$} (POSSESSES); | ||
10 | \node[attribute] [below right of =PET] {\pkey{Name}} edge (PET); | ||
11 | \node[attribute] [below left of =PET] {Gender} edge (PET); | ||
12 | \node[attribute] [below of =PET] {Specie} edge (PET); | ||
13 | |||
14 | \node[entity] (FOOD) [above right= 3cm and 0cm of FRIEND] {FOOD}; | ||
15 | \node[relationship] (LOVES) [below right of=FOOD] {LOVED\_BY} edge node[above, pos=0.5] {$\cM$} (PET) edge node[above, pos=0.3]{$\cN$}(FOOD); | ||
16 | |||
17 | \node[ident relationship] (PLAYSWITH) [above right of =PET] {PLAYS WITH} edge node[above, pos=0.7] {$1$} (PET); | ||
18 | \node[weak entity] (TOY) [right = 1cm of PLAYSWITH] {TOY} edge[total] node[above, pos=0.3] {$\cM$} (PLAYSWITH); | ||
19 | \end{tikzpicture} | ||
20 | |||
21 | \end{document} |
File notes/fig/er/Phone_Carrier1.tex added (mode: 100644) (index 0000000..814d5ba) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node [entity] (phone) {PHONE}; | ||
6 | \node [attribute] [above left of=phone] {Attribute $1$} edge (phone); | ||
7 | \node [attribute] [above right of=phone] {Attribute $n$} edge (phone); | ||
8 | \node (dots) [above = 3em of phone] {…}; | ||
9 | \node [relationship] (uses) [right=of phone] {USES} edge[total] node[above]{$\cN$} (phone); | ||
10 | \node [attribute] [above of=uses] {Average\_Network\_Quality} edge (uses); | ||
11 | \node [entity] (carrier) [right = of uses] {CARRIER} edge node[above]{$1$} (uses); | ||
12 | |||
13 | \end{tikzpicture} | ||
14 | |||
15 | \end{document} |
File notes/fig/er/Phone_Carrier2.tex added (mode: 100644) (index 0000000..01d9b35) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node [entity] (phone) {PHONE}; | ||
6 | \node [attribute] [above left of=phone] {Attribute $1$} edge (phone); | ||
7 | \node [attribute] [above right of=phone] {Attribute $n$} edge (phone); | ||
8 | \node (dots) [above = 3em of phone] {…}; | ||
9 | \node [relationship] (uses) [right=of phone] {USES} edge[total] node[above]{$\cN$} (phone); | ||
10 | \node [attribute] [below of=phone] {Average\_Network\_Quality} edge (phone); | ||
11 | \node [entity] (carrier) [right = of uses] {CARRIER} edge node[above]{$1$} (uses); | ||
12 | \end{tikzpicture} | ||
13 | |||
14 | \end{document} |
File notes/fig/er/Pilot.tex added (mode: 100644) (index 0000000..a2596f2) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=8em] | ||
5 | \node[entity] (person) {PILOT}; | ||
6 | \node[attribute] (pid) [left of=person] {\key{ID}} edge (person); | ||
7 | \node[attribute] (name) [above left of=person] {Name} edge (person); | ||
8 | \node[attribute] (phone) [above of=person] {Experience} edge (person); | ||
9 | |||
10 | \node[relationship] (drives) [below of=person] {ASSIGNED\_TO} edge node[right, pos=0.1] {$N$} (person); | ||
11 | \node[entity] (plane) [below of=drives] {PLANE} edge [total] node[right, pos=0.7] {$1$} (drives); | ||
12 | \node[attribute] (make) [left of=plane] {\key{TailID}} edge (plane); | ||
13 | \node[attribute] (maxS) [below left of =plane] {MaxSpeed} edge (plane); | ||
14 | \node[attribute] (airPlaneType) [below of = plane] {AirPlaneType} edge (plane); | ||
15 | \end{tikzpicture} | ||
16 | |||
17 | \end{document} |
File notes/fig/er/Printer.tex added (mode: 100644) (index 0000000..fe11dc9) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[entity] (printer) {PRINTER}; | ||
6 | \node[attribute] (mid) [above left of=printer] {\key{Office}} edge (printer); | ||
7 | \node[attribute] (firmware) [above right of=printer] {Firmware} edge (printer); | ||
8 | \node[attribute] (carrier) [above right of=firmware] {Name} edge (firmware); | ||
9 | \node[attribute] (price) [above left of=firmware] {Version} edge (firmware); | ||
10 | \end{tikzpicture} | ||
11 | |||
12 | \end{document} |
File notes/fig/er/Produces.tex added (mode: 100644) (index 0000000..a62308a) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (producer) {PRODUCER}; | ||
6 | \node [relationship] (produces) [right=of producer] {PRODUCES} edge node[above]{$1$} (producer); | ||
7 | \node [entity] (movie) [right = of produces] {MOVIE} edge node[above]{$\cM$} (produces); | ||
8 | \node[attribute] (mid) [above of=movie] {Amount\_Given\_By\_Producer} edge (movie); | ||
9 | \end{tikzpicture} | ||
10 | |||
11 | \end{document} |
File notes/fig/er/Record.tex added (mode: 100644) (index 0000000..b6407e6) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=1.5cm] | ||
5 | \node[entity] (LABEL) {LABEL}; | ||
6 | \node[attribute] [above of=LABEL] {\key{Name}} edge (LABEL); | ||
7 | \node[attribute] [right = .5cm of LABEL] {Phone} edge (LABEL); | ||
8 | \node[multi attribute] [above right = .5cm of LABEL] {Genre} edge (LABEL); | ||
9 | % | ||
10 | \node[relationship] (RELEASEDBY) [left = 1.5cm of LABEL] {RELEASED\_BY} edge node[above, pos=0.4] {$\cN$} (LABEL); | ||
11 | % | ||
12 | \node[entity] (RECORDING) [left = 1.5cm of RELEASEDBY] {RECORDING} edge[total] node[above, pos=0.6]{$\cM$} (RELEASEDBY); | ||
13 | \node[attribute] [above of = RECORDING] {\key{Title}} edge (RECORDING); | ||
14 | % | ||
15 | \node[ident relationship] (USES) [below =0.8cm of LABEL] {USES} edge [total] node[right, pos=0.4] {$1$} (LABEL); | ||
16 | \node[attribute] [above = .5cm of RELEASEDBY] {Date} edge (RELEASEDBY); | ||
17 | % | ||
18 | \node[weak entity] (LOGO) [below = 3cm of LABEL] {LOGO} edge [total] node[right, pos=0.4] {$1$} (USES); | ||
19 | \node[attribute] [right = .5cm of LOGO] {\pkey{Name}} edge (LOGO); | ||
20 | \node[attribute] [below = .5cm of LOGO] {Color} edge (LOGO); | ||
21 | % | ||
22 | % \node[relationship] (REPAIREDBY) [below right =3cm of RECORDING] {REPAIRED\_BY} edge node[below, pos=0.6] {$\cM$} (RECORDING) edge node[below, pos=0.6] {$1$} (LOGO); | ||
23 | % | ||
24 | |||
25 | \node[relationship] (ISSOLDAT) [below left = 1.5cm of RECORDING] {IS\_SOLD\_AT} edge node[above, pos=0.4] {$\cN$} (RECORDING); | ||
26 | \node[attribute] [left = .5cm of ISSOLDAT] {Number of copies} edge (ISSOLDAT); | ||
27 | |||
28 | \node[entity] (SHOP) [below = 5cm of RECORDING] {RECORD SHOP} edge[total] node[right, pos=0.4]{$\cM$} (ISSOLDAT); | ||
29 | |||
30 | \node[attribute] (Address) [left = 0.5cm of SHOP] {Address} edge (SHOP); | ||
31 | \node[attribute] [above left of = Address] {Zip} edge (Address); | ||
32 | \node[attribute] [below left of = Address] {Street Name} edge (Address); | ||
33 | \node[attribute] [left = .6cm of Address] {City} edge (Address); | ||
34 | |||
35 | \node[relationship] (ISPLAYEDAT) [below right = 1.5cm and 0cm of RECORDING] {IS\_AN\_EXCLUSIVITY\_OF} edge node[right, pos=0.4] {$\cN$} (RECORDING) edge node[left]{$1$} (SHOP); | ||
36 | |||
37 | \node[attribute] [below of = SHOP] {\key{Name}} edge (SHOP); | ||
38 | |||
39 | %\node[entity] (LABEL) {LABEL}; | ||
40 | % | ||
41 | % | ||
42 | % | ||
43 | %\node[relationship] (SPEAKS) [below right of=LABEL] {SPEAKS} edge node[right, pos=0.4] {$M$} (LABEL); | ||
44 | %\node[entity] (LANGUAGE) [below right of=SPEAKS] {LANGUAGE} edge node[right, pos=0.5] {$N$} (SPEAKS); | ||
45 | %\node[attribute] (code) [left of = LANGUAGE] {\key{Code}} edge (LANGUAGE); | ||
46 | %\node[attribute] (symbol) [right of = LANGUAGE] {Name} edge (LANGUAGE); | ||
47 | % | ||
48 | %\node[relationship] (BWF) [below of = LANGUAGE] {B\_W\_F}; | ||
49 | %\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (BWF.west); | ||
50 | %\draw (LANGUAGE) to node[right, pos=0.6] {$M$} (BWF.east); | ||
51 | % | ||
52 | % | ||
53 | %\node[multi attribute] (color) [right =1cm of anthem] {Creator} edge (anthem); | ||
54 | |||
55 | % | ||
56 | %\node[relationship] (WIN) [above right of =LANGUAGE] {W\_IN}; | ||
57 | %\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (WIN); | ||
58 | %\draw (anthem) to node[right, pos=0.6] {$M$} (WIN); | ||
59 | |||
60 | \end{tikzpicture} | ||
61 | |||
62 | \end{document} |
File notes/fig/er/Rel_Instance.tex added (mode: 100644) (index 0000000..a26a0f7) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=2em] | ||
5 | \draw [fill= gray!20] (0,-1) ellipse (1cm and 2cm) node[above=2]{Entity Set 1}; | ||
6 | \draw [fill= blue!20] (2.75, -1) ellipse (1cm and 2cm) node[above=2]{Relationship Set 1}; | ||
7 | \draw [fill= green!20] (5.5, -1) ellipse (1cm and 2cm) node[above=2]{Entity Set 2}; | ||
8 | % | ||
9 | \node (e1) {\(e_1\)}; | ||
10 | \node (e2) [below of = e1] {\(e_2\)}; | ||
11 | \node (dots) [below of = e2] {\(\vdots\)}; | ||
12 | \node (en) [below of = dots] {\(e_n\)}; | ||
13 | % | ||
14 | \node (c1) [right = 5 of e1]{\(c_1\)}; | ||
15 | \node (c2) [below of = c1]{\(c_1\)}; | ||
16 | \node (cdots) [below of = c2] {\(\vdots\)}; | ||
17 | \node (cp) [below of = cdots] {\(c_p\)}; | ||
18 | % | ||
19 | \node (r1) [right = 2.25 of e2] {\(r_1\)}; | ||
20 | \draw (r1) to (e1); | ||
21 | \draw (r1) to (c2); | ||
22 | % | ||
23 | \node (r2) [below of = r1] {\(r_2\)}; | ||
24 | \draw (r2) to (e2); | ||
25 | \draw (r2) to (cp); | ||
26 | \end{tikzpicture} | ||
27 | |||
28 | \end{document} |
File notes/fig/er/Role_Name1.tex added (mode: 100644) (index 0000000..045a707) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (company) {COMPANY}; | ||
6 | \node [relationship] (employs) [right=of company] {EMPLOYS} edge node[above]{Employer} (company); | ||
7 | \node [entity] (person) [right = of employs] {PERSON} edge node[above]{Employee} (employs); | ||
8 | \end{tikzpicture} | ||
9 | |||
10 | \end{document} |
File notes/fig/er/Role_Name2.tex added (mode: 100644) (index 0000000..f88673a) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (person) {PERSON}; | ||
6 | \node [relationship] (hosts) [above=of person] {HOSTS}; | ||
7 | \draw (hosts.east) -- node[right]{Guest} (person); | ||
8 | \draw (hosts.west) -- node[left]{Host} (person); | ||
9 | \end{tikzpicture} | ||
10 | |||
11 | \end{document} |
File notes/fig/er/Role_Name3.tex added (mode: 100644) (index 0000000..571db0a) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (professor) {PROFESSOR}; | ||
6 | \node [relationship] (mentors) [above=of professor] {MENTORS}; | ||
7 | \draw (mentors.east) -- node[right]{Mentor} (professor); | ||
8 | \draw (mentors.west) -- node[left]{Mentee} (professor); | ||
9 | \end{tikzpicture} | ||
10 | |||
11 | \end{document} |
File notes/fig/er/Software_Dep.tex added (mode: 100644) (index 0000000..180475a) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (SOFTWARE) {SOFTWARE}; | ||
6 | \node [relationship] (REQUIRES) [above=of SOFTWARE] {REQUIRES}; | ||
7 | \draw (REQUIRES.east) -- node[right]{Requirement} node[right, pos = 0.8]{$\cN$} (SOFTWARE); | ||
8 | \draw (REQUIRES.west) -- node[left, pos = 0.8]{$\cM$}(SOFTWARE); | ||
9 | \node [attribute] (id) [right= .5cm of SOFTWARE] {\key{Id}} edge (SOFTWARE); | ||
10 | \node [attribute, above right of = id] {Version} edge (id); | ||
11 | \node [attribute, below right of = id] {Name} edge (id); | ||
12 | \end{tikzpicture} | ||
13 | |||
14 | \end{document} |
File notes/fig/er/Song.tex added (mode: 100644) (index 0000000..96d6d0d) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node[entity] (ALBUM) {ALBUM}; | ||
6 | \node[attribute] [left = .5cm of ALBUM] {\key{Name}} edge (ALBUM); | ||
7 | \node[attribute] (Date) [above of=ALBUM] {Release Date} edge (ALBUM); | ||
8 | \node[attribute] [above right of=Date] {Day} edge (Date); | ||
9 | \node[attribute] [above = 1.2cm of Date] {Month} edge (Date); | ||
10 | \node[attribute] [above left of=Date] {Year} edge (Date); | ||
11 | |||
12 | \node[ident relationship] (CONTAINS) [right = 1cm of ALBUM] {CONTAINS} edge node[above, pos=0.3] {$1$} (ALBUM); | ||
13 | \node[weak entity] (SONG) [right = 1cm of CONTAINS] {SONG} edge[total] node[above, pos=0.7] {$N$} (CONTAINS); | ||
14 | \node[attribute] [right = .5cm of SONG] {\pkey{Track Number}} edge (SONG); | ||
15 | |||
16 | \node[attribute] (Length) [above of =SONG] {Length} edge (SONG); | ||
17 | \node[attribute] [above left of =Length] {Hours} edge (Length); | ||
18 | \node[attribute] [above =1.3cm of Length] {Minutes} edge (Length); | ||
19 | \node[attribute] [above right of =Length] {Seconds} edge (Length); | ||
20 | \end{tikzpicture} | ||
21 | |||
22 | \end{document} |
File notes/fig/er/Stays_At.tex added (mode: 100644) (index 0000000..de3269a) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=7em] | ||
5 | \node[relationship] (contains){STAYS\_AT}; | ||
6 | \node[entity] (person) [above = 1cm of contains] {PERSON} edge node[right] {$N$} (contains);; | ||
7 | \node[attribute] (ssn) [left of=person] {\key{SSN}} edge (person); | ||
8 | \node[attribute] (dob) [above = .5cm of person] {Date\_Of\_Birth} edge (person); | ||
9 | \node[entity] (burger) [below of= contains] {PLACE} edge node[right] {$1$} (contains); | ||
10 | \node[attribute] (dob) [below = .5cm of burger] {\key{Address}} edge (burger); | ||
11 | \node[attribute] (ssn) [left of=burger] {Rooms} edge (burger); | ||
12 | \end{tikzpicture} | ||
13 | |||
14 | \end{document} |
File notes/fig/er/Teaches.tex added (mode: 100644) (index 0000000..eb837f8) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (PROFESSOR) {PROFESSOR}; | ||
6 | \node [relationship] (TEACHES) [right=of PROFESSOR] {TEACHES} edge node[above]{$1$} (PROFESSOR); | ||
7 | \node [entity] [right = of TEACHES] {COURSE} edge node[above]{$\cN$} (TEACHES); | ||
8 | \node [entity] [above = of TEACHES] {QUARTER} edge node[right]{$\cM$} (TEACHES); | ||
9 | \node [entity] [below = of TEACHES] {ROOM} edge node[left]{$\cP$} (TEACHES); | ||
10 | \end{tikzpicture} | ||
11 | \end{document} |
File notes/fig/er/Ternary_LectureNotes.tex added (mode: 100644) (index 0000000..b1a606e) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{tikzpicture}[node distance=5em] | ||
5 | \node [entity] (CLASS) {CLASS}; | ||
6 | \node [relationship] (REFERS) [right=of CLASS] {REFERS TO} edge node[above]{$\cP$} (CLASS); | ||
7 | \node [entity] [right = of REFERS] {PROFESSOR} edge node[above]{$\cN$} (REFERS); | ||
8 | \node [entity] [below = of REFERS] {LECTURE NOTES} edge node[left]{$\cM$} (REFERS); | ||
9 | \end{tikzpicture} | ||
10 | \end{document} |
File notes/fig/er/template.def added (mode: 100644) (index 0000000..c38e409) | |||
1 | \renewcommand\familydefault{\sfdefault} % Default family: serif | ||
2 | %\usepackage[usenames,dvipsnames]{xcolor} | ||
3 | \usepackage[x11names]{xcolor} | ||
4 | \usepackage{tikz} | ||
5 | \usepackage{soulutf8} | ||
6 | \usetikzlibrary{arrows,fit,positioning,shapes,calc} | ||
7 | |||
8 | %\definecolor{WIRE}{HTML}{002FA7} % Klein Blue | ||
9 | \usepackage[normalem]{ulem} | ||
10 | |||
11 | \tikzstyle{every entity} = [] | ||
12 | \tikzstyle{every weak entity} = [] | ||
13 | \tikzstyle{every attribute} = [] | ||
14 | \tikzstyle{every relationship} = [] | ||
15 | \tikzstyle{every link} = [] | ||
16 | \tikzstyle{every isa} = [] | ||
17 | |||
18 | \tikzstyle{link} = [>=triangle 60, draw, thick, every link] | ||
19 | |||
20 | \tikzstyle{total} = [link, double, double distance=3pt] | ||
21 | |||
22 | \tikzstyle{entity} = [rectangle, draw, black, very thick, | ||
23 | minimum width=6em, minimum height=3em, | ||
24 | every entity] | ||
25 | |||
26 | \tikzstyle{weak entity} = [entity, double, double distance=2pt, | ||
27 | every weak entity] | ||
28 | |||
29 | \tikzstyle{attribute} = [ellipse, draw, black, very thick, | ||
30 | minimum width=5em, minimum height=2em, | ||
31 | every attribute] | ||
32 | |||
33 | %\tikzstyle{key attribute} = [attribute, font=\bfseries] | ||
34 | |||
35 | \tikzstyle{multi attribute} = [attribute, double, double distance=2pt] | ||
36 | |||
37 | \tikzstyle{derived attribute} = [attribute, dashed] | ||
38 | |||
39 | %\tikzstyle{discriminator} = [attribute, font=\itshape] | ||
40 | |||
41 | \tikzstyle{relationship} = [diamond, draw, black, very thick, | ||
42 | minimum width=2em, aspect=1, | ||
43 | every relationship] | ||
44 | |||
45 | \tikzstyle{ident relationship} = [relationship, double, double distance=2pt] | ||
46 | |||
47 | \tikzstyle{isa} = [isosceles triangle, isosceles triangle apex angle=60, | ||
48 | shape border rotate=-90, | ||
49 | draw, black, very thick, minimum size=3em, | ||
50 | every isa] | ||
51 | |||
52 | % for text un key attributes | ||
53 | \newcommand{\key}[1]{\underline{#1}} | ||
54 | \newcommand{\pkey}[1]{\dashuline{#1}} | ||
55 | |||
56 | % for text in discriminator attributes | ||
57 | \def\discriminator{\bgroup | ||
58 | \ifdim\ULdepth=\maxdimen % Set depth based on font, if not set already | ||
59 | \settodepth\ULdepth{(j}\advance\ULdepth.4pt\fi | ||
60 | \markoverwith{\kern.15em | ||
61 | \vtop{\kern\ULdepth \hrule width .3em}% | ||
62 | \kern.15em}\ULon} | ||
63 | |||
64 | %% | ||
65 | |||
66 | |||
67 | \definecolor{MediumPurple1}{rgb}{0.58, 0.44, 0.86} | ||
68 | \definecolor{Chartreuse2}{rgb}{0.5, 1.0, 0.0} | ||
69 | \tikzset{every entity/.style={draw=orange, fill=orange!20}} | ||
70 | \tikzset{every attribute/.style={draw=MediumPurple1, fill=MediumPurple1!20}} | ||
71 | \tikzset{every relationship/.style={draw=Chartreuse2, fill=Chartreuse2!20}} | ||
72 | |||
73 | %% Variable for participation constraint | ||
74 | \newcommand{\cM}{\mathrm{M}} | ||
75 | \newcommand{\cN}{\mathrm{N}} | ||
76 | \newcommand{\cO}{\mathrm{O}} | ||
77 | \newcommand{\cP}{\mathrm{P}} | ||
78 | |||
79 | \begin{document} |
File notes/fig/fd/Course.tex added (mode: 100644) (index 0000000..015ee6f) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| Course \(\big(\) \& \ul{Teacher} \& \ul{Code} \& Credit Hours \& Textbook \& Difficulty \& |[none]| \(\big)\)\\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=2]{2}{5}{} | ||
9 | \depedge[lvl=2]{3}{5}{} | ||
10 | \depedge[lvl=1]{3}{4}{} | ||
11 | \depedge[lvl=2]{2}{6}{} | ||
12 | % \depedge[lvl=2]{3}{5}{} | ||
13 | \end{dependency} | ||
14 | |||
15 | \end{document} |
File notes/fig/fd/Course_Norm1.tex added (mode: 100644) (index 0000000..2991672) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| Course \(\big(\) \& \ul{Teacher} \& \ul{Code} \& Textbook \& Difficulty \& |[none]| \(\big)\) % New Line | ||
7 | \& |[none]| CreditHours\(\big(\) \& \ul{Code} \& Credit Hours\& |[none]| \(\big)\)\\ | ||
8 | \end{deptext} | ||
9 | \depedge[lvl=1]{2}{5}{} | ||
10 | \depedge[lvl=1]{3}{5}{} | ||
11 | \depedge[lvl=1]{2}{4}{} | ||
12 | \depedge[lvl=1]{8}{9}{} | ||
13 | \depedge[lvl=1, FK, edge above]{8}{3}{} | ||
14 | \end{dependency} | ||
15 | |||
16 | \end{document} |
File notes/fig/fd/DriverExample1.tex added (mode: 100644) (index 0000000..23f797b) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| DRIVER \(\big(\) \& State \& Driver\_Licence\_Num \& Name \& Governor) \& |[none]| \(\big)\)\\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=1]{2}{4}{} | ||
9 | \depedge[lvl=1]{3}{4}{} | ||
10 | \depedge[lvl=1, edge above]{2}{5}{} | ||
11 | \end{dependency} | ||
12 | |||
13 | \end{document} |
File notes/fig/fd/DriverExample2.tex added (mode: 100644) (index 0000000..dac4ff1) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| DRIVER \(\big(\) \& \ul{State} \& \ul{Driver\_Licence\_Num} \& Name) \& |[none]| \(\big)\) \& |[none]| GOVERNOR \(\big(\) \& \ul{State} \& Governor \& |[none]| \(\big)\)\\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=1]{2}{4}{} | ||
9 | \depedge[lvl=1]{3}{4}{} | ||
10 | \depedge[lvl=1]{7}{8}{} | ||
11 | \depedge[lvl=1, FK, edge above]{7}{2}{} | ||
12 | \end{dependency} | ||
13 | |||
14 | |||
15 | |||
16 | \end{document} |
File notes/fig/fd/Example.tex added (mode: 100644) (index 0000000..bfd444b) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| R \(\big(\) \& A \& B \& C \& D \& E \& |[none]| \(\big)\)\\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=1, edge above]{2}{5}{} | ||
9 | \depedge[lvl=1, edge above]{3}{5}{} | ||
10 | % \depedge[lvl=1]{3}{4}{} | ||
11 | % \depedge[lvl=2]{2}{6}{} | ||
12 | \depedge[lvl=1]{4}{3}{} | ||
13 | \depedge[lvl=2]{6}{2}{} | ||
14 | \end{dependency} | ||
15 | |||
16 | \end{document} |
File notes/fig/fd/Example2NF1.tex added (mode: 100644) (index 0000000..b087bbf) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| \(R \big(\) \& \ul{\(A_1\)} \& \ul{\(A_2\)} \& \(A_3\) \& \(A_4\) \& \(A_5\) \& |[none]| \(\big)\)\\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=1, edge above]{2}{6}{} | ||
9 | \depedge[lvl=1, edge above]{3}{6}{} | ||
10 | \depedge[lvl=1]{3}{4}{} | ||
11 | \depedge[lvl=1]{3}{5}{} | ||
12 | \end{dependency} | ||
13 | |||
14 | \end{document} |
File notes/fig/fd/Example2NF2.tex added (mode: 100644) (index 0000000..26e7160) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| \(R \big(\) \& \ul{\(A_1\)} \& \ul{\(A_2\)} \& \(A_5\) \& |[none]| \(\big)\) \& |[none]| \(R' \big(\) \& \ul{\(A_2\)} \& \(A_3\) \& |[none]| \(\big)\) \& |[none]| \(R'' \big(\) \& \ul{\(A_2\)} \& \(A_4\)\& |[none]| \(\big)\)\\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=1]{2}{4}{} | ||
9 | \depedge[lvl=1]{3}{4}{} | ||
10 | \depedge[lvl=1]{7}{8}{} | ||
11 | \depedge[lvl=1]{11}{12}{} | ||
12 | \depedge[lvl=1, FK, edge above]{7}{3}{} | ||
13 | \depedge[lvl=1, FK, edge above]{11}{3}{} | ||
14 | \end{dependency} | ||
15 | |||
16 | \end{document} |
File notes/fig/fd/Example2NF3.tex added (mode: 100644) (index 0000000..3e96837) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| \(R \big(\) \& \ul{\(A_1\)} \& \ul{\(A_2\)} \& \(A_5\) \& |[none]| \(\big)\) \& |[none]| \(R' \big(\) \& \ul{\(A_2\)} \& \(A_3\) \& \(A_4\) \& |[none]| \(\big)\)\\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=1]{2}{4}{} | ||
9 | \depedge[lvl=1]{3}{4}{} | ||
10 | \depedge[lvl=1]{7}{8}{} | ||
11 | \depedge[lvl=1]{7}{9}{} | ||
12 | \depedge[lvl=1, FK, edge above]{7}{3}{} | ||
13 | % \depedge[lvl=1, FK, edge above]{11}{3}{} | ||
14 | \end{dependency} | ||
15 | |||
16 | \end{document} |
File notes/fig/fd/Notation1.tex added (mode: 100644) (index 0000000..1dbe7d0) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | MARKER.Id \& MARKER.Color \& MARKER.Brand \& MARKER.Owner \\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=1]{1}{2}{} % Edge are organized by level. | ||
9 | \depedge[lvl=1]{1}{3}{} | ||
10 | \depedge[lvl=1]{1}{4}{} | ||
11 | \depedge[lvl=1, edge above]{4}{2}{} | ||
12 | \depedge[lvl=1, edge above]{4}{3}{} | ||
13 | \end{dependency} | ||
14 | |||
15 | \par | ||
16 | |||
17 | \begin{dependency} | ||
18 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
19 | TEACHER.Name \& TEACHER.Office \& TEACHER.Phone \\ | ||
20 | \end{deptext} | ||
21 | \depedge[lvl=1]{2}{1}{} | ||
22 | \depedge[lvl=1]{2}{3}{} | ||
23 | \end{dependency} | ||
24 | |||
25 | \end{document} |
File notes/fig/fd/Notation2.tex added (mode: 100644) (index 0000000..ef09a7c) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| MARKER \(\big(\) \& Id \& Color \& Brand \& Owner \& |[none]| \(\big)\) \& |[none]| TEACHER \(\big(\) \& Name \& Office \& Phone \& |[none]| \(\big)\) \\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=1]{2}{3}{} % Edge are organized by level. | ||
9 | \depedge[lvl=1]{2}{4}{} | ||
10 | \depedge[lvl=1]{2}{5}{} | ||
11 | \depedge[lvl=1, edge above]{5}{3}{} | ||
12 | \depedge[lvl=1, edge above]{5}{4}{} | ||
13 | \depedge[lvl=1]{9}{8}{} | ||
14 | \depedge[lvl=1]{9}{10}{} | ||
15 | \end{dependency} | ||
16 | |||
17 | \end{document} |
File notes/fig/fd/Notation3.tex added (mode: 100644) (index 0000000..8535559) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| TRAIN \(\big(\) \& Id \& Model \& |[none]| \(\big)\) \& |[none]| CONDUCTOR \(\big(\) \& Name \& Affected-to \& |[none]| \(\big)\) \\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=1]{2}{3}{} | ||
9 | \depedge[lvl=1]{6}{7}{} | ||
10 | \depedge[lvl=1, FK, edge above]{7}{2}{} | ||
11 | % \depedge[lvl=1]{2}{4}{} | ||
12 | % \depedge[lvl=1]{2}{5}{} | ||
13 | % \depedge[lvl=1, edge above]{5}{3}{} | ||
14 | % \depedge[lvl=1, edge above]{5}{4}{} | ||
15 | % \depedge[lvl=1]{9}{8}{} | ||
16 | % \depedge[lvl=1]{9}{10}{} | ||
17 | \end{dependency} | ||
18 | |||
19 | \end{document} |
File notes/fig/fd/Print.tex added (mode: 100644) (index 0000000..1be1a25) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| PRINT \(\big(\) \& Author \& Technique \& Title \& Price \& Size \& ShippingCost \& |[none]| \(\big)\)\\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=1, edge above]{2}{3}{} | ||
9 | \depedge[lvl=1, edge above]{4}{3}{} | ||
10 | \depedge[lvl=1]{2}{5}{} | ||
11 | \depedge[lvl=1]{4}{5}{} | ||
12 | \depedge[lvl=1]{6}{5}{} | ||
13 | \depedge[lvl=1, edge above]{6}{7}{} | ||
14 | \end{dependency} | ||
15 | |||
16 | \end{document} |
File notes/fig/fd/Schedule.tex added (mode: 100644) (index 0000000..6312057) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| SCHEDULE \(\big(\) \& \ul{Period\_Start} \& \ul{Date} \& Room \& Organizer \& Period\_End \& |[none]| \(\big)\) \& |[none]| LENGTH \(\big(\) \& \ul{Period\_Start} \& \ul{Period\_End} \& Length \& |[none]| \(\big)\) | ||
7 | \& |[none]| ROOM \(\big(\) \& \ul{Room} \& Building \& |[none]| \(\big)\)\\ | ||
8 | \end{deptext} | ||
9 | \depedge[lvl=1]{2}{4}{} | ||
10 | \depedge[lvl=1]{3}{5}{} | ||
11 | \depedge[lvl=1]{2}{6}{} | ||
12 | \depedge[lvl=1]{9}{11}{} | ||
13 | \depedge[lvl=1]{10}{11}{} | ||
14 | \depedge[lvl=1]{14}{15}{} | ||
15 | % \depedge[lvl=2, FK]{2}{9}{} | ||
16 | % \depedge[lvl=1, FK, edge above]{6}{10}{} | ||
17 | \end{dependency} | ||
18 | |||
19 | |||
20 | %\{Period\_Start, Date\} | →| Room | ||
21 | %\{Period\_Start, Length\} | →| Period\_End | ||
22 | %\{Period\_Start, Period\_End\} | →| Length | ||
23 | %\{Period\_End, Length\} | →| Period\_Start | ||
24 | %\{Date, Period\_Start\} | →| Organizer | ||
25 | %Room | →| Building | ||
26 | % | ||
27 | |||
28 | |||
29 | \end{document} |
File notes/fig/fd/StudentExample1.tex added (mode: 100644) (index 0000000..ed243e9) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| STUDENT \(\big(\) \& \ul{Login} \& Name \& Major \& Major\_Head) \& |[none]| \(\big)\)\\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=1]{2}{4}{} | ||
9 | \depedge[lvl=1]{3}{4}{} | ||
10 | % \depedge[lvl=1]{2}{5}{} | ||
11 | \depedge[lvl=1, edge above]{4}{5}{} | ||
12 | \end{dependency} | ||
13 | |||
14 | \end{document} |
File notes/fig/fd/StudentExample2.tex added (mode: 100644) (index 0000000..476d5b5) | |||
1 | \documentclass[margin=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
6 | |[none]| STUDENT \(\big(\) \& \ul{Login} \& Name \& Major ) \& |[none]| \(\big)\) \& |[none]| HEAD \(\big(\) \& \ul{Major} \& Major\_Head \& |[none]| \(\big)\)\\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=1]{2}{4}{} | ||
9 | \depedge[lvl=1]{3}{4}{} | ||
10 | \depedge[lvl=1]{7}{8}{} | ||
11 | % \depedge[lvl=1, edge above]{4}{5}{} | ||
12 | \depedge[lvl=1, FK, edge above]{7}{4}{} | ||
13 | \end{dependency} | ||
14 | |||
15 | \end{document} |
File notes/fig/fd/model.tex added (mode: 100644) (index 0000000..3240f73) | |||
1 | \documentclass[border=20pt]{standalone} | ||
2 | \input{template.def} | ||
3 | |||
4 | \begin{dependency} | ||
5 | \begin{deptext} | ||
6 | Ename \& \ul{Ssn} \& BDate \& Address \& Dnumber \& Dname \& Dmgr\_ssn \\ | ||
7 | \end{deptext} | ||
8 | \depedge[lvl=1]{2}{1}{} % Edge are organized by level. | ||
9 | \depedge[lvl=1]{2}{3}{} | ||
10 | \depedge[lvl=1]{2}{4}{} | ||
11 | \depedge[lvl=1]{2}{5}{} | ||
12 | \depedge[lvl=2]{5}{6}{} | ||
13 | \depedge[lvl=2]{5}{7}{} | ||
14 | \end{dependency} | ||
15 | |||
16 | |||
17 | \begin{dependency} | ||
18 | \begin{deptext}[TxtBook] % Applying the TxtBook style. | ||
19 | \ul{Ssn} \& \ul{Pnumber} \& Hours \& Ename \& Pname \& Plocation \\ | ||
20 | \end{deptext} | ||
21 | \depedge[lvl=1]{1}{3}{} | ||
22 | \depedge[lvl=1]{2}{3}{} | ||
23 | \depedge[lvl=2]{1}{4}{} | ||
24 | \depedge[lvl=3]{2}{5}{} | ||
25 | \depedge[lvl=3]{2}{6}{} | ||
26 | \end{dependency} | ||
27 | |||
28 | \end{document} |
File notes/fig/fd/template.def added (mode: 100644) (index 0000000..a352d5c) | |||
1 | \renewcommand\familydefault{\sfdefault} % Default family: serif | ||
2 | \usepackage{tikz-dependency} % WARNING: we are using an EDITED version of this package. | ||
3 | \usetikzlibrary{arrows.meta} | ||
4 | \usepackage{soulutf8} | ||
5 | \setul{}{1.1pt} | ||
6 | |||
7 | % The following is to allow the use of \(…\) with the soul package. | ||
8 | % cf. https://tex.stackexchange.com/a/443317/34551 | ||
9 | \usepackage{expl3} | ||
10 | |||
11 | \ExplSyntaxOn | ||
12 | \tl_new:N \__l_SOUL_argument_tl | ||
13 | \cs_set_eq:Nc \SOUL_start:n { SOUL@start } | ||
14 | \cs_generate_variant:Nn \SOUL_start:n { V } | ||
15 | \cs_set_protected:cpn {SOUL@start} #1 | ||
16 | { | ||
17 | \tl_set:Nn \__l_SOUL_argument_tl { #1 } | ||
18 | \regex_replace_all:nnN | ||
19 | { \c{\(} (.*?) \c{\)} } % look for \(...\) (lazily) | ||
20 | { \cM\$ \1 \cM\$ } % replace with $...$ | ||
21 | \__l_SOUL_argument_tl | ||
22 | \SOUL_start:V \__l_SOUL_argument_tl % do the usual | ||
23 | } | ||
24 | \ExplSyntaxOff | ||
25 | |||
26 | \begin{document} | ||
27 | |||
28 | \depstyle{lvl}{% | ||
29 | edge height=2.5ex, | ||
30 | % edge unit distance=#1*2.5ex, % Another way of controlling the appearance of the edges. | ||
31 | edge below, | ||
32 | edge horizontal padding=0, | ||
33 | edge start y offset=-(#1-1)*3ex, | ||
34 | text only label, % No need for label for functional dependencies. | ||
35 | edge slant=0, % Right angles | ||
36 | rounded corners=0, | ||
37 | edge style={thick, >={Latex[width=2mm,length=2mm]}} % Change the style of the arrowheads. | ||
38 | } | ||
39 | |||
40 | % To deal with multiple parameters, in order to have a difference between the "level" (distance from node) | ||
41 | % and the starting point of the arrows, we could start with something like: | ||
42 | %\tikzset{/depgraph/lvl/.style 2 args={%<tikz options>},...} | ||
43 | %\tikzstyle{lvl} = {%definition} | ||
44 | %\depstyle{lvl}{% | ||
45 | % edge height=2.5ex, | ||
46 | %edge unit distance=(#1-1)*3ex,, % Another way of controlling the appearance of the edges. | ||
47 | %edge below, | ||
48 | %edge horizontal padding=0, | ||
49 | %edge start y offset=-(#1-1)*3ex, | ||
50 | %text only label, % No need for label for functional dependencies. | ||
51 | %edge slant=0, % Right angles | ||
52 | %rounded corners=0, | ||
53 | %edge style={thick, >={Latex[width=2mm,length=2mm]}} % Change the style of the arrowheads. | ||
54 | %} | ||
55 | %} | ||
56 | |||
57 | \depstyle{FK}{% | ||
58 | color=red, | ||
59 | edge slant = 3pt, | ||
60 | rounded corners = 2 | ||
61 | } | ||
62 | |||
63 | \depstyle{none}{% | ||
64 | draw=none, | ||
65 | fill=none | ||
66 | } | ||
67 | |||
68 | \tikzset{ | ||
69 | matrix/.append style={column sep=0.4cm, row sep=2em} % Adding some distance between the attributes. | ||
70 | } | ||
71 | |||
72 | \tikzstyle{TxtBook}=[% Style to mimic the textbook Fundamentals of Database Systems. | ||
73 | column sep=0cm, % No distance between two attributes. | ||
74 | nodes={% | ||
75 | fill=gray!20, | ||
76 | draw=black, | ||
77 | inner xsep=3ex, | ||
78 | inner ysep=1ex | ||
79 | } | ||
80 | ] | ||
81 | |||
82 |
File notes/fig/fd/tikz-dependency.sty added (mode: 100644) (index 0000000..067fb2c) | |||
1 | % Copyright 2011 by Daniele Pighin | ||
2 | % | ||
3 | % This file may be distributed and/or modified | ||
4 | % | ||
5 | % 1. under the LaTeX Project Public License and/or | ||
6 | % 2. under the GNU Public License. | ||
7 | % | ||
8 | % See the file doc/generic/tikz-dependency/licenses/LICENSE for more details. | ||
9 | % | ||
10 | % Changelog | ||
11 | % | ||
12 | % 1.2 (Nov 3, 2016) | ||
13 | % - It's been a while :) Integrated a patch submitted by Jan Strunk <jan.strunk@uni-koeln.de> | ||
14 | % (thanks a lot Jan!) fixing a bug with the behavior of "edge end x offset". | ||
15 | % | ||
16 | % 1.1 (Jan 17, 2012) | ||
17 | % - Added the possibility to use simple arcs as edges (keys: arc edge/segmented edge) | ||
18 | % - Added "edge start x offset" and "edge end x offset" to fine tune edge start/end point position | ||
19 | % - Added \depstyle to define styles more easily | ||
20 | % - Added "simple" theme, based on the parse on page 1 of [Nivre and McDonald, 2008 ACL-HLT] | ||
21 | % - Added instructions to draw bubble parses | ||
22 | % - Fixed bug that would cause groupedges not to be straight under some circumstances; | ||
23 | % | ||
24 | % 1.0 (Nov 26, 2011) | ||
25 | % - First public release | ||
26 | |||
27 | \ProvidesPackage{tikz-dependency}[2011/01/08 v1.1 Macros to draw dependency trees] | ||
28 | \NeedsTeXFormat{LaTeX2e}[1999/12/01] | ||
29 | |||
30 | \RequirePackage{tikz,environ} | ||
31 | \usetikzlibrary{matrix,arrows,backgrounds,calc,patterns,positioning,fit,shapes} | ||
32 | |||
33 | \pgfdeclarelayer{depgroups} | ||
34 | \pgfsetlayers{depgroups,main} | ||
35 | |||
36 | \newcounter{dt@labelid} | ||
37 | \newif\ifdt@linkbelow | ||
38 | \newif\ifdt@arcedge | ||
39 | \tikzset{ | ||
40 | /depgraph/.cd, | ||
41 | /depgraph/.search also = {/tikz}, | ||
42 | dep id/.code = {\def\dt@depid{#1}}, | ||
43 | dep id = dependency, | ||
44 | % fix the distance of the edge | ||
45 | edge height/.code = {\pgfmathsetlengthmacro{\dt@linkheight}{#1}}, | ||
46 | edge height = 0pt, | ||
47 | % the distant of the horizontal line of the edge style for two adjacent words | ||
48 | edge unit distance/.code = {\pgfmathsetlengthmacro{\dt@linkstep}{#1}}, | ||
49 | edge unit distance = 3ex, | ||
50 | % the horizontal offset defining the trapezoidal look | ||
51 | edge slant/.code = {\pgfmathsetlengthmacro{\dt@linkslant}{#1}}, | ||
52 | edge slant = 3pt, | ||
53 | % the horizontal offset defining the starting/ending position of the edge style | ||
54 | edge horizontal padding/.code = {\pgfmathsetlengthmacro{\dt@linkoffset}{#1}}, | ||
55 | edge horizontal padding = 4pt, | ||
56 | % vertical offset of the edge style from the word | ||
57 | edge vertical padding/.code = {\pgfmathsetlengthmacro{\dt@linkdist}{#1}}, | ||
58 | edge vertical padding = 0ex, | ||
59 | % should links be placed above or below the sentence | ||
60 | edge below/.is if = dt@linkbelow, | ||
61 | edge below/.default=true, | ||
62 | edge above/.code = {\dt@linkbelowfalse}, | ||
63 | % arc edge | ||
64 | arc edge/.is if = dt@arcedge, | ||
65 | segmented edge/.code = {\dt@arcedgefalse}, | ||
66 | arc angle/.store in = \dt@arcangle, | ||
67 | arc angle = 60, | ||
68 | % an explicit offset to compensate the y position of the edge | ||
69 | edge start y offset/.code = {\pgfmathsetlengthmacro{\dt@EdgeStartOffsetY}{#1}}, | ||
70 | edge start y offset = 0, | ||
71 | % an explicit offset to compensate the x position of the edge | ||
72 | edge start x offset/.code = {\pgfmathsetlengthmacro{\dt@EdgeStartOffsetX}{#1}}, | ||
73 | edge start x offset = 0, | ||
74 | edge end x offset/.code = {\pgfmathsetlengthmacro{\dt@EdgeEndOffsetX}{#1}}, | ||
75 | edge end x offset = 0, | ||
76 | % the layer that links should connect | ||
77 | % (should be set to "1" for edge above, and to the number of rows | ||
78 | % in the matrix for edge below) | ||
79 | target layer/.store in = \dt@tgtlayer, | ||
80 | target layer/.default = 0, | ||
81 | target layer = 0, | ||
82 | % styling options | ||
83 | reserved/edge style/.style = {->, >=stealth, black, solid, rounded corners = 2, line cap = round, segmented edge}, | ||
84 | edge style/.style = {reserved/edge style/.append style = {#1}}, | ||
85 | reserved/label style/.style = { | ||
86 | anchor = mid, | ||
87 | draw, solid, | ||
88 | black, | ||
89 | scale = .7, | ||
90 | text height = 1.5ex, text depth = 0.25ex, % needed to center text vertically | ||
91 | inner sep=.5ex, | ||
92 | outer sep = 0pt, | ||
93 | rounded corners = 2pt, | ||
94 | text = black, | ||
95 | fill = white}, | ||
96 | label style/.style = {reserved/label style/.append style = {#1}}, | ||
97 | hide label/.style = {reserved/label style/.append style = {opacity = 0, text opacity = 0}}, | ||
98 | show label/.style = {reserved/label style/.append style = {opacity = 1, text opacity = 1}}, | ||
99 | text only label/.style = {reserved/label style/.append style = {opacity=0, text opacity=1}}, | ||
100 | reserved/text style/.style = { | ||
101 | text height=1.5ex, text depth = 0.25ex, % needed to center text vertically | ||
102 | inner sep = .5ex}, | ||
103 | text style/.style = {reserved/text style/.append style = {#1}}, | ||
104 | % group styling | ||
105 | reserved/group style/.style = { | ||
106 | inner sep = 0, | ||
107 | draw, solid, | ||
108 | outer sep = .5ex, | ||
109 | rounded corners = 2pt}, | ||
110 | group style/.style = {reserved/group style/.append style = {#1}}, | ||
111 | % themes for text | ||
112 | text theme/.is choice, | ||
113 | text theme/default/.style = {text style={black}}, | ||
114 | text theme/brazil/.style = {text style={blue!60!black}}, | ||
115 | text theme/iron/.style = {text style={black!80}}, | ||
116 | text theme/copper/.style = {text style={brown!60!black}}, | ||
117 | text theme/night/.style = {text style={black}}, | ||
118 | text theme/grassy/.style = {text style={green!40!black}}, | ||
119 | text theme/simple/.style = {text style={black}}, | ||
120 | % themes for labels | ||
121 | label theme/.is choice, | ||
122 | label theme/default/.style = {label style={fill=white, draw=black}}, | ||
123 | label theme/night/.style = {label style={text=white, fill=black, font=\bfseries}}, | ||
124 | label theme/brazil/.style = {label style={thick, black, fill=yellow, text=black, font=\bfseries}}, | ||
125 | label theme/iron/.style = {label style={top color=black!60, bottom color=black!80, draw=black!80, text=white, font=\bfseries}}, | ||
126 | label theme/copper/.style = {label style={top color=brown!80!pink, bottom color=brown!60!black, draw=brown!80, text=white, font=\bfseries}}, | ||
127 | label theme/grassy/.style = {label style={bottom color=green!60!black, top color=green!20!black, draw=green!40!black, text=white, font=\bfseries}}, | ||
128 | label theme/simple/.style = {label style={draw=none,fill=none,above,font=\scriptsize}}, | ||
129 | % themes for edges | ||
130 | edge theme/.is choice, | ||
131 | edge theme/default/.style = {edge style={thin,black}}, | ||
132 | edge theme/night/.style = {edge style={thick}}, | ||
133 | edge theme/brazil/.style = {edge style={thick,green!60!black}}, | ||
134 | edge theme/iron/.style = {edge style={thick, black!80}}, | ||
135 | edge theme/copper/.style = {edge style={thick, brown!80}}, | ||
136 | edge theme/grassy/.style = {edge style={thick, green!40!black}}, | ||
137 | edge theme/simple/.style = {arc edge, arc angle=79}, | ||
138 | % themes styles | ||
139 | theme/.style = {label theme = #1, edge theme = #1, text theme = #1}, | ||
140 | } | ||
141 | |||
142 | \newcommand{\depstyle}[2]{\tikzset{#1/.style = {/depgraph/.cd, #2}}} | ||
143 | |||
144 | |||
145 | \newenvironment{dependency}[1][]{% | ||
146 | \begin{tikzpicture}[/depgraph/.cd, #1] | ||
147 | \begin{scope} | ||
148 | }{% | ||
149 | \end{scope}% | ||
150 | \end{tikzpicture}% | ||
151 | } | ||
152 | |||
153 | \NewEnviron{deptext}[1][]{% | ||
154 | \begin{scope} | ||
155 | \matrix (\dt@depid)[% | ||
156 | nodes = {/depgraph/reserved/text style}, | ||
157 | column sep = 0, | ||
158 | row sep = -.5ex, | ||
159 | matrix of nodes, | ||
160 | ampersand replacement = \&, | ||
161 | nodes in empty cells, | ||
162 | #1] { | ||
163 | \BODY% | ||
164 | };% | ||
165 | \pgfmathtruncatemacro\dt@tmp{\pgfmatrixcurrentrow} | ||
166 | \xdef\dt@numrows{\dt@tmp} | ||
167 | \end{scope}% | ||
168 | } | ||
169 | |||
170 | \newcommand{\depkeys}[1]{\tikzset{/depgraph/.cd, #1}} | ||
171 | |||
172 | \newcommand{\settgtlayer}{% | ||
173 | \ifnum\dt@tgtlayer=0% | ||
174 | \ifdt@linkbelow% | ||
175 | \pgfmathtruncatemacro{\dt@tgtlayer}{\dt@numrows}% | ||
176 | \else% | ||
177 | \pgfmathtruncatemacro{\dt@tgtlayer}{1}% | ||
178 | \fi% | ||
179 | \fi% | ||
180 | } | ||
181 | |||
182 | \newcommand{\deproot}[3][]{% options, root offset, root reserved/label style | ||
183 | \begin{scope} | ||
184 | \depkeys{#1} | ||
185 | \pgfmathsetmacro{\offa}{#2} | ||
186 | \settgtlayer | ||
187 | \def\anchorpoint{north} | ||
188 | \ifdt@linkbelow | ||
189 | \def\anchorpoint{south} | ||
190 | \fi | ||
191 | \def\source{\dt@depid-\dt@tgtlayer-#2} | ||
192 | |||
193 | \ifdim\dt@linkheight=0pt | ||
194 | \pgfmathsetmacro{\distance}{\dt@linkstep * 4} | ||
195 | \else | ||
196 | \pgfmathsetlengthmacro{\distance}{\dt@linkheight} | ||
197 | \fi | ||
198 | \pgfmathsetlengthmacro{\dt@startdist}{\dt@linkdist} | ||
199 | \ifdt@linkbelow | ||
200 | \pgfmathsetmacro{\distance}{-(\dt@linkstep * 4)} | ||
201 | \pgfmathsetlengthmacro{\dt@startdist}{-\dt@startdist} | ||
202 | \fi | ||
203 | \node at (\source) (\rootref) [yshift=\distance, /depgraph/.cd, reserved/label style, #1] {#3}; | ||
204 | \draw [/depgraph/.cd, reserved/edge style, #1] (\rootref) -- ($(\source.\anchorpoint) + (0, \dt@startdist)$); | ||
205 | \end{scope} | ||
206 | } | ||
207 | |||
208 | \newcommand{\depedge}[4][]{% options, source offset, target offset, dep name | ||
209 | \begin{scope} | ||
210 | \depkeys{#1} | ||
211 | \pgfmathsetmacro{\offa}{#2} | ||
212 | \pgfmathsetmacro{\offb}{#3} | ||
213 | \settgtlayer | ||
214 | \def\source{\wordref{\dt@tgtlayer}{#2}} | ||
215 | \def\dest{\wordref{\dt@tgtlayer}{#3}} | ||
216 | \def\depname{#4} | ||
217 | \ifdim\dt@linkheight=0pt | ||
218 | \pgfmathsetlengthmacro{\distance}{abs(\offb - \offa)*\dt@linkstep} | ||
219 | \else | ||
220 | \pgfmathsetlengthmacro{\distance}{\dt@linkheight} | ||
221 | \fi | ||
222 | \groupedge[#1]{\source}{\dest}{\depname}{\distance} | ||
223 | \end{scope}} | ||
224 | |||
225 | \newlength{\xca} | ||
226 | \newlength{\yca} | ||
227 | \newlength{\xcb} | ||
228 | \newlength{\ycb} | ||
229 | |||
230 | \newcommand{\wordref}[2]{\dt@depid-#1-#2} | ||
231 | |||
232 | \newcommand{\rootref}{\dt@depid-root} | ||
233 | |||
234 | \newcommand{\matrixref}{\dt@depid} | ||
235 | |||
236 | % \storelabelnode | ||
237 | % | ||
238 | % \edef#1 the name of the last reserved/label style, stored in \dt@lastlabel | ||
239 | % | ||
240 | % #1 - a macro | ||
241 | \newcommand{\storelabelnode}[1]{\edef#1{\dt@lastlabel}} | ||
242 | |||
243 | \newcommand{\storefirstcorner}[1]{\edef#1{\dt@lastlabel-edge-first-corner}} | ||
244 | \newcommand{\storesecondcorner}[1]{\edef#1{\dt@lastlabel-edge-second-corner}} | ||
245 | |||
246 | \newcommand{\wordgroup}[5][]{% options, layer, col-start, col-end, identifier | ||
247 | \begin{scope}[/depgraph/.cd, #1] | ||
248 | \pgfonlayer{depgroups} | ||
249 | \node (#5) [fit = (\wordref{#2}{#3}) (\wordref{#2}{#4}), /depgraph/.cd, reserved/group style, #1] {}; | ||
250 | \endpgfonlayer | ||
251 | \end{scope} | ||
252 | } | ||
253 | |||
254 | \newcommand{\groupedge}[5][]{% options, source, target, depname, distance | ||
255 | \begin{scope}[/depgraph/.cd, #1] | ||
256 | \def\anchorpoint{north} | ||
257 | \ifdt@linkbelow | ||
258 | \def\anchorpoint{south} | ||
259 | \fi | ||
260 | \pgfextractx{\xca}{\pgfpointanchor{#2}{\anchorpoint}} | ||
261 | \pgfextractx{\xcb}{\pgfpointanchor{#3}{\anchorpoint}} | ||
262 | \pgfextracty{\yca}{\pgfpointanchor{#2}{\anchorpoint}} | ||
263 | \pgfextracty{\ycb}{\pgfpointanchor{#3}{\anchorpoint}} | ||
264 | \pgfmathsetlengthmacro{\ydiff}{\yca-\ycb} | ||
265 | \ifdim\xca>\xcb | ||
266 | \pgfmathsetlengthmacro{\doff}{-\dt@linkoffset} | ||
267 | \pgfmathsetlengthmacro{\dslant}{-\dt@linkslant} | ||
268 | \else | ||
269 | \pgfmathsetlengthmacro{\doff}{\dt@linkoffset} | ||
270 | \pgfmathsetlengthmacro{\dslant}{\dt@linkslant} | ||
271 | \fi | ||
272 | \addtocounter{dt@labelid}{1} | ||
273 | \xdef\dt@lastlabel{\dt@depid-\the\value{dt@labelid}} | ||
274 | \pgfmathsetlengthmacro{\dt@startdist}{\dt@linkdist} | ||
275 | \pgfmathsetlengthmacro{\dt@enddist}{#5} | ||
276 | \ifdt@linkbelow | ||
277 | \pgfmathsetlengthmacro{\dt@startdist}{-\dt@startdist} | ||
278 | \pgfmathsetlengthmacro{\dt@enddist}{-\dt@enddist} | ||
279 | \fi | ||
280 | |||
281 | % Calculate edge anchors. -edge-first-corner and -edge-second-corner are only | ||
282 | % meaningful for segmented edge, but we also draw the nodes for arc edge, someone | ||
283 | % may always find these anchors useful... | ||
284 | \node (\dt@lastlabel-edge-origin) [coordinate] at ($(#2.\anchorpoint) + (\doff,\dt@startdist) + (\dt@EdgeStartOffsetX,0) + (0,\dt@EdgeStartOffsetY)$) {}; | ||
285 | \node (\dt@lastlabel-edge-first-corner) [coordinate] at ($(\dt@lastlabel-edge-origin) + (\dslant,\dt@enddist)$) {}; | ||
286 | \node (\dt@lastlabel-edge-second-corner) [coordinate] at ($(#3.\anchorpoint) + (\dt@EdgeEndOffsetX,0) + (0,\dt@EdgeStartOffsetY) + (-\dslant,\dt@enddist+\dt@startdist+\ydiff)$) {}; | ||
287 | \node (\dt@lastlabel-edge-endpoint) [coordinate] at ($(#3.\anchorpoint) + (0,\dt@startdist) + (\dt@EdgeEndOffsetX,0)$) {}; | ||
288 | |||
289 | \ifdt@arcedge | ||
290 | % link above, left to right | ||
291 | \pgfmathsetmacro{\dt@arcin}{180-\dt@arcangle} | ||
292 | \pgfmathsetmacro{\dt@arcout}{\dt@arcangle} | ||
293 | \ifdt@linkbelow | ||
294 | % link below | ||
295 | \pgfmathsetmacro{\dt@arcin}{-\dt@arcin} | ||
296 | \pgfmathsetmacro{\dt@arcout}{-\dt@arcout} | ||
297 | \fi | ||
298 | \ifdim\xca>\xcb | ||
299 | % right to left | ||
300 | \pgfmathsetmacro{\dt@temp}{\dt@arcin} | ||
301 | \pgfmathsetmacro{\dt@arcin}{\dt@arcout} | ||
302 | \pgfmathsetmacro{\dt@arcout}{\dt@temp} | ||
303 | \fi | ||
304 | %\draw [/depgraph/.cd, reserved/edge style, rounded corners = #5/5, #1] | ||
305 | \draw [out=\dt@arcout, in=\dt@arcin,/depgraph/.cd, reserved/edge style, rounded corners = #5/5, #1] | ||
306 | (\dt@lastlabel-edge-origin) | ||
307 | to node (\dt@lastlabel) [/depgraph/.cd, #1, reserved/label style] {#4} | ||
308 | (\dt@lastlabel-edge-endpoint); | ||
309 | |||
310 | \else | ||
311 | \draw [/depgraph/.cd, reserved/edge style, rounded corners = #5/5, #1] | ||
312 | (\dt@lastlabel-edge-origin) -- | ||
313 | (\dt@lastlabel-edge-first-corner) -- | ||
314 | (\dt@lastlabel-edge-second-corner) -- | ||
315 | (\dt@lastlabel-edge-endpoint); | ||
316 | \node (\dt@lastlabel) [/depgraph/.cd, #1, reserved/label style] at | ||
317 | ($ .5*(\dt@lastlabel-edge-second-corner) + .5*(\dt@lastlabel-edge-first-corner) $) | ||
318 | {#4}; | ||
319 | \fi | ||
320 | \end{scope} | ||
321 | } | ||
322 |