m-nodechart.mkvi /size: 3464 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [       file=m-nodechart,
3%D        version=2011.11.11, % nos sure when it started, needed for fonts-mkiv
4%D          title=\CONTEXT\ Modules,
5%D       subtitle=Node Visualization,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\registerctxluafile{m-nodechart}{}
15
16\usemodule[chart]
17
18\unprotect
19
20\def\enspaceminus{\hskip.5em minus .25em\relax}
21
22\starttexdefinition unexpanded doFLOWglyphnode #comment #subtype #font #char #unicode
23   \dontleavehmode\hbox{\bf\setstrut\strut \doifsomething{#comment}{#comment\enspaceminus:\enspaceminus}glyph #subtype}
24   \vss
25   \dontleavehmode\hbox{\tx\setstrut\strut font\enspaceminus#font:\enspace#unicode:\enspaceminus\setfontofid{#font}\char#char}
26\stoptexdefinition
27
28\starttexdefinition unexpanded doFLOWdiscnode #comment #subtype
29   \dontleavehmode\hbox{\bf\setstrut\strut disc}
30   \vss
31   \dontleavehmode\hbox{\tx\setstrut\strut}
32\stoptexdefinition
33
34\starttexdefinition unexpanded doFLOWkernnode #comment #subtype #kern
35   \dontleavehmode\hbox{\bf\setstrut\strut#subtype}
36   \vss
37   \dontleavehmode\hbox{\tx\setstrut\strut#kern}
38\stoptexdefinition
39
40\starttexdefinition unexpanded doFLOWpenaltynode #comment #subtype #penalty
41   \dontleavehmode\hbox{\bf\setstrut\strut#subtype}
42   \vss
43   \dontleavehmode\hbox{\tx\setstrut\strut#penalty}
44\stoptexdefinition
45
46\starttexdefinition unexpanded doFLOWgluenode #comment #subtype #width #shrink #stretch
47   \dontleavehmode\hbox{\bf\setstrut\strut#subtype}
48   \vss
49   \dontleavehmode\hbox{\tx\setstrut\strut#width\enspaceminus-\enspaceminus#shrink\enspaceminus+\enspaceminus#stretch}
50\stoptexdefinition
51
52\starttexdefinition unexpanded doFLOWdirnode #comment #subtype #direction
53   \dontleavehmode\hbox{\bf\setstrut\strut#subtype}
54   \vss
55   \dontleavehmode\hbox{\tx\setstrut\strut#direction}
56\stoptexdefinition
57
58\defineframed
59  [flowcell:node]
60  [flowcell:base]
61  [\c!top=\vss,
62   \c!bottom=\vss,
63   \c!align=\v!middle,
64   \c!foregroundstyle=\tt]
65
66% this is a temporary interface ... we will have instances and optional settings
67
68\unexpanded\def\boxtoFLOWchart[#name]#box%
69  {\ctxlua{moduledata.charts.nodes.chart {
70       name = "#name",
71       box  = \number#box,
72   }}}
73
74\unexpanded\def\nextboxtoFLOWchart[#name]%
75  {\dowithnextbox{\boxtoFLOWchart[#name]\nextbox}}
76
77\unexpanded\def\hboxtoFLOWchart[#name]%
78  {\nextboxtoFLOWchart[#name]\hbox}
79
80\unexpanded\def\vboxtoFLOWchart[#name]%
81  {\nextboxtoFLOWchart[#name]\vbox}
82
83\protect
84
85\continueifinputfile{m-nodechart.mkvi}
86
87\definecolor[nodechart:glyph][darkred]
88
89\setupbodyfont[dejavu,10pt]
90
91\starttext
92
93\startTEXpage[offset=10pt]
94
95    \hboxtoFLOWchart[dummy]{an affil\discretionary{-}{-}{!}iation}
96
97    \FLOWchart[dummy][width=14em,height=3em,dx=1em,dy=.75em,hcompact=yes]
98
99\stopTEXpage
100
101\startTEXpage[offset=10pt]
102
103    \hboxtoFLOWchart[dummy]{an affiliation}
104
105    \FLOWchart[dummy][width=14em,height=3em,dx=.5em,dy=.75em,hcompact=yes]
106
107\stopTEXpage
108
109\startTEXpage[offset=10pt]
110
111    \hboxtoFLOWchart[dummy]{\nl effe fijn fietsen}
112
113    \FLOWchart[dummy][width=14em,height=3em,dx=.5em,dy=.75em,hcompact=yes]
114
115\stopTEXpage
116
117\startTEXpage[offset=10pt]
118
119    \hboxtoFLOWchart[dummy]{\righttoleft t\kern 1pt est}
120
121    \FLOWchart[dummy][width=14em,height=3em,dx=.5em,dy=.75em,hcompact=yes]
122
123\stopTEXpage
124
125\stoptext
126