cancel
Showing results for 
Search instead for 
Did you mean: 

Diagram complexity metric? Mechanism to quantify crossing lines in a diagram?

Former Member
0 Kudos

I'm looking to see if I can generate a metric to cover how complex (and driving towards a (un)readability metric) a ERD diagram is. I was thinking using the number of entities, number of relationships, ideally the size of the canvas to provide a view on the compactness of the model. So I think this is largely doable - but if someone already has done this I'll happily reuse it.

However to make this even better I think having a count of crossing relationship lines would provide an interesting weighting for readability.

So two questions:

1) has anyone done this before, and can share?

2) Is it possible to work out the number of relationship lines crosses?

Many thanks,

Gareth

Accepted Solutions (0)

Answers (2)

Answers (2)

GeorgeMcGeachie
Active Contributor
0 Kudos
Former Member
0 Kudos

Thanks - I've made a first pass (and implementation) on a view on how to measure the complexity of a diagram.

1) Compare the size of the canvas to the size of the entities on the canvas. Seems to be anything below 9% seems a little suspect.

2) Compare the number of entities to the number of page. If the average ratio is lower than 2 then it is probably a less than readable diagram.

I would also like to raise a pet peeve, and pose a question to the PD team. "Why can we not easily report on Subject Areas/Diagrams?", it seems while we can get a list of most things reporting on diagrams in a list report or any interactive table seems missing or well hidden. Is there a reason for that (or am I missing something)?

I have a couple more up my sleeve to try out, and then I'll post the code somewhere.

George thanks for the line intersecting options, however I think the cost of doing it mathematically is probably too expensive to do in VBA (from both a programming perspective and a ROI one).  I was hoping there was a "hint" available in PD that could easily tell us that without having to determine all the lines within a relationship. I was hoping we could turn on "Show Bridges at Intersections" and be able to count those though some magic mechanism - but I don't see anything where that information is available .

Former Member
0 Kudos

Hi Gareth,

In the examples of Vbasic scripts, installed in the powerdesigner program directory, you find a scripts called MeasurePDMComplexity.vbs

May be that might help you a bit.

Hans

Former Member
0 Kudos

Thanks - that is helpful. The number of times I've looked into the samples, and told others to do so - now its happened to me!

However these stats don't immediately help on a per diagram basis, but definitely interesting none the less.

Many thanks for pointing that one out,

Gareth

GeorgeMcGeachie
Active Contributor
0 Kudos

Sounds interesting, Gareth.

You could use diagram.GetPagesCount() to get an indication of the size of a diagram, after setting diagram.PageFormat and PageOrientation to a common value.

I can't see an easy way of spotting lines that cross, you'd have to use the co-ordinates of each line segment, and use a vector graphics function to see if any of them cross over - I've a vague feeling I've seen somebody write about that somewhere.

You'd also want to look out for overlapping entity symbols (if notation = Barker, some of them are obviously meant to overlap).

Former Member
0 Kudos

Ah yes - good thought on the Barker!