Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. The Lounge
  3. Diagram layout algos?

Diagram layout algos?

Scheduled Pinned Locked Moved The Lounge
algorithmsjavaquestion
11 Posts 6 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Roger Alsing 0
    wrote on last edited by
    #1

    Hi, Does anyone know the name of any 2d diagram layout algorithms? Ive been searching all over and only come up with Spring (aka force directed) algorithm. however, Im trying to layout class diagrams for a tool here and spring just dont make it look right (atleast not for class diagrams) //Roger

    R R S 3 Replies Last reply
    0
    • R Roger Alsing 0

      Hi, Does anyone know the name of any 2d diagram layout algorithms? Ive been searching all over and only come up with Spring (aka force directed) algorithm. however, Im trying to layout class diagrams for a tool here and spring just dont make it look right (atleast not for class diagrams) //Roger

      R Offline
      R Offline
      Roger Alsing 0
      wrote on last edited by
      #2

      man Ive should have looked at the cp ads first :P just found some names on dundas chart: Graph Layouts : Flow Chart layout Force-directed layouts Spring layout Barycenter layout Hierarchical layout (ok I thought force-directed was the same as spring?)

      1 Reply Last reply
      0
      • R Roger Alsing 0

        Hi, Does anyone know the name of any 2d diagram layout algorithms? Ive been searching all over and only come up with Spring (aka force directed) algorithm. however, Im trying to layout class diagrams for a tool here and spring just dont make it look right (atleast not for class diagrams) //Roger

        R Offline
        R Offline
        Ryan Roberts
        wrote on last edited by
        #3

        You might want to have a look at the netron library (http://netron.sourceforge.net/wp/?page_id=94[^]). The tree layout is probably going to to look better for class diagrams. Ryan

        O fools, awake! The rites you sacred hold Are but a cheat contrived by men of old, Who lusted after wealth and gained their lust And died in baseness—and their law is dust. al-Ma'arri (973-1057)

        R 1 Reply Last reply
        0
        • R Ryan Roberts

          You might want to have a look at the netron library (http://netron.sourceforge.net/wp/?page_id=94[^]). The tree layout is probably going to to look better for class diagrams. Ryan

          O fools, awake! The rites you sacred hold Are but a cheat contrived by men of old, Who lusted after wealth and gained their lust And died in baseness—and their law is dust. al-Ma'arri (973-1057)

          R Offline
          R Offline
          Roger Alsing 0
          wrote on last edited by
          #4

          I was looking at neutron last night but could only see a spring layout handler ( ?) also , classdigrams are graphs not trees so a tree layout wont cut it (only works for pure inheritance diagrams) here is what im trying to layout: http://www.puzzleframework.com/tmp/classdesignerzoomedout.gif[^] (Im using force directed there and I think it looks pretty odd) //Roger

          R A 2 Replies Last reply
          0
          • R Roger Alsing 0

            Hi, Does anyone know the name of any 2d diagram layout algorithms? Ive been searching all over and only come up with Spring (aka force directed) algorithm. however, Im trying to layout class diagrams for a tool here and spring just dont make it look right (atleast not for class diagrams) //Roger

            S Offline
            S Offline
            Stuart Dootson
            wrote on last edited by
            #5

            You could try GraphViz[^].

            L R R 3 Replies Last reply
            0
            • R Roger Alsing 0

              I was looking at neutron last night but could only see a spring layout handler ( ?) also , classdigrams are graphs not trees so a tree layout wont cut it (only works for pure inheritance diagrams) here is what im trying to layout: http://www.puzzleframework.com/tmp/classdesignerzoomedout.gif[^] (Im using force directed there and I think it looks pretty odd) //Roger

              R Offline
              R Offline
              Ryan Roberts
              wrote on last edited by
              #6

              Roger J wrote:

              also , classdigrams are graphs not trees

              Ah, of course. All those pesky association relations. Your right, it does look a little odd, you would expect them to be laid out on a grid as much as possible. Could you use a hybrid approach - treating nodes with association relations as single nodes, while using tree ordering for inheritance relations? There are bound to be lots of horrible edge cases you would need to check for. Still, fun problem. Wish I could be more use. I'll get back to my databinding now :) Ryan

              O fools, awake! The rites you sacred hold Are but a cheat contrived by men of old, Who lusted after wealth and gained their lust And died in baseness—and their law is dust. al-Ma'arri (973-1057)

              1 Reply Last reply
              0
              • S Stuart Dootson

                You could try GraphViz[^].

                L Offline
                L Offline
                leppie
                wrote on last edited by
                #7

                The one and only :) Although it chokes on some heavy graphs, or maybe i'm not patient enuf :) xacc.ide-0.1.0.12 released! Now even prettier than the last build :) Download and screenshots

                1 Reply Last reply
                0
                • S Stuart Dootson

                  You could try GraphViz[^].

                  R Offline
                  R Offline
                  Roger Alsing 0
                  wrote on last edited by
                  #8

                  cooool :) Ill have a look at it :-)

                  1 Reply Last reply
                  0
                  • S Stuart Dootson

                    You could try GraphViz[^].

                    R Offline
                    R Offline
                    Rob Graham
                    wrote on last edited by
                    #9

                    Too bad it has a "viral" licence... Absolute faith corrupts as absolutely as absolute power Eric Hoffer All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke

                    S 1 Reply Last reply
                    0
                    • R Rob Graham

                      Too bad it has a "viral" licence... Absolute faith corrupts as absolutely as absolute power Eric Hoffer All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke

                      S Offline
                      S Offline
                      Stuart Dootson
                      wrote on last edited by
                      #10

                      Hmmmm - looking at the CPL FAQ[^], I see the clauses below which imply you can *use* Graphviz without making the source code that *you* write open - all you need to do is a) acknowledge use of Graphviz, and b) say where the Graphviz source is available from. However, IANAL! 13. Can I take a Program licensed under the CPL, compile it without modification, and commercially license the result? Yes. You may compile a Program licensed under the CPL without modification and commercially license the result in accordance with the terms of the CPL. 14. Do I need to include the source code for such Program with the object code distribution? No. But you do need to include a statement that the source code is available from you and information on how to obtain it. 15. When I incorporate a portion of a Program licensed under the CPL into my own proprietary product distributed in object code form, can I use a single license for the full product, in other words, covering the portion of the Program plus my own code? Yes. The object code for the product may be distributed under a single license as long as it references the CPL portion and complies, for that portion, with the terms of the CPL.

                      1 Reply Last reply
                      0
                      • R Roger Alsing 0

                        I was looking at neutron last night but could only see a spring layout handler ( ?) also , classdigrams are graphs not trees so a tree layout wont cut it (only works for pure inheritance diagrams) here is what im trying to layout: http://www.puzzleframework.com/tmp/classdesignerzoomedout.gif[^] (Im using force directed there and I think it looks pretty odd) //Roger

                        A Offline
                        A Offline
                        Andrei Zenkovitch
                        wrote on last edited by
                        #11

                        The screenshot that you have does look like a variation of spring layout to me although you might have to adjust the strength of replusion and attraction forces to achieve better placement of the graph nodes. Word of caution: spring layout is usually pretty slow actually I usually wouldnot recommend to use it on a graph with more than 30 nodes especially if the number of edges is significant. But in your case I may suggest using Radial layout. This is a variation of tree layout so when you layout a graph you'll have to extract a spanning tree first. It seems like in your case the density of edges is pretty low so you should gain pretty good results when trying a Radial layout first. After that you may wish to apply Spring layout to refine the final output. Regards, Andrei Zenkovitch -- modified at 11:12 Monday 12th December, 2005

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups