Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{tufte-handout}
- usepackage{tikz}
- usetikzlibrary{shapes.multipart}
- usetikzlibrary{matrix}
- usetikzlibrary{positioning}
- usetikzlibrary{shadows}
- usetikzlibrary{calc}
- makeatletter
- pgfarrowsdeclare{crow's foot}{crow's foot}
- {
- pgfarrowsleftextend{+-.5pgflinewidth}%
- pgfarrowsrightextend{+.5pgflinewidth}%
- }
- {
- pgfutil@tempdima=0.5pt%
- advancepgfutil@tempdima by.25pgflinewidth%
- pgfsetdash{}{+0pt}%
- pgfsetmiterjoin%
- pgfpathmoveto{pgfqpoint{0pt}{-6pgfutil@tempdima}}%
- pgfpathlineto{pgfqpoint{-6pgfutil@tempdima}{0pt}}%
- pgfpathlineto{pgfqpoint{0pt}{6pgfutil@tempdima}}%
- pgfusepathqstroke%
- }
- tikzset{
- entity/.code={
- tikzset{
- label=above:#1,
- name=#1,
- inner sep=0pt,
- every entity/.try,
- fill=white,
- general shadow={
- shadow xshift=0.0625in,
- shadow yshift=-0.0625in,
- opacity=0.5,
- fill=black!50
- }
- }%
- defentityname{#1}%
- },
- entity anchor/.style={matrix anchor=#1.center},
- every entity/.style={
- draw,
- },
- every property/.style={
- inner xsep=0.25cm, inner ysep=0.125cm, anchor=west, text width=1.45in
- },
- zig zag to/.style={
- to path={(tikztostart) -| ($(tikztostart)!#1!(tikztotarget)$) |- (tikztotarget)}
- },
- zig zag to/.default=0.5,
- one to many/.style={
- -crow's foot, zig zag to
- },
- many to one/.style={
- crow's foot-, zig zag to
- },
- many to many/.style={
- crow's foot-crow's foot, zig zag to
- }
- }
- defproperty#1{node[name=entityname-#1, every property/.try]{#1};}
- defproperties{begingroupcatcode`_=11relaxprocessproperties}
- defprocessproperties#1{endgroup%
- defpropertycode{}%
- foreach p in {#1}{%
- expandafterexpandafterexpandaftergdefexpandafterexpandafterexpandafterpropertycode%
- expandafterexpandafterexpandafter{expandafterpropertycodeexpandafterpropertyexpandafter{p}\}%
- }%
- propertycode%
- }
- begin{document}
- begin{tikzpicture}[every node/.style={font=ttfamily}, node distance=1in]
- matrix [entity=Mspstring_Supportstring_Period] {
- properties{
- spe_refno,
- spe_peo_refno,
- spe_spcs_refno,
- spe_start,
- spe_expected_end,
- (etc)
- }
- };
- matrix [entity=People,
- right=3cm of Mspstring_Supportstring_Period-spe_refno,
- entity anchor=People-peo_refno] {
- properties{
- peo_refno,
- peo_surname,
- peo_dob,
- peo_hrv_ethnic,
- (etc)
- }
- };
- matrix [entity=Spstring_Contractedstring_Services,
- below left =4.5cm and -1cm of Mspstring_Supportstring_Period-spe_refno,
- entity anchor=Spstring_Contractedstring_Services-spcs_spcn_contract_id] {
- properties{
- spcs_spcn_contract_id,
- exp_org_name,
- exp_hrv_exp_type,
- (etc)
- }
- };
- matrix [entity=Mspstring_Referral,
- below right =4cm and -1cm of People-peo_refno,
- entity anchor=Mspstring_Referral-ref_peo_refno] {
- properties{
- ref_peo_refno,
- ref_exp_refno,
- ref_spcs_refno,
- ref_type,
- ref_received_by,
- ref_reject_date,
- (etc)
- }
- };
- matrix [entity=Houstring_Refstring_Values,
- right=4cm of People-peo_refno,
- entity anchor=Houstring_Refstring_Values-hrv_code] {
- properties{
- hrv_code,
- hrv_hrd_domain,
- hrv_name,
- (etc)
- }
- };
- matrix [entity=Mspstring_Externalstring_Parties,
- below right=4cm and 7.5cm of Mspstring_Referral-ref_exp_refno,
- entity anchor=Mspstring_Referral-ref_exp_refno] {
- properties{
- exp_refno,
- exp_org_name,
- exp_hrv_exp_type,
- (etc)
- }
- };
- draw [many to one] (Mspstring_Supportstring_Period-spe_refno) to (People-peo_refno);
- draw [many to one] (Mspstring_Supportstring_Period-spe_spcs_refno) to (Spstring_Contractedstring_Services-spcs_spcn_contract_id);
- draw [many to one] (People-peo_refno) to (Mspstring_Referral-ref_peo_refno);
- draw [many to one] (Mspstring_Referral-ref_spcs_refno) to (Spstring_Contractedstring_Services-spcs_spcn_contract_id);
- draw [many to one] (Mspstring_Referral-ref_exp_refno) to (Msp_External_Parties-exp_refno);
- end{tikzpicture}
- end{document}
Add Comment
Please, Sign In to add comment