summaryrefslogtreecommitdiff
path: root/graph.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-04-14 11:07:07 +0100
committerNick White <git@njw.name>2020-04-14 11:07:07 +0100
commitb4849ccab46cf3f55f109436153e45a175888792 (patch)
treef849a60b84bec7e9d8b49a73be1d5f635589df11 /graph.go
parentdacb5cf28e3ede3b9f1bbf2d9d80b5a9d0d1bc56 (diff)
Remove unused PreprocPattern, allow sensible defaults with aws setup, and add a little more documentation
Diffstat (limited to 'graph.go')
-rw-r--r--graph.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/graph.go b/graph.go
index 8d6c857..a7b46bc 100644
--- a/graph.go
+++ b/graph.go
@@ -32,6 +32,8 @@ type GraphConf struct {
Pgnum, Conf float64
}
+// createLine creates a horizontal line with a particular y value for
+// a graph
func createLine(xvalues []float64, y float64, c drawing.Color) chart.ContinuousSeries {
var yvalues []float64
for range xvalues {
@@ -46,10 +48,12 @@ func createLine(xvalues []float64, y float64, c drawing.Color) chart.ContinuousS
}
}
+// Graph creates a graph of the confidence of each page in a book
func Graph(confs map[string]*Conf, bookname string, w io.Writer) error {
return GraphOpts(confs, bookname, "Page number", true, w)
}
+// Graph creates a graph of confidences
func GraphOpts(confs map[string]*Conf, bookname string, xaxis string, guidelines bool, w io.Writer) error {
if len(confs) < 2 {
return errors.New("Not enough valid confidences")