Comments (15)
I got double line thickness to indicate a bus working with this commit.
Before:
After (along with some other changes I made):
I've also started looking into indicating the bus width with an edge label but so far it's proved unsuccessful. ElkJS seems to make space for the labels but doesn't actually place them for some reason.
from netlistsvg.
I would love to see this integrated into netlistsvg and demos in https://github.com/SymbiFlow/sphinxcontrib-hdl-diagrams
from netlistsvg.
ELK supports edge labels, but it's going to really clutter up the schematic if we have every single edge labeled. So I think the only tricky part about this is deciding which edges to add labels to.
Yosys also provides net names, so in theory we could also consider putting the netnames as an edge label.
from netlistsvg.
I could have sworn there was some universal convention in digital logic schematics to indicate bus widths with some slanted edges. Something like this:
But maybe dotted or squiggly somehow? I can't find any examples. Do you know what I am thinking of? This would have to be done with a graph node.
from netlistsvg.
I guess the convention is just a single slanted line and a number next to it.
from: https://tex.stackexchange.com/questions/125460/drawing-bus-width-like-markers-with-number-on-arrows
from netlistsvg.
finding the coordinates of the slanty line also makes this a little tricky.
from netlistsvg.
Would it be an option to draw buses in another color / thickness to distinguish them from individual lines? I agree that adding labels or width may clutter the figure indeed
from netlistsvg.
Another option may be to add the slanted line with number as one of the nodes on the line for ELK to place for you? That should help in keeping things clean
from netlistsvg.
I like that solution. It would add more columns but I think that is fine.
from netlistsvg.
This would be really helpful to me. Even just using a bold line to indicate a bus versus a single wire would be a big help.
I'm happy to submit a PR if you can point me in the right direction to get started.
from netlistsvg.
Looks great. Well done.
from netlistsvg.
that's looking nice already!
from netlistsvg.
Alright I've worked on this a bit more and figured out why labels weren't showing up - they weren't being drawn. I've added that but it seems like some labels are inline and others aren't (i think the ones with junction points are inline). Maybe there's a function that's centering all the elements of an edge when there's a junction (?). Setting 'org.eclipse.elk.edgeLabels.inline' false
in each label layoutOptions doesn't seem to do anything.
Ideally the labels would be closer to the source, but setting 'org.eclipse.elk.core.options.EdgeLabelPlacement': 'HEAD'
doesn't seem to do anything either. Ideally the design would also be less expanded (closer to how it was before).
Either way I've been able to manually offset it so it looks okay (but may have a line going over the label). Also, adding the labels does change layout, just an FYI.
Without manual offset (same json as above):
With manual offset:
All code is on this edgeLabels branch if anyone else wants to take a look at it. Any feedback welcome.
from netlistsvg.
I'm also on the netlistsvg Gitter if anyone wants to talk about this there.
from netlistsvg.
This is super cool!
from netlistsvg.
Related Issues (20)
- Exported svg is using "physical wiring connections" instead of "signal name association" (netlists) HOT 4
- Request: Padding
- TypeError: Cannot read property 'startsWith' of undefined at built/Skin.js:11 HOT 5
- patch for correct OR and NOR gates shapes in default.svg HOT 1
- Node v12 doesn't resolve dependancies HOT 1
- Text is getting cropped
- New version? HOT 1
- Module name used instead of Instance name for generic cells
- Render attribute as label on wires
- How to decode this error message? HOT 1
- $_ANDNOT gate is rendered as $_NAND HOT 4
- The generated schematics are corrupted around the (AND) cell. HOT 2
- wires
- output pin doesn't connect to anything HOT 1
- Add css media queries to support dark themes HOT 1
- Forcing bits on a bus to be ordered numerically HOT 1
- could you please commit and maintain a package lock file? HOT 1
- sv2v interfaces not rendered properly
- Feature Request: Hide Specified Ports
- Feature Request: Generate arithmetic operations fused with constants HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netlistsvg.