Skip to content

Commit

Permalink
reformat the code
Browse files Browse the repository at this point in the history
  • Loading branch information
haoel committed Sep 7, 2019
1 parent 5705792 commit ddb6eed
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/main/main.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package main

import (
"bufio"
"encoding/csv"
_ "fmt"
"image/color"
"io"
"os"
"bufio"
"strconv"
"encoding/csv"
"image/color"

"common"
"diagram"
Expand Down Expand Up @@ -45,13 +45,16 @@ func main() {
smaplesLTOB := downsampling.LTOB(rawdata, 500)
smaplesLTTB := downsampling.LTTB(rawdata, 500)

rawLine, err := diagram.MakeLinePlotter(diagram.CovertToPlotXY(rawdata), color.RGBA{R: 0, G: 0, B: 0, A: 255})
rawLine, err := diagram.MakeLinePlotter(
diagram.CovertToPlotXY(rawdata), color.RGBA{R: 0, G: 0, B: 0, A: 255})
common.CheckError("Cannot make a line plotter", err)

sampleLineLTOB, err := diagram.MakeLinePlotter(diagram.CovertToPlotXY(smaplesLTOB), color.RGBA{R: 255, G: 0, B: 0, A: 255})
sampleLineLTOB, err := diagram.MakeLinePlotter(
diagram.CovertToPlotXY(smaplesLTOB), color.RGBA{R: 255, G: 0, B: 0, A: 255})
common.CheckError("Cannot make a line plotter", err)

sampleLineLTTB, err := diagram.MakeLinePlotter(diagram.CovertToPlotXY(smaplesLTTB), color.RGBA{R: 0, G: 0, B: 255, A: 255})
sampleLineLTTB, err := diagram.MakeLinePlotter(
diagram.CovertToPlotXY(smaplesLTTB), color.RGBA{R: 0, G: 0, B: 255, A: 255})
common.CheckError("Cannot make a line plotter", err)

if err := diagram.SavePNG("Raw Data", "01.png",
Expand All @@ -72,7 +75,8 @@ func main() {
common.LogFatal("Cannot save the png file", err)
}

if err := diagram.ConcatPNGs([]string{"01.png", "02.png", "03.png", "05.png"}, dataDir+"downsampling.chart.png"); err != nil {
if err := diagram.ConcatPNGs([]string{"01.png", "02.png", "03.png", "05.png"},
dataDir+"downsampling.chart.png"); err != nil {
common.LogFatal("Cannot concatenate the png files", err)
}
}

0 comments on commit ddb6eed

Please sign in to comment.