Skip to content

Better Positioning Algorithm #81

Open
@ondras

Description

@ondras

From [email protected] on March 14, 2010 13:52:30

What steps will reproduce the problem? 1. Load data from a large database What is the expected output? What do you see instead? You expect the job to be done, whilst the relations can't be read, because
they superpose. What version of the product are you using? On what operating system? 2.4 / Chrome / XP Please provide any additional information below. What I did is not perfect, but might give you some ideas :

  1. place the tables with only 1 relation on a large circle (outer circle)
  2. place the tables with at most 1 relation per row on a less large circle
    (inner circle)
  3. place the tables without relation elsewhere (for exemple, from the
    bottom left to the bottom right outside of the circle)
  4. place all other tables in a rotate square so that they do not align
    horizontaly
    x
    x
    x
    x
  5. reorder the tables from the 1st step so they get closer to their unique
    related table
  6. reorder the tables from the 4th step so theyre relation count is with a
    better repartion
    9 8 7 9 5 8
    6 5 4 => 2 1 4
    3 2 1 6 3 7

You've already seen the result ;) http://maintenance.netsoins.org/dbdesign/ It is not perfect, I think it lack some reordering of the inner circle, and
no taking count of self-to-self relations :
+---+
---| |-
| | | this table has two relations but the shall count as one
| |-
+---+

There is a lot of work for this issue, you can read what I uglyly did :

SQL.Designer.prototype.alignTables http://maintenance.netsoins.org/dbdesign/js/wwwsqldesigner.js

Original issue: http://code.google.com/p/wwwsqldesigner/issues/detail?id=74

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions