Open ronaldtse opened 4 years ago
@elquimista you up for this?
@ronaldtse yes I'm up for this. The second diagram is a class diagram right? Can you draw it on paper and share?
@elquimista Yes the second diagram is a class diagram that we wish to reproduce in OGDF.
@elquimista please feel free to ask questions here. @w00lf and @DmitryDrobotov would be also able to help. Thanks!
Find below (also attached as SVG) graph for the second diagram generated by OGDF (code attached - C++17):
After spending considerable time and effort on this, here are my observations and updates:
OGDF doesn't fully support UML Class diagrams yet! All the required elements of the UML Class Diagram such as Class (attributes, methods, visibility, etc.) and relationships (inheritance, composition, aggregation, etc.) are not available. The image generation through SVG (please refer to SvgPrinter) does not support the components of a Class Diagram mentioned above. The generation of a similar diagram like the first one could be emulated by writing everything (just like HTML + CSS + SVG) but that's a non-trivial task. To do this, the drawing and layout of each element need to be manually planned and generated. Then, what's the point of using OGDF at all? This could be done by writing a custom library that only deals with UML diagrams i.e. the required types, algorithms, and image generation mechanism.
Additionally, I've tried to use its GML and GraphML formats but it didn't work. It's unable to even read the file generated by its own code (please refer to these examples).
On the other hand, I tried yEd and it supports these things out-of-the-box and is pretty straightforward to use. Here's one of its sample UML Class diagram:
To sum up, if the objective is just to provide Ruby bindings for OGDF APIs then that should be targeted. The bindings may be updated as and when the UML support is added or as the library itself grows. Otherwise, a standalone Ruby version of OGDF (not necessarily based on OGDF) may be developed. And, that is a non-trivial and long-term commitment.
@ronaldtse @DmitryDrobotov @w00lf ☝️
@elquimista could you provide the code you wrote for both diagrams? You mentioned about code attached but I don't see them...
All the required elements of the UML Class Diagram such as Class (attributes, methods, visibility, etc.) and relationships (inheritance, composition, aggregation, etc.) are not available.
The first diagram, generated via OGDF, contains attributes, generalization and composition.
yEd does not meet our requirements for drawing these: https://github.com/lutaml/lutaml-uml/issues
What exactly did you mean by:
This could be done by writing a custom library that only deals with UML diagrams i.e. the required types, algorithms, and image generation mechanism. ?
Were you able to find out how to do diagrams like this?
https://ogdf.uos.de/doc/dir_d2bf5410fcb0d0ed7083a64a0eaec90a.html
Maybe the approach is we have to do a C++ program in OGDF to handle our UML syntax and create a Ruby binding for that.
@ronaldtse
Could you provide the code you wrote for both diagrams? You mentioned code attached but I don't see them.
Sorry I thought I attached it. Here's the code: ogdf-example.zip
The first diagram, generated via OGDF, contains attributes, generalization, and composition.
A code reference may have helped but could not find anything remotely similar. Even if it was developed with OGDF, its support must be buried deep in its Git history. Maybe, you want to look at that.
yEd does not meet our requirements.
Right.
What exactly did you mean by this:
This could be done by writing a custom library that only deals with UML diagrams i.e. the required types, algorithms, and image generation mechanism. ?
OGDF doesn't support UML fully and it's going to be removed. Its source code for layouts and rendering shows that the required functionality is not there. The SvgPrinter module that renders the images in SVG doesn't include UML components.
So, it was suggested that the required components, algorithms, and renderer may be custom-developed.
Were you able to find out how to do diagrams like this?
These are simple graphs with a different layout (planar + upward + weighted edges), not UML Class diagrams.
Maybe the approach is we have to do a C++ program in OGDF to handle our UML syntax and create a Ruby binding for that.
Which is akin to build a custom library altogether, as I mentioned earlier, and that from the scratch.
@ronaldtse
Could you provide the code you wrote for both diagrams? You mentioned code attached but I don't see them.
Sorry I thought I attached it. Here's the code: ogdf-example.zip
The first diagram, generated via OGDF, contains attributes, generalization, and composition.
A code reference may have helped but could not find anything remotely similar. Even if it was developed with OGDF, its support must be buried deep in its Git history. Maybe, you want to look at that.
yEd does not meet our requirements.
Right.
What exactly did you mean by this:
This could be done by writing a custom library that only deals with UML diagrams i.e. the required types, algorithms, and image generation mechanism. ?
OGDF doesn't support UML fully and it's going to be removed. Its source code for layouts and rendering shows that the required functionality is not there. The SvgPrinter module that renders the images in SVG doesn't include UML components.
So, it was suggested that the required components, algorithms, and renderer may be custom-developed.
Were you able to find out how to do diagrams like this?
These are simple graphs with a different layout (planar + upward + weighted edges), not UML Class diagrams.
Maybe the approach is we have to do a C++ program in OGDF to handle our UML syntax and create a Ruby binding for that.
Which is akin to build a custom library altogether, as I mentioned earlier, and that from the scratch.
That's strange, we have made research before about ogdf capabilities and most of the sources tell that it can be used to create complex uml state diagrams, for example - http://publications.lib.chalmers.se/records/fulltext/252095/252095.pdf, in 2.4.1 ogdf described as a modular library capable of rendering complex diagrams. Maybe there are some additional libraries(plugins) for ogdf that extend its drawing capabilities?
That discusses State Machines (useful for FA, TG, GTG, etc.), not Class Diagrams.
Here are some of the resources that I've gone through:
Maybe there are some additional libraries (plugins) for ogdf that extend its drawing capabilities?
That may be the case. But, then something must pop up in the search results, GitHub history, or the source code. Even if someone or some company is doing it with OGDF then most probably that would be proprietary.
Which is akin to build a custom library altogether, as I mentioned earlier, and that from the scratch.
@elquimista can you help do this? The point is we want to create that UML diagram.
@ronaldtse I'd like to help you with this provided that the detailed specs are complete and I'm not busy on other things. Regardless, I'd be able to spend some time on the weekends depending on my availability. Also, it would be very helpful to know what this library would be expected to provide in terms of usability and performance.
@ronaldtse I'd like to help you with this provided that the detailed specs are complete and I'm not busy on other things. Regardless, I'd be able to spend some time on the weekends depending on my availability. Also, it would be very helpful to know what this library would be expected to provide in terms of usability and performance.
The main requirement here is to create a collection of predefined methods that we can use as native extensions from our ruby library like described here - http://tristanpenman.com/blog/posts/2018/09/16/extending-ruby-with-cpp/. performance won't be an issue here, the largest diagram we encounter so far in our docs consists of 15 nodes. @elquimista do you think it will be possible to create such collection of methods?
Ping @elquimista
@ronaldtse Did you get my email I sent on Sep 3?
We need to use OGDF to draw a UML diagram in C++.
OGDF is a framework for drawing graphs. They seem to be able to draw UML diagrams well.
Some links:
This site contains quite a number of examples for OGDF usage https://chameerawijebandara.wordpress.com/tag/ogdf/
Documentation available here with examples: https://ogdf.uos.de/doc/
There is XMI support in UmlModelGraph (https://ogdf.uos.de/doc/classogdf_1_1_uml_model_graph.html)
Description of OGDF: http://tcs.informatik.uos.de/_media/pubs/gdchapter_ogdf.pdf
Here's an example of UML generated by OGDF:
The goal is to re-draw this diagram using OGDF (the current diagram is ugly, OGDF output is much nicer!):
I think one of these ways will work:
Eventually the goal is to have a Ruby API that can perform either of these.