MCPcopy Create free account
hub / github.com/jakesgordon/javascript-state-machine / dotcfg

Function dotcfg

lib/visualize.js:118–142  ·  view source on GitHub ↗
(fsm, options)

Source from the content-addressed store, hash-verified

116//-------------------------------------------------------------------------------------------------
117
118function dotcfg(fsm, options) {
119
120 options = options || {}
121
122 var config = dotcfg.fetch(fsm),
123 name = options.name,
124 rankdir = dotcfg.rankdir(options.orientation),
125 states = dotcfg.states(config, options),
126 transitions = dotcfg.transitions(config, options),
127 result = { }
128
129 if (name)
130 result.name = name
131
132 if (rankdir)
133 result.rankdir = rankdir
134
135 if (states && states.length > 0)
136 result.states = states
137
138 if (transitions && transitions.length > 0)
139 result.transitions = transitions
140
141 return result
142}
143
144//-------------------------------------------------------------------------------------------------
145

Callers 2

visualizeFunction · 0.70
visualize.jsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected