-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataframe_utils.go
74 lines (61 loc) · 1.36 KB
/
dataframe_utils.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
package gandalff
import "github.com/charmbracelet/lipgloss"
type PPrintParams struct {
index bool
useLipGloss bool
minColWidth int
maxColWidth int
colWidth int
width int
nrows int
tailLen int
indent string
styleNames lipgloss.Style
styleTypes lipgloss.Style
}
func NewPPrintParams() PPrintParams {
return PPrintParams{
index: true,
minColWidth: 10,
maxColWidth: 20,
colWidth: 11,
width: 100,
nrows: 10,
tailLen: 3,
indent: "",
styleNames: lipgloss.NewStyle().Bold(true),
styleTypes: lipgloss.NewStyle().Bold(true).Italic(true).Foreground(lipgloss.Color("241")),
}
}
func (ppp PPrintParams) SetIndex(b bool) PPrintParams {
ppp.index = b
return ppp
}
func (ppp PPrintParams) SetUseLipGloss(b bool) PPrintParams {
ppp.useLipGloss = b
return ppp
}
func (ppp PPrintParams) SetMinColWidth(n int) PPrintParams {
ppp.minColWidth = n
return ppp
}
func (ppp PPrintParams) SetMaxColWidth(n int) PPrintParams {
ppp.maxColWidth = n
return ppp
}
func (ppp PPrintParams) SetWidth(n int) PPrintParams {
ppp.width = n
return ppp
}
func (ppp PPrintParams) SetNRows(n int) PPrintParams {
ppp.nrows = n
return ppp
}
func (ppp PPrintParams) SetTailLen(n int) PPrintParams {
ppp.tailLen = n
return ppp
}
func (ppp PPrintParams) SetIndent(s string) PPrintParams {
ppp.indent = s
return ppp
}