Skip to content

Conversation

@nmoran
Copy link
Contributor

@nmoran nmoran commented May 25, 2020

When the spread of points in either dimension is zero, the logic to rescale the location of points places all the points at the same location. This PR has a simple fix for this.

Example to demonstrate the issue

using GraphPlot
using LightGraphs

# case with a single point
g = SimpleGraph(1)
gplot(g, [0.0], [0.0])

# case two or more points in a line
g = SimpleGraph(3)
gplot(g, zeros(3), Float64.(1:3))

@codecov
Copy link

codecov bot commented May 25, 2020

Codecov Report

Merging #112 into master will increase coverage by 0.20%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #112      +/-   ##
==========================================
+ Coverage   32.02%   32.22%   +0.20%     
==========================================
  Files           9        9              
  Lines         509      512       +3     
==========================================
+ Hits          163      165       +2     
- Misses        346      347       +1     
Impacted Files Coverage Δ
src/plot.jl 61.62% <66.66%> (+0.18%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b8c963...20343ab. Read the comment docs.

@simonschoelly
Copy link
Member

Thank you! I am not sure if this is exactly the best strategy to solve this issue but as we don't have anything other at the moment, it wont hurt if we merge this for now.

@simonschoelly simonschoelly merged commit f6dcbf5 into JuliaGraphs:master Sep 22, 2020
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

Successfully merging this pull request may close these issues.

2 participants