Galapagos icon indicating copy to clipboard operation
Galapagos copied to clipboard

Link arrows way too big in some cases

Open qiemem opened this issue 10 years ago • 8 comments

A good example is Diffusion on a Directed Network:

NLW: image

Desktop: image

qiemem avatar Aug 06 '15 14:08 qiemem

@TheBizzle I would like to work on this can you guide me?

venky18 avatar Mar 30 '17 10:03 venky18

Sure.

The line that's responsible for drawing this in NetLogo Web is this one. The relevant code for this in desktop NetLogo is here.

Let me know if there's anything else you would like to know.

TheBizzle avatar Mar 30 '17 21:03 TheBizzle

Here's how the desktop NetLogo version of Link Breeds Example looks:

desktop-normal

Here is how NetLogo Web's version of it currently looks:

nlw-normal

So our indicators are far, far too large, and a bit too thick.

It might seem that the obvious solution to this problem is to mess with the coefficient of scaling here. However, that alone is not sufficient. Here is what the model looks like if we change the 2 to 15:

nlw-reduced

The lengths of the indicators are now roughly correct, but they're very hard to see, because our thickness got scaled down into oblivion.

For all the faults of the current implementation, the indicators it produces are at least easily visible. Any solution to this needs to find a reliable way of producing both indicators that have both a suitable length and a suitable thickness.

TheBizzle avatar Apr 05 '17 19:04 TheBizzle

@TheBizzle what is the Galapagos equivalent of numLines and cellSize? I read both files but couldn't find what these 2 keyword stands for?

venky18 avatar Apr 10 '17 15:04 venky18

numLines in desktop NetLogo would be equivalent to running lines.length in the Galapagos code. cellSize seems to be the "patch size" value that you can set in desktop NetLogo if you click the "Settings" button or right-click the View widget and go to "Edit...". I believe that, in Galapagos, that value is unintuitively known as @view.onePixel.

TheBizzle avatar Apr 10 '17 19:04 TheBizzle

@TheBizzle I added directionIndicatorScale: (lineThickness,cellSize) => (lineThickness*Math.sqrt(@view.onePixel / 2) + 2) * (Math.max(1, 3/ 1.5) ) and ran the examples the arrow size decreased but the thickness also decreased quite a bit. So i tried changing the thickness here still no success.. could you give any suggestions?

venky18 avatar Apr 17 '17 16:04 venky18

I don't really have hugely valuable suggestions on this one. I kind of feel like the most likely useful solution will be to scale the indicators to the right size and then find some formula through trial and error that will give a relatively good thicknesses, based on how much the indicator was scaled.

TheBizzle avatar Apr 17 '17 16:04 TheBizzle

Reported again recently in the Tortoise repository.

LaCuneta avatar Mar 16 '18 14:03 LaCuneta