-
Notifications
You must be signed in to change notification settings - Fork 228
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
Ability to Specify Jumpers #286
Comments
I agree the current version (v0.3.2) doesn't handle such loops in the diagram very well, but there is an optional connectors:
X6:
pinlabels: [+28VDC, +28VDC RTN, Token-In REF, Token-In, NC, NC, RS-485+, RS-485-, RS-485 Shield]
type: P1
loops:
- [3, 4] See the syntax doc, and also #48 where this feature and some possible alternatives are discussed. |
I missed the loops attribute. That is, indeed, what I wanted. As mentioned in #48, the length of the shorting wire needs some control. It overlapped the wire description box: I was able to work around this by reordering the pins:
I had to refer to the loop by the pin index within pins, and not its value. I don't know if this is intended or a bug. Anyway, I have a suitable solution. Thanks! |
👍
Suggestions about how to solve this are welcome! The overlap and spline lengths are controlled by the Graphviz dot tool, and I don't know if any of the input parameters of this tool can override such features.
I would say it sounds like an unwanted feature. |
Increasing the horizontal spacing is useful for the current implementation of loops as it helps with the wire table not overlapping the loop(s). Though, doing so is only necessary because loops are currently very pronounced... well, loops. Is there perhaps a clever way to use GraphViz tweaking to influence the appearance of loops? In case that cannot be done just for loops, I could imagine that a hint to GraphViz not to generally make bends less pronounced on a global level would potentially not hurt regular wires much but improve the appearance of loops. |
@blackbit42 wrote:
How wide the loops become seems to be dependent on other elements in the diagram, their spacing, or some other relations. Compare the small loop in my single connector diagram above with the wider loops in the larger diagrams. This dependency is also mentioned in #288. The reason behind such a difference has to be connected to the internal algorithms of Graphviz - that I don't know much about. Please search/ask at Graphviz user phorums to investigate further.
I recommend editing the
This is a question you should ask at some Graphviz phorum. In #3 you can find some examples on advanced Graphviz attributes for controlling the wire curves in a twisted wire usecase, and in #120 you can find some alternative ways to call Graphviz. Maybe any of those can be of any help. |
I stumbled on a possible solution to this issue today when reading this: https://stackoverflow.com/questions/70996779/graphviz-edges-between-cells-in-the-same-html-table-are-too-long @AlanLivingston, @rr-david, @blackbit42, and others with similar use cases - please try this work-around (adding an empty label to all edges) for your use cases, and report here if it works or if you find any unexpected side effects: connectors:
X2:
pinlabels: [+28VDC, +28VDC RTN, Token-In REF, Token-In, NC, NC, RS-485+, RS-485-, RS-485 Shield]
type: P1
loops:
- [3, 4]
cables:
W1:
colors: [RD, BK, IV, BU, GN]
connections:
- - W1: [1-5]
- X2: [1-2, 7-9]
tweak:
override:
edge:
label: " " Update: This work-around is no longer needed with v0.4.1 that includes PR #381. |
Instead of defining the loop by a single edge, I would simply split it into two edges, running through a node (shape as either point or none). This should allow for a higher degree of freedom for Graphviz. Another side effect is that it will avoid edges overlapping the nodes. In effect, this is similar to the concept of virtual splices. The definition of a "jumper cable" is possible though, which could even be associated with more than two pins. This cable would connect all loop wires into a virtual splice. It also allows the loop/jumper to be displayed with some wire definitions, if needed. Using a tweak, you could hide/shrink the cable and the splice for this approach:
Refer to the example that I provided for displaying twisted wires #3 (comment) |
@tobiasfalk - your suggestion is very similar to the 4 year old suggestion in #48 (comment). If you find a way to implement this in the Graphviz HTML syntax (in a |
@kvid I have no idea about GraphViz, it was only a idea that I thought I share |
The Problem seams to be the font(arial) what is a bit confusing. By setting it to Adobe Kaiti Std it works but I get this: |
@tobiasfalk The PNG rendering is a Unicode issue that can probably be solved. See here: https://graphviz.org/doc/char.html Note that I have updated #286 (comment) with some pictures above. |
It works when specefing the font: |
Here they talk about starting the line in the center of the node, with this it should be posible to do the dotet lines between the Point/Circles. |
It seams with when the attributes |
Since doing the dashed line between the point may be not possible or at least quite hard, I though that coloring the point could improve readability. |
Work-around to improve the #286 use case.
Work-around to improve the #286 use case.
Work-around to improve the #286 use case.
@AlanLivingston please verify, if PR #369 by @tobiasfalk poses an even better solution to your issue. @AlanLivingston wrote:
I propose to close this issue and continue the discussion here: |
Here's the yaml:
graphviz v0.20.3 |
Your connectors need some indentation, otherwise they will not be recognized at all. |
I think that's because I suck at GitHub markdown! X1 and X2 are indented in the .yml file. |
Here's the file, renamed as .log so GitHub will link it. It's really ajl.yml. |
I am using Win10 with I have created a new branch (Jumpes_sync)where I removed the Face attribute for the Black Circle, this breaks it on my system, but could you try it? |
@AlanLivingston |
As for the offset Circle in SVG, I have no Idea how to solve this, since this is a GraphViz Problem, mentioned here #350 (comment)
This would require a separate Cairo installation that currently can not be achieved with pip (to my knowledge) and I tried many things and was not able to install it in a way that I could test |
@AlanLivingston |
@AlanLivingston wrote:
This is the latest version of the Python wrapper from PyPI, not the actual version of the Graphviz executable from www.graphviz.org |
I realized that this morning after trying to match Tobias' graphviz version. The version I have installed is 11.0.0:
|
I am working on a solution with a image of a Black circle instead. This should sollen the Charakter debacle and the maybe the SVG offset problem, but I am not sure about the later one. |
@AlanLivingston could you test the latest Version of my Jumpers Branch, it now no longer uses characters but some GraphViz magic to draw dots at the ends of lines |
I concur. I tested on my system with both ex15.yml and my funky test, ajl.yml, and both .png and .svg files render properly! |
Those latest renders look excellent! My main thought is whether the individual short groups need to have names (SH1, SH2), or if in most cases, it would be obvious by seeing which pins are shorted (all GNDs, all VCCs, ...) and having duplicate info just clutters the table. shorts:
- [1,2,3] # if its obvious
- NAME: [4,5,6] # if it's not The other question is whether "shorts" is the proper word, since to me, a short circuit sounds like a fault. Final point: having colorful short dots could be helpful, but I would lean towards black lines+dots, with optional colorful filling, to preserve full legibility even when printing in B&W or using very light colors (yellow, white). |
You are right about both, for not showing the short name in the diagram, I would add the option to hide them. For not having names, I can currently not test how to do this but it is highly possible that it may not possible to Mix both. Partially because not having names I directly Sets the hide names to true.
I see your point, and yes Jumpers or Bridges Sound good.
Not sure if I currently can color the dot like it is in your example, but yes makes sense.
So you want the line color String something like this: bgk_color: Background Color, since this may not be white. |
Comparing the left and right connector, I came to realize, a systematic behavior should define which columns the Jumpers are drawn into. Pin numbers may appear on the left or right side, sometimes even both. Should the pin names and labels really be separated from their numbers (as seen in the left connector)? |
I've split off this discussion into #404 |
How about an explicit definition of the compact jumper set? shorts:
- [ [1,2], [3,4] ] # 1st column
- NAME: [5,6] # 2nd column named I would vote against some magical algorithm that reorders things on its own. |
After some thinking, my preference would be, no smart nesting, and use the order in which they are defined, to preserve the intention of the harness designer. E.g. they could want a pin-wise systematic ordering (as I sketched above), alphabetical based on the name of the jumper set, by groups (GND first, then voltages ascending, ...).
I like the approach! Code would need to handle lists (unnamed sets), dicts (named sets) and lists of lists (multiple sets in one column). And what happens if there's a collision within a column that would cause the sets to be drawn on top of each other? shorts:
- [ [1,3], [2,4] ] |
Yes, it could be done and looks good, but I would for now implement the "basic" jumpers, maybe without naming, but I would make naming mandatory at the beginning and then add the option to not display the name and after thet that the name is not needed in the syntax. |
1 similar comment
Yes, it could be done and looks good, but I would for now implement the "basic" jumpers, maybe without naming, but I would make naming mandatory at the beginning and then add the option to not display the name and after thet that the name is not needed in the syntax. |
As an additional usage of such optional labels in both My main motivation was to avoid separate lists with very similar entries of loop wires, short components, and the general connectors:
X1:
pincount: 12
additional_components:
W1:
type: Wire
subtype: 0.25 mm2
color: RD
qty: 2
unit: cm
J1:
type: Jumper
color: BN
loops:
- W1.: [1, 2]
- W1.: [3, 4]
shorts:
- J1.VCC: [5, 6]
- J1.GND: [11, 12] |
@formatc1702 I have added your syntax suggestion in #412 (but you can only have either of the two and not combine them in one connector), I now added a white border to the vertical line but Multicolor dots a bit of a problem and need more thinking of how to implement them, maybe a more advanced gvpr script, |
Currently, if I want to jump from a connector pin 3 to pin 4, I have to create a wire set, and in the connections, specify the connection like:
connectors:
X6:
pinlabels: [+28VDC, +28VDC RTN, Token-In REF, Token-In, NC, NC, RS-485+, RS-485-, RS-485 Shield]
type: P1
`cables:` ` W5:` ` colors: [BU]`
connections:
-
- X6: 3
- W5: 1
- X6: 4
But this creates a very bulky diagram, when what I really want is a jumper from pin 3 to pin 4 on the left side of connector X6.
The text was updated successfully, but these errors were encountered: