GraphPlot.jl icon indicating copy to clipboard operation
GraphPlot.jl copied to clipboard

Added optional keyword parameter to gplot for plotting Chain Graphs

Open dietercastel opened this issue 5 years ago • 2 comments

Hi all,

I added support for "mixed model" graphs or so called "chain graphs" with an optional keyword parameter called "chainGraph". It (selectively) removes the double arrows for bi-directional edges for SimpleDiGraphs.

Visual Examples below:

g = SimpleDiGraph([ 0 1 0 1 ; 1 0 1 0 ; 1 0 0 0 ; 1 0 1 0])
gplot(d, chainGraph=true)

gives chainGraphTrue

d = SimpleDiGraph([ 0 1 0 0 0; 0 0 1 1 1; 0 1 0 1 1; 0 1 1 0 1; 0 1 1 1 0])
gplot(d, chainGraph=true, nodesize = [0.6; 1.0; 1.0; 1.0; 1.0])

gives chainGraphSizeTrue

I also added a (visual) test set for that case. I haven't implemented it for the linestyle="curve" option though. Should an error be thrown in that case (until it's implemented)?

I'm also wondering about the placement of the helper functions hasReverseEdge and filterUndef currently they reside in lines.jl where they are used.

kr, Dieter

dietercastel avatar May 16 '20 18:05 dietercastel

Codecov Report

Merging #110 into master will increase coverage by 5.35%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #110      +/-   ##
==========================================
+ Coverage   32.02%   37.38%   +5.35%     
==========================================
  Files           9        9              
  Lines         509      527      +18     
==========================================
+ Hits          163      197      +34     
+ Misses        346      330      -16     
Impacted Files Coverage Δ
src/lines.jl 67.51% <100.00%> (+15.71%) :arrow_up:
src/plot.jl 61.44% <100.00%> (ø)

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 d18be2e...6c0245c. Read the comment docs.

codecov[bot] avatar May 16 '20 18:05 codecov[bot]

Hi,

Sorry for the huge delay here. I like this feature, but I am not sure if chainGraph is the best name - maybe we can come with a more intiutive name?

simonschoelly avatar Sep 30 '20 21:09 simonschoelly