gonum / plot

A repository for plotting and visualizing data
BSD 3-Clause "New" or "Revised" License
2.74k stars 203 forks source link

Changes PDF handling to use supported libraries. #654

Closed dlorenc closed 3 years ago

dlorenc commented 3 years ago

The existing PDF functionality was based on two now-unsupported libraries: rsc.io/pdf and github.com/jung-kurt/gofpdf

This change drops the rsc.io/pdf dependency, and moves the jung-kurt one to a now maintained fork: github.com/phpdave11/gofpdf

I also had to replace the custom pdf comparison function (built on rsc.io/pdf) with an existing comparison method in gofpdf. There weren't any tests here, so I'm not sure how to be super confident the results will be the same.

Please take a look.

codecov-io commented 3 years ago

Codecov Report

Merging #654 (efc36dd) into master (a51a196) will increase coverage by 0.47%. The diff coverage is 74.80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #654      +/-   ##
==========================================
+ Coverage   70.28%   70.75%   +0.47%     
==========================================
  Files          55       57       +2     
  Lines        4620     4852     +232     
==========================================
+ Hits         3247     3433     +186     
- Misses       1203     1240      +37     
- Partials      170      179       +9     
Impacted Files Coverage Δ
cmpimg/cmpimg.go 51.78% <0.00%> (+12.59%) :arrow_up:
vg/vgpdf/vgpdf.go 70.15% <ø> (ø)
vg/vggio/vggio.go 72.27% <72.27%> (ø)
vg/vggio/context.go 100.00% <100.00%> (ø)
vg/vgimg/vgimg.go 49.68% <100.00%> (+0.64%) :arrow_up:
version.go 0.00% <0.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 76061dd...efc36dd. Read the comment docs.

dlorenc commented 3 years ago

Thanks for the reviews! I'll send that PR to add myself once this is merged.

sbinet commented 3 years ago

I believe we actually do this the other way around (or rather, we merge the PRs A+C, then code, once the 2 PRs are ready).

dlorenc commented 3 years ago

Oh, sorry! I misunderstood. PR sent.

sbinet commented 3 years ago

no worries :)

needs https://github.com/gonum/gonum/pull/1530

sbinet commented 3 years ago

thanks a lot.