mirror of
https://github.com/taigrr/gico.git
synced 2026-04-02 03:09:07 -07:00
rename API call from Image to SVG
This commit is contained in:
@@ -22,7 +22,7 @@ func main() {
|
||||
freq = append(freq, rand.Int())
|
||||
}
|
||||
w.Header().Add("Content-Type", "text/html")
|
||||
svg := graph.GetWeekImage(freq)
|
||||
svg := graph.GetWeekSVG(freq)
|
||||
svg.WriteTo(w)
|
||||
|
||||
})
|
||||
@@ -31,7 +31,7 @@ func main() {
|
||||
for i := 0; i < 365; i++ {
|
||||
freq = append(freq, rand.Int())
|
||||
}
|
||||
svg := graph.GetYearImage(freq)
|
||||
svg := graph.GetYearSVG(freq)
|
||||
w.Header().Add("Content-Type", "text/html")
|
||||
svg.WriteTo(w)
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ func ColorForFrequency(freq, min, max int) sc.SimpleColor {
|
||||
}
|
||||
return colorScheme[colorIndex]
|
||||
}
|
||||
func GetWeekImage(frequencies []int) bytes.Buffer {
|
||||
func GetWeekSVG(frequencies []int) bytes.Buffer {
|
||||
squareColors := []sc.SimpleColor{}
|
||||
min, max := minmax(frequencies)
|
||||
for _, f := range frequencies {
|
||||
@@ -76,7 +76,7 @@ func drawWeekImage(c []sc.SimpleColor) bytes.Buffer {
|
||||
sbw.Flush()
|
||||
return sb
|
||||
}
|
||||
func GetYearImage(frequencies []int) bytes.Buffer {
|
||||
func GetYearSVG(frequencies []int) bytes.Buffer {
|
||||
squareColors := []sc.SimpleColor{}
|
||||
min, max := minmax(frequencies)
|
||||
for _, f := range frequencies {
|
||||
|
||||
Reference in New Issue
Block a user