jeudi 25 décembre 2014

Block diagram scheme file format


Yesterday I wanted to show my colleague a work flow diagram representing my view on developing our next project. Today I want to display file structure of another my project with includes as a tree diagram.


But each time I try, I realize that the fastest way is to open Paint and draw a picture, then send it like attachment, rather than waste a couple of hours using some heavyweight programm and ask my recipients to install it too.


So 2 main points of this problem are:



  1. software for creating block diagrams, though the process is very simple and understood by a child, just draw blocks and arrows, they keep to be very complicated offering enumerous options

  2. unified interchange format, thats what I'm going to touch further


I made a little research and this is a list of popular software (not full of course):



Each of them uses own format to store your data or only



A few words about XMI. It's an add-on upon XML that is already excessive by itself for this task + 400 pages of docs and unreadable format. MS Visio also packs this trash in zip.


So, you see, that the choiсe of formats is depressingly poor. My idea is to create a simple well understood format that can be easily parsed and used on every platform.


Let's start with basics. For example I have the simpliest block diagram


example 1


I can represent it like [A](1)[B]. Which means that block with index 0 and content A refers to block with index 1 that has content B.


Next example


example 2


would be [A](1,2)[B][C]. What about two double-ended arrow? No problem. It must be [A](1)[B](0) form the 1st example, so that every block points to each other. More complicated example: example 3 is [A](1)[B](0,2)[C](0,3)[D](3)


Actually, my wife asked my to add a loop, but it's still simple: block referes to itself.


So this is what I have


Main concepts:



  1. File contents should be as easy as block diagram itself

  2. Styling (colors, backgrounds, arrow endings, etc.) should be done on end computer


File description.



  1. Every block is represented by [].

  2. All contents of the block must be held inside it.

  3. Every block recieves index starting from 0 in order it's met in file.

  4. Block can have () section with it's relation(s).

  5. Relation is represented by number - index of block it is related to.

  6. () section is currently optional.

  7. ???


I wrote two parsers already (in PHP and JS) and I know it's very simple too do it in any other language and write plugins for any program. Also I understand that the real problem will be with unraveling and displaying graph, but I have a lot of suggestions how to make it easier, e.g.:



  • using {} characters to group blocks (even intersecting like {...{..}...})

  • using additional metadata file with information about relative positions of blocks


  • using matrix-type recording with empty blocks like



    [][A](1)[]
    [B](2)[][]
    [][][C]



or combination of methods to position them, group, draw boxes around, etc. As I mentioned, end user must decide what color and font it should be. Though it's not difficult to add file with styles later.


So the question is: Is this worth idea?


Answers:


DOT Yes, I know that I could easily store it any appropriate format. I saw lots of converters to and from JSON, XML, etc. But DOT (oblivious to the fact that it's developed for describing graphs, not diagrams, though it's practically the same) have the same disadvantage as all of them: convention.


I didn't mention it, because was not sure that someone will read such long post, but I also wanted to add it to my main concepts section. It's a big difference between file structer description and attribute name convention. This makes working with file more difficult. Your software has always to know what my software ment by rank or label.


Also I dont use strange -> and block repeating. In my format I will avoid attributes and all other stuff. Rules must be as simple as possible.


OGDL It doesn't have enough possibilities to represent block diagram with identations





Aucun commentaire:

Enregistrer un commentaire