Repository: wireviz/WireViz

Issue #293: Force connector to wire connections to the same side
Created: 2022-09-15T14:10:19Z
Hello all,
I am trying to document a H topology cable:

From the following source:
https://gist.github.com/martonmiklos/8603dcaaebea8eea07143e39b3de4fa0
It renders what I want to make, but the arranging is not quite as descriptive as it should.
Is there any way to force the +12V out 2 and GND out 2 connctors:

To force the wire entry to one side like happens on the +12V out 1 and GND out 1?

Duplicate issue #313: Can't get Daisy chaining working. Help.
Created: 2023-03-31T17:49:11Z
I need to have this fit a normal sized paper, thought I could move Cable 2 and the RGB_led connector down with Daisy chaining bit cant get it working. Can anyone help?

The connections in the code:
https://pastebin.com/1Q4bGLM8
I tried daisy chaining like shown below but it didn't change anything. Should I move the connectors down some other way?
daisy connections:
https://pastebin.com/aMjEtz41
The entire code:
https://pastebin.com/4iEgM3xS

Closing comment (2023-03-31T22:21:22Z): Thank you for sharing your usecase. It seems to be related to #293 and partly also #209. The order of the elements in each connection specify wires to be drawn from left to right in the diagram, so you need to swap the order of the C2 connections to force rgb_led to the left in the diagram. See my second diagram below.
It seems you have terminated the right end of the C1:10 wire at 3 different connectors, which is normally hard to do in real life with the same physical wire end. I assume you either intend to connect these GND terminals together with short wires to a common junction point (using a ferrule or soldering), or daisy chaining short wires between the same terminals. I suggest you specify in the diagram one of these ways. See my alternatives below.
Is it really your intention to connect G to Blue and B to Green at the rgb_led connector? Their names indicate rather these two connections should be swapped.
First, I show how a ferrule can be used to avoid terminating the same wire at several connectors:



Expand to show YAML code for the diagram above
connectors:
  dsub9:
    type: SUBD-9
    subtype: female
    pinlabels: [Reset, VCC_RGB, VCC_Programming, RGB_Red, Switch, RGB_Blue, RGB_Green, SW_DIO, SW_CLK, Housing (GND)]
  fixture:
    type: custom
    pinlabels: [Reset, "3V3", SWD_IO, SWD_CLK, GND]
  led_driver:
    type: custom
    pinlabels: ["VCC", "Red", "Blue", "Green"]
  rgb_led:
    type: custom
    pinlabels: [R, G, B, GND]
  switch:
    type: custom
    pinlabels: ["1", GND]
  ferrule:
    style: simple
    pincount: 1
cables:
  C1:
    gauge: 0.22 mm2
    length: 1 m
    colors: [BK, BN, WH, RD, VT, BU, GN, OG, GY, YE]
  C2:
    colors: [RD, BU, GN]
  C3:
    category: bundle
    colors: [YE,YE,YE]
    gauge: 0.22 mm2
    length: 0.1 m
    show_name: False
connections:
  -
    - dsub9: [1-10]
    - C1: [1-10]
  -
    - C1: [1,3,8-10]
    - fixture: [1-5]
  -
    - C1: [2,4,6-7]
    - led_driver: [1-4]
  -
    - led_driver: [2-4]
    - C2: [1-3]
    - rgb_led: [1-3]
  -
    - C1: 5
    - switch: 1
  -
    - ferrule: 1
    - C3: 1
    - fixture: GND
  -
    - ferrule: 1
    - C3: 2
    - switch: GND
  -
    - ferrule: 1
    - C3: 3
    - rgb_led: GND


Then I show how to daisy chain for a more compact diagram:



Expand to show YAML code for the diagram above
connectors:
  dsub9:
    type: SUBD-9
    subtype: female
    pinlabels: [Reset, VCC_RGB, VCC_Programming, RGB_Red, Switch, RGB_Blue, RGB_Green, SW_DIO, SW_CLK, Housing (GND)]
  fixture:
    type: custom
    pinlabels: [Reset, "3V3", SWD_IO, SWD_CLK, GND]
  led_driver:
    type: custom
    pinlabels: ["VCC", "Red", "Blue", "Green"]
  rgb_led:
    type: custom
    pinlabels: [R, G, B, GND]
  switch:
    type: custom
    pinlabels: ["1", GND]
cables:
  C1:
    gauge: 0.22 mm2
    length: 1 m
    colors: [BK, BN, WH, RD, VT, BU, GN, OG, GY, YE]
  C2:
    colors: [RD, BU, GN]
  C3:
    category: bundle
    colors: [YE,YE]
    gauge: 0.22 mm2
    length: 0.2 m
    show_name: False
connections:
  -
    - dsub9: [1-10]
    - C1: [1-10]
  -
    - C1: [1,3,8-10]
    - fixture: [1-5]
  -
    - C1: [2,4,6-7]
    - led_driver: [1-4]
  -
    - rgb_led: [1-3]
    - C2: [1-3]
    - led_driver: [2-4]
  -
    - C1: 5
    - switch: 1
  -
    - rgb_led: GND
    - C3: 1
    - fixture: GND
  -
    - rgb_led: GND
    - C3: 2
    - switch: GND
tweak:
  override:
    graph:
      ranksep: "4"  # Increase horizontal spacing (default 2) for better readability


With default horizontal spacing, the wires drawn between C1 and led_driver became hard to separate in this last diagram, so I doubled the horizontal spacing for better readability.