-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] hide_disconnected_pins
when nothing is connected
#257
Comments
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. |
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](
https://mermaid-js.github.io/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
<#257 (comment)>,
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
|
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):
|
hide_disconnected_pins
when nothing is connectedhide_disconnected_pins
when nothing is connected
There are a few other syntax options for The latter part adds new functionality to wires though, so we might need to discuss this in a new issue. It depends a bit on how this bug would be solved. There was also a similar bug related to loops in issue #263, which got solved by PR #264 by @kvid. Note that I dropped the ending PS: I can confirm this bug. My use case involved using a YAML template that I applied to all connectors. I found this as good practice to show all pins while building the connections list and only hide them when finished. |
It's a shame this bug has been present for so long without being fixed. It was not complicated at all. @egradman and @martinrieder - Please try my PR #375 and report here if this issue was fixed. PS: I agree with @martinrieder that his suggestion about renaming the connector attribute deserves a new issue. |
Fine, the option is called connectors:
X1:
style: simple
hide_disconnected_pins: true
connections:
- - X1 connectors:
X1:
pincount: 1
show_name: false
show_pincount: false
hide_disconnected_pins: true
connections:
- - X1 Note: If the connector is not referenced in the |
@martinrieder wrote:
I only hide this table when it's empty to avoid the Graphviz error.
I chose to not output an empty table that produced an error. Another choice could be to insert a dummy cell in empty tables, but that would increase the space of the connector node. Is that better? Please suggest alternatives.
This does not collapse in size due to some white-space in the otherwise empty cell in the connector table. I can remove that white-space, but It'll require code changes several places in the code instead of only at one single place. Another way to make the output of a simple connector more like a connector with all pins hidden, is to insert the similar white-space in the simple connector case, but I haven't tested that alternative for side-effects. I don't want to make too much out of this fix because PR #251 will change all this code very soon anyway.
That is as designed. See the syntax description about this. |
I did exactly this, but the collapsed simple connector is easy to miss on a white background:
There is need to have a dummy table: It would be less confusing if the whitespace was internally set as a default. If users wanted to override this, they would have to define
I am thinking the same, though it would need to be solved in another issue. There are some more important things to tackle than a "missing whitespace". ;-)
I do not see any benefit in this. Please leave it as is.
I am being pedantic, so please don't get me wrong. I just wanted to highlight the corner case by providing this example.
I meant to say: The described bug is fixed. End of story. ^^ |
We seem to agree that the reported bug is fixed, so I will not add more to my fix now. However, I just want you @martinrieder to understand that my fix has absolutely no effect on simple connectors. If you try that YAML input example with WireViz v0.4, you will see an identical collapsed output as with my fixed version. You can also remove the |
@kvid sorry for the confusion, but we are on the same page. Comparing before and after fixing only has no effect on the simple connectors, of course. |
Closed after releasing v0.4.1. |
Hi,
When I have
hide_disconnected_pins
set on a connector that has no connections, I get a syntax error fromdot
. 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!
The text was updated successfully, but these errors were encountered: