WireViz icon indicating copy to clipboard operation
WireViz copied to clipboard

[bug] `hide_disconnected_pins` when nothing is connected

Open egradman opened this issue 3 years ago • 10 comments

Hi,

When I have hide_disconnected_pins set on a connector that has no connections, I get a syntax error from dot. Looks like an empty table isn't supported.

I realize that this is a super edge-case, but the error message wasn't helpful enough to track down the problem, and it took me a long time to figure out what was going on. I generate some pretty complicated wireviz documents with jinja2, so sometimes I encounter weird edge cases like this!

Love the project. Thanks so much for making it!

egradman avatar Nov 12 '21 19:11 egradman

Thanks for the input. I am currently refactoring the entire graph generation code, so I will keep this edge case in mind.

Is there a way to see some of the diagrams you are generating, out of sheer curiosity? Feel free to post them in #143. I've also noticed your obsidian-wireviz repo.. Never used Obsidian myself, but nice to know that WireViz will be supported :-)

formatc1702 avatar Nov 15 '21 17:11 formatc1702

thanks!

Here's a dropbox directory containing an example of how I'm combining jinja2 and wireviz. I probably overstated its complexity :) Also, I'm certain I'm not using WireViz in the manner in which you intended!

https://www.dropbox.com/sh/9pooo26ypwdjmci/AACWMr0FgoHUQTcLXsLp-s_Ja?dl=0

As far as obsidian-wireviz is concerned, I'll probably poke at that project again next weekend. I totally rely on mermaid in obsidian, and being able to inline quick wireviz diagrams into project notes will be really useful to me!

On Mon, Nov 15, 2021 at 9:09 AM Daniel Rojas @.***> wrote:

Thanks for the input. I am currently refactoring the entire graph generation code, so I will keep this edge case in mind.

Is there a way to see some of the diagrams you are generating, out of sheer curiosity? I've also noticed your obsidian-wireviz https://github.com/egradman/obsidian-wireviz repo.. Never used Obsidian myself, but nice to know that WireViz will be supported :-)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/formatc1702/WireViz/issues/257#issuecomment-969123531, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAZFWOTGKKHQOBLHWK2M3DUME5GHANCNFSM5H5SDYUA .

-- Eric Gradman CTO & Mad Inventor P: 213-268-6253 | W: twobitcircus.com http://www.twobitcircus.com/ TW: @egradman http://www.twitter.com/egradman

TWO BIT CIRCUS Engineering Entertainment

Inventors | Developers | Performers

egradman avatar Nov 15 '21 20:11 egradman

Another user has just reported the same bug, and I linked the duplicate to this issue. As both bug reports use quite complicated YAML input examples to demonstrate the same bug, I suggest here a much simpler YAML input to provoke the same error:

connectors:
  X1:
    pincount: 2
    hide_disconnected_pins: true

I got this error when running WireViz 0.3.2 with the input above (in Python 3.7.5 and Graphviz 2.40.1 at Ubuntu 18.04):

Error: syntax error in line 15
...
  </table> ...
in label of node X1
Traceback (most recent call last):
  File "wireviz.py", line 270, in <module>
    main()
  File "wireviz.py", line 266, in main
    parse(yaml_input, file_out=file_out)
  File "wireviz.py", line 195, in parse
    harness.output(filename=file_out, fmt=('png', 'svg'), view=False)
  File "../wireviz/Harness.py", line 437, in output
    graph.render(filename=filename, view=view, cleanup=cleanup)
  File "/home/kvid/src/formatc1702/WireViz/wv-env/lib/python3.7/site-packages/graphviz/files.py", line 209, in render
    quiet=quiet)
  File "/home/kvid/src/formatc1702/WireViz/wv-env/lib/python3.7/site-packages/graphviz/backend.py", line 221, in render
    run(cmd, capture_output=True, cwd=cwd, check=True, quiet=quiet)
  File "/home/kvid/src/formatc1702/WireViz/wv-env/lib/python3.7/site-packages/graphviz/backend.py", line 184, in run
    output=out, stderr=err)
graphviz.backend.CalledProcessError: Command '['dot', '-Tpng', '-O', 'single_connector_hide']' returned non-zero exit status 1. [stderr: b'Error: syntax error in line 15 \n... \n  </table> ...\nin label of node X1\n']

kvid avatar Dec 29 '23 19:12 kvid