magjac / d3-graphviz

Graphviz DOT rendering and animated transitions using D3
BSD 3-Clause "New" or "Revised" License
1.7k stars 103 forks source link

Fix rare use of undefined variable #196

Open starboerg opened 3 years ago

starboerg commented 3 years ago

Variable x2 was used undefined in case of polygons without y-extend. Defaulting x2 to zero works around this issue.

codecov[bot] commented 3 years ago

Codecov Report

Merging #196 (54d1d6d) into master (ee30f6e) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #196   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           36        36           
  Lines         1107      1108    +1     
=========================================
+ Hits          1107      1108    +1     
Impacted Files Coverage Δ
src/svg.js 100.00% <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 ee30f6e...54d1d6d. Read the comment docs.

magjac commented 2 years ago

@starboerg Thanks for the contribution and apologies for the delay. Can you provide an example that trigger this? Or even better, add a test case?

starboerg commented 2 years ago

@magjac I did not dive too deep into the code, just stumbled upon this issue. I use a sequence of graphs and transition them into each other: graphviz.transition(function () { return d3.transition("main").ease(d3.easeLinear).delay(0).duration(500); }); Likely a horizontal line element in the graphs triggers this, but I did not keep any example.