Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link arrows way too big in some cases #298

Open
qiemem opened this issue Aug 6, 2015 · 8 comments
Open

Link arrows way too big in some cases #298

qiemem opened this issue Aug 6, 2015 · 8 comments

Comments

@qiemem
Copy link
Member

qiemem commented Aug 6, 2015

A good example is Diffusion on a Directed Network:

NLW:
image

Desktop:
image

@venky18
Copy link

venky18 commented Mar 30, 2017

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

@TheBizzle
Copy link
Member

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
Copy link
Member

TheBizzle commented Apr 5, 2017

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.

@venky18
Copy link

venky18 commented Apr 10, 2017

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

@TheBizzle
Copy link
Member

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.

@venky18
Copy link

venky18 commented Apr 17, 2017

@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?

@TheBizzle
Copy link
Member

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.

LaCuneta pushed a commit that referenced this issue Mar 1, 2018
…passing @view.onePixel in @lineShapeDrawer constructor
@LaCuneta
Copy link
Contributor

Reported again recently in the Tortoise repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants