about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-03-18 17:58:25 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-03-18 17:58:25 -0700
commit03a38835551088960427a1b7221e686ba8cb0822 (patch)
tree58d234f41591692436e378e57bf2f0dfeef27849
parent824705f77065be794496e9a30683d6c14f025fc8 (diff)
downloadteliva-03a38835551088960427a1b7221e686ba8cb0822.tar.gz
graphviz: read multiple .dot files
It's useful to be able to import dependencies for multiple packages at
once, so that we can see common dependencies.
-rw-r--r--graphviz.tlv30
1 files changed, 30 insertions, 0 deletions
diff --git a/graphviz.tlv b/graphviz.tlv
index c9f9b70..5db0d23 100644
--- a/graphviz.tlv
+++ b/graphviz.tlv
@@ -838,3 +838,33 @@
     >    window:addstr('_')
     >  end
     >end
+- __teliva_timestamp:
+    >Fri Mar 18 17:51:18 2022
+  main:
+    >function main()
+    >  if #arg == 0 then
+    >    Window:clear()
+    >    print('restart this app with the name of a .dot file')
+    >    Window:refresh()
+    >    while true do Window:getch(); end
+    >  end
+    >  for _, filename in ipairs(arg) do
+    >    read_dot_file(filename, Graph)
+    >  end
+    >
+    >  while true do
+    >    render(Window)
+    >    update(Window)
+    >  end
+    >end
+- __teliva_timestamp:
+    >Fri Mar 18 17:51:32 2022
+  read_dot_file:
+    >function read_dot_file(filename, graph)
+    >  local infile = start_reading(nil, filename)
+    >  if infile then
+    >    local chars = graphviz_buffered_reader(infile)
+    >    local tokens = graphviz_tokenizer(chars)
+    >    parse_graph(tokens, graph)
+    >  end
+    >end