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

canvas-graph assumptions #37

Open
squeetus opened this issue Feb 20, 2019 · 0 comments
Open

canvas-graph assumptions #37

squeetus opened this issue Feb 20, 2019 · 0 comments

Comments

@squeetus
Copy link
Contributor

@esaule says:
So, we noticed somethings on the graph-canvas visualization that could be worth adjusting.

In this file: https://github.com/squeetus/bridgesAPI/blob/master/public/js/graph-canvas.js line 58 performs a split on d.name, we could test the existence of d.name and set d.lines at "" or whatever is appropriate [""] ?

The parameters d.shape and d.size were meant to be optional as is understood by looking at BridgesVisualizer.shapeLookup or by looking at line 62. When drawing links with drawCurvedLink, the computation of d2 uses d.target.size. If size was undefined line 62, I guess it is still undefined there, which probably causes shapeedge to return 0 or undefined and cause a division by 0, or something else of equally bad consequence.

I don't exactly know how javascript works, when you dereference something that does not exist as a function parameter. But I suggest that all the functions in https://github.com/squeetus/bridgesAPI/blob/master/public/js/Bridges/BridgesVisualizer.js about scaling and ragning and what not test the parameter and if it is undefined return a sane default value.

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

No branches or pull requests

1 participant