SylvainTI / wwwsqldesigner

Automatically exported from code.google.com/p/wwwsqldesigner
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Color enhancement #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. This is not a bug, but a suggestion

What is the expected output? What do you see instead?
When having many relations between tables (large database), they do not 
appear well as they superpose (well i'm not sure if this world is english).
Some thing I did towards this is to put random colors one the relation 
lines. See above.

What version of the product are you using? On what operating system?
2.4 / Chromium / XP

Please provide any additional information below.

In config.js file, add this :
 > RELATION_COLORS:['#000','#F00','#080','#F80','#008'],
In the main JS file, change those :
[svg]
 > path.setAttribute("stroke","black");
[vml]
 > curve.strokecolor = "#000";

with :
[svg]
 > path.setAttribute("stroke", CONFIG.RELATION_COLORS[ ColorPos++ % 
CONFIG.RELATION_COLORS.length] );
[vml]
 > curve.strokecolor = CONFIG.RELATION_COLORS[ ColorPos++ % 
CONFIG.RELATION_COLORS.length];

(not touching the "other rendering method" code)

Note : ColorPos is a Global, define at the top of the file with
 var ColorPos = 0;
But You should move it in SQL.Relation...

This does something pretty cool like this :
  http://maintenance.netsoins.org/dbdesign/
(notice that I had some fun with the code...)

Original issue reported on code.google.com by geompse@gmail.com on 11 Mar 2010 at 7:43

GoogleCodeExporter commented 9 years ago
PS : The actual behavior can still be optained with this line in the config.js
 > RELATION_COLORS:['#000'],

Original comment by geompse@gmail.com on 11 Mar 2010 at 7:44

GoogleCodeExporter commented 9 years ago
Good suggestion, will do this.

Original comment by ondrej.zara on 12 Mar 2010 at 7:30

GoogleCodeExporter commented 9 years ago
Added in r82, thanks for a nice idea :)

Original comment by ondrej.zara on 14 Mar 2010 at 8:47