-
Notifications
You must be signed in to change notification settings - Fork 276
Add support for Multicolored Wires #17
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
10e747c
Ignore IDE settings and windows stuff
aakatz3 21bc9b1
Add support for Multicolored (banded) wires
aakatz3 dccdfa7
Add example for banded wires
aakatz3 f23c186
Create multicolored wires with multiple HTML rows to match the curved…
kvid 89048d0
Fix table color issue
aakatz3 3562c0e
Merge #1
aakatz3 b253d0a
Reverse colors to match the curved wires when more than 2 colors
kvid 9cd46e4
Merge pull request #5 from kvid/kvid/feature-multicolor-wires
aakatz3 e631753
Rename examples to allow merge
aakatz3 f0d10bf
Merge branch 'dev' into feature-multicolor-wires
aakatz3 525be74
Merge multi-color wires into refactored code
aakatz3 4f076a5
Add Jetbrains IDE config
aakatz3 61a5545
Update all examples
aakatz3 bb0826a
Merge branch 'dev' into feature-multicolor-wires
aakatz3 e4a034c
Prepare for dev reset and re-merge
aakatz3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,22 @@ | ||
| .DS_Store | ||
| temp/ | ||
|
|
||
| .vscode/ | ||
|
|
||
| .idea/ | ||
|
|
||
|
|
||
| # IntelliJ Stuff | ||
| # Default ignored files | ||
| /shelf/ | ||
| /workspace.xml | ||
| # Datasource local storage ignored files | ||
| /dataSources/ | ||
| /dataSources.local.xml | ||
| # Editor-based HTTP Client requests | ||
| /httpRequests/ | ||
|
|
||
|
|
||
| # Windows | ||
| thumbs.db | ||
| desktop.ini |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Item Qty Unit Designators | ||
| Connector, Stewart Connector SS-37000-002, male, 8 pins 2 X1, X2 | ||
| Cable, 8 x 24 AWG 1 m W1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| graph { | ||
| // Graph generated by WireViz | ||
| // https://github.com/formatc1702/WireViz | ||
| graph [bgcolor="#fffbf8" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] | ||
| node [fillcolor=white fontname=arial shape=record style=filled] | ||
| edge [fontname=arial style=bold] | ||
| X1 [label="X1|{Stewart Connector SS-37000-002|male|8-pin}|{{DA+|DA-|DB+|DC+|DC-|DB-|DD+|DD-}|{<p1r>1|<p2r>2|<p3r>3|<p4r>4|<p5r>5|<p6r>6|<p7r>7|<p8r>8}}"] | ||
| X2 [label="X2|{Stewart Connector SS-37000-002|male|8-pin}|{{<p1l>1|<p2l>2|<p3l>3|<p4l>4|<p5l>5|<p6l>6|<p7l>7|<p8l>8}|{DB+|DB-|DA+|DD+|DD-|DA-|DC+|DC-}}"] | ||
| edge [color="#000000:#ffffff:#00ff00:#ffffff:#000000"] | ||
| X1:p1r:e -- W1:w1:w | ||
| W1:w1:e -- X2:p3l:w | ||
| edge [color="#000000:#00ff00:#000000"] | ||
| X1:p2r:e -- W1:w2:w | ||
| W1:w2:e -- X2:p6l:w | ||
| edge [color="#000000:#ffffff:#ff8000:#ffffff:#000000"] | ||
| X1:p3r:e -- W1:w3:w | ||
| W1:w3:e -- X2:p1l:w | ||
| edge [color="#000000:#0066ff:#000000"] | ||
| X1:p4r:e -- W1:w4:w | ||
| W1:w4:e -- X2:p7l:w | ||
| edge [color="#000000:#ffffff:#0066ff:#ffffff:#000000"] | ||
| X1:p5r:e -- W1:w5:w | ||
| W1:w5:e -- X2:p8l:w | ||
| edge [color="#000000:#ff8000:#000000"] | ||
| X1:p6r:e -- W1:w6:w | ||
| W1:w6:e -- X2:p2l:w | ||
| edge [color="#000000:#ffffff:#a52a2a:#ffffff:#000000"] | ||
| X1:p7r:e -- W1:w7:w | ||
| W1:w7:e -- X2:p4l:w | ||
| edge [color="#000000:#a52a2a:#000000"] | ||
| X1:p8r:e -- W1:w8:w | ||
| W1:w8:e -- X2:p5l:w | ||
| W1 [label=<<table border="0" cellspacing="0" cellpadding="0"><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td colspan="3">W1</td></tr><tr><td>8x</td><td>24 AWG</td><td>1 m</td></tr></table></td></tr><tr><td> </td></tr><tr><td><table border="0" cellspacing="0" cellborder="0"><tr><td>X1:1</td><td>WHGN</td><td>X2:3</td></tr><tr><td colspan="3" cellpadding="0" height="6" bgcolor="#ffffff:#00ff00" border="2" sides="tb" port="w1"></td></tr><tr><td>X1:2</td><td>GN</td><td>X2:6</td></tr><tr><td colspan="3" cellpadding="0" height="6" bgcolor="#00ff00" border="2" sides="tb" port="w2"></td></tr><tr><td>X1:3</td><td>WHOG</td><td>X2:1</td></tr><tr><td colspan="3" cellpadding="0" height="6" bgcolor="#ffffff:#ff8000" border="2" sides="tb" port="w3"></td></tr><tr><td>X1:4</td><td>BU</td><td>X2:7</td></tr><tr><td colspan="3" cellpadding="0" height="6" bgcolor="#0066ff" border="2" sides="tb" port="w4"></td></tr><tr><td>X1:5</td><td>WHBU</td><td>X2:8</td></tr><tr><td colspan="3" cellpadding="0" height="6" bgcolor="#ffffff:#0066ff" border="2" sides="tb" port="w5"></td></tr><tr><td>X1:6</td><td>OG</td><td>X2:2</td></tr><tr><td colspan="3" cellpadding="0" height="6" bgcolor="#ff8000" border="2" sides="tb" port="w6"></td></tr><tr><td>X1:7</td><td>WHBN</td><td>X2:4</td></tr><tr><td colspan="3" cellpadding="0" height="6" bgcolor="#ffffff:#a52a2a" border="2" sides="tb" port="w7"></td></tr><tr><td>X1:8</td><td>BN</td><td>X2:5</td></tr><tr><td colspan="3" cellpadding="0" height="6" bgcolor="#a52a2a" border="2" sides="tb" port="w8"></td></tr><tr><td> </td></tr></table></td></tr></table>> fillcolor=white margin=0 shape=box style=""] | ||
| } |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Example 7: Crossover Cable | ||
| connectors: | ||
| X1: | ||
| type: Stewart Connector SS-37000-002 | ||
| subtype: male | ||
| pinout: [DA+,DA-,DB+,DC+,DC-,DB-,DD+,DD-] # pincount is implicit in pinout | ||
| X2: | ||
| type: Stewart Connector SS-37000-002 | ||
| subtype: male | ||
| pinout: [DB+,DB-,DA+,DD+,DD-,DA-,DC+,DC-] | ||
|
|
||
| cables: | ||
| W1: | ||
| color_code: T568A # auto-color wires based on a standard | ||
| wirecount: 8 # need to specify number of wires explicitly when using a color code | ||
| gauge: 24 AWG # also accepts AWG as unit | ||
| length: 1 # length in m | ||
| shield: false | ||
| type: CAT5e | ||
|
|
||
| connections: | ||
| - - X1: [1-8] | ||
| - W1: [1-8] | ||
| - X2: [3,6,1,7,8,2,4,5] # crossover |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest changing height="6" to height="10" for two-colored wires to match the extra thickness of the connecting curved wires. The thickness seems to be 2x the number of color stripes (black edge + base color + stripe color + base color + black edge).
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An even better improvement (to avoid the color gradient) is to build the striped wire using multiple HTML rows with the port attribute only present in the middle row for each wire. See this excerpt from the upper wire in ex07.gv where the black edges are separated rows:
It might be easier to to use one row (with no border) for each color in the generic case with multiple stripes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SVG provides dashes ( https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray ) which provide a simple and clean way to add this. Draw a solid wire then a dashed wire.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just saw your changes, if you are able to, please check out my solution and let me knnow if you have any comments. I will try to review your pull request shortly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just created this PR: aakatz3#4 with my suggested implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@njhurst While it would be nice to do this, there is a problem: Graphviz does not support this properly. When drawing dashed lines, you cannot specify an alternate color, and you can't seem to overlay them properly. One COULD modify the SVG after the fact, but it breaks compatibility with GraphViz