-
Notifications
You must be signed in to change notification settings - Fork 0
/
context.go
69 lines (62 loc) · 1.29 KB
/
context.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
package heatman
/*
Context represents parameters for building heat map.
*/
type Context struct {
/*
SizeOfAPixel shows a pixel size of a cell.
*/
SizeOfAPixel int
/*
GapOfAdditionalLine shows to need assistnace lines by some cells.
If this value is negative value, no assistance lines are drawn.
*/
GapOfAdditionalLine int
/*
Destination represents the destination file name.
*/
Destination string
/*
WithHeader shows header type.
*/
WithHeader HeaderModel
/*
Converter is value to color mapper.
*/
Converter HeatmapConverter
}
/*
HeaderModel shows the header type of given csv file.
*/
type HeaderModel int
const (
/*
RowHeader shows the given csv file has row header only.
*/
RowHeader HeaderModel = iota
/*
ColumnHeader shows the given csv file has column header only.
*/
ColumnHeader
/*
RowColumnHeader shows the given csv file has row and column header.
*/
RowColumnHeader
/*
NoHeaders shows the given csv file has no headers.
*/
NoHeaders
/*
InvalidHeaderModel shows some error on parsing header model.
*/
InvalidHeaderModel
)
/*
NewContext create an instance of Context.
*/
func NewContext(sizeOfAPixel, gapOfAdditionalLine int) *Context {
return &Context{
SizeOfAPixel: sizeOfAPixel,
GapOfAdditionalLine: gapOfAdditionalLine,
}
}