webweb icon indicating copy to clipboard operation
webweb copied to clipboard

bug: web page crashes when link strength is too high

Open nwlandry opened this issue 5 years ago • 1 comments

I am using Google Chrome on a Windows machine and on the webweb documentation page (https://webwebpage.github.io) if I set the link strength to 5 on any visualization, the website crashes. I think the input should be restricted, or better error handling implemented. I tested it out, and if the link strength is slightly higher than 1 (1.1, etc.) it still works.

nwlandry avatar Jun 17 '19 13:06 nwlandry

I think this would fix it (referencing line 1124 in the webweb.v5.js file) for now:

function changeLinkStrength(linkStrength) { if (linkStrength >= 0 && linkStrength<=1) { webweb.display.linkStrength = linkStrength; webweb.updateSimulation("link"); } else { alert("Link strength must be between 0 and 1"); } }

nwlandry avatar Jun 18 '19 15:06 nwlandry