Comments (21)
Just adding to chorus: "arrow across scope" support would be a great + highly appreciated feature addition. Thanks.
from nomnoml.
Would love to see this too! This is one of the missing features that keeps causing me to fall back to tools other than nomnoml (which I hate to do, because I love nomnoml!)
Honestly, I'd be happy with no extensions to the syntax, and a change to the rules for how names are scoped.
A simple case:
[<package> A | [Vehicle]]
[<package> B | [Car]-:>[Vehicle]]
Right now, this is interpreted as meaning that package B contains both Car and Vehicle. Of course, in this case, the intent is for B to contain just Car, with an association to Vehicle in A. I think this is the more common intent for cases like this; I'd almost never want to have multiple things with the same name in the same diagram (that just sounds confusing!)
If there are use cases for having multiple things of the same name, maybe require that these must be defined on the left-hand side of an association (or without an association at all)? So, if someone really wanted package B to contain both Car and Vehicle (different from A's Vehicle) they could disambiguate by saying:
[<package> A | [Vehicle]]
[<package> B | [Vehicle]; [Car]-:>[Vehicle]]
This avoids introducing new syntax, allocates the simpler syntax for (IMO) the more common case, allows more complex syntax for the less common case, and is even a little discoverable (insofar as it's something you might try - "no, nomnoml, I really do want another Vehicle in B!")
Finally, for more complex ambiguities like:
[<package> A | [Vehicle]]
[<package> B | [Vehicle]]
[<package> C | [Car]-:>[Vehicle]]
...I don't really care what nomnoml does. I've described an incoherent diagram and don't expect a coherent result.
from nomnoml.
Drawing the graphics is the easy part. Actually calculating the graph layout is a complex task that Dagre does for us.
Here is one of the scientific papers that Dagre is based on http://www.graphviz.org/Documentation/TSE93.pdf
And specifically, "arrow across scope" is really about graph clustering which is described in this paper: https://publikationen.sulb.uni-saarland.de/bitstream/20.500.11880/25862/1/tr-A03-96.pdf
However I think that the latest versions of Dagre do support graph clustering, so this could be implemented. There is just the nitty-gritty details to work out.
from nomnoml.
Yes, The colon was only example because i am not an UML Expert :)
I have missed the dot in the [B.Dog]
But the dot is a valid accessor in most programming languages i know.
So for me it would be ok
And it is also possible to solve the ambiguity by using absolute paths (maybe)
[<package> A|
[Cat] -> [B.Dog]
[Cat] -> [A.B.Bird]
[<package> B|
[Bird]
]
]
[<package> B|
[Dog]
]
from nomnoml.
I'm a bit late to the convo but I'd also use this feature for the reason given in #46 Is it still not possible?
from nomnoml.
There is no way to do this in nomnoml right now. 😞
Both due to limitations in the current layout engine - and some unresolved questions on syntax.
See the example below for a case where we would have ambiguity. Some concept of "absolute paths" would have to be implemented. I am hesitant as that would be a move away from the nice visual ASCII-art like syntax towards a more programming-language like syntax.
[<package> A|
[Cat] -> [B.Dog]
[<package> B|
[Bird]
]
]
[<package> B|
[Dog]
]
from nomnoml.
Yes, I see it would be confusing with current syntax, which implicitly create cell when describing connection.
I am hesitant as that would be a move away from the nice visual ASCII-art like syntax towards a more programming-language like syntax.
Plus there will be name escaping (so that dots can be used safely in name), and will get nasty.
I think this can be considered together with #2.
from nomnoml.
I can also second that this is the only major limitation that prevents using nomnoml at all in place of Gliffy/LucidCharts for me.
from nomnoml.
What about somehting like:
[<package> A | [Vehicle]]
[<package> B | [Vehicle]]
[<package> C | [Car]-:>[A:Vehicle]]
where [A:Vehicle]
is an absolute path beginning on root of diagram
from nomnoml.
The colon ":" is already a UML control character that is used for instances.
[A:Vehicle]
means an instance named A of the class named Vehicle.
It also does not address the problems described in #6 (comment)
from nomnoml.
I think all paths should go through the container facade: in a sense nomnoml teaches us to design the class diagram better. So a different approach would be to have package facades (show the connection to package (considering the facade has the same name) an then from package to classes inside of it). The first part nomnoml already does. The second part can be emulated by having a class with the same name as the package inside the package and linking form there.
Of course the reader has to be educated about this convention..
from nomnoml.
This would be a great feature. I'd rather use Nomnoml than Mermaid honestly. (I use the 'subgraph' feature in Mermaid.)
from nomnoml.
Really nice tool, but this feature would make it even better.
How about something like the construct PlantUML uses?
[<package> A|[Pirate] as pirate]
[<package> B|[Bird] as bird]
[bird]->[pirate]
from nomnoml.
Not a supported feature unfortunately. 😞
It is not supported by the underlying graph-layout-library so there would have to be some work done to replace/extend that. Pull requests are welcome 😄
from nomnoml.
It would be great if this feature wiil be implemented 👍
from nomnoml.
@skanaar Hmm... I see your pickle.... It looks like you use dagre?
You might need to do some serious refactoring to use something more low-level like Snap.svg or something else.
My point in the other post?
When it comes to stacking, could use CSS flexbox?
You could draw the graphs and wrap them in a <div>
, that would allow the developed to create their own layout.
from nomnoml.
... I see, I'll keep quiet then.... Good luck!
from nomnoml.
Tell us when it becomes available! Thxx
from nomnoml.
@jhonatan1090 You are welcome to help out!
I gladly accept pull requests.
from nomnoml.
Why not add one more - to signify absoluteness or ignore grouping?
[fruit]--->[tomato]
This way, it's left to the user to draw arrow to and from any entity, regardless of them being in a group.
I'm sorry if this seems like a stupid suggestion, but this seems like the most obvious.
from nomnoml.
Looking around, D2 supports containers, even when using Dagre as the layout engine. Maybe check out how they are doing that?
from nomnoml.
Related Issues (20)
- Weird spacing on simple layout HOT 1
- any guess for when the new 1.6.0 version will get published? HOT 4
- Using <span> css in table definitions HOT 3
- Add 'doubled' shape style HOT 2
- following snippet does not work with the new parser but works with the old one HOT 4
- Is it possible modify the table contents. HOT 1
- missing <end>e label in homepage sample HOT 1
- support drag-and-drop and custom positioning of individual items? HOT 1
- Labels overlapping
- PNG export resolution is low HOT 1
- Classifier Style Problem with <frame> Visual HOT 3
- Support Google Fonts usage HOT 1
- Delegation connector for component internals HOT 1
- What happened to the formal grammar? HOT 4
- Text search not working for larger nomnoml diagrams HOT 1
- Parse error at line 2 column 35, expected "label" but got "[" HOT 2
- Creating groups HOT 1
- nomnoml.com : Diagrams not rendering HOT 2
- Incorrect file name handling HOT 5
- large margins for russian text 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 nomnoml.