gopherdata / gopherdata/gophernotes

Error in gonum.org/v1/plot code that used to work

Đang mở
#198 11 bình luận 0 reaction 1 người được giao Được @cosmos72 nhận Xem trên GitHub
bug
Ngôn ngữ chính
Go
Star
4k
Fork
264
Merge trung bình
7 ngày 21 giờ
Pull request đã merge (30 ngày)
1

Mô tả

Hi, After not using gophernotes for a month or so, something has changed so that example code for gonum.org/v1/plot no longer runs properly in gophernotes, but continues to run fine in the latest gomacro.

Reproduction from [this example code](https://godoc.org/gonum.org/v1/plot/plotter#ex-BarChart):

```golang
import (
"log"
"image/color"
"gonum.org/v1/plot"
"gonum.org/v1/plot/plotter"
"gonum.org/v1/plot/plotutil"
"gonum.org/v1/plot/vg"
)

groupA := plotter.Values{20, 35, 30, 35, 27}
groupB := plotter.Values{25, 32, 34, 20, 25}
groupC := plotter.Values{12, 28, 15, 21, 8}
groupD := plotter.Values{30, 42, 6, 9, 12}

p, err := plot.New()
if err != nil {
log.Panic(err)
}
p.Title.Text = "Bar chart"
p.Y.Label.Text = "Heights"

w := vg.Points(8)

barsA, err := plotter.NewBarChart(groupA, w)
if err != nil {
log.Panic(err)
}
barsA.Color = color.RGBA{R: 255, A: 255}
barsA.Offset = -w / 2

barsB, err := plotter.NewBarChart(groupB, w)
if err != nil {
log.Panic(err)
}
barsB.Color = color.RGBA{R: 196, G: 196, A: 255}
barsB.Offset = w / 2

barsC, err := plotter.NewBarChart(groupC, w)
if err != nil {
log.Panic(err)
}
barsC.XMin = 6
barsC.Color = color.RGBA{B: 255, A: 255}
barsC.Offset = -w / 2

barsD, err := plotter.NewBarChart(groupD, w)
if err != nil {
log.Panic(err)
}
barsD.Color = color.RGBA{B: 255, R: 255, A: 255}
barsD.XMin = 6
barsD.Offset = w / 2

p.Add(barsA, barsB, barsC, barsD)
p.Legend.Add("A", barsA)
p.Legend.Add("B", barsB)
p.Legend.Add("C", barsC)
p.Legend.Add("D", barsD)
p.Legend.Top = true
p.NominalX("Zero", "One", "Two", "Three", "Four", "",
"Six", "Seven", "Eight", "Nine", "Ten")

p.Add(plotter.NewGlyphBoxes())
err = p.Save(300, 250, "barChart2.png")
if err != nil {
log.Panic(err)
}
```

Which panics with:
```
type : inconsistent 0-th method signature:
go/types.Type has receiver and 2 parameters: func(string, ...gonum.org/v1/plot.Thumbnailer)
reflect.Type has 2 parameters: func(plot.Legend, string) vg.Length
```

The code above works fine on the latest commit of `gomacro` by itself, I only see this failure in a fresh install of gophernotes.

I've tried clearing all of the state in `~/go/pkg` and `~/go/src/gomacro.imports` but that didn't resolve anything. Has gophernotes fallen behind `gomacro` in some respect and this is a symptom?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.