Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions go.mod
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,14 +4,15 @@ go 1.16

require (
gioui.org v0.0.0-20210308172011-57750fc8a0a6
git.sr.ht/~sbinet/gg v0.3.1
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527
github.com/fogleman/gg v1.3.0
github.com/go-fonts/latin-modern v0.2.0
github.com/go-fonts/liberation v0.2.0
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81
github.com/go-pdf/fpdf v0.5.0
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d
golang.org/x/image v0.0.0-20211028202545-6944b10bf410
golang.org/x/text v0.3.7 // indirect
gonum.org/v1/gonum v0.9.3
rsc.io/pdf v0.1.1
)
9 changes: 6 additions & 3 deletions go.sum
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20210308172011-57750fc8a0a6 h1:K72hopUosKG3ntOPNG4OzzbuhxGuVf06fa2la1/H/Ho=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik=
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527 h1:NImof/JkF93OVWZY+PINgl6fPtQyF6f+hNUtZ0QZA1c=
Expand All@@ -9,7 +11,6 @@ github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/go-fonts/dejavu v0.1.0 h1:JSajPXURYqpr+Cu8U9bt8K+XcACIHWqWrvWCKyeFmVQ=
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
Expand DownExpand Up@@ -56,8 +57,9 @@ golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+o
golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 h1:hTftEOvwiOq2+O8k2D5/Q7COC7k5Qcrgc2TFURJYnvQ=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All@@ -70,8 +72,9 @@ golang.org/x/sys v0.0.0-20210304124612-50617c2ba197 h1:7+SpRyhoo46QjKkYInQXpcfxx
golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
Binary file modifiedpalette/moreland/testdata/moreland_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_palette_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart2_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart_positiveNegative_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/bubbles_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/clippedFilledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontalLog_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontal_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarVertical_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/color_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/contour_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/errorBars_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/filledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/functions_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/gopher_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/heatMap_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_logy_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBarChart_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/image_plot_golden.png
Binary file modifiedplotter/testdata/image_plot_log_golden.png
Binary file modifiedplotter/testdata/invertedlogscale_golden.png
Binary file modifiedplotter/testdata/labels_cnv_coords_golden.png
Binary file modifiedplotter/testdata/labels_glyphboxes_golden.png
Binary file modifiedplotter/testdata/labels_golden.png
Binary file modifiedplotter/testdata/logscale_golden.png
Binary file modifiedplotter/testdata/plotLogo_golden.png
Binary file modifiedplotter/testdata/polygon_hexagons_golden.png
Binary file modifiedplotter/testdata/polygon_holes_golden.png
Binary file modifiedplotter/testdata/precision_golden.png
Binary file modifiedplotter/testdata/rasterHeatMap_golden.png
Binary file modifiedplotter/testdata/rotation_golden.png
Binary file modifiedplotter/testdata/sankeyGrouped_golden.png
Binary file modifiedplotter/testdata/sankeySimple_golden.png
Binary file modifiedplotter/testdata/scatterColor_golden.png
Binary file modifiedplotter/testdata/scatter_golden.png
Binary file modifiedplotter/testdata/stackedBarChart_golden.png
Binary file modifiedplotter/testdata/step_golden.png
Binary file modifiedplotter/testdata/timeseries_golden.png
Binary file modifiedplotter/testdata/verticalBarChart_golden.png
Binary file modifiedplotter/testdata/verticalBoxPlot_golden.png
Binary file modifiedplotter/testdata/verticalQuartPlot_golden.png
Binary file modifiedplotter/testdata/volcano_golden.png
Binary file modifiedtestdata/align_golden.png
Binary file modifiedtestdata/axis_labels_golden.png
Binary file modifiedtestdata/axis_padding_00_golden.png
Binary file modifiedtestdata/axis_padding_05_golden.png
Binary file modifiedtestdata/axis_padding_10_golden.png
Binary file modifiedtestdata/glyphbox_golden.png
Binary file modifiedtestdata/legendAlignment_golden.png
Binary file modifiedtestdata/legend_standalone_golden.png
Binary file modifiedtext/testdata/latex_golden.png
Binary file modifiedvg/testdata/cosine_golden.png
Binary file modifiedvg/testdata/sine_golden.png
Binary file modifiedvg/testdata/width_-1_golden.jpg
Binary file modifiedvg/testdata/width_-1_golden.png
Binary file modifiedvg/testdata/width_-1_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_0_golden.jpg
Binary file modifiedvg/testdata/width_0_golden.png
Binary file modifiedvg/testdata/width_0_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_1_golden.jpg
Binary file modifiedvg/testdata/width_1_golden.png
Binary file modifiedvg/testdata/width_1_golden.tiff
Binary file not shown.
Binary file modifiedvg/vgimg/testdata/issue179_golden.jpg
Binary file modifiedvg/vgimg/testdata/issue540_golden.png
Binary file addedvg/vgimg/testdata/issue687_golden.png
4 changes: 2 additions & 2 deletions vg/vgimg/vgimg.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.

// Package vgimg implements the vg.Canvas interface using
// github.com/fogleman/gg as a backend to output raster images.
// git.sr.ht/~sbinet/gg as a backend to output raster images.
package vgimg // import "gonum.org/v1/plot/vg/vgimg"

import (
Expand All@@ -16,7 +16,7 @@ import (
"image/png"
"io"

"github.com/fogleman/gg"
"git.sr.ht/~sbinet/gg"
"golang.org/x/image/tiff"

"gonum.org/v1/plot/font"
Expand Down
37 changes: 37 additions & 0 deletions vg/vgimg/vgimg_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@ import (
"image/color"
"log"
"os"
"path/filepath"
"reflect"
"sync"
"testing"
Expand DownExpand Up@@ -147,3 +148,39 @@ func TestIssue540(t *testing.T) {
t.Fatalf("images differ")
}
}

func TestIssue687(t *testing.T) {
min := func(a, b int) int {
if a < b {
return a
}
return b
}

const (
fname = "testdata/issue687.png"
size = 500
)
cmpimg.CheckPlot(func() {
p := plot.New()
p.Title.Text = "Issue 687"
p.X.Label.Text = "X"
p.Y.Label.Text = "Y"
data := make(plotter.XYs, 4779) // Lower values still lose part of horizontal.
for i := range data {
data[i] = plotter.XY{X: float64(i) / float64(len(data)*2), Y: float64(len(data) - min(i, len(data)/2))}
}
lines, err := plotter.NewLine(data)
lines.Color = color.RGBA{R: 0xff, A: 0xff}
if err != nil {
t.Fatal(err)
}
p.Add(lines)

err = p.Save(size, size, fname)
if err != nil {
t.Fatal(err)
}

}, t, filepath.Base(fname))
}
Binary file modifiedvg/vgtex/testdata/linestyle_golden.png
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions go.mod
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,14 +4,15 @@ go 1.16

require (
gioui.org v0.0.0-20210308172011-57750fc8a0a6
git.sr.ht/~sbinet/gg v0.3.1
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527
github.com/fogleman/gg v1.3.0
github.com/go-fonts/latin-modern v0.2.0
github.com/go-fonts/liberation v0.2.0
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81
github.com/go-pdf/fpdf v0.5.0
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d
golang.org/x/image v0.0.0-20211028202545-6944b10bf410
golang.org/x/text v0.3.7 // indirect
gonum.org/v1/gonum v0.9.3
rsc.io/pdf v0.1.1
)
9 changes: 6 additions & 3 deletions go.sum
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20210308172011-57750fc8a0a6 h1:K72hopUosKG3ntOPNG4OzzbuhxGuVf06fa2la1/H/Ho=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik=
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527 h1:NImof/JkF93OVWZY+PINgl6fPtQyF6f+hNUtZ0QZA1c=
Expand All@@ -9,7 +11,6 @@ github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/go-fonts/dejavu v0.1.0 h1:JSajPXURYqpr+Cu8U9bt8K+XcACIHWqWrvWCKyeFmVQ=
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
Expand DownExpand Up@@ -56,8 +57,9 @@ golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+o
golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 h1:hTftEOvwiOq2+O8k2D5/Q7COC7k5Qcrgc2TFURJYnvQ=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All@@ -70,8 +72,9 @@ golang.org/x/sys v0.0.0-20210304124612-50617c2ba197 h1:7+SpRyhoo46QjKkYInQXpcfxx
golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
Binary file modifiedpalette/moreland/testdata/moreland_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_palette_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart2_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart_positiveNegative_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/bubbles_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/clippedFilledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontalLog_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontal_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarVertical_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/color_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/contour_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/errorBars_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/filledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/functions_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/gopher_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/heatMap_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_logy_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBarChart_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/image_plot_golden.png
Binary file modifiedplotter/testdata/image_plot_log_golden.png
Binary file modifiedplotter/testdata/invertedlogscale_golden.png
Binary file modifiedplotter/testdata/labels_cnv_coords_golden.png
Binary file modifiedplotter/testdata/labels_glyphboxes_golden.png
Binary file modifiedplotter/testdata/labels_golden.png
Binary file modifiedplotter/testdata/logscale_golden.png
Binary file modifiedplotter/testdata/plotLogo_golden.png
Binary file modifiedplotter/testdata/polygon_hexagons_golden.png
Binary file modifiedplotter/testdata/polygon_holes_golden.png
Binary file modifiedplotter/testdata/precision_golden.png
Binary file modifiedplotter/testdata/rasterHeatMap_golden.png
Binary file modifiedplotter/testdata/rotation_golden.png
Binary file modifiedplotter/testdata/sankeyGrouped_golden.png
Binary file modifiedplotter/testdata/sankeySimple_golden.png
Binary file modifiedplotter/testdata/scatterColor_golden.png
Binary file modifiedplotter/testdata/scatter_golden.png
Binary file modifiedplotter/testdata/stackedBarChart_golden.png
Binary file modifiedplotter/testdata/step_golden.png
Binary file modifiedplotter/testdata/timeseries_golden.png
Binary file modifiedplotter/testdata/verticalBarChart_golden.png
Binary file modifiedplotter/testdata/verticalBoxPlot_golden.png
Binary file modifiedplotter/testdata/verticalQuartPlot_golden.png
Binary file modifiedplotter/testdata/volcano_golden.png
Binary file modifiedtestdata/align_golden.png
Binary file modifiedtestdata/axis_labels_golden.png
Binary file modifiedtestdata/axis_padding_00_golden.png
Binary file modifiedtestdata/axis_padding_05_golden.png
Binary file modifiedtestdata/axis_padding_10_golden.png
Binary file modifiedtestdata/glyphbox_golden.png
Binary file modifiedtestdata/legendAlignment_golden.png
Binary file modifiedtestdata/legend_standalone_golden.png
Binary file modifiedtext/testdata/latex_golden.png
Binary file modifiedvg/testdata/cosine_golden.png
Binary file modifiedvg/testdata/sine_golden.png
Binary file modifiedvg/testdata/width_-1_golden.jpg
Binary file modifiedvg/testdata/width_-1_golden.png
Binary file modifiedvg/testdata/width_-1_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_0_golden.jpg
Binary file modifiedvg/testdata/width_0_golden.png
Binary file modifiedvg/testdata/width_0_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_1_golden.jpg
Binary file modifiedvg/testdata/width_1_golden.png
Binary file modifiedvg/testdata/width_1_golden.tiff
Binary file not shown.
Binary file modifiedvg/vgimg/testdata/issue179_golden.jpg
Binary file modifiedvg/vgimg/testdata/issue540_golden.png
Binary file addedvg/vgimg/testdata/issue687_golden.png
4 changes: 2 additions & 2 deletions vg/vgimg/vgimg.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.

// Package vgimg implements the vg.Canvas interface using
// github.com/fogleman/gg as a backend to output raster images.
// git.sr.ht/~sbinet/gg as a backend to output raster images.
package vgimg // import "gonum.org/v1/plot/vg/vgimg"

import (
Expand All@@ -16,7 +16,7 @@ import (
"image/png"
"io"

"github.com/fogleman/gg"
"git.sr.ht/~sbinet/gg"
"golang.org/x/image/tiff"

"gonum.org/v1/plot/font"
Expand Down
37 changes: 37 additions & 0 deletions vg/vgimg/vgimg_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@ import (
"image/color"
"log"
"os"
"path/filepath"
"reflect"
"sync"
"testing"
Expand DownExpand Up@@ -147,3 +148,39 @@ func TestIssue540(t *testing.T) {
t.Fatalf("images differ")
}
}

func TestIssue687(t *testing.T) {
min := func(a, b int) int {
if a < b {
return a
}
return b
}

const (
fname = "testdata/issue687.png"
size = 500
)
cmpimg.CheckPlot(func() {
p := plot.New()
p.Title.Text = "Issue 687"
p.X.Label.Text = "X"
p.Y.Label.Text = "Y"
data := make(plotter.XYs, 4779) // Lower values still lose part of horizontal.
for i := range data {
data[i] = plotter.XY{X: float64(i) / float64(len(data)*2), Y: float64(len(data) - min(i, len(data)/2))}
}
lines, err := plotter.NewLine(data)
lines.Color = color.RGBA{R: 0xff, A: 0xff}
if err != nil {
t.Fatal(err)
}
p.Add(lines)

err = p.Save(size, size, fname)
if err != nil {
t.Fatal(err)
}

}, t, filepath.Base(fname))
}
Binary file modifiedvg/vgtex/testdata/linestyle_golden.png
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions go.mod
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,14 +4,15 @@ go 1.16

require (
gioui.org v0.0.0-20210308172011-57750fc8a0a6
git.sr.ht/~sbinet/gg v0.3.1
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527
github.com/fogleman/gg v1.3.0
github.com/go-fonts/latin-modern v0.2.0
github.com/go-fonts/liberation v0.2.0
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81
github.com/go-pdf/fpdf v0.5.0
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d
golang.org/x/image v0.0.0-20211028202545-6944b10bf410
golang.org/x/text v0.3.7 // indirect
gonum.org/v1/gonum v0.9.3
rsc.io/pdf v0.1.1
)
9 changes: 6 additions & 3 deletions go.sum
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20210308172011-57750fc8a0a6 h1:K72hopUosKG3ntOPNG4OzzbuhxGuVf06fa2la1/H/Ho=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik=
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527 h1:NImof/JkF93OVWZY+PINgl6fPtQyF6f+hNUtZ0QZA1c=
Expand All@@ -9,7 +11,6 @@ github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/go-fonts/dejavu v0.1.0 h1:JSajPXURYqpr+Cu8U9bt8K+XcACIHWqWrvWCKyeFmVQ=
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
Expand DownExpand Up@@ -56,8 +57,9 @@ golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+o
golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 h1:hTftEOvwiOq2+O8k2D5/Q7COC7k5Qcrgc2TFURJYnvQ=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All@@ -70,8 +72,9 @@ golang.org/x/sys v0.0.0-20210304124612-50617c2ba197 h1:7+SpRyhoo46QjKkYInQXpcfxx
golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
Binary file modifiedpalette/moreland/testdata/moreland_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_palette_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart2_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart_positiveNegative_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/bubbles_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/clippedFilledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontalLog_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontal_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarVertical_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/color_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/contour_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/errorBars_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/filledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/functions_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/gopher_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/heatMap_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_logy_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBarChart_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/image_plot_golden.png
Binary file modifiedplotter/testdata/image_plot_log_golden.png
Binary file modifiedplotter/testdata/invertedlogscale_golden.png
Binary file modifiedplotter/testdata/labels_cnv_coords_golden.png
Binary file modifiedplotter/testdata/labels_glyphboxes_golden.png
Binary file modifiedplotter/testdata/labels_golden.png
Binary file modifiedplotter/testdata/logscale_golden.png
Binary file modifiedplotter/testdata/plotLogo_golden.png
Binary file modifiedplotter/testdata/polygon_hexagons_golden.png
Binary file modifiedplotter/testdata/polygon_holes_golden.png
Binary file modifiedplotter/testdata/precision_golden.png
Binary file modifiedplotter/testdata/rasterHeatMap_golden.png
Binary file modifiedplotter/testdata/rotation_golden.png
Binary file modifiedplotter/testdata/sankeyGrouped_golden.png
Binary file modifiedplotter/testdata/sankeySimple_golden.png
Binary file modifiedplotter/testdata/scatterColor_golden.png
Binary file modifiedplotter/testdata/scatter_golden.png
Binary file modifiedplotter/testdata/stackedBarChart_golden.png
Binary file modifiedplotter/testdata/step_golden.png
Binary file modifiedplotter/testdata/timeseries_golden.png
Binary file modifiedplotter/testdata/verticalBarChart_golden.png
Binary file modifiedplotter/testdata/verticalBoxPlot_golden.png
Binary file modifiedplotter/testdata/verticalQuartPlot_golden.png
Binary file modifiedplotter/testdata/volcano_golden.png
Binary file modifiedtestdata/align_golden.png
Binary file modifiedtestdata/axis_labels_golden.png
Binary file modifiedtestdata/axis_padding_00_golden.png
Binary file modifiedtestdata/axis_padding_05_golden.png
Binary file modifiedtestdata/axis_padding_10_golden.png
Binary file modifiedtestdata/glyphbox_golden.png
Binary file modifiedtestdata/legendAlignment_golden.png
Binary file modifiedtestdata/legend_standalone_golden.png
Binary file modifiedtext/testdata/latex_golden.png
Binary file modifiedvg/testdata/cosine_golden.png
Binary file modifiedvg/testdata/sine_golden.png
Binary file modifiedvg/testdata/width_-1_golden.jpg
Binary file modifiedvg/testdata/width_-1_golden.png
Binary file modifiedvg/testdata/width_-1_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_0_golden.jpg
Binary file modifiedvg/testdata/width_0_golden.png
Binary file modifiedvg/testdata/width_0_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_1_golden.jpg
Binary file modifiedvg/testdata/width_1_golden.png
Binary file modifiedvg/testdata/width_1_golden.tiff
Binary file not shown.
Binary file modifiedvg/vgimg/testdata/issue179_golden.jpg
Binary file modifiedvg/vgimg/testdata/issue540_golden.png
Binary file addedvg/vgimg/testdata/issue687_golden.png
4 changes: 2 additions & 2 deletions vg/vgimg/vgimg.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.

// Package vgimg implements the vg.Canvas interface using
// github.com/fogleman/gg as a backend to output raster images.
// git.sr.ht/~sbinet/gg as a backend to output raster images.
package vgimg // import "gonum.org/v1/plot/vg/vgimg"

import (
Expand All@@ -16,7 +16,7 @@ import (
"image/png"
"io"

"github.com/fogleman/gg"
"git.sr.ht/~sbinet/gg"
"golang.org/x/image/tiff"

"gonum.org/v1/plot/font"
Expand Down
37 changes: 37 additions & 0 deletions vg/vgimg/vgimg_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@ import (
"image/color"
"log"
"os"
"path/filepath"
"reflect"
"sync"
"testing"
Expand DownExpand Up@@ -147,3 +148,39 @@ func TestIssue540(t *testing.T) {
t.Fatalf("images differ")
}
}

func TestIssue687(t *testing.T) {
min := func(a, b int) int {
if a < b {
return a
}
return b
}

const (
fname = "testdata/issue687.png"
size = 500
)
cmpimg.CheckPlot(func() {
p := plot.New()
p.Title.Text = "Issue 687"
p.X.Label.Text = "X"
p.Y.Label.Text = "Y"
data := make(plotter.XYs, 4779) // Lower values still lose part of horizontal.
for i := range data {
data[i] = plotter.XY{X: float64(i) / float64(len(data)*2), Y: float64(len(data) - min(i, len(data)/2))}
}
lines, err := plotter.NewLine(data)
lines.Color = color.RGBA{R: 0xff, A: 0xff}
if err != nil {
t.Fatal(err)
}
p.Add(lines)

err = p.Save(size, size, fname)
if err != nil {
t.Fatal(err)
}

}, t, filepath.Base(fname))
}
Binary file modifiedvg/vgtex/testdata/linestyle_golden.png
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions go.mod
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,14 +4,15 @@ go 1.16

require (
gioui.org v0.0.0-20210308172011-57750fc8a0a6
git.sr.ht/~sbinet/gg v0.3.1
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527
github.com/fogleman/gg v1.3.0
github.com/go-fonts/latin-modern v0.2.0
github.com/go-fonts/liberation v0.2.0
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81
github.com/go-pdf/fpdf v0.5.0
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d
golang.org/x/image v0.0.0-20211028202545-6944b10bf410
golang.org/x/text v0.3.7 // indirect
gonum.org/v1/gonum v0.9.3
rsc.io/pdf v0.1.1
)
9 changes: 6 additions & 3 deletions go.sum
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20210308172011-57750fc8a0a6 h1:K72hopUosKG3ntOPNG4OzzbuhxGuVf06fa2la1/H/Ho=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik=
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527 h1:NImof/JkF93OVWZY+PINgl6fPtQyF6f+hNUtZ0QZA1c=
Expand All@@ -9,7 +11,6 @@ github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/go-fonts/dejavu v0.1.0 h1:JSajPXURYqpr+Cu8U9bt8K+XcACIHWqWrvWCKyeFmVQ=
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
Expand DownExpand Up@@ -56,8 +57,9 @@ golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+o
golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 h1:hTftEOvwiOq2+O8k2D5/Q7COC7k5Qcrgc2TFURJYnvQ=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All@@ -70,8 +72,9 @@ golang.org/x/sys v0.0.0-20210304124612-50617c2ba197 h1:7+SpRyhoo46QjKkYInQXpcfxx
golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
Binary file modifiedpalette/moreland/testdata/moreland_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_palette_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart2_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart_positiveNegative_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/bubbles_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/clippedFilledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontalLog_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontal_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarVertical_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/color_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/contour_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/errorBars_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/filledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/functions_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/gopher_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/heatMap_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_logy_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBarChart_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/image_plot_golden.png
Binary file modifiedplotter/testdata/image_plot_log_golden.png
Binary file modifiedplotter/testdata/invertedlogscale_golden.png
Binary file modifiedplotter/testdata/labels_cnv_coords_golden.png
Binary file modifiedplotter/testdata/labels_glyphboxes_golden.png
Binary file modifiedplotter/testdata/labels_golden.png
Binary file modifiedplotter/testdata/logscale_golden.png
Binary file modifiedplotter/testdata/plotLogo_golden.png
Binary file modifiedplotter/testdata/polygon_hexagons_golden.png
Binary file modifiedplotter/testdata/polygon_holes_golden.png
Binary file modifiedplotter/testdata/precision_golden.png
Binary file modifiedplotter/testdata/rasterHeatMap_golden.png
Binary file modifiedplotter/testdata/rotation_golden.png
Binary file modifiedplotter/testdata/sankeyGrouped_golden.png
Binary file modifiedplotter/testdata/sankeySimple_golden.png
Binary file modifiedplotter/testdata/scatterColor_golden.png
Binary file modifiedplotter/testdata/scatter_golden.png
Binary file modifiedplotter/testdata/stackedBarChart_golden.png
Binary file modifiedplotter/testdata/step_golden.png
Binary file modifiedplotter/testdata/timeseries_golden.png
Binary file modifiedplotter/testdata/verticalBarChart_golden.png
Binary file modifiedplotter/testdata/verticalBoxPlot_golden.png
Binary file modifiedplotter/testdata/verticalQuartPlot_golden.png
Binary file modifiedplotter/testdata/volcano_golden.png
Binary file modifiedtestdata/align_golden.png
Binary file modifiedtestdata/axis_labels_golden.png
Binary file modifiedtestdata/axis_padding_00_golden.png
Binary file modifiedtestdata/axis_padding_05_golden.png
Binary file modifiedtestdata/axis_padding_10_golden.png
Binary file modifiedtestdata/glyphbox_golden.png
Binary file modifiedtestdata/legendAlignment_golden.png
Binary file modifiedtestdata/legend_standalone_golden.png
Binary file modifiedtext/testdata/latex_golden.png
Binary file modifiedvg/testdata/cosine_golden.png
Binary file modifiedvg/testdata/sine_golden.png
Binary file modifiedvg/testdata/width_-1_golden.jpg
Binary file modifiedvg/testdata/width_-1_golden.png
Binary file modifiedvg/testdata/width_-1_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_0_golden.jpg
Binary file modifiedvg/testdata/width_0_golden.png
Binary file modifiedvg/testdata/width_0_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_1_golden.jpg
Binary file modifiedvg/testdata/width_1_golden.png
Binary file modifiedvg/testdata/width_1_golden.tiff
Binary file not shown.
Binary file modifiedvg/vgimg/testdata/issue179_golden.jpg
Binary file modifiedvg/vgimg/testdata/issue540_golden.png
Binary file addedvg/vgimg/testdata/issue687_golden.png
4 changes: 2 additions & 2 deletions vg/vgimg/vgimg.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.

// Package vgimg implements the vg.Canvas interface using
// github.com/fogleman/gg as a backend to output raster images.
// git.sr.ht/~sbinet/gg as a backend to output raster images.
package vgimg // import "gonum.org/v1/plot/vg/vgimg"

import (
Expand All@@ -16,7 +16,7 @@ import (
"image/png"
"io"

"github.com/fogleman/gg"
"git.sr.ht/~sbinet/gg"
"golang.org/x/image/tiff"

"gonum.org/v1/plot/font"
Expand Down
37 changes: 37 additions & 0 deletions vg/vgimg/vgimg_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@ import (
"image/color"
"log"
"os"
"path/filepath"
"reflect"
"sync"
"testing"
Expand DownExpand Up@@ -147,3 +148,39 @@ func TestIssue540(t *testing.T) {
t.Fatalf("images differ")
}
}

func TestIssue687(t *testing.T) {
min := func(a, b int) int {
if a < b {
return a
}
return b
}

const (
fname = "testdata/issue687.png"
size = 500
)
cmpimg.CheckPlot(func() {
p := plot.New()
p.Title.Text = "Issue 687"
p.X.Label.Text = "X"
p.Y.Label.Text = "Y"
data := make(plotter.XYs, 4779) // Lower values still lose part of horizontal.
for i := range data {
data[i] = plotter.XY{X: float64(i) / float64(len(data)*2), Y: float64(len(data) - min(i, len(data)/2))}
}
lines, err := plotter.NewLine(data)
lines.Color = color.RGBA{R: 0xff, A: 0xff}
if err != nil {
t.Fatal(err)
}
p.Add(lines)

err = p.Save(size, size, fname)
if err != nil {
t.Fatal(err)
}

}, t, filepath.Base(fname))
}
Binary file modifiedvg/vgtex/testdata/linestyle_golden.png
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions go.mod
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,14 +4,15 @@ go 1.16

require (
gioui.org v0.0.0-20210308172011-57750fc8a0a6
git.sr.ht/~sbinet/gg v0.3.1
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527
github.com/fogleman/gg v1.3.0
github.com/go-fonts/latin-modern v0.2.0
github.com/go-fonts/liberation v0.2.0
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81
github.com/go-pdf/fpdf v0.5.0
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d
golang.org/x/image v0.0.0-20211028202545-6944b10bf410
golang.org/x/text v0.3.7 // indirect
gonum.org/v1/gonum v0.9.3
rsc.io/pdf v0.1.1
)
9 changes: 6 additions & 3 deletions go.sum
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20210308172011-57750fc8a0a6 h1:K72hopUosKG3ntOPNG4OzzbuhxGuVf06fa2la1/H/Ho=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik=
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527 h1:NImof/JkF93OVWZY+PINgl6fPtQyF6f+hNUtZ0QZA1c=
Expand All@@ -9,7 +11,6 @@ github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/go-fonts/dejavu v0.1.0 h1:JSajPXURYqpr+Cu8U9bt8K+XcACIHWqWrvWCKyeFmVQ=
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
Expand DownExpand Up@@ -56,8 +57,9 @@ golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+o
golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 h1:hTftEOvwiOq2+O8k2D5/Q7COC7k5Qcrgc2TFURJYnvQ=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All@@ -70,8 +72,9 @@ golang.org/x/sys v0.0.0-20210304124612-50617c2ba197 h1:7+SpRyhoo46QjKkYInQXpcfxx
golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
Binary file modifiedpalette/moreland/testdata/moreland_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_palette_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart2_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart_positiveNegative_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/bubbles_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/clippedFilledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontalLog_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontal_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarVertical_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/color_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/contour_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/errorBars_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/filledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/functions_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/gopher_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/heatMap_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_logy_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBarChart_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/image_plot_golden.png
Binary file modifiedplotter/testdata/image_plot_log_golden.png
Binary file modifiedplotter/testdata/invertedlogscale_golden.png
Binary file modifiedplotter/testdata/labels_cnv_coords_golden.png
Binary file modifiedplotter/testdata/labels_glyphboxes_golden.png
Binary file modifiedplotter/testdata/labels_golden.png
Binary file modifiedplotter/testdata/logscale_golden.png
Binary file modifiedplotter/testdata/plotLogo_golden.png
Binary file modifiedplotter/testdata/polygon_hexagons_golden.png
Binary file modifiedplotter/testdata/polygon_holes_golden.png
Binary file modifiedplotter/testdata/precision_golden.png
Binary file modifiedplotter/testdata/rasterHeatMap_golden.png
Binary file modifiedplotter/testdata/rotation_golden.png
Binary file modifiedplotter/testdata/sankeyGrouped_golden.png
Binary file modifiedplotter/testdata/sankeySimple_golden.png
Binary file modifiedplotter/testdata/scatterColor_golden.png
Binary file modifiedplotter/testdata/scatter_golden.png
Binary file modifiedplotter/testdata/stackedBarChart_golden.png
Binary file modifiedplotter/testdata/step_golden.png
Binary file modifiedplotter/testdata/timeseries_golden.png
Binary file modifiedplotter/testdata/verticalBarChart_golden.png
Binary file modifiedplotter/testdata/verticalBoxPlot_golden.png
Binary file modifiedplotter/testdata/verticalQuartPlot_golden.png
Binary file modifiedplotter/testdata/volcano_golden.png
Binary file modifiedtestdata/align_golden.png
Binary file modifiedtestdata/axis_labels_golden.png
Binary file modifiedtestdata/axis_padding_00_golden.png
Binary file modifiedtestdata/axis_padding_05_golden.png
Binary file modifiedtestdata/axis_padding_10_golden.png
Binary file modifiedtestdata/glyphbox_golden.png
Binary file modifiedtestdata/legendAlignment_golden.png
Binary file modifiedtestdata/legend_standalone_golden.png
Binary file modifiedtext/testdata/latex_golden.png
Binary file modifiedvg/testdata/cosine_golden.png
Binary file modifiedvg/testdata/sine_golden.png
Binary file modifiedvg/testdata/width_-1_golden.jpg
Binary file modifiedvg/testdata/width_-1_golden.png
Binary file modifiedvg/testdata/width_-1_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_0_golden.jpg
Binary file modifiedvg/testdata/width_0_golden.png
Binary file modifiedvg/testdata/width_0_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_1_golden.jpg
Binary file modifiedvg/testdata/width_1_golden.png
Binary file modifiedvg/testdata/width_1_golden.tiff
Binary file not shown.
Binary file modifiedvg/vgimg/testdata/issue179_golden.jpg
Binary file modifiedvg/vgimg/testdata/issue540_golden.png
Binary file addedvg/vgimg/testdata/issue687_golden.png
4 changes: 2 additions & 2 deletions vg/vgimg/vgimg.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.

// Package vgimg implements the vg.Canvas interface using
// github.com/fogleman/gg as a backend to output raster images.
// git.sr.ht/~sbinet/gg as a backend to output raster images.
package vgimg // import "gonum.org/v1/plot/vg/vgimg"

import (
Expand All@@ -16,7 +16,7 @@ import (
"image/png"
"io"

"github.com/fogleman/gg"
"git.sr.ht/~sbinet/gg"
"golang.org/x/image/tiff"

"gonum.org/v1/plot/font"
Expand Down
37 changes: 37 additions & 0 deletions vg/vgimg/vgimg_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@ import (
"image/color"
"log"
"os"
"path/filepath"
"reflect"
"sync"
"testing"
Expand DownExpand Up@@ -147,3 +148,39 @@ func TestIssue540(t *testing.T) {
t.Fatalf("images differ")
}
}

func TestIssue687(t *testing.T) {
min := func(a, b int) int {
if a < b {
return a
}
return b
}

const (
fname = "testdata/issue687.png"
size = 500
)
cmpimg.CheckPlot(func() {
p := plot.New()
p.Title.Text = "Issue 687"
p.X.Label.Text = "X"
p.Y.Label.Text = "Y"
data := make(plotter.XYs, 4779) // Lower values still lose part of horizontal.
for i := range data {
data[i] = plotter.XY{X: float64(i) / float64(len(data)*2), Y: float64(len(data) - min(i, len(data)/2))}
}
lines, err := plotter.NewLine(data)
lines.Color = color.RGBA{R: 0xff, A: 0xff}
if err != nil {
t.Fatal(err)
}
p.Add(lines)

err = p.Save(size, size, fname)
if err != nil {
t.Fatal(err)
}

}, t, filepath.Base(fname))
}
Binary file modifiedvg/vgtex/testdata/linestyle_golden.png
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions go.mod
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,14 +4,15 @@ go 1.16

require (
gioui.org v0.0.0-20210308172011-57750fc8a0a6
git.sr.ht/~sbinet/gg v0.3.1
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527
github.com/fogleman/gg v1.3.0
github.com/go-fonts/latin-modern v0.2.0
github.com/go-fonts/liberation v0.2.0
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81
github.com/go-pdf/fpdf v0.5.0
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d
golang.org/x/image v0.0.0-20211028202545-6944b10bf410
golang.org/x/text v0.3.7 // indirect
gonum.org/v1/gonum v0.9.3
rsc.io/pdf v0.1.1
)
9 changes: 6 additions & 3 deletions go.sum
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20210308172011-57750fc8a0a6 h1:K72hopUosKG3ntOPNG4OzzbuhxGuVf06fa2la1/H/Ho=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik=
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527 h1:NImof/JkF93OVWZY+PINgl6fPtQyF6f+hNUtZ0QZA1c=
Expand All@@ -9,7 +11,6 @@ github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/go-fonts/dejavu v0.1.0 h1:JSajPXURYqpr+Cu8U9bt8K+XcACIHWqWrvWCKyeFmVQ=
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
Expand DownExpand Up@@ -56,8 +57,9 @@ golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+o
golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 h1:hTftEOvwiOq2+O8k2D5/Q7COC7k5Qcrgc2TFURJYnvQ=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All@@ -70,8 +72,9 @@ golang.org/x/sys v0.0.0-20210304124612-50617c2ba197 h1:7+SpRyhoo46QjKkYInQXpcfxx
golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
Binary file modifiedpalette/moreland/testdata/moreland_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_palette_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart2_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart_positiveNegative_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/bubbles_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/clippedFilledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontalLog_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontal_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarVertical_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/color_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/contour_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/errorBars_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/filledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/functions_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/gopher_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/heatMap_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_logy_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBarChart_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/image_plot_golden.png
Binary file modifiedplotter/testdata/image_plot_log_golden.png
Binary file modifiedplotter/testdata/invertedlogscale_golden.png
Binary file modifiedplotter/testdata/labels_cnv_coords_golden.png
Binary file modifiedplotter/testdata/labels_glyphboxes_golden.png
Binary file modifiedplotter/testdata/labels_golden.png
Binary file modifiedplotter/testdata/logscale_golden.png
Binary file modifiedplotter/testdata/plotLogo_golden.png
Binary file modifiedplotter/testdata/polygon_hexagons_golden.png
Binary file modifiedplotter/testdata/polygon_holes_golden.png
Binary file modifiedplotter/testdata/precision_golden.png
Binary file modifiedplotter/testdata/rasterHeatMap_golden.png
Binary file modifiedplotter/testdata/rotation_golden.png
Binary file modifiedplotter/testdata/sankeyGrouped_golden.png
Binary file modifiedplotter/testdata/sankeySimple_golden.png
Binary file modifiedplotter/testdata/scatterColor_golden.png
Binary file modifiedplotter/testdata/scatter_golden.png
Binary file modifiedplotter/testdata/stackedBarChart_golden.png
Binary file modifiedplotter/testdata/step_golden.png
Binary file modifiedplotter/testdata/timeseries_golden.png
Binary file modifiedplotter/testdata/verticalBarChart_golden.png
Binary file modifiedplotter/testdata/verticalBoxPlot_golden.png
Binary file modifiedplotter/testdata/verticalQuartPlot_golden.png
Binary file modifiedplotter/testdata/volcano_golden.png
Binary file modifiedtestdata/align_golden.png
Binary file modifiedtestdata/axis_labels_golden.png
Binary file modifiedtestdata/axis_padding_00_golden.png
Binary file modifiedtestdata/axis_padding_05_golden.png
Binary file modifiedtestdata/axis_padding_10_golden.png
Binary file modifiedtestdata/glyphbox_golden.png
Binary file modifiedtestdata/legendAlignment_golden.png
Binary file modifiedtestdata/legend_standalone_golden.png
Binary file modifiedtext/testdata/latex_golden.png
Binary file modifiedvg/testdata/cosine_golden.png
Binary file modifiedvg/testdata/sine_golden.png
Binary file modifiedvg/testdata/width_-1_golden.jpg
Binary file modifiedvg/testdata/width_-1_golden.png
Binary file modifiedvg/testdata/width_-1_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_0_golden.jpg
Binary file modifiedvg/testdata/width_0_golden.png
Binary file modifiedvg/testdata/width_0_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_1_golden.jpg
Binary file modifiedvg/testdata/width_1_golden.png
Binary file modifiedvg/testdata/width_1_golden.tiff
Binary file not shown.
Binary file modifiedvg/vgimg/testdata/issue179_golden.jpg
Binary file modifiedvg/vgimg/testdata/issue540_golden.png
Binary file addedvg/vgimg/testdata/issue687_golden.png
4 changes: 2 additions & 2 deletions vg/vgimg/vgimg.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.

// Package vgimg implements the vg.Canvas interface using
// github.com/fogleman/gg as a backend to output raster images.
// git.sr.ht/~sbinet/gg as a backend to output raster images.
package vgimg // import "gonum.org/v1/plot/vg/vgimg"

import (
Expand All@@ -16,7 +16,7 @@ import (
"image/png"
"io"

"github.com/fogleman/gg"
"git.sr.ht/~sbinet/gg"
"golang.org/x/image/tiff"

"gonum.org/v1/plot/font"
Expand Down
37 changes: 37 additions & 0 deletions vg/vgimg/vgimg_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@ import (
"image/color"
"log"
"os"
"path/filepath"
"reflect"
"sync"
"testing"
Expand DownExpand Up@@ -147,3 +148,39 @@ func TestIssue540(t *testing.T) {
t.Fatalf("images differ")
}
}

func TestIssue687(t *testing.T) {
min := func(a, b int) int {
if a < b {
return a
}
return b
}

const (
fname = "testdata/issue687.png"
size = 500
)
cmpimg.CheckPlot(func() {
p := plot.New()
p.Title.Text = "Issue 687"
p.X.Label.Text = "X"
p.Y.Label.Text = "Y"
data := make(plotter.XYs, 4779) // Lower values still lose part of horizontal.
for i := range data {
data[i] = plotter.XY{X: float64(i) / float64(len(data)*2), Y: float64(len(data) - min(i, len(data)/2))}
}
lines, err := plotter.NewLine(data)
lines.Color = color.RGBA{R: 0xff, A: 0xff}
if err != nil {
t.Fatal(err)
}
p.Add(lines)

err = p.Save(size, size, fname)
if err != nil {
t.Fatal(err)
}

}, t, filepath.Base(fname))
}
Binary file modifiedvg/vgtex/testdata/linestyle_golden.png
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions go.mod
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,14 +4,15 @@ go 1.16

require (
gioui.org v0.0.0-20210308172011-57750fc8a0a6
git.sr.ht/~sbinet/gg v0.3.1
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527
github.com/fogleman/gg v1.3.0
github.com/go-fonts/latin-modern v0.2.0
github.com/go-fonts/liberation v0.2.0
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81
github.com/go-pdf/fpdf v0.5.0
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d
golang.org/x/image v0.0.0-20211028202545-6944b10bf410
golang.org/x/text v0.3.7 // indirect
gonum.org/v1/gonum v0.9.3
rsc.io/pdf v0.1.1
)
9 changes: 6 additions & 3 deletions go.sum
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20210308172011-57750fc8a0a6 h1:K72hopUosKG3ntOPNG4OzzbuhxGuVf06fa2la1/H/Ho=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik=
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527 h1:NImof/JkF93OVWZY+PINgl6fPtQyF6f+hNUtZ0QZA1c=
Expand All@@ -9,7 +11,6 @@ github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/go-fonts/dejavu v0.1.0 h1:JSajPXURYqpr+Cu8U9bt8K+XcACIHWqWrvWCKyeFmVQ=
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
Expand DownExpand Up@@ -56,8 +57,9 @@ golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+o
golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 h1:hTftEOvwiOq2+O8k2D5/Q7COC7k5Qcrgc2TFURJYnvQ=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All@@ -70,8 +72,9 @@ golang.org/x/sys v0.0.0-20210304124612-50617c2ba197 h1:7+SpRyhoo46QjKkYInQXpcfxx
golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
Binary file modifiedpalette/moreland/testdata/moreland_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_palette_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart2_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart_positiveNegative_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/bubbles_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/clippedFilledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontalLog_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontal_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarVertical_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/color_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/contour_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/errorBars_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/filledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/functions_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/gopher_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/heatMap_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_logy_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBarChart_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/image_plot_golden.png
Binary file modifiedplotter/testdata/image_plot_log_golden.png
Binary file modifiedplotter/testdata/invertedlogscale_golden.png
Binary file modifiedplotter/testdata/labels_cnv_coords_golden.png
Binary file modifiedplotter/testdata/labels_glyphboxes_golden.png
Binary file modifiedplotter/testdata/labels_golden.png
Binary file modifiedplotter/testdata/logscale_golden.png
Binary file modifiedplotter/testdata/plotLogo_golden.png
Binary file modifiedplotter/testdata/polygon_hexagons_golden.png
Binary file modifiedplotter/testdata/polygon_holes_golden.png
Binary file modifiedplotter/testdata/precision_golden.png
Binary file modifiedplotter/testdata/rasterHeatMap_golden.png
Binary file modifiedplotter/testdata/rotation_golden.png
Binary file modifiedplotter/testdata/sankeyGrouped_golden.png
Binary file modifiedplotter/testdata/sankeySimple_golden.png
Binary file modifiedplotter/testdata/scatterColor_golden.png
Binary file modifiedplotter/testdata/scatter_golden.png
Binary file modifiedplotter/testdata/stackedBarChart_golden.png
Binary file modifiedplotter/testdata/step_golden.png
Binary file modifiedplotter/testdata/timeseries_golden.png
Binary file modifiedplotter/testdata/verticalBarChart_golden.png
Binary file modifiedplotter/testdata/verticalBoxPlot_golden.png
Binary file modifiedplotter/testdata/verticalQuartPlot_golden.png
Binary file modifiedplotter/testdata/volcano_golden.png
Binary file modifiedtestdata/align_golden.png
Binary file modifiedtestdata/axis_labels_golden.png
Binary file modifiedtestdata/axis_padding_00_golden.png
Binary file modifiedtestdata/axis_padding_05_golden.png
Binary file modifiedtestdata/axis_padding_10_golden.png
Binary file modifiedtestdata/glyphbox_golden.png
Binary file modifiedtestdata/legendAlignment_golden.png
Binary file modifiedtestdata/legend_standalone_golden.png
Binary file modifiedtext/testdata/latex_golden.png
Binary file modifiedvg/testdata/cosine_golden.png
Binary file modifiedvg/testdata/sine_golden.png
Binary file modifiedvg/testdata/width_-1_golden.jpg
Binary file modifiedvg/testdata/width_-1_golden.png
Binary file modifiedvg/testdata/width_-1_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_0_golden.jpg
Binary file modifiedvg/testdata/width_0_golden.png
Binary file modifiedvg/testdata/width_0_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_1_golden.jpg
Binary file modifiedvg/testdata/width_1_golden.png
Binary file modifiedvg/testdata/width_1_golden.tiff
Binary file not shown.
Binary file modifiedvg/vgimg/testdata/issue179_golden.jpg
Binary file modifiedvg/vgimg/testdata/issue540_golden.png
Binary file addedvg/vgimg/testdata/issue687_golden.png
4 changes: 2 additions & 2 deletions vg/vgimg/vgimg.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.

// Package vgimg implements the vg.Canvas interface using
// github.com/fogleman/gg as a backend to output raster images.
// git.sr.ht/~sbinet/gg as a backend to output raster images.
package vgimg // import "gonum.org/v1/plot/vg/vgimg"

import (
Expand All@@ -16,7 +16,7 @@ import (
"image/png"
"io"

"github.com/fogleman/gg"
"git.sr.ht/~sbinet/gg"
"golang.org/x/image/tiff"

"gonum.org/v1/plot/font"
Expand Down
37 changes: 37 additions & 0 deletions vg/vgimg/vgimg_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@ import (
"image/color"
"log"
"os"
"path/filepath"
"reflect"
"sync"
"testing"
Expand DownExpand Up@@ -147,3 +148,39 @@ func TestIssue540(t *testing.T) {
t.Fatalf("images differ")
}
}

func TestIssue687(t *testing.T) {
min := func(a, b int) int {
if a < b {
return a
}
return b
}

const (
fname = "testdata/issue687.png"
size = 500
)
cmpimg.CheckPlot(func() {
p := plot.New()
p.Title.Text = "Issue 687"
p.X.Label.Text = "X"
p.Y.Label.Text = "Y"
data := make(plotter.XYs, 4779) // Lower values still lose part of horizontal.
for i := range data {
data[i] = plotter.XY{X: float64(i) / float64(len(data)*2), Y: float64(len(data) - min(i, len(data)/2))}
}
lines, err := plotter.NewLine(data)
lines.Color = color.RGBA{R: 0xff, A: 0xff}
if err != nil {
t.Fatal(err)
}
p.Add(lines)

err = p.Save(size, size, fname)
if err != nil {
t.Fatal(err)
}

}, t, filepath.Base(fname))
}
Binary file modifiedvg/vgtex/testdata/linestyle_golden.png
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions go.mod
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,14 +4,15 @@ go 1.16

require (
gioui.org v0.0.0-20210308172011-57750fc8a0a6
git.sr.ht/~sbinet/gg v0.3.1
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527
github.com/fogleman/gg v1.3.0
github.com/go-fonts/latin-modern v0.2.0
github.com/go-fonts/liberation v0.2.0
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81
github.com/go-pdf/fpdf v0.5.0
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d
golang.org/x/image v0.0.0-20211028202545-6944b10bf410
golang.org/x/text v0.3.7 // indirect
gonum.org/v1/gonum v0.9.3
rsc.io/pdf v0.1.1
)
9 changes: 6 additions & 3 deletions go.sum
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20210308172011-57750fc8a0a6 h1:K72hopUosKG3ntOPNG4OzzbuhxGuVf06fa2la1/H/Ho=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik=
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527 h1:NImof/JkF93OVWZY+PINgl6fPtQyF6f+hNUtZ0QZA1c=
Expand All@@ -9,7 +11,6 @@ github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/go-fonts/dejavu v0.1.0 h1:JSajPXURYqpr+Cu8U9bt8K+XcACIHWqWrvWCKyeFmVQ=
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
Expand DownExpand Up@@ -56,8 +57,9 @@ golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+o
golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 h1:hTftEOvwiOq2+O8k2D5/Q7COC7k5Qcrgc2TFURJYnvQ=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All@@ -70,8 +72,9 @@ golang.org/x/sys v0.0.0-20210304124612-50617c2ba197 h1:7+SpRyhoo46QjKkYInQXpcfxx
golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
Binary file modifiedpalette/moreland/testdata/moreland_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedpalette/testdata/reverse_palette_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart2_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/barChart_positiveNegative_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/bubbles_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/clippedFilledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontalLog_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarHorizontal_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/colorBarVertical_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/color_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/contour_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/errorBars_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/filledLine_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/functions_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/gopher_field_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/groupedQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/heatMap_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/histogram_logy_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBarChart_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalBoxPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/horizontalQuartPlot_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modifiedplotter/testdata/image_plot_golden.png
Binary file modifiedplotter/testdata/image_plot_log_golden.png
Binary file modifiedplotter/testdata/invertedlogscale_golden.png
Binary file modifiedplotter/testdata/labels_cnv_coords_golden.png
Binary file modifiedplotter/testdata/labels_glyphboxes_golden.png
Binary file modifiedplotter/testdata/labels_golden.png
Binary file modifiedplotter/testdata/logscale_golden.png
Binary file modifiedplotter/testdata/plotLogo_golden.png
Binary file modifiedplotter/testdata/polygon_hexagons_golden.png
Binary file modifiedplotter/testdata/polygon_holes_golden.png
Binary file modifiedplotter/testdata/precision_golden.png
Binary file modifiedplotter/testdata/rasterHeatMap_golden.png
Binary file modifiedplotter/testdata/rotation_golden.png
Binary file modifiedplotter/testdata/sankeyGrouped_golden.png
Binary file modifiedplotter/testdata/sankeySimple_golden.png
Binary file modifiedplotter/testdata/scatterColor_golden.png
Binary file modifiedplotter/testdata/scatter_golden.png
Binary file modifiedplotter/testdata/stackedBarChart_golden.png
Binary file modifiedplotter/testdata/step_golden.png
Binary file modifiedplotter/testdata/timeseries_golden.png
Binary file modifiedplotter/testdata/verticalBarChart_golden.png
Binary file modifiedplotter/testdata/verticalBoxPlot_golden.png
Binary file modifiedplotter/testdata/verticalQuartPlot_golden.png
Binary file modifiedplotter/testdata/volcano_golden.png
Binary file modifiedtestdata/align_golden.png
Binary file modifiedtestdata/axis_labels_golden.png
Binary file modifiedtestdata/axis_padding_00_golden.png
Binary file modifiedtestdata/axis_padding_05_golden.png
Binary file modifiedtestdata/axis_padding_10_golden.png
Binary file modifiedtestdata/glyphbox_golden.png
Binary file modifiedtestdata/legendAlignment_golden.png
Binary file modifiedtestdata/legend_standalone_golden.png
Binary file modifiedtext/testdata/latex_golden.png
Binary file modifiedvg/testdata/cosine_golden.png
Binary file modifiedvg/testdata/sine_golden.png
Binary file modifiedvg/testdata/width_-1_golden.jpg
Binary file modifiedvg/testdata/width_-1_golden.png
Binary file modifiedvg/testdata/width_-1_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_0_golden.jpg
Binary file modifiedvg/testdata/width_0_golden.png
Binary file modifiedvg/testdata/width_0_golden.tiff
Binary file not shown.
Binary file modifiedvg/testdata/width_1_golden.jpg
Binary file modifiedvg/testdata/width_1_golden.png
Binary file modifiedvg/testdata/width_1_golden.tiff
Binary file not shown.
Binary file modifiedvg/vgimg/testdata/issue179_golden.jpg
Binary file modifiedvg/vgimg/testdata/issue540_golden.png
Binary file addedvg/vgimg/testdata/issue687_golden.png
4 changes: 2 additions & 2 deletions vg/vgimg/vgimg.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.

// Package vgimg implements the vg.Canvas interface using
// github.com/fogleman/gg as a backend to output raster images.
// git.sr.ht/~sbinet/gg as a backend to output raster images.
package vgimg // import "gonum.org/v1/plot/vg/vgimg"

import (
Expand All@@ -16,7 +16,7 @@ import (
"image/png"
"io"

"github.com/fogleman/gg"
"git.sr.ht/~sbinet/gg"
"golang.org/x/image/tiff"

"gonum.org/v1/plot/font"
Expand Down
37 changes: 37 additions & 0 deletions vg/vgimg/vgimg_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@ import (
"image/color"
"log"
"os"
"path/filepath"
"reflect"
"sync"
"testing"
Expand DownExpand Up@@ -147,3 +148,39 @@ func TestIssue540(t *testing.T) {
t.Fatalf("images differ")
}
}

func TestIssue687(t *testing.T) {
min := func(a, b int) int {
if a < b {
return a
}
return b
}

const (
fname = "testdata/issue687.png"
size = 500
)
cmpimg.CheckPlot(func() {
p := plot.New()
p.Title.Text = "Issue 687"
p.X.Label.Text = "X"
p.Y.Label.Text = "Y"
data := make(plotter.XYs, 4779) // Lower values still lose part of horizontal.
for i := range data {
data[i] = plotter.XY{X: float64(i) / float64(len(data)*2), Y: float64(len(data) - min(i, len(data)/2))}
}
lines, err := plotter.NewLine(data)
lines.Color = color.RGBA{R: 0xff, A: 0xff}
if err != nil {
t.Fatal(err)
}
p.Add(lines)

err = p.Save(size, size, fname)
if err != nil {
t.Fatal(err)
}

}, t, filepath.Base(fname))
}
Binary file modifiedvg/vgtex/testdata/linestyle_golden.png