diff options
author | koray kavukcuoglu <koray@kavukcuoglu.org> | 2015-01-13 14:41:54 +0300 |
---|---|---|
committer | koray kavukcuoglu <koray@kavukcuoglu.org> | 2015-01-13 14:41:54 +0300 |
commit | 518b60b632179b09db4b06c953c2ac4fc66097ce (patch) | |
tree | b3538d01f23bd59d3c443de3ebc950da0641f1e5 | |
parent | ac66714505032e85f734cf197a8d224060da3f17 (diff) |
add name function to create named nodes to easily inspect in the graph
-rw-r--r-- | node.lua | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -44,6 +44,13 @@ function nnNode:split(noutput) return unpack(selectnodes) end +function nnNode:name(name) + if self.data and istable(self.data) then + self.data.name = name + end + return self +end + function nnNode:label() local lbl = {} @@ -78,12 +85,12 @@ function nnNode:label() for k,v in pairs(self.data) do local vstr = '' - if k=='mapindex' then + if k == 'mapindex' then if #v > 1 then vstr = getmapindexstr(v) table.insert(lbl, k .. ' = ' .. vstr) end - elseif k=='forwardNodeId' then + elseif k == 'forwardNodeId' then -- the forwardNodeId is not displayed in the label. else vstr = getstr(v) |