-
Notifications
You must be signed in to change notification settings - Fork 4
/
timeseries_page.qtpl.go
164 lines (145 loc) · 4.08 KB
/
timeseries_page.qtpl.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
// Code generated by qtc from "timeseries_page.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
//line timeseries_page.qtpl:1
package c3
//line timeseries_page.qtpl:1
import "github.com/grokify/mogo/time/timeutil"
//line timeseries_page.qtpl:2
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line timeseries_page.qtpl:2
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line timeseries_page.qtpl:2
func StreamTimeseriesPage(qw422016 *qt422016.Writer, pageData TimeseriesPageData) {
//line timeseries_page.qtpl:2
qw422016.N().S(`
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.15/c3.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.15/c3.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<style>
p,h1,h2,th,td{
font-family: Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>
<h1>`)
//line timeseries_page.qtpl:22
qw422016.E().S(pageData.Title)
//line timeseries_page.qtpl:22
qw422016.N().S(`</h1>
<p>URL: <a href="`)
//line timeseries_page.qtpl:24
qw422016.N().S(pageData.URL)
//line timeseries_page.qtpl:24
qw422016.N().S(`">`)
//line timeseries_page.qtpl:24
qw422016.E().S(pageData.URL)
//line timeseries_page.qtpl:24
qw422016.N().S(`</a></p>
`)
//line timeseries_page.qtpl:26
qw422016.N().S(TimeseriesHTML(pageData.Charts[0]))
//line timeseries_page.qtpl:26
qw422016.N().S(`
`)
//line timeseries_page.qtpl:28
qw422016.N().S(TimeseriesHTML(pageData.Charts[1]))
//line timeseries_page.qtpl:28
qw422016.N().S(`
<h2>Growth</h2>
<table id="growthTable">
<thead>
<th>Quarter</th>
<th>Total</th>
<th>Growth</th>
<th>YoY</th>
<th>QoQ</th>
</thead>
<tbody>
`)
//line timeseries_page.qtpl:41
for _, point := range pageData.XoxPoints {
//line timeseries_page.qtpl:41
qw422016.N().S(`
<tr>
<td>`)
//line timeseries_page.qtpl:43
qw422016.E().S(point.Time.Format(timeutil.ISO8601YM))
//line timeseries_page.qtpl:43
qw422016.N().S(`</td>
<td>`)
//line timeseries_page.qtpl:44
qw422016.N().D(int(point.AggregateValue))
//line timeseries_page.qtpl:44
qw422016.N().S(`</td>
<td>`)
//line timeseries_page.qtpl:45
qw422016.N().D(int(point.Value))
//line timeseries_page.qtpl:45
qw422016.N().S(`</td>
<td>`)
//line timeseries_page.qtpl:46
qw422016.N().FPrec(point.YoYAggregate*100.0, 0)
//line timeseries_page.qtpl:46
qw422016.N().S(`%</td>
<td>`)
//line timeseries_page.qtpl:47
qw422016.N().FPrec(point.QoQAggregate*100.0, 0)
//line timeseries_page.qtpl:47
qw422016.N().S(`%</td>
</tr>
`)
//line timeseries_page.qtpl:49
}
//line timeseries_page.qtpl:49
qw422016.N().S(`
</tbody>
</table>
<script>
$(document).ready(function(){
$('#growthTable').DataTable({
"lengthMenu": [ [-1], ["All"] ]
});
});
</script>
</body></html>
`)
//line timeseries_page.qtpl:64
}
//line timeseries_page.qtpl:64
func WriteTimeseriesPage(qq422016 qtio422016.Writer, pageData TimeseriesPageData) {
//line timeseries_page.qtpl:64
qw422016 := qt422016.AcquireWriter(qq422016)
//line timeseries_page.qtpl:64
StreamTimeseriesPage(qw422016, pageData)
//line timeseries_page.qtpl:64
qt422016.ReleaseWriter(qw422016)
//line timeseries_page.qtpl:64
}
//line timeseries_page.qtpl:64
func TimeseriesPage(pageData TimeseriesPageData) string {
//line timeseries_page.qtpl:64
qb422016 := qt422016.AcquireByteBuffer()
//line timeseries_page.qtpl:64
WriteTimeseriesPage(qb422016, pageData)
//line timeseries_page.qtpl:64
qs422016 := string(qb422016.B)
//line timeseries_page.qtpl:64
qt422016.ReleaseByteBuffer(qb422016)
//line timeseries_page.qtpl:64
return qs422016
//line timeseries_page.qtpl:64
}