diff options
author | Nick White <git@njw.name> | 2019-08-27 21:26:45 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2019-08-27 21:26:45 +0100 |
commit | 877a718fa68af1ecc67c0e34dce9c6edf31191fc (patch) | |
tree | 3e03423811d4c359be36bbaeca5dfcaa4794d994 | |
parent | 2d6a3a3ff743f24f29a0b8d8369911906e8eae3c (diff) |
Add annotations for pages with confidence below 70
-rw-r--r-- | bookpipeline/main.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bookpipeline/main.go b/bookpipeline/main.go index 63eb6bc..c202bad 100644 --- a/bookpipeline/main.go +++ b/bookpipeline/main.go @@ -231,9 +231,13 @@ func analyse(toanalyse chan string, up chan string, errc chan error, logger *log } sort.Slice(graphconf, func(i, j int) bool { return graphconf[i].pgnum < graphconf[j].pgnum }) var xvalues, yvalues []float64 + var annotations []chart.Value2 for _, c := range graphconf { xvalues = append(xvalues, c.pgnum) yvalues = append(yvalues, c.conf) + if c.conf < 70 { + annotations = append(annotations, chart.Value2{Label: fmt.Sprintf("%.0f", c.pgnum), XValue: c.pgnum, YValue: c.conf}) + } } mainSeries := chart.ContinuousSeries{ XValues: xvalues, @@ -305,6 +309,9 @@ func analyse(toanalyse chan string, up chan string, errc chan error, logger *log maxSeries, chart.LastValueAnnotation(minSeries), chart.LastValueAnnotation(maxSeries), + chart.AnnotationSeries{ + Annotations: annotations, + }, //chart.ContinuousSeries{ // YAxis: chart.YAxisSecondary, // XValues: xvalues, |